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

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

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

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

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

#ifdef __cplusplus
extern "C" {
#endif

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

// Arrays
struct futhark_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_236933[10240];
static int32_t mainzicounter_mem_realtype_236949[10240];
static int32_t mainzicounter_mem_realtype_236985[10240];
static int32_t mainzicounter_mem_realtype_237001[10240];
static int32_t mainzicounter_mem_realtype_237037[10240];
static int32_t mainzicounter_mem_realtype_237053[10240];
static int32_t mainzicounter_mem_realtype_237094[10240];
static int32_t mainzicounter_mem_realtype_237125[10240];
static int32_t mainzicounter_mem_realtype_237156[10240];
static int32_t mainzicounter_mem_realtype_237197[10240];
static int32_t mainzicounter_mem_realtype_237213[10240];
static int32_t mainzicounter_mem_realtype_237239[10240];
static int32_t mainzicounter_mem_realtype_237255[10240];
static int32_t mainzicounter_mem_realtype_237281[10240];
static int32_t mainzicounter_mem_realtype_237297[10240];
static int32_t mainzicounter_mem_realtype_237358[10240];
static int32_t mainzicounter_mem_realtype_237374[10240];
static int32_t mainzicounter_mem_realtype_237410[10240];
static int32_t mainzicounter_mem_realtype_237426[10240];
static int32_t mainzicounter_mem_realtype_237462[10240];
static int32_t mainzicounter_mem_realtype_237478[10240];
static int32_t mainzicounter_mem_realtype_237594[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_232838(int32_t num_elems_232835,\n                                                       double val_232836,\n                                                       __global\n                                                       unsigned char *mem_232834)\n{\n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    int32_t replicate_gtid_232838;\n    int32_t replicate_ltid_232839;\n    int32_t replicate_gid_232840;\n    \n    replicate_gtid_232838 = get_global_id(0);\n    replicate_ltid_232839 = get_local_id(0);\n    replicate_gid_232840 = get_group_id(0);\n    \n    int64_t slice_232844 = num_elems_232835;\n    int64_t rep_i_232843 = sext_i32_i64(replicate_gtid_232838);\n    int64_t remnant_232845 = sext_i32_i64(replicate_gtid_232838) - rep_i_232843;\n    \n    if (slt64(replicate_gtid_232838, num_elems_232835)) {\n        ((__global double *) mem_232834)[rep_i_232843] = val_232836;\n    }\n    \n  error_0:\n    return;\n}\n__kernel void builtinzhreplicate_i64zireplicate_232421(int32_t num_elems_232418,\n                                                       int64_t val_232419,\n                                                       __global\n                                                       unsigned char *mem_232417)\n{\n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 ",
                   "= 2;\n    int32_t replicate_gtid_232421;\n    int32_t replicate_ltid_232422;\n    int32_t replicate_gid_232423;\n    \n    replicate_gtid_232421 = get_global_id(0);\n    replicate_ltid_232422 = get_local_id(0);\n    replicate_gid_232423 = get_group_id(0);\n    \n    int64_t slice_232427 = num_elems_232418;\n    int64_t rep_i_232426 = sext_i32_i64(replicate_gtid_232421);\n    int64_t remnant_232428 = sext_i32_i64(replicate_gtid_232421) - rep_i_232426;\n    \n    if (slt64(replicate_gtid_232421, num_elems_232418)) {\n        ((__global int64_t *) mem_232417)[rep_i_232426] = val_232419;\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_232439(int64_t n_203490,\n                                int64_t partition_sizze_203577,\n                                int64_t i_203670, __global\n                                unsigned char *mem_229186, __global\n                        ",
                   "        unsigned char *mem_229194)\n{\n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    int32_t copy_gtid_232439;\n    int32_t copy_ltid_232440;\n    int32_t copy_gid_232441;\n    \n    copy_gtid_232439 = get_global_id(0);\n    copy_ltid_232440 = get_local_id(0);\n    copy_gid_232441 = get_group_id(0);\n    \n    int64_t slice_232445 = partition_sizze_203577;\n    int64_t copy_i_232444 = sext_i32_i64(copy_gtid_232439);\n    int64_t remnant_232446 = sext_i32_i64(copy_gtid_232439) - copy_i_232444;\n    \n    if (slt64(sext_i32_i64(copy_gtid_232439), partition_sizze_203577)) {\n        int64_t tmp_232447;\n        \n        tmp_232447 = ((__global int64_t *) mem_229186)[i_203670 +\n                                                       copy_i_232444 *\n                                                       n_203490];\n        ((__global int64_t *) mem_229194)[copy_i_232444] = tmp_232447;\n    }\n    \n  error_0:\n    return;\n}\n__kernel void mainzicopy_232598(int64_t n_p_203492,\n                                int64_t partition_sizze_203577,\n                                int64_t defunc_0_f_res_203631, int64_t i_203718,\n                                __global unsigned char *mem_229250, __global\n                                unsigned char *mem_229260)\n{\n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    int32_t copy_gtid_232598;\n    int32_t copy_ltid_232599;\n    int32_t copy_gid_232600;\n    \n    copy_gtid_232598 = get_global_id(0);\n    copy_ltid_232599 = get_local_id(0);\n    copy_gid_232600 = get_group_id(0);\n    \n    int64_t slice_232605 = n_p_203492;\n    int64_t slice_232606 = partition_sizze_203577 * slice_232605;\n    int64_t copy_i_232603 = squot64(sext_i32_i64(copy_gtid_232598),\n                                    slice_232605);\n    int64_t remnant_232607 = sext_i32_i64(copy_gtid_232598) - copy_i_232603 *\n            slice_232605;\n    int64_t copy_i_232604 = remnant_232607;\n    int64_t remnant_23260",
                   "8 = remnant_232607 - copy_i_232604;\n    \n    if (slt64(sext_i32_i64(copy_gtid_232598), partition_sizze_203577 *\n              n_p_203492)) {\n        int64_t tmp_232609;\n        \n        tmp_232609 = ((__global int64_t *) mem_229250)[i_203718 +\n                                                       (copy_i_232603 *\n                                                        (defunc_0_f_res_203631 *\n                                                         n_p_203492) +\n                                                        copy_i_232604 *\n                                                        defunc_0_f_res_203631)];\n        ((__global int64_t *) mem_229260)[copy_i_232603 * n_p_203492 +\n                                          copy_i_232604] = tmp_232609;\n    }\n    \n  error_0:\n    return;\n}\n__kernel void mainzicopy_234521(int64_t n_203490,\n                                int64_t partition_sizze_203577,\n                                int64_t ctx_param_ext_229488,\n                                int64_t ctx_param_ext_229489,\n                                int64_t ctx_param_ext_229491, __global\n                                unsigned char *mem_param_229493, __global\n                                unsigned char *mem_230564)\n{\n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    int32_t copy_gtid_234521;\n    int32_t copy_ltid_234522;\n    int32_t copy_gid_234523;\n    \n    copy_gtid_234521 = get_global_id(0);\n    copy_ltid_234522 = get_local_id(0);\n    copy_gid_234523 = get_group_id(0);\n    \n    int64_t slice_234528 = n_203490;\n    int64_t slice_234529 = partition_sizze_203577 * slice_234528;\n    int64_t copy_i_234526 = squot64(sext_i32_i64(copy_gtid_234521),\n                                    slice_234528);\n    int64_t remnant_234530 = sext_i32_i64(copy_gtid_234521) - copy_i_234526 *\n            slice_234528;\n    int64_t copy_i_234527 = remnant_234530;\n    int64_t remnant_234531 = remnant_234530 - copy_i_234527;\n    \n    if (slt6",
                   "4(sext_i32_i64(copy_gtid_234521), partition_sizze_203577 *\n              n_203490)) {\n        double tmp_234532;\n        \n        tmp_234532 = ((__global\n                       double *) mem_param_229493)[ctx_param_ext_229488 +\n                                                   (copy_i_234526 *\n                                                    ctx_param_ext_229489 +\n                                                    copy_i_234527 *\n                                                    ctx_param_ext_229491)];\n        ((__global double *) mem_230564)[copy_i_234527 *\n                                         partition_sizze_203577 +\n                                         copy_i_234526] = tmp_234532;\n    }\n    \n  error_0:\n    return;\n}\n__kernel void mainzicopy_234720(int64_t n_203490,\n                                int64_t partition_sizze_203577,\n                                int64_t ctx_param_ext_229488,\n                                int64_t ctx_param_ext_229489,\n                                int64_t ctx_param_ext_229491, __global\n                                unsigned char *mem_param_229493, __global\n                                unsigned char *mem_230622)\n{\n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    int32_t copy_gtid_234720;\n    int32_t copy_ltid_234721;\n    int32_t copy_gid_234722;\n    \n    copy_gtid_234720 = get_global_id(0);\n    copy_ltid_234721 = get_local_id(0);\n    copy_gid_234722 = get_group_id(0);\n    \n    int64_t slice_234727 = n_203490;\n    int64_t slice_234728 = partition_sizze_203577 * slice_234727;\n    int64_t copy_i_234725 = squot64(sext_i32_i64(copy_gtid_234720),\n                                    slice_234727);\n    int64_t remnant_234729 = sext_i32_i64(copy_gtid_234720) - copy_i_234725 *\n            slice_234727;\n    int64_t copy_i_234726 = remnant_234729;\n    int64_t remnant_234730 = remnant_234729 - copy_i_234726;\n    \n    if (slt64(sext_i32_i64(copy_gtid_234720), partition_sizze_20357",
                   "7 *\n              n_203490)) {\n        double tmp_234731;\n        \n        tmp_234731 = ((__global\n                       double *) mem_param_229493)[ctx_param_ext_229488 +\n                                                   (copy_i_234725 *\n                                                    ctx_param_ext_229489 +\n                                                    copy_i_234726 *\n                                                    ctx_param_ext_229491)];\n        ((__global double *) mem_230622)[copy_i_234726 *\n                                         partition_sizze_203577 +\n                                         copy_i_234725] = tmp_234731;\n    }\n    \n  error_0:\n    return;\n}\n__kernel void mainzicopy_234970(int64_t n_203490,\n                                int64_t partition_sizze_203577,\n                                int64_t ctx_param_ext_229488,\n                                int64_t ctx_param_ext_229489,\n                                int64_t ctx_param_ext_229491, __global\n                                unsigned char *mem_param_229493, __global\n                                unsigned char *mem_230729)\n{\n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    int32_t copy_gtid_234970;\n    int32_t copy_ltid_234971;\n    int32_t copy_gid_234972;\n    \n    copy_gtid_234970 = get_global_id(0);\n    copy_ltid_234971 = get_local_id(0);\n    copy_gid_234972 = get_group_id(0);\n    \n    int64_t slice_234977 = n_203490;\n    int64_t slice_234978 = partition_sizze_203577 * slice_234977;\n    int64_t copy_i_234975 = squot64(sext_i32_i64(copy_gtid_234970),\n                                    slice_234977);\n    int64_t remnant_234979 = sext_i32_i64(copy_gtid_234970) - copy_i_234975 *\n            slice_234977;\n    int64_t copy_i_234976 = remnant_234979;\n    int64_t remnant_234980 = remnant_234979 - copy_i_234976;\n    \n    if (slt64(sext_i32_i64(copy_gtid_234970), partition_sizze_203577 *\n              n_203490)) {\n        double tmp_23498",
                   "1;\n        \n        tmp_234981 = ((__global\n                       double *) mem_param_229493)[ctx_param_ext_229488 +\n                                                   (copy_i_234975 *\n                                                    ctx_param_ext_229489 +\n                                                    copy_i_234976 *\n                                                    ctx_param_ext_229491)];\n        ((__global double *) mem_230729)[copy_i_234976 *\n                                         partition_sizze_203577 +\n                                         copy_i_234975] = tmp_234981;\n    }\n    \n  error_0:\n    return;\n}\n__kernel void mainzicopy_235348(int64_t n_203490,\n                                int64_t partition_sizze_203577,\n                                int64_t ctx_param_ext_229488,\n                                int64_t ctx_param_ext_229489,\n                                int64_t ctx_param_ext_229491, __global\n                                unsigned char *mem_param_229493, __global\n                                unsigned char *mem_230939)\n{\n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    int32_t copy_gtid_235348;\n    int32_t copy_ltid_235349;\n    int32_t copy_gid_235350;\n    \n    copy_gtid_235348 = get_global_id(0);\n    copy_ltid_235349 = get_local_id(0);\n    copy_gid_235350 = get_group_id(0);\n    \n    int64_t slice_235355 = n_203490;\n    int64_t slice_235356 = partition_sizze_203577 * slice_235355;\n    int64_t copy_i_235353 = squot64(sext_i32_i64(copy_gtid_235348),\n                                    slice_235355);\n    int64_t remnant_235357 = sext_i32_i64(copy_gtid_235348) - copy_i_235353 *\n            slice_235355;\n    int64_t copy_i_235354 = remnant_235357;\n    int64_t remnant_235358 = remnant_235357 - copy_i_235354;\n    \n    if (slt64(sext_i32_i64(copy_gtid_235348), partition_sizze_203577 *\n              n_203490)) {\n        double tmp_235359;\n        \n        tmp_235359 = ((__global\n           ",
                   "            double *) mem_param_229493)[ctx_param_ext_229488 +\n                                                   (copy_i_235353 *\n                                                    ctx_param_ext_229489 +\n                                                    copy_i_235354 *\n                                                    ctx_param_ext_229491)];\n        ((__global double *) mem_230939)[copy_i_235354 *\n                                         partition_sizze_203577 +\n                                         copy_i_235353] = tmp_235359;\n    }\n    \n  error_0:\n    return;\n}\n__kernel void mainzicopy_235570(int64_t n_203490,\n                                int64_t partition_sizze_203577,\n                                int64_t ctx_param_ext_229488,\n                                int64_t ctx_param_ext_229489,\n                                int64_t ctx_param_ext_229491, __global\n                                unsigned char *mem_param_229493, __global\n                                unsigned char *mem_231059)\n{\n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    int32_t copy_gtid_235570;\n    int32_t copy_ltid_235571;\n    int32_t copy_gid_235572;\n    \n    copy_gtid_235570 = get_global_id(0);\n    copy_ltid_235571 = get_local_id(0);\n    copy_gid_235572 = get_group_id(0);\n    \n    int64_t slice_235577 = n_203490;\n    int64_t slice_235578 = partition_sizze_203577 * slice_235577;\n    int64_t copy_i_235575 = squot64(sext_i32_i64(copy_gtid_235570),\n                                    slice_235577);\n    int64_t remnant_235579 = sext_i32_i64(copy_gtid_235570) - copy_i_235575 *\n            slice_235577;\n    int64_t copy_i_235576 = remnant_235579;\n    int64_t remnant_235580 = remnant_235579 - copy_i_235576;\n    \n    if (slt64(sext_i32_i64(copy_gtid_235570), partition_sizze_203577 *\n              n_203490)) {\n        double tmp_235581;\n        \n        tmp_235581 = ((__global\n                       double *) mem_param_229493)[ctx_param_ext_2",
                   "29488 +\n                                                   (copy_i_235575 *\n                                                    ctx_param_ext_229489 +\n                                                    copy_i_235576 *\n                                                    ctx_param_ext_229491)];\n        ((__global double *) mem_231059)[copy_i_235576 *\n                                         partition_sizze_203577 +\n                                         copy_i_235575] = tmp_235581;\n    }\n    \n  error_0:\n    return;\n}\n__kernel void mainzicopy_235843(int64_t n_203490,\n                                int64_t partition_sizze_203577,\n                                int64_t ctx_param_ext_229488,\n                                int64_t ctx_param_ext_229489,\n                                int64_t ctx_param_ext_229491, __global\n                                unsigned char *mem_param_229493, __global\n                                unsigned char *mem_231228)\n{\n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    int32_t copy_gtid_235843;\n    int32_t copy_ltid_235844;\n    int32_t copy_gid_235845;\n    \n    copy_gtid_235843 = get_global_id(0);\n    copy_ltid_235844 = get_local_id(0);\n    copy_gid_235845 = get_group_id(0);\n    \n    int64_t slice_235850 = n_203490;\n    int64_t slice_235851 = partition_sizze_203577 * slice_235850;\n    int64_t copy_i_235848 = squot64(sext_i32_i64(copy_gtid_235843),\n                                    slice_235850);\n    int64_t remnant_235852 = sext_i32_i64(copy_gtid_235843) - copy_i_235848 *\n            slice_235850;\n    int64_t copy_i_235849 = remnant_235852;\n    int64_t remnant_235853 = remnant_235852 - copy_i_235849;\n    \n    if (slt64(sext_i32_i64(copy_gtid_235843), partition_sizze_203577 *\n              n_203490)) {\n        double tmp_235854;\n        \n        tmp_235854 = ((__global\n                       double *) mem_param_229493)[ctx_param_ext_229488 +\n                                               ",
                   "    (copy_i_235848 *\n                                                    ctx_param_ext_229489 +\n                                                    copy_i_235849 *\n                                                    ctx_param_ext_229491)];\n        ((__global double *) mem_231228)[copy_i_235849 *\n                                         partition_sizze_203577 +\n                                         copy_i_235848] = tmp_235854;\n    }\n    \n  error_0:\n    return;\n}\n__kernel void mainziscan_stage1_206867(__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_232259_backing_aligned_0,\n                                       int64_t m_203489, int64_t n_203490,\n                                       int64_t n_p_203492,\n                                       int64_t defunc_0_f_res_203510,\n                                       int32_t num_threads_232253, __global\n                                       unsigned char *mem_229148, __global\n                                       unsigned char *mem_229152, __global\n                                       unsigned char *mem_229155, __global\n                                       unsigned char *mem_229157)\n{\n    #define segscan_group_sizze_206862 (mainzisegscan_group_sizze_206861)\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_232259_backing_0 =\n                                   (__local volatile\n                                    unsigned char *) scan_arr_mem_232259_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    barri",
                   "er(CLK_LOCAL_MEM_FENCE);\n    \n    int32_t global_tid_232254;\n    int32_t local_tid_232255;\n    int64_t group_sizze_232258;\n    int32_t wave_sizze_232257;\n    int32_t group_tid_232256;\n    \n    global_tid_232254 = get_global_id(0);\n    local_tid_232255 = get_local_id(0);\n    group_sizze_232258 = get_local_size(0);\n    wave_sizze_232257 = LOCKSTEP_WIDTH;\n    group_tid_232256 = get_group_id(0);\n    \n    int32_t phys_tid_206867 = global_tid_232254;\n    __local unsigned char *scan_arr_mem_232259;\n    \n    scan_arr_mem_232259 = (__local\n                           unsigned char *) scan_arr_mem_232259_backing_0;\n    \n    int64_t x_203544;\n    int64_t y_203545;\n    \n    x_203544 = (int64_t) 0;\n    for (int64_t j_232261 = 0; j_232261 < sdiv_up64(m_203489,\n                                                    sext_i32_i64(num_threads_232253));\n         j_232261++) {\n        int64_t chunk_offset_232262 = segscan_group_sizze_206862 * j_232261 +\n                sext_i32_i64(group_tid_232256) * (segscan_group_sizze_206862 *\n                                                  sdiv_up64(m_203489,\n                                                            sext_i32_i64(num_threads_232253)));\n        int64_t flat_idx_232263 = chunk_offset_232262 +\n                sext_i32_i64(local_tid_232255);\n        int64_t gtid_206866 = flat_idx_232263;\n        \n        // threads in bounds read input\n        {\n            if (slt64(gtid_206866, m_203489)) {\n                bool defunc_2_reduce_res_203548;\n                bool redout_228648 = 0;\n                \n                for (int64_t i_228649 = 0; i_228649 < n_p_203492; i_228649++) {\n                    bool defunc_2_reduce_res_203553;\n                    bool redout_228650 = 1;\n                    \n                    for (int64_t i_228651 = 0; i_228651 < defunc_0_f_res_203510;\n                         i_228651++) {\n                        int64_t x_203558 = mul64(n_p_203492, i_228651);\n                        int64_t idx_203559 = add64(x_2035",
                   "58, i_228649);\n                        bool cond_203560 = slt64(idx_203559, n_203490);\n                        bool defunc_0_f_res_203561;\n                        \n                        if (cond_203560) {\n                            bool x_203562 = sle64((int64_t) 0, idx_203559);\n                            bool bounds_check_203563 = cond_203560 && x_203562;\n                            bool index_certs_203564;\n                            \n                            if (!bounds_check_203563) {\n                                {\n                                    if (atomic_cmpxchg_i32_global(global_failure,\n                                                                  -1, 0) ==\n                                        -1) {\n                                        global_failure_args[0] =\n                                            (int64_t) idx_203559;\n                                        global_failure_args[1] =\n                                            (int64_t) n_203490;\n                                        ;\n                                    }\n                                    local_failure = true;\n                                    goto error_0;\n                                }\n                            }\n                            \n                            double isnan_arg_203565;\n                            \n                            isnan_arg_203565 = ((__global\n                                                 double *) mem_229148)[idx_203559 *\n                                                                       m_203489 +\n                                                                       gtid_206866];\n                            \n                            bool isnan_res_203566;\n                            \n                            isnan_res_203566 = futrts_isnan64(isnan_arg_203565);\n                            defunc_0_f_res_203561 = isnan_res_203566;\n                        } else {\n                            defunc_0",
                   "_f_res_203561 = 0;\n                        }\n                        \n                        bool x_203556 = defunc_0_f_res_203561 && redout_228650;\n                        bool redout_tmp_232265 = x_203556;\n                        \n                        redout_228650 = redout_tmp_232265;\n                    }\n                    defunc_2_reduce_res_203553 = redout_228650;\n                    \n                    bool defunc_1_op_res_203551 = defunc_2_reduce_res_203553 ||\n                         redout_228648;\n                    bool redout_tmp_232264 = defunc_1_op_res_203551;\n                    \n                    redout_228648 = redout_tmp_232264;\n                }\n                defunc_2_reduce_res_203548 = redout_228648;\n                \n                int64_t defunc_2_lifted_lambda_res_203567 =\n                        btoi_bool_i64(defunc_2_reduce_res_203548);\n                bool is_i_203568 = defunc_2_lifted_lambda_res_203567 ==\n                     (int64_t) 0;\n                bool cond_neg_203569 = !is_i_203568;\n                int64_t part_res_203570 = btoi_bool_i64(cond_neg_203569);\n                int64_t part_res_203571 = btoi_bool_i64(is_i_203568);\n                \n                // write to-scan values to parameters\n                {\n                    y_203545 = part_res_203571;\n                }\n                // write mapped values results to global memory\n                {\n                    ((__global int64_t *) mem_229155)[gtid_206866] =\n                        part_res_203570;\n                    ((__global bool *) mem_229157)[gtid_206866] =\n                        defunc_2_reduce_res_203548;\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_206866, m_203489)) {\n                    y_203545 = (int64_t) 0;\n                }\n            }\n            // combine wi",
                   "th carry and write to local memory\n            {\n                int64_t zz_203546 = x_203544 + y_203545;\n                \n                ((__local\n                  int64_t *) scan_arr_mem_232259)[sext_i32_i64(local_tid_232255)] =\n                    zz_203546;\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_232266;\n            int64_t y_232267;\n            int64_t x_232269;\n            int64_t y_232270;\n            bool ltid_in_bounds_232272 = slt64(sext_i32_i64(local_tid_232255),\n                                               segscan_group_sizze_206862);\n            int32_t skip_threads_232273;\n            \n            // read input for in-block scan\n            {\n                if (ltid_in_bounds_232272) {\n                    y_232267 = ((volatile __local\n                                 int64_t *) scan_arr_mem_232259)[sext_i32_i64(local_tid_232255)];\n                    if ((local_tid_232255 - squot32(local_tid_232255, 32) *\n                         32) == 0) {\n                        x_232266 = y_232267;\n                    }\n                }\n            }\n            // in-block scan (hopefully no barriers needed)\n            {\n                skip_threads_232273 = 1;\n                while (slt32(skip_threads_232273, 32)) {\n                    bool thread_active_232274 = sle32(skip_threads_232273,\n                                                      local_tid_232255 -\n                                                      squot32(local_tid_232255,\n                                                              32) * 32) &&\n                         ltid_in_bounds_232272;\n                    \n                    if (thread_active_232274) {\n                        // read operands\n                        {\n                            x_232266 = ((volatile __local\n                             ",
                   "            int64_t *) scan_arr_mem_232259)[sext_i32_i64(local_tid_232255) -\n                                                                         sext_i32_i64(skip_threads_232273)];\n                        }\n                    }\n                    // perform operation\n                    {\n                        if (thread_active_232274) {\n                            int64_t zz_232268 = x_232266 + y_232267;\n                            \n                            x_232266 = zz_232268;\n                        }\n                    }\n                    if (sle32(wave_sizze_232257, skip_threads_232273)) {\n                        barrier(CLK_LOCAL_MEM_FENCE);\n                    }\n                    if (thread_active_232274) {\n                        // write result\n                        {\n                            ((volatile __local\n                              int64_t *) scan_arr_mem_232259)[sext_i32_i64(local_tid_232255)] =\n                                x_232266;\n                            y_232267 = x_232266;\n                        }\n                    }\n                    if (sle32(wave_sizze_232257, skip_threads_232273)) {\n                        barrier(CLK_LOCAL_MEM_FENCE);\n                    }\n                    skip_threads_232273 *= 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_232255 - squot32(local_tid_232255, 32) * 32) ==\n                    31 && ltid_in_bounds_232272) {\n                    ((volatile __local\n                      int64_t *) scan_arr_mem_232259)[sext_i32_i64(squot32(local_tid_232255,\n                                                                           32))] =\n                        x_232266;\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_232275;\n                \n                // read input for in-block scan\n                {\n                    if (squot32(local_tid_232255, 32) == 0 &&\n                        ltid_in_bounds_232272) {\n                        y_232270 = ((volatile __local\n                                     int64_t *) scan_arr_mem_232259)[sext_i32_i64(local_tid_232255)];\n                        if ((local_tid_232255 - squot32(local_tid_232255, 32) *\n                             32) == 0) {\n                            x_232269 = y_232270;\n                        }\n                    }\n                }\n                // in-block scan (hopefully no barriers needed)\n                {\n                    skip_threads_232275 = 1;\n                    while (slt32(skip_threads_232275, 32)) {\n                        bool thread_active_232276 = sle32(skip_threads_232275,\n                                                          local_tid_232255 -\n                                                          squot32(local_tid_232255,\n                                                                  32) * 32) &&\n                             (squot32(local_tid_232255, 32) == 0 &&\n                              ltid_in_bounds_232272);\n                        \n                        if (thread_active_232276) {\n                            // read operands\n                            {\n                                x_232269 = ((volatile __local\n                                             int64_t *) scan_arr_mem_232259)[sext_i32_i64(local_tid_232255) -\n                                                                             sext_i32_i64(skip_threads_232275)];\n                            }\n                        }\n                        // perform operation\n                        {\n                            if (thread_active_232276) {\n                                int64_t zz_232271 = x_232269 + y_232270;\n                                \n        ",
                   "                        x_232269 = zz_232271;\n                            }\n                        }\n                        if (sle32(wave_sizze_232257, skip_threads_232275)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        if (thread_active_232276) {\n                            // write result\n                            {\n                                ((volatile __local\n                                  int64_t *) scan_arr_mem_232259)[sext_i32_i64(local_tid_232255)] =\n                                    x_232269;\n                                y_232270 = x_232269;\n                            }\n                        }\n                        if (sle32(wave_sizze_232257, skip_threads_232275)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        skip_threads_232275 *= 2;\n                    }\n                }\n            }\n            barrier(CLK_LOCAL_MEM_FENCE);\n            \n            bool no_carry_in_232277 = squot32(local_tid_232255, 32) == 0 ||\n                 !ltid_in_bounds_232272;\n            \n            // carry-in for every block except the first\n            {\n                // read operands\n                {\n                    if (!no_carry_in_232277) {\n                        y_232267 = x_232266;\n                        x_232266 = ((__local\n                                     int64_t *) scan_arr_mem_232259)[sext_i32_i64(squot32(local_tid_232255,\n                                                                                          32)) -\n                                                                     (int64_t) 1];\n                    }\n                }\n                // perform operation\n                {\n                    if (!no_carry_in_232277) {\n                        int64_t zz_232268 = x_232266 + y_232267;\n                        \n                        x_232266 = zz_232268;\n                    }\n        ",
                   "        }\n                // write final result\n                {\n                    if (!no_carry_in_232277) {\n                        ((__local\n                          int64_t *) scan_arr_mem_232259)[sext_i32_i64(local_tid_232255)] =\n                            x_232266;\n                    }\n                }\n            }\n            barrier(CLK_LOCAL_MEM_FENCE);\n            // restore correct values for first block\n            {\n                if (squot32(local_tid_232255, 32) == 0 &&\n                    ltid_in_bounds_232272) {\n                    ((__local\n                      int64_t *) scan_arr_mem_232259)[sext_i32_i64(local_tid_232255)] =\n                        y_232267;\n                }\n            }\n            barrier(CLK_LOCAL_MEM_FENCE);\n            // threads in bounds write partial scan result\n            {\n                if (slt64(gtid_206866, m_203489)) {\n                    int64_t tmp_232278;\n                    \n                    tmp_232278 = ((__local\n                                   int64_t *) scan_arr_mem_232259)[sext_i32_i64(local_tid_232255)];\n                    ((__global int64_t *) mem_229152)[gtid_206866] = tmp_232278;\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_232279 = 0;\n                bool should_load_carry_232280 = local_tid_232255 == 0 &&\n                     !crosses_segment_232279;\n                \n                if (should_load_carry_232280) {\n                    x_203544 = ((__local\n                                 int64_t *) scan_arr_mem_232259)[segscan_group_sizze_206862 -\n                                                                 (int64_t) 1];\n                }\n                if (!should_load_carry_232280) {\n                    x_203544 = (int64_t) 0;\n                }\n            }\n            barrier(CLK_LOCAL_MEM_FENCE);\n        }\n    }\n    \n ",
                   " error_1:\n    return;\n    #undef segscan_group_sizze_206862\n}\n__kernel void mainziscan_stage1_207007(__global int *global_failure,\n                                       __local volatile\n                                       int64_t *scan_arr_mem_232360_backing_aligned_0,\n                                       int64_t n_203490,\n                                       int64_t partition_sizze_203577,\n                                       int32_t num_threads_232354, __global\n                                       unsigned char *mem_229161, __global\n                                       unsigned char *mem_229186)\n{\n    #define segscan_group_sizze_207001 (mainzisegscan_group_sizze_206981)\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_232360_backing_0 =\n                                   (__local volatile\n                                    unsigned char *) scan_arr_mem_232360_backing_aligned_0;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_232355;\n    int32_t local_tid_232356;\n    int64_t group_sizze_232359;\n    int32_t wave_sizze_232358;\n    int32_t group_tid_232357;\n    \n    global_tid_232355 = get_global_id(0);\n    local_tid_232356 = get_local_id(0);\n    group_sizze_232359 = get_local_size(0);\n    wave_sizze_232358 = LOCKSTEP_WIDTH;\n    group_tid_232357 = get_group_id(0);\n    \n    int32_t phys_tid_207007 = global_tid_232355;\n    __local unsigned char *scan_arr_mem_232360;\n    \n    scan_arr_mem_232360 = (__local\n                           unsigned char *) scan_arr_mem_232360_backing_0;\n    \n    int64_t x_207008;\n    int64_t x_207009;\n    \n    x_207008 = (int64_t) 0;\n    for (int64_t j_232362 = 0; j_232362 < sdiv_up64(partition_sizze_203577 *\n                                                    n_203490,\n                                                    sext_i32_i64(num_threads_232354));\n         j_232362++) {\n        int64_t chu",
                   "nk_offset_232363 = segscan_group_sizze_207001 * j_232362 +\n                sext_i32_i64(group_tid_232357) * (segscan_group_sizze_207001 *\n                                                  sdiv_up64(partition_sizze_203577 *\n                                                            n_203490,\n                                                            sext_i32_i64(num_threads_232354)));\n        int64_t flat_idx_232364 = chunk_offset_232363 +\n                sext_i32_i64(local_tid_232356);\n        int64_t gtid_207005 = squot64(flat_idx_232364, n_203490);\n        int64_t gtid_207006 = flat_idx_232364 - squot64(flat_idx_232364,\n                                                        n_203490) * n_203490;\n        \n        // threads in bounds read input\n        {\n            if (slt64(gtid_207005, partition_sizze_203577) && slt64(gtid_207006,\n                                                                    n_203490)) {\n                double x_207012;\n                \n                x_207012 = ((__global double *) mem_229161)[gtid_207005 *\n                                                            n_203490 +\n                                                            gtid_207006];\n                \n                bool isnan_res_207013;\n                \n                isnan_res_207013 = futrts_isnan64(x_207012);\n                \n                bool defunc_0_p_res_207014 = !isnan_res_207013;\n                int64_t defunc_0_f_res_207015 =\n                        btoi_bool_i64(defunc_0_p_res_207014);\n                \n                // write to-scan values to parameters\n                {\n                    x_207009 = defunc_0_f_res_207015;\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_207005, partition_sizze_",
                   "203577) &&\n                      slt64(gtid_207006, n_203490))) {\n                    x_207009 = (int64_t) 0;\n                }\n            }\n            // combine with carry and write to local memory\n            {\n                int64_t defunc_1_op_res_207010 = add64(x_207008, x_207009);\n                \n                ((__local\n                  int64_t *) scan_arr_mem_232360)[sext_i32_i64(local_tid_232356)] =\n                    defunc_1_op_res_207010;\n            }\n            barrier(CLK_LOCAL_MEM_FENCE);\n            \n            int64_t x_232365;\n            int64_t x_232366;\n            int64_t x_232368;\n            int64_t x_232369;\n            bool ltid_in_bounds_232371 = slt64(sext_i32_i64(local_tid_232356),\n                                               segscan_group_sizze_207001);\n            int32_t skip_threads_232372;\n            \n            // read input for in-block scan\n            {\n                if (ltid_in_bounds_232371) {\n                    x_232366 = ((volatile __local\n                                 int64_t *) scan_arr_mem_232360)[sext_i32_i64(local_tid_232356)];\n                    if ((local_tid_232356 - squot32(local_tid_232356, 32) *\n                         32) == 0) {\n                        x_232365 = x_232366;\n                    }\n                }\n            }\n            // in-block scan (hopefully no barriers needed)\n            {\n                skip_threads_232372 = 1;\n                while (slt32(skip_threads_232372, 32)) {\n                    bool thread_active_232373 = sle32(skip_threads_232372,\n                                                      local_tid_232356 -\n                                                      squot32(local_tid_232356,\n                                                              32) * 32) &&\n                         ltid_in_bounds_232371;\n                    \n                    if (thread_active_232373) {\n                        // read operands\n                        {\n                 ",
                   "           x_232365 = ((volatile __local\n                                         int64_t *) scan_arr_mem_232360)[sext_i32_i64(local_tid_232356) -\n                                                                         sext_i32_i64(skip_threads_232372)];\n                        }\n                    }\n                    // perform operation\n                    {\n                        bool inactive_232374 =\n                             slt64(srem64(sext_i32_i64(local_tid_232356) +\n                                          chunk_offset_232363, n_203490),\n                                   sext_i32_i64(local_tid_232356) +\n                                   chunk_offset_232363 -\n                                   (sext_i32_i64(local_tid_232356 -\n                                    skip_threads_232372) +\n                                    chunk_offset_232363));\n                        \n                        if (thread_active_232373 && inactive_232374) {\n                            x_232365 = x_232366;\n                        }\n                        if (thread_active_232373) {\n                            if (!inactive_232374) {\n                                int64_t defunc_1_op_res_232367 = add64(x_232365,\n                                                                       x_232366);\n                                \n                                x_232365 = defunc_1_op_res_232367;\n                            }\n                        }\n                    }\n                    if (sle32(wave_sizze_232358, skip_threads_232372)) {\n                        barrier(CLK_LOCAL_MEM_FENCE);\n                    }\n                    if (thread_active_232373) {\n                        // write result\n                        {\n                            ((volatile __local\n                              int64_t *) scan_arr_mem_232360)[sext_i32_i64(local_tid_232356)] =\n                                x_232365;\n                            x_232366 = x_232365;\n             ",
                   "           }\n                    }\n                    if (sle32(wave_sizze_232358, skip_threads_232372)) {\n                        barrier(CLK_LOCAL_MEM_FENCE);\n                    }\n                    skip_threads_232372 *= 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_232356 - squot32(local_tid_232356, 32) * 32) ==\n                    31 && ltid_in_bounds_232371) {\n                    ((volatile __local\n                      int64_t *) scan_arr_mem_232360)[sext_i32_i64(squot32(local_tid_232356,\n                                                                           32))] =\n                        x_232365;\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_232375;\n                \n                // read input for in-block scan\n                {\n                    if (squot32(local_tid_232356, 32) == 0 &&\n                        ltid_in_bounds_232371) {\n                        x_232369 = ((volatile __local\n                                     int64_t *) scan_arr_mem_232360)[sext_i32_i64(local_tid_232356)];\n                        if ((local_tid_232356 - squot32(local_tid_232356, 32) *\n                             32) == 0) {\n                            x_232368 = x_232369;\n                        }\n                    }\n                }\n                // in-block scan (hopefully no barriers needed)\n                {\n                    skip_threads_232375 = 1;\n                    while (slt32(skip_threads_232375, 32)) {\n                        bool thread_active_232376 = sle32(skip_threads_232375,\n                                                          local_tid_232356 -\n                                                          squot32(local_ti",
                   "d_232356,\n                                                                  32) * 32) &&\n                             (squot32(local_tid_232356, 32) == 0 &&\n                              ltid_in_bounds_232371);\n                        \n                        if (thread_active_232376) {\n                            // read operands\n                            {\n                                x_232368 = ((volatile __local\n                                             int64_t *) scan_arr_mem_232360)[sext_i32_i64(local_tid_232356) -\n                                                                             sext_i32_i64(skip_threads_232375)];\n                            }\n                        }\n                        // perform operation\n                        {\n                            bool inactive_232377 =\n                                 slt64(srem64(sext_i32_i64(local_tid_232356 *\n                                              32 + 32 - 1) +\n                                              chunk_offset_232363, n_203490),\n                                       sext_i32_i64(local_tid_232356 * 32 + 32 -\n                                       1) + chunk_offset_232363 -\n                                       (sext_i32_i64((local_tid_232356 -\n                                                      skip_threads_232375) *\n                                        32 + 32 - 1) + chunk_offset_232363));\n                            \n                            if (thread_active_232376 && inactive_232377) {\n                                x_232368 = x_232369;\n                            }\n                            if (thread_active_232376) {\n                                if (!inactive_232377) {\n                                    int64_t defunc_1_op_res_232370 =\n                                            add64(x_232368, x_232369);\n                                    \n                                    x_232368 = defunc_1_op_res_232370;\n                                }\n ",
                   "                           }\n                        }\n                        if (sle32(wave_sizze_232358, skip_threads_232375)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        if (thread_active_232376) {\n                            // write result\n                            {\n                                ((volatile __local\n                                  int64_t *) scan_arr_mem_232360)[sext_i32_i64(local_tid_232356)] =\n                                    x_232368;\n                                x_232369 = x_232368;\n                            }\n                        }\n                        if (sle32(wave_sizze_232358, skip_threads_232375)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        skip_threads_232375 *= 2;\n                    }\n                }\n            }\n            barrier(CLK_LOCAL_MEM_FENCE);\n            \n            bool no_carry_in_232378 = squot32(local_tid_232356, 32) == 0 ||\n                 !ltid_in_bounds_232371;\n            \n            // carry-in for every block except the first\n            {\n                // read operands\n                {\n                    if (!no_carry_in_232378) {\n                        x_232366 = x_232365;\n                        x_232365 = ((__local\n                                     int64_t *) scan_arr_mem_232360)[sext_i32_i64(squot32(local_tid_232356,\n                                                                                          32)) -\n                                                                     (int64_t) 1];\n                    }\n                }\n                // perform operation\n                {\n                    bool inactive_232379 =\n                         slt64(srem64(sext_i32_i64(local_tid_232356) +\n                                      chunk_offset_232363, n_203490),\n                               sext_i32_i64(local_tid_232356) +\n            ",
                   "                   chunk_offset_232363 -\n                               (sext_i32_i64(squot32(local_tid_232356, 32) *\n                                32 - 1) + chunk_offset_232363));\n                    \n                    if (!no_carry_in_232378) {\n                        if (inactive_232379) {\n                            x_232365 = x_232366;\n                        }\n                    }\n                    if (!no_carry_in_232378) {\n                        if (!inactive_232379) {\n                            int64_t defunc_1_op_res_232367 = add64(x_232365,\n                                                                   x_232366);\n                            \n                            x_232365 = defunc_1_op_res_232367;\n                        }\n                    }\n                }\n                // write final result\n                {\n                    if (!no_carry_in_232378) {\n                        ((__local\n                          int64_t *) scan_arr_mem_232360)[sext_i32_i64(local_tid_232356)] =\n                            x_232365;\n                    }\n                }\n            }\n            barrier(CLK_LOCAL_MEM_FENCE);\n            // restore correct values for first block\n            {\n                if (squot32(local_tid_232356, 32) == 0 &&\n                    ltid_in_bounds_232371) {\n                    ((__local\n                      int64_t *) scan_arr_mem_232360)[sext_i32_i64(local_tid_232356)] =\n                        x_232366;\n                }\n            }\n            barrier(CLK_LOCAL_MEM_FENCE);\n            // threads in bounds write partial scan result\n            {\n                if (slt64(gtid_207005, partition_sizze_203577) &&\n                    slt64(gtid_207006, n_203490)) {\n                    int64_t tmp_232380;\n                    \n                    tmp_232380 = ((__local\n                                   int64_t *) scan_arr_mem_232360)[sext_i32_i64(local_tid_232356)];\n                    ((__global int64_t *) ",
                   "mem_229186)[gtid_207005 * n_203490 +\n                                                      gtid_207006] = tmp_232380;\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_232381 = slt64(srem64(chunk_offset_232363 +\n                                                           segscan_group_sizze_207001,\n                                                           n_203490),\n                                                    chunk_offset_232363 +\n                                                    segscan_group_sizze_207001 -\n                                                    (chunk_offset_232363 +\n                                                     segscan_group_sizze_207001 -\n                                                     (int64_t) 1));\n                bool should_load_carry_232382 = local_tid_232356 == 0 &&\n                     !crosses_segment_232381;\n                \n                if (should_load_carry_232382) {\n                    x_207008 = ((__local\n                                 int64_t *) scan_arr_mem_232360)[segscan_group_sizze_207001 -\n                                                                 (int64_t) 1];\n                }\n                if (!should_load_carry_232382) {\n                    x_207008 = (int64_t) 0;\n                }\n            }\n            barrier(CLK_LOCAL_MEM_FENCE);\n        }\n    }\n    \n  error_1:\n    return;\n    #undef segscan_group_sizze_207001\n}\n__kernel void mainziscan_stage1_207559(__global int *global_failure,\n                                       __local volatile\n                                       int64_t *scan_arr_mem_232529_backing_aligned_0,\n                                       int64_t n_p_203492,\n                                       int64_t partition_sizze_203577,\n                                       int64_t defunc_0_f_res_203631,\n                   ",
                   "                    int32_t num_threads_232523, __global\n                                       unsigned char *mem_229206, __global\n                                       unsigned char *mem_229250)\n{\n    #define segscan_group_sizze_207552 (mainzisegscan_group_sizze_207419)\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_232529_backing_0 =\n                                   (__local volatile\n                                    unsigned char *) scan_arr_mem_232529_backing_aligned_0;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_232524;\n    int32_t local_tid_232525;\n    int64_t group_sizze_232528;\n    int32_t wave_sizze_232527;\n    int32_t group_tid_232526;\n    \n    global_tid_232524 = get_global_id(0);\n    local_tid_232525 = get_local_id(0);\n    group_sizze_232528 = get_local_size(0);\n    wave_sizze_232527 = LOCKSTEP_WIDTH;\n    group_tid_232526 = get_group_id(0);\n    \n    int32_t phys_tid_207559 = global_tid_232524;\n    __local unsigned char *scan_arr_mem_232529;\n    \n    scan_arr_mem_232529 = (__local\n                           unsigned char *) scan_arr_mem_232529_backing_0;\n    \n    int64_t x_207560;\n    int64_t x_207561;\n    \n    x_207560 = (int64_t) 0;\n    for (int64_t j_232531 = 0; j_232531 < sdiv_up64(partition_sizze_203577 *\n                                                    n_p_203492 *\n                                                    defunc_0_f_res_203631,\n                                                    sext_i32_i64(num_threads_232523));\n         j_232531++) {\n        int64_t chunk_offset_232532 = segscan_group_sizze_207552 * j_232531 +\n                sext_i32_i64(group_tid_232526) * (segscan_group_sizze_207552 *\n                                                  sdiv_up64(partition_sizze_203577 *\n                                                            n_p_203492 *\n                                               ",
                   "             defunc_0_f_res_203631,\n                                                            sext_i32_i64(num_threads_232523)));\n        int64_t flat_idx_232533 = chunk_offset_232532 +\n                sext_i32_i64(local_tid_232525);\n        int64_t gtid_207556 = squot64(flat_idx_232533, n_p_203492 *\n                                      defunc_0_f_res_203631);\n        int64_t gtid_207557 = squot64(flat_idx_232533 - squot64(flat_idx_232533,\n                                                                n_p_203492 *\n                                                                defunc_0_f_res_203631) *\n                                      (n_p_203492 * defunc_0_f_res_203631),\n                                      defunc_0_f_res_203631);\n        int64_t gtid_207558 = flat_idx_232533 - squot64(flat_idx_232533,\n                                                        n_p_203492 *\n                                                        defunc_0_f_res_203631) *\n                (n_p_203492 * defunc_0_f_res_203631) - squot64(flat_idx_232533 -\n                                                               squot64(flat_idx_232533,\n                                                                       n_p_203492 *\n                                                                       defunc_0_f_res_203631) *\n                                                               (n_p_203492 *\n                                                                defunc_0_f_res_203631),\n                                                               defunc_0_f_res_203631) *\n                defunc_0_f_res_203631;\n        \n        // threads in bounds read input\n        {\n            if ((slt64(gtid_207556, partition_sizze_203577) &&\n                 slt64(gtid_207557, n_p_203492)) && slt64(gtid_207558,\n                                                          defunc_0_f_res_203631)) {\n                double x_207565;\n                \n                x_207565 = ((__global double *) mem_229206",
                   ")[gtid_207556 *\n                                                            (defunc_0_f_res_203631 *\n                                                             n_p_203492) +\n                                                            gtid_207557 *\n                                                            defunc_0_f_res_203631 +\n                                                            gtid_207558];\n                \n                bool isnan_res_207566;\n                \n                isnan_res_207566 = futrts_isnan64(x_207565);\n                \n                bool defunc_0_p_res_207567 = !isnan_res_207566;\n                int64_t defunc_0_f_res_207568 =\n                        btoi_bool_i64(defunc_0_p_res_207567);\n                \n                // write to-scan values to parameters\n                {\n                    x_207561 = defunc_0_f_res_207568;\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_207556, partition_sizze_203577) &&\n                       slt64(gtid_207557, n_p_203492)) && slt64(gtid_207558,\n                                                                defunc_0_f_res_203631))) {\n                    x_207561 = (int64_t) 0;\n                }\n            }\n            // combine with carry and write to local memory\n            {\n                int64_t defunc_1_op_res_207562 = add64(x_207560, x_207561);\n                \n                ((__local\n                  int64_t *) scan_arr_mem_232529)[sext_i32_i64(local_tid_232525)] =\n                    defunc_1_op_res_207562;\n            }\n            barrier(CLK_LOCAL_MEM_FENCE);\n            \n            int64_t x_232534;\n            int64_t x_232535;\n            int64_t x_232537;\n            int64_t x_232538;\n            bool ltid_in_b",
                   "ounds_232540 = slt64(sext_i32_i64(local_tid_232525),\n                                               segscan_group_sizze_207552);\n            int32_t skip_threads_232541;\n            \n            // read input for in-block scan\n            {\n                if (ltid_in_bounds_232540) {\n                    x_232535 = ((volatile __local\n                                 int64_t *) scan_arr_mem_232529)[sext_i32_i64(local_tid_232525)];\n                    if ((local_tid_232525 - squot32(local_tid_232525, 32) *\n                         32) == 0) {\n                        x_232534 = x_232535;\n                    }\n                }\n            }\n            // in-block scan (hopefully no barriers needed)\n            {\n                skip_threads_232541 = 1;\n                while (slt32(skip_threads_232541, 32)) {\n                    bool thread_active_232542 = sle32(skip_threads_232541,\n                                                      local_tid_232525 -\n                                                      squot32(local_tid_232525,\n                                                              32) * 32) &&\n                         ltid_in_bounds_232540;\n                    \n                    if (thread_active_232542) {\n                        // read operands\n                        {\n                            x_232534 = ((volatile __local\n                                         int64_t *) scan_arr_mem_232529)[sext_i32_i64(local_tid_232525) -\n                                                                         sext_i32_i64(skip_threads_232541)];\n                        }\n                    }\n                    // perform operation\n                    {\n                        bool inactive_232543 =\n                             slt64(srem64(sext_i32_i64(local_tid_232525) +\n                                          chunk_offset_232532,\n                                          defunc_0_f_res_203631),\n                                   sext_i32_i64(local_tid_23",
                   "2525) +\n                                   chunk_offset_232532 -\n                                   (sext_i32_i64(local_tid_232525 -\n                                    skip_threads_232541) +\n                                    chunk_offset_232532));\n                        \n                        if (thread_active_232542 && inactive_232543) {\n                            x_232534 = x_232535;\n                        }\n                        if (thread_active_232542) {\n                            if (!inactive_232543) {\n                                int64_t defunc_1_op_res_232536 = add64(x_232534,\n                                                                       x_232535);\n                                \n                                x_232534 = defunc_1_op_res_232536;\n                            }\n                        }\n                    }\n                    if (sle32(wave_sizze_232527, skip_threads_232541)) {\n                        barrier(CLK_LOCAL_MEM_FENCE);\n                    }\n                    if (thread_active_232542) {\n                        // write result\n                        {\n                            ((volatile __local\n                              int64_t *) scan_arr_mem_232529)[sext_i32_i64(local_tid_232525)] =\n                                x_232534;\n                            x_232535 = x_232534;\n                        }\n                    }\n                    if (sle32(wave_sizze_232527, skip_threads_232541)) {\n                        barrier(CLK_LOCAL_MEM_FENCE);\n                    }\n                    skip_threads_232541 *= 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_232525 - squot32(local_tid_232525, 32) * 32) ==\n                    31 && ltid_in_bounds_232540) {\n                    ((volatile __local\n                      int64_t *) scan_arr_mem_232529)[sext_i32_i",
                   "64(squot32(local_tid_232525,\n                                                                           32))] =\n                        x_232534;\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_232544;\n                \n                // read input for in-block scan\n                {\n                    if (squot32(local_tid_232525, 32) == 0 &&\n                        ltid_in_bounds_232540) {\n                        x_232538 = ((volatile __local\n                                     int64_t *) scan_arr_mem_232529)[sext_i32_i64(local_tid_232525)];\n                        if ((local_tid_232525 - squot32(local_tid_232525, 32) *\n                             32) == 0) {\n                            x_232537 = x_232538;\n                        }\n                    }\n                }\n                // in-block scan (hopefully no barriers needed)\n                {\n                    skip_threads_232544 = 1;\n                    while (slt32(skip_threads_232544, 32)) {\n                        bool thread_active_232545 = sle32(skip_threads_232544,\n                                                          local_tid_232525 -\n                                                          squot32(local_tid_232525,\n                                                                  32) * 32) &&\n                             (squot32(local_tid_232525, 32) == 0 &&\n                              ltid_in_bounds_232540);\n                        \n                        if (thread_active_232545) {\n                            // read operands\n                            {\n                                x_232537 = ((volatile __local\n                                             int64_t *) scan_arr_mem_232529)[sext_i32_i64(local_tid_232525) -\n                                                                             sext_i32_i6",
                   "4(skip_threads_232544)];\n                            }\n                        }\n                        // perform operation\n                        {\n                            bool inactive_232546 =\n                                 slt64(srem64(sext_i32_i64(local_tid_232525 *\n                                              32 + 32 - 1) +\n                                              chunk_offset_232532,\n                                              defunc_0_f_res_203631),\n                                       sext_i32_i64(local_tid_232525 * 32 + 32 -\n                                       1) + chunk_offset_232532 -\n                                       (sext_i32_i64((local_tid_232525 -\n                                                      skip_threads_232544) *\n                                        32 + 32 - 1) + chunk_offset_232532));\n                            \n                            if (thread_active_232545 && inactive_232546) {\n                                x_232537 = x_232538;\n                            }\n                            if (thread_active_232545) {\n                                if (!inactive_232546) {\n                                    int64_t defunc_1_op_res_232539 =\n                                            add64(x_232537, x_232538);\n                                    \n                                    x_232537 = defunc_1_op_res_232539;\n                                }\n                            }\n                        }\n                        if (sle32(wave_sizze_232527, skip_threads_232544)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        if (thread_active_232545) {\n                            // write result\n                            {\n                                ((volatile __local\n                                  int64_t *) scan_arr_mem_232529)[sext_i32_i64(local_tid_232525)] =\n                                    x_232537;\n                         ",
                   "       x_232538 = x_232537;\n                            }\n                        }\n                        if (sle32(wave_sizze_232527, skip_threads_232544)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        skip_threads_232544 *= 2;\n                    }\n                }\n            }\n            barrier(CLK_LOCAL_MEM_FENCE);\n            \n            bool no_carry_in_232547 = squot32(local_tid_232525, 32) == 0 ||\n                 !ltid_in_bounds_232540;\n            \n            // carry-in for every block except the first\n            {\n                // read operands\n                {\n                    if (!no_carry_in_232547) {\n                        x_232535 = x_232534;\n                        x_232534 = ((__local\n                                     int64_t *) scan_arr_mem_232529)[sext_i32_i64(squot32(local_tid_232525,\n                                                                                          32)) -\n                                                                     (int64_t) 1];\n                    }\n                }\n                // perform operation\n                {\n                    bool inactive_232548 =\n                         slt64(srem64(sext_i32_i64(local_tid_232525) +\n                                      chunk_offset_232532,\n                                      defunc_0_f_res_203631),\n                               sext_i32_i64(local_tid_232525) +\n                               chunk_offset_232532 -\n                               (sext_i32_i64(squot32(local_tid_232525, 32) *\n                                32 - 1) + chunk_offset_232532));\n                    \n                    if (!no_carry_in_232547) {\n                        if (inactive_232548) {\n                            x_232534 = x_232535;\n                        }\n                    }\n                    if (!no_carry_in_232547) {\n                        if (!inactive_232548) {\n                       ",
                   "     int64_t defunc_1_op_res_232536 = add64(x_232534,\n                                                                   x_232535);\n                            \n                            x_232534 = defunc_1_op_res_232536;\n                        }\n                    }\n                }\n                // write final result\n                {\n                    if (!no_carry_in_232547) {\n                        ((__local\n                          int64_t *) scan_arr_mem_232529)[sext_i32_i64(local_tid_232525)] =\n                            x_232534;\n                    }\n                }\n            }\n            barrier(CLK_LOCAL_MEM_FENCE);\n            // restore correct values for first block\n            {\n                if (squot32(local_tid_232525, 32) == 0 &&\n                    ltid_in_bounds_232540) {\n                    ((__local\n                      int64_t *) scan_arr_mem_232529)[sext_i32_i64(local_tid_232525)] =\n                        x_232535;\n                }\n            }\n            barrier(CLK_LOCAL_MEM_FENCE);\n            // threads in bounds write partial scan result\n            {\n                if ((slt64(gtid_207556, partition_sizze_203577) &&\n                     slt64(gtid_207557, n_p_203492)) && slt64(gtid_207558,\n                                                              defunc_0_f_res_203631)) {\n                    int64_t tmp_232549;\n                    \n                    tmp_232549 = ((__local\n                                   int64_t *) scan_arr_mem_232529)[sext_i32_i64(local_tid_232525)];\n                    ((__global int64_t *) mem_229250)[gtid_207556 *\n                                                      (defunc_0_f_res_203631 *\n                                                       n_p_203492) +\n                                                      gtid_207557 *\n                                                      defunc_0_f_res_203631 +\n                                                      gtid_207558] = tmp_232549;\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_232550 = slt64(srem64(chunk_offset_232532 +\n                                                           segscan_group_sizze_207552,\n                                                           defunc_0_f_res_203631),\n                                                    chunk_offset_232532 +\n                                                    segscan_group_sizze_207552 -\n                                                    (chunk_offset_232532 +\n                                                     segscan_group_sizze_207552 -\n                                                     (int64_t) 1));\n                bool should_load_carry_232551 = local_tid_232525 == 0 &&\n                     !crosses_segment_232550;\n                \n                if (should_load_carry_232551) {\n                    x_207560 = ((__local\n                                 int64_t *) scan_arr_mem_232529)[segscan_group_sizze_207552 -\n                                                                 (int64_t) 1];\n                }\n                if (!should_load_carry_232551) {\n                    x_207560 = (int64_t) 0;\n                }\n            }\n            barrier(CLK_LOCAL_MEM_FENCE);\n        }\n    }\n    \n  error_1:\n    return;\n    #undef segscan_group_sizze_207552\n}\n__kernel void mainziscan_stage1_218683(__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_234175_backing_aligned_0,\n                                       int64_t n_p_203492,\n                                       double i64_res_203507,\n                                       int64_t partition_siz",
                   "ze_203577,\n                                       int64_t C_len_203634,\n                                       int64_t lifted_single_ma_l_arg_204134,\n                                       int32_t num_threads_234169, __global\n                                       unsigned char *mem_230500, __global\n                                       unsigned char *ext_mem_230512, __global\n                                       unsigned char *mem_230517)\n{\n    #define segscan_group_sizze_218677 (mainzisegscan_group_sizze_218641)\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_234175_backing_0 =\n                                   (__local volatile\n                                    unsigned char *) scan_arr_mem_234175_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_234170;\n    int32_t local_tid_234171;\n    int64_t group_sizze_234174;\n    int32_t wave_sizze_234173;\n    int32_t group_tid_234172;\n    \n    global_tid_234170 = get_global_id(0);\n    local_tid_234171 = get_local_id(0);\n    group_sizze_234174 = get_local_size(0);\n    wave_sizze_234173 = LOCKSTEP_WIDTH;\n    group_tid_234172 = get_group_id(0);\n    \n    int32_t phys_tid_218683 = global_tid_234170;\n    __local unsigned char *scan_arr_mem_234175;\n    \n    scan_arr_mem_234175 = (__local\n                           unsigned char *) scan_arr_mem_234175_backing_0;\n    \n    double x_218684;\n    double x_218685;\n    \n    x_218684 = 0.0;\n    for (int64_t j_234177 = 0; j_234177 < sdiv_up64(partition_sizze_203577 *\n                                                    lifted_single_ma_l_arg_204134,\n                                                    sext_i32_i64(num_threads_234169));\n         j_234177+",
                   "+) {\n        int64_t chunk_offset_234178 = segscan_group_sizze_218677 * j_234177 +\n                sext_i32_i64(group_tid_234172) * (segscan_group_sizze_218677 *\n                                                  sdiv_up64(partition_sizze_203577 *\n                                                            lifted_single_ma_l_arg_204134,\n                                                            sext_i32_i64(num_threads_234169)));\n        int64_t flat_idx_234179 = chunk_offset_234178 +\n                sext_i32_i64(local_tid_234171);\n        int64_t gtid_218681 = squot64(flat_idx_234179,\n                                      lifted_single_ma_l_arg_204134);\n        int64_t gtid_218682 = flat_idx_234179 - squot64(flat_idx_234179,\n                                                        lifted_single_ma_l_arg_204134) *\n                lifted_single_ma_l_arg_204134;\n        \n        // threads in bounds read input\n        {\n            if (slt64(gtid_218681, partition_sizze_203577) && slt64(gtid_218682,\n                                                                    lifted_single_ma_l_arg_204134)) {\n                bool cond_218690 = gtid_218682 == (int64_t) 0;\n                double defunc_0_f_res_218691;\n                \n                if (cond_218690) {\n                    double x_218688;\n                    \n                    x_218688 = ((__global\n                                 double *) ext_mem_230512)[gtid_218681];\n                    \n                    double defunc_0_f_res_t_res_218692 = x_218688 /\n                           i64_res_203507;\n                    \n                    defunc_0_f_res_218691 = defunc_0_f_res_t_res_218692;\n                } else {\n                    int64_t x_218693 = add64(n_p_203492, gtid_218682);\n                    int64_t i_218694 = sub64(x_218693, (int64_t) 1);\n                    bool x_218695 = sle64((int64_t) 0, i_218694);\n                    bool y_218696 = slt64(i_218694, C_len_203634);\n                    bool bou",
                   "nds_check_218697 = x_218695 && y_218696;\n                    bool index_certs_218698;\n                    \n                    if (!bounds_check_218697) {\n                        {\n                            if (atomic_cmpxchg_i32_global(global_failure, -1,\n                                                          44) == -1) {\n                                global_failure_args[0] = (int64_t) i_218694;\n                                global_failure_args[1] = (int64_t) C_len_203634;\n                                ;\n                            }\n                            local_failure = true;\n                            goto error_0;\n                        }\n                    }\n                    \n                    double x_218699;\n                    \n                    x_218699 = ((__global double *) mem_230500)[gtid_218681 *\n                                                                C_len_203634 +\n                                                                i_218694];\n                    \n                    int64_t i_218700 = sub64(gtid_218682, (int64_t) 1);\n                    bool x_218701 = sle64((int64_t) 0, i_218700);\n                    bool y_218702 = slt64(i_218700, C_len_203634);\n                    bool bounds_check_218703 = x_218701 && y_218702;\n                    bool index_certs_218704;\n                    \n                    if (!bounds_check_218703) {\n                        {\n                            if (atomic_cmpxchg_i32_global(global_failure, -1,\n                                                          45) == -1) {\n                                global_failure_args[0] = (int64_t) i_218700;\n                                global_failure_args[1] = (int64_t) C_len_203634;\n                                ;\n                            }\n                            local_failure = true;\n                            goto error_0;\n                        }\n                    }\n                    \n                    double y_2",
                   "18705;\n                    \n                    y_218705 = ((__global double *) mem_230500)[gtid_218681 *\n                                                                C_len_203634 +\n                                                                i_218700];\n                    \n                    double x_218706 = x_218699 - y_218705;\n                    double defunc_0_f_res_f_res_218707 = x_218706 /\n                           i64_res_203507;\n                    \n                    defunc_0_f_res_218691 = defunc_0_f_res_f_res_218707;\n                }\n                // write to-scan values to parameters\n                {\n                    x_218685 = defunc_0_f_res_218691;\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_218681, partition_sizze_203577) &&\n                      slt64(gtid_218682, lifted_single_ma_l_arg_204134))) {\n                    x_218685 = 0.0;\n                }\n            }\n            // combine with carry and write to local memory\n            {\n                double defunc_1_op_res_218686 = x_218684 + x_218685;\n                \n                ((__local\n                  double *) scan_arr_mem_234175)[sext_i32_i64(local_tid_234171)] =\n                    defunc_1_op_res_218686;\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_234180;\n            double x_234181;\n            double x_234183;\n            double x_234184;\n            bool ltid_in_bounds_234186 = slt64(sext_i32_i64(local_tid_234171),\n                                               segscan_group_sizze_218677);\n            int32_t skip_threads_234187;\n ",
                   "           \n            // read input for in-block scan\n            {\n                if (ltid_in_bounds_234186) {\n                    x_234181 = ((volatile __local\n                                 double *) scan_arr_mem_234175)[sext_i32_i64(local_tid_234171)];\n                    if ((local_tid_234171 - squot32(local_tid_234171, 32) *\n                         32) == 0) {\n                        x_234180 = x_234181;\n                    }\n                }\n            }\n            // in-block scan (hopefully no barriers needed)\n            {\n                skip_threads_234187 = 1;\n                while (slt32(skip_threads_234187, 32)) {\n                    bool thread_active_234188 = sle32(skip_threads_234187,\n                                                      local_tid_234171 -\n                                                      squot32(local_tid_234171,\n                                                              32) * 32) &&\n                         ltid_in_bounds_234186;\n                    \n                    if (thread_active_234188) {\n                        // read operands\n                        {\n                            x_234180 = ((volatile __local\n                                         double *) scan_arr_mem_234175)[sext_i32_i64(local_tid_234171) -\n                                                                        sext_i32_i64(skip_threads_234187)];\n                        }\n                    }\n                    // perform operation\n                    {\n                        bool inactive_234189 =\n                             slt64(srem64(sext_i32_i64(local_tid_234171) +\n                                          chunk_offset_234178,\n                                          lifted_single_ma_l_arg_204134),\n                                   sext_i32_i64(local_tid_234171) +\n                                   chunk_offset_234178 -\n                                   (sext_i32_i64(local_tid_234171 -\n                                 ",
                   "   skip_threads_234187) +\n                                    chunk_offset_234178));\n                        \n                        if (thread_active_234188 && inactive_234189) {\n                            x_234180 = x_234181;\n                        }\n                        if (thread_active_234188) {\n                            if (!inactive_234189) {\n                                double defunc_1_op_res_234182 = x_234180 +\n                                       x_234181;\n                                \n                                x_234180 = defunc_1_op_res_234182;\n                            }\n                        }\n                    }\n                    if (sle32(wave_sizze_234173, skip_threads_234187)) {\n                        barrier(CLK_LOCAL_MEM_FENCE);\n                    }\n                    if (thread_active_234188) {\n                        // write result\n                        {\n                            ((volatile __local\n                              double *) scan_arr_mem_234175)[sext_i32_i64(local_tid_234171)] =\n                                x_234180;\n                            x_234181 = x_234180;\n                        }\n                    }\n                    if (sle32(wave_sizze_234173, skip_threads_234187)) {\n                        barrier(CLK_LOCAL_MEM_FENCE);\n                    }\n                    skip_threads_234187 *= 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_234171 - squot32(local_tid_234171, 32) * 32) ==\n                    31 && ltid_in_bounds_234186) {\n                    ((volatile __local\n                      double *) scan_arr_mem_234175)[sext_i32_i64(squot32(local_tid_234171,\n                                                                          32))] =\n                        x_234180;\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_234190;\n                \n                // read input for in-block scan\n                {\n                    if (squot32(local_tid_234171, 32) == 0 &&\n                        ltid_in_bounds_234186) {\n                        x_234184 = ((volatile __local\n                                     double *) scan_arr_mem_234175)[sext_i32_i64(local_tid_234171)];\n                        if ((local_tid_234171 - squot32(local_tid_234171, 32) *\n                             32) == 0) {\n                            x_234183 = x_234184;\n                        }\n                    }\n                }\n                // in-block scan (hopefully no barriers needed)\n                {\n                    skip_threads_234190 = 1;\n                    while (slt32(skip_threads_234190, 32)) {\n                        bool thread_active_234191 = sle32(skip_threads_234190,\n                                                          local_tid_234171 -\n                                                          squot32(local_tid_234171,\n                                                                  32) * 32) &&\n                             (squot32(local_tid_234171, 32) == 0 &&\n                              ltid_in_bounds_234186);\n                        \n                        if (thread_active_234191) {\n                            // read operands\n                            {\n                                x_234183 = ((volatile __local\n                                             double *) scan_arr_mem_234175)[sext_i32_i64(local_tid_234171) -\n                                                                            sext_i32_i64(skip_threads_234190)];\n                            }\n                        }\n                        // perform operation\n                        {\n                            bool inactive_234192 =\n        ",
                   "                         slt64(srem64(sext_i32_i64(local_tid_234171 *\n                                              32 + 32 - 1) +\n                                              chunk_offset_234178,\n                                              lifted_single_ma_l_arg_204134),\n                                       sext_i32_i64(local_tid_234171 * 32 + 32 -\n                                       1) + chunk_offset_234178 -\n                                       (sext_i32_i64((local_tid_234171 -\n                                                      skip_threads_234190) *\n                                        32 + 32 - 1) + chunk_offset_234178));\n                            \n                            if (thread_active_234191 && inactive_234192) {\n                                x_234183 = x_234184;\n                            }\n                            if (thread_active_234191) {\n                                if (!inactive_234192) {\n                                    double defunc_1_op_res_234185 = x_234183 +\n                                           x_234184;\n                                    \n                                    x_234183 = defunc_1_op_res_234185;\n                                }\n                            }\n                        }\n                        if (sle32(wave_sizze_234173, skip_threads_234190)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        if (thread_active_234191) {\n                            // write result\n                            {\n                                ((volatile __local\n                                  double *) scan_arr_mem_234175)[sext_i32_i64(local_tid_234171)] =\n                                    x_234183;\n                                x_234184 = x_234183;\n                            }\n                        }\n                        if (sle32(wave_sizze_234173, skip_threads_234190)) {\n                            barrier(CLK_LOCAL_MEM_F",
                   "ENCE);\n                        }\n                        skip_threads_234190 *= 2;\n                    }\n                }\n            }\n            barrier(CLK_LOCAL_MEM_FENCE);\n            \n            bool no_carry_in_234193 = squot32(local_tid_234171, 32) == 0 ||\n                 !ltid_in_bounds_234186;\n            \n            // carry-in for every block except the first\n            {\n                // read operands\n                {\n                    if (!no_carry_in_234193) {\n                        x_234181 = x_234180;\n                        x_234180 = ((__local\n                                     double *) scan_arr_mem_234175)[sext_i32_i64(squot32(local_tid_234171,\n                                                                                         32)) -\n                                                                    (int64_t) 1];\n                    }\n                }\n                // perform operation\n                {\n                    bool inactive_234194 =\n                         slt64(srem64(sext_i32_i64(local_tid_234171) +\n                                      chunk_offset_234178,\n                                      lifted_single_ma_l_arg_204134),\n                               sext_i32_i64(local_tid_234171) +\n                               chunk_offset_234178 -\n                               (sext_i32_i64(squot32(local_tid_234171, 32) *\n                                32 - 1) + chunk_offset_234178));\n                    \n                    if (!no_carry_in_234193) {\n                        if (inactive_234194) {\n                            x_234180 = x_234181;\n                        }\n                    }\n                    if (!no_carry_in_234193) {\n                        if (!inactive_234194) {\n                            double defunc_1_op_res_234182 = x_234180 + x_234181;\n                            \n                            x_234180 = defunc_1_op_res_234182;\n                        }\n                    }\n         ",
                   "       }\n                // write final result\n                {\n                    if (!no_carry_in_234193) {\n                        ((__local\n                          double *) scan_arr_mem_234175)[sext_i32_i64(local_tid_234171)] =\n                            x_234180;\n                    }\n                }\n            }\n            barrier(CLK_LOCAL_MEM_FENCE);\n            // restore correct values for first block\n            {\n                if (squot32(local_tid_234171, 32) == 0 &&\n                    ltid_in_bounds_234186) {\n                    ((__local\n                      double *) scan_arr_mem_234175)[sext_i32_i64(local_tid_234171)] =\n                        x_234181;\n                }\n            }\n            barrier(CLK_LOCAL_MEM_FENCE);\n            // threads in bounds write partial scan result\n            {\n                if (slt64(gtid_218681, partition_sizze_203577) &&\n                    slt64(gtid_218682, lifted_single_ma_l_arg_204134)) {\n                    double tmp_234195;\n                    \n                    tmp_234195 = ((__local\n                                   double *) scan_arr_mem_234175)[sext_i32_i64(local_tid_234171)];\n                    ((__global double *) mem_230517)[gtid_218681 *\n                                                     lifted_single_ma_l_arg_204134 +\n                                                     gtid_218682] = tmp_234195;\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_234196 = slt64(srem64(chunk_offset_234178 +\n                                                           segscan_group_sizze_218677,\n                                                           lifted_single_ma_l_arg_204134),\n                                                    chunk_offset_234178 +\n                                                    segscan_group_sizze_218677 -\n       ",
                   "                                             (chunk_offset_234178 +\n                                                     segscan_group_sizze_218677 -\n                                                     (int64_t) 1));\n                bool should_load_carry_234197 = local_tid_234171 == 0 &&\n                     !crosses_segment_234196;\n                \n                if (should_load_carry_234197) {\n                    x_218684 = ((__local\n                                 double *) scan_arr_mem_234175)[segscan_group_sizze_218677 -\n                                                                (int64_t) 1];\n                }\n                if (!should_load_carry_234197) {\n                    x_218684 = 0.0;\n                }\n            }\n            barrier(CLK_LOCAL_MEM_FENCE);\n        }\n    }\n    \n  error_1:\n    return;\n    #undef segscan_group_sizze_218677\n}\n__kernel void mainziscan_stage1_218814(__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_234318_backing_aligned_0,\n                                       int64_t n_p_203492,\n                                       double i64_res_203507,\n                                       int64_t partition_sizze_203577,\n                                       int64_t lifted_single_ma_l_arg_204134,\n                                       int64_t dyn_lifted_single_ma_l_arg_204144,\n                                       int32_t num_threads_234312, __global\n                                       unsigned char *mem_230517, __global\n                                       unsigned char *ext_mem_230529, __global\n                                       unsigned char *mem_230534)\n{\n    #define segscan_group_sizze_218808 (mainzisegscan_group_sizze_218772)\n    \n    const int block_dim0 = 0;\n    const i",
                   "nt block_dim1 = 1;\n    const int block_dim2 = 2;\n    __local volatile unsigned char *restrict scan_arr_mem_234318_backing_0 =\n                                   (__local volatile\n                                    unsigned char *) scan_arr_mem_234318_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_234313;\n    int32_t local_tid_234314;\n    int64_t group_sizze_234317;\n    int32_t wave_sizze_234316;\n    int32_t group_tid_234315;\n    \n    global_tid_234313 = get_global_id(0);\n    local_tid_234314 = get_local_id(0);\n    group_sizze_234317 = get_local_size(0);\n    wave_sizze_234316 = LOCKSTEP_WIDTH;\n    group_tid_234315 = get_group_id(0);\n    \n    int32_t phys_tid_218814 = global_tid_234313;\n    __local unsigned char *scan_arr_mem_234318;\n    \n    scan_arr_mem_234318 = (__local\n                           unsigned char *) scan_arr_mem_234318_backing_0;\n    \n    double x_218815;\n    double x_218816;\n    \n    x_218815 = 0.0;\n    for (int64_t j_234320 = 0; j_234320 < sdiv_up64(partition_sizze_203577 *\n                                                    dyn_lifted_single_ma_l_arg_204144,\n                                                    sext_i32_i64(num_threads_234312));\n         j_234320++) {\n        int64_t chunk_offset_234321 = segscan_group_sizze_218808 * j_234320 +\n                sext_i32_i64(group_tid_234315) * (segscan_group_sizze_218808 *\n                                                  sdiv_up64(partition_sizze_203577 *\n                                                            dyn_lifted_single_ma_l_arg_204144,\n                                                            sext_i32_i64(num_threads_234312)));\n        int64_t flat_idx_234322 = chunk_offset_234321 +\n                sext_i32_i64(local_tid_234314);\n        int64_t gtid_2",
                   "18812 = squot64(flat_idx_234322,\n                                      dyn_lifted_single_ma_l_arg_204144);\n        int64_t gtid_218813 = flat_idx_234322 - squot64(flat_idx_234322,\n                                                        dyn_lifted_single_ma_l_arg_204144) *\n                dyn_lifted_single_ma_l_arg_204144;\n        \n        // threads in bounds read input\n        {\n            if (slt64(gtid_218812, partition_sizze_203577) && slt64(gtid_218813,\n                                                                    dyn_lifted_single_ma_l_arg_204144)) {\n                bool cond_218821 = gtid_218813 == (int64_t) 0;\n                double defunc_0_f_res_218822;\n                \n                if (cond_218821) {\n                    double x_218819;\n                    \n                    x_218819 = ((__global\n                                 double *) ext_mem_230529)[gtid_218812];\n                    \n                    double defunc_0_f_res_t_res_218823 = x_218819 /\n                           i64_res_203507;\n                    \n                    defunc_0_f_res_218822 = defunc_0_f_res_t_res_218823;\n                } else {\n                    int64_t x_218824 = add64(n_p_203492, gtid_218813);\n                    int64_t i_218825 = sub64(x_218824, (int64_t) 1);\n                    bool x_218826 = sle64((int64_t) 0, i_218825);\n                    bool y_218827 = slt64(i_218825,\n                                          lifted_single_ma_l_arg_204134);\n                    bool bounds_check_218828 = x_218826 && y_218827;\n                    bool index_certs_218829;\n                    \n                    if (!bounds_check_218828) {\n                        {\n                            if (atomic_cmpxchg_i32_global(global_failure, -1,\n                                                          46) == -1) {\n                                global_failure_args[0] = (int64_t) i_218825;\n                                global_failure_args[1] =\n                     ",
                   "               (int64_t) lifted_single_ma_l_arg_204134;\n                                ;\n                            }\n                            local_failure = true;\n                            goto error_0;\n                        }\n                    }\n                    \n                    double x_218830;\n                    \n                    x_218830 = ((__global double *) mem_230517)[gtid_218812 *\n                                                                lifted_single_ma_l_arg_204134 +\n                                                                i_218825];\n                    \n                    int64_t i_218831 = sub64(gtid_218813, (int64_t) 1);\n                    bool x_218832 = sle64((int64_t) 0, i_218831);\n                    bool y_218833 = slt64(i_218831,\n                                          lifted_single_ma_l_arg_204134);\n                    bool bounds_check_218834 = x_218832 && y_218833;\n                    bool index_certs_218835;\n                    \n                    if (!bounds_check_218834) {\n                        {\n                            if (atomic_cmpxchg_i32_global(global_failure, -1,\n                                                          47) == -1) {\n                                global_failure_args[0] = (int64_t) i_218831;\n                                global_failure_args[1] =\n                                    (int64_t) lifted_single_ma_l_arg_204134;\n                                ;\n                            }\n                            local_failure = true;\n                            goto error_0;\n                        }\n                    }\n                    \n                    double y_218836;\n                    \n                    y_218836 = ((__global double *) mem_230517)[gtid_218812 *\n                                                                lifted_single_ma_l_arg_204134 +\n                                                                i_218831];\n                    \n     ",
                   "               double x_218837 = x_218830 - y_218836;\n                    double defunc_0_f_res_f_res_218838 = x_218837 /\n                           i64_res_203507;\n                    \n                    defunc_0_f_res_218822 = defunc_0_f_res_f_res_218838;\n                }\n                // write to-scan values to parameters\n                {\n                    x_218816 = defunc_0_f_res_218822;\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_218812, partition_sizze_203577) &&\n                      slt64(gtid_218813, dyn_lifted_single_ma_l_arg_204144))) {\n                    x_218816 = 0.0;\n                }\n            }\n            // combine with carry and write to local memory\n            {\n                double defunc_1_op_res_218817 = x_218815 + x_218816;\n                \n                ((__local\n                  double *) scan_arr_mem_234318)[sext_i32_i64(local_tid_234314)] =\n                    defunc_1_op_res_218817;\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_234323;\n            double x_234324;\n            double x_234326;\n            double x_234327;\n            bool ltid_in_bounds_234329 = slt64(sext_i32_i64(local_tid_234314),\n                                               segscan_group_sizze_218808);\n            int32_t skip_threads_234330;\n            \n            // read input for in-block scan\n            {\n                if (ltid_in_bounds_234329) {\n                    x_234324 = ((volatile __local\n                                 double *) scan_arr_mem_234318)[sext_i32_i64(local_tid_234314)];\n                    ",
                   "if ((local_tid_234314 - squot32(local_tid_234314, 32) *\n                         32) == 0) {\n                        x_234323 = x_234324;\n                    }\n                }\n            }\n            // in-block scan (hopefully no barriers needed)\n            {\n                skip_threads_234330 = 1;\n                while (slt32(skip_threads_234330, 32)) {\n                    bool thread_active_234331 = sle32(skip_threads_234330,\n                                                      local_tid_234314 -\n                                                      squot32(local_tid_234314,\n                                                              32) * 32) &&\n                         ltid_in_bounds_234329;\n                    \n                    if (thread_active_234331) {\n                        // read operands\n                        {\n                            x_234323 = ((volatile __local\n                                         double *) scan_arr_mem_234318)[sext_i32_i64(local_tid_234314) -\n                                                                        sext_i32_i64(skip_threads_234330)];\n                        }\n                    }\n                    // perform operation\n                    {\n                        bool inactive_234332 =\n                             slt64(srem64(sext_i32_i64(local_tid_234314) +\n                                          chunk_offset_234321,\n                                          dyn_lifted_single_ma_l_arg_204144),\n                                   sext_i32_i64(local_tid_234314) +\n                                   chunk_offset_234321 -\n                                   (sext_i32_i64(local_tid_234314 -\n                                    skip_threads_234330) +\n                                    chunk_offset_234321));\n                        \n                        if (thread_active_234331 && inactive_234332) {\n                            x_234323 = x_234324;\n                        }\n                      ",
                   "  if (thread_active_234331) {\n                            if (!inactive_234332) {\n                                double defunc_1_op_res_234325 = x_234323 +\n                                       x_234324;\n                                \n                                x_234323 = defunc_1_op_res_234325;\n                            }\n                        }\n                    }\n                    if (sle32(wave_sizze_234316, skip_threads_234330)) {\n                        barrier(CLK_LOCAL_MEM_FENCE);\n                    }\n                    if (thread_active_234331) {\n                        // write result\n                        {\n                            ((volatile __local\n                              double *) scan_arr_mem_234318)[sext_i32_i64(local_tid_234314)] =\n                                x_234323;\n                            x_234324 = x_234323;\n                        }\n                    }\n                    if (sle32(wave_sizze_234316, skip_threads_234330)) {\n                        barrier(CLK_LOCAL_MEM_FENCE);\n                    }\n                    skip_threads_234330 *= 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_234314 - squot32(local_tid_234314, 32) * 32) ==\n                    31 && ltid_in_bounds_234329) {\n                    ((volatile __local\n                      double *) scan_arr_mem_234318)[sext_i32_i64(squot32(local_tid_234314,\n                                                                          32))] =\n                        x_234323;\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_234333;\n                \n                // read input for in-block scan\n                {\n                    if (squot3",
                   "2(local_tid_234314, 32) == 0 &&\n                        ltid_in_bounds_234329) {\n                        x_234327 = ((volatile __local\n                                     double *) scan_arr_mem_234318)[sext_i32_i64(local_tid_234314)];\n                        if ((local_tid_234314 - squot32(local_tid_234314, 32) *\n                             32) == 0) {\n                            x_234326 = x_234327;\n                        }\n                    }\n                }\n                // in-block scan (hopefully no barriers needed)\n                {\n                    skip_threads_234333 = 1;\n                    while (slt32(skip_threads_234333, 32)) {\n                        bool thread_active_234334 = sle32(skip_threads_234333,\n                                                          local_tid_234314 -\n                                                          squot32(local_tid_234314,\n                                                                  32) * 32) &&\n                             (squot32(local_tid_234314, 32) == 0 &&\n                              ltid_in_bounds_234329);\n                        \n                        if (thread_active_234334) {\n                            // read operands\n                            {\n                                x_234326 = ((volatile __local\n                                             double *) scan_arr_mem_234318)[sext_i32_i64(local_tid_234314) -\n                                                                            sext_i32_i64(skip_threads_234333)];\n                            }\n                        }\n                        // perform operation\n                        {\n                            bool inactive_234335 =\n                                 slt64(srem64(sext_i32_i64(local_tid_234314 *\n                                              32 + 32 - 1) +\n                                              chunk_offset_234321,\n                                              dyn_lifted_single_ma_l_arg_204144)",
                   ",\n                                       sext_i32_i64(local_tid_234314 * 32 + 32 -\n                                       1) + chunk_offset_234321 -\n                                       (sext_i32_i64((local_tid_234314 -\n                                                      skip_threads_234333) *\n                                        32 + 32 - 1) + chunk_offset_234321));\n                            \n                            if (thread_active_234334 && inactive_234335) {\n                                x_234326 = x_234327;\n                            }\n                            if (thread_active_234334) {\n                                if (!inactive_234335) {\n                                    double defunc_1_op_res_234328 = x_234326 +\n                                           x_234327;\n                                    \n                                    x_234326 = defunc_1_op_res_234328;\n                                }\n                            }\n                        }\n                        if (sle32(wave_sizze_234316, skip_threads_234333)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        if (thread_active_234334) {\n                            // write result\n                            {\n                                ((volatile __local\n                                  double *) scan_arr_mem_234318)[sext_i32_i64(local_tid_234314)] =\n                                    x_234326;\n                                x_234327 = x_234326;\n                            }\n                        }\n                        if (sle32(wave_sizze_234316, skip_threads_234333)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        skip_threads_234333 *= 2;\n                    }\n                }\n            }\n            barrier(CLK_LOCAL_MEM_FENCE);\n            \n            bool no_carry_in_234336 = squot32(local_tid_234314, 32) == 0 ||\n      ",
                   "           !ltid_in_bounds_234329;\n            \n            // carry-in for every block except the first\n            {\n                // read operands\n                {\n                    if (!no_carry_in_234336) {\n                        x_234324 = x_234323;\n                        x_234323 = ((__local\n                                     double *) scan_arr_mem_234318)[sext_i32_i64(squot32(local_tid_234314,\n                                                                                         32)) -\n                                                                    (int64_t) 1];\n                    }\n                }\n                // perform operation\n                {\n                    bool inactive_234337 =\n                         slt64(srem64(sext_i32_i64(local_tid_234314) +\n                                      chunk_offset_234321,\n                                      dyn_lifted_single_ma_l_arg_204144),\n                               sext_i32_i64(local_tid_234314) +\n                               chunk_offset_234321 -\n                               (sext_i32_i64(squot32(local_tid_234314, 32) *\n                                32 - 1) + chunk_offset_234321));\n                    \n                    if (!no_carry_in_234336) {\n                        if (inactive_234337) {\n                            x_234323 = x_234324;\n                        }\n                    }\n                    if (!no_carry_in_234336) {\n                        if (!inactive_234337) {\n                            double defunc_1_op_res_234325 = x_234323 + x_234324;\n                            \n                            x_234323 = defunc_1_op_res_234325;\n                        }\n                    }\n                }\n                // write final result\n                {\n                    if (!no_carry_in_234336) {\n                        ((__local\n                          double *) scan_arr_mem_234318)[sext_i32_i64(local_tid_234314)] =\n                            x_234",
                   "323;\n                    }\n                }\n            }\n            barrier(CLK_LOCAL_MEM_FENCE);\n            // restore correct values for first block\n            {\n                if (squot32(local_tid_234314, 32) == 0 &&\n                    ltid_in_bounds_234329) {\n                    ((__local\n                      double *) scan_arr_mem_234318)[sext_i32_i64(local_tid_234314)] =\n                        x_234324;\n                }\n            }\n            barrier(CLK_LOCAL_MEM_FENCE);\n            // threads in bounds write partial scan result\n            {\n                if (slt64(gtid_218812, partition_sizze_203577) &&\n                    slt64(gtid_218813, dyn_lifted_single_ma_l_arg_204144)) {\n                    double tmp_234338;\n                    \n                    tmp_234338 = ((__local\n                                   double *) scan_arr_mem_234318)[sext_i32_i64(local_tid_234314)];\n                    ((__global double *) mem_230534)[gtid_218812 *\n                                                     dyn_lifted_single_ma_l_arg_204144 +\n                                                     gtid_218813] = tmp_234338;\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_234339 = slt64(srem64(chunk_offset_234321 +\n                                                           segscan_group_sizze_218808,\n                                                           dyn_lifted_single_ma_l_arg_204144),\n                                                    chunk_offset_234321 +\n                                                    segscan_group_sizze_218808 -\n                                                    (chunk_offset_234321 +\n                                                     segscan_group_sizze_218808 -\n                                                     (int64_t) 1));\n                bool should_load_carry_2",
                   "34340 = local_tid_234314 == 0 &&\n                     !crosses_segment_234339;\n                \n                if (should_load_carry_234340) {\n                    x_218815 = ((__local\n                                 double *) scan_arr_mem_234318)[segscan_group_sizze_218808 -\n                                                                (int64_t) 1];\n                }\n                if (!should_load_carry_234340) {\n                    x_218815 = 0.0;\n                }\n            }\n            barrier(CLK_LOCAL_MEM_FENCE);\n        }\n    }\n    \n  error_1:\n    return;\n    #undef segscan_group_sizze_218808\n}\n__kernel void mainziscan_stage1_218945(__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_234461_backing_aligned_0,\n                                       int64_t n_203490,\n                                       int64_t partition_sizze_203577,\n                                       int64_t dyn_lifted_single_ma_l_arg_204144,\n                                       int32_t num_threads_234455, __global\n                                       unsigned char *mem_230534, __global\n                                       unsigned char *ext_mem_230546, __global\n                                       unsigned char *mem_230551)\n{\n    #define segscan_group_sizze_218939 (mainzisegscan_group_sizze_218903)\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_234461_backing_0 =\n                                   (__local volatile\n                                    unsigned char *) scan_arr_mem_234461_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_234456;\n    int32_t local_tid_234457;\n    int64_t group_sizze_234460;\n    int32_t wave_sizze_234459;\n    int32_t group_tid_234458;\n    \n    global_tid_234456 = get_global_id(0);\n    local_tid_234457 = get_local_id(0);\n    group_sizze_234460 = get_local_size(0);\n    wave_sizze_234459 = LOCKSTEP_WIDTH;\n    group_tid_234458 = get_group_id(0);\n    \n    int32_t phys_tid_218945 = global_tid_234456;\n    __local unsigned char *scan_arr_mem_234461;\n    \n    scan_arr_mem_234461 = (__local\n                           unsigned char *) scan_arr_mem_234461_backing_0;\n    \n    double x_218946;\n    double x_218947;\n    \n    x_218946 = 0.0;\n    for (int64_t j_234463 = 0; j_234463 < sdiv_up64(partition_sizze_203577 *\n                                                    n_203490,\n                                                    sext_i32_i64(num_threads_234455));\n         j_234463++) {\n        int64_t chunk_offset_234464 = segscan_group_sizze_218939 * j_234463 +\n                sext_i32_i64(group_tid_234458) * (segscan_group_sizze_218939 *\n                                                  sdiv_up64(partition_sizze_203577 *\n                                                            n_203490,\n                                                            sext_i32_i64(num_threads_234455)));\n        int64_t flat_idx_234465 = chunk_offset_234464 +\n                sext_i32_i64(local_tid_234457);\n        int64_t gtid_218943 = squot64(flat_idx_234465, n_203490);\n        int64_t gtid_218944 = flat_idx_234465 - squot64(flat_idx_234465,\n                                                        n_203490) * n_203490;\n        \n        // threads in bounds read input\n        {\n            if (slt64(gtid_218943, partition_sizze_203577) && slt64(gtid_218944,\n                                                                    n_203490)) {\n                bool cond_218952 =",
                   " gtid_218944 == (int64_t) 0;\n                double defunc_0_f_res_218953;\n                \n                if (cond_218952) {\n                    double x_218950;\n                    \n                    x_218950 = ((__global\n                                 double *) ext_mem_230546)[gtid_218943];\n                    \n                    double defunc_0_f_res_t_res_218954 = x_218950 / 3.0;\n                    \n                    defunc_0_f_res_218953 = defunc_0_f_res_t_res_218954;\n                } else {\n                    int64_t x_218955 = add64((int64_t) 3, gtid_218944);\n                    int64_t i_218956 = sub64(x_218955, (int64_t) 1);\n                    bool x_218957 = sle64((int64_t) 0, i_218956);\n                    bool y_218958 = slt64(i_218956,\n                                          dyn_lifted_single_ma_l_arg_204144);\n                    bool bounds_check_218959 = x_218957 && y_218958;\n                    bool index_certs_218960;\n                    \n                    if (!bounds_check_218959) {\n                        {\n                            if (atomic_cmpxchg_i32_global(global_failure, -1,\n                                                          48) == -1) {\n                                global_failure_args[0] = (int64_t) i_218956;\n                                global_failure_args[1] =\n                                    (int64_t) dyn_lifted_single_ma_l_arg_204144;\n                                ;\n                            }\n                            local_failure = true;\n                            goto error_0;\n                        }\n                    }\n                    \n                    double x_218961;\n                    \n                    x_218961 = ((__global double *) mem_230534)[gtid_218943 *\n                                                                dyn_lifted_single_ma_l_arg_204144 +\n                                                                i_218956];\n                    \n                    ",
                   "int64_t i_218962 = sub64(gtid_218944, (int64_t) 1);\n                    bool x_218963 = sle64((int64_t) 0, i_218962);\n                    bool y_218964 = slt64(i_218962,\n                                          dyn_lifted_single_ma_l_arg_204144);\n                    bool bounds_check_218965 = x_218963 && y_218964;\n                    bool index_certs_218966;\n                    \n                    if (!bounds_check_218965) {\n                        {\n                            if (atomic_cmpxchg_i32_global(global_failure, -1,\n                                                          49) == -1) {\n                                global_failure_args[0] = (int64_t) i_218962;\n                                global_failure_args[1] =\n                                    (int64_t) dyn_lifted_single_ma_l_arg_204144;\n                                ;\n                            }\n                            local_failure = true;\n                            goto error_0;\n                        }\n                    }\n                    \n                    double y_218967;\n                    \n                    y_218967 = ((__global double *) mem_230534)[gtid_218943 *\n                                                                dyn_lifted_single_ma_l_arg_204144 +\n                                                                i_218962];\n                    \n                    double x_218968 = x_218961 - y_218967;\n                    double defunc_0_f_res_f_res_218969 = x_218968 / 3.0;\n                    \n                    defunc_0_f_res_218953 = defunc_0_f_res_f_res_218969;\n                }\n                // write to-scan values to parameters\n                {\n                    x_218947 = defunc_0_f_res_218953;\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_218943, partition_sizze_203577) &&\n                      slt64(gtid_218944, n_203490))) {\n                    x_218947 = 0.0;\n                }\n            }\n            // combine with carry and write to local memory\n            {\n                double defunc_1_op_res_218948 = x_218946 + x_218947;\n                \n                ((__local\n                  double *) scan_arr_mem_234461)[sext_i32_i64(local_tid_234457)] =\n                    defunc_1_op_res_218948;\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_234466;\n            double x_234467;\n            double x_234469;\n            double x_234470;\n            bool ltid_in_bounds_234472 = slt64(sext_i32_i64(local_tid_234457),\n                                               segscan_group_sizze_218939);\n            int32_t skip_threads_234473;\n            \n            // read input for in-block scan\n            {\n                if (ltid_in_bounds_234472) {\n                    x_234467 = ((volatile __local\n                                 double *) scan_arr_mem_234461)[sext_i32_i64(local_tid_234457)];\n                    if ((local_tid_234457 - squot32(local_tid_234457, 32) *\n                         32) == 0) {\n                        x_234466 = x_234467;\n                    }\n                }\n            }\n            // in-block scan (hopefully no barriers needed)\n            {\n                skip_threads_234473 = 1;\n                while (slt32(skip_threads_234473, 32)) {\n                    bool thread_active_234474 = sle32(skip_threads_234473,\n                                                      local_tid_234457 -\n                                                      squot32(local_tid_234457,\n                                                              32) * 32) &&\n             ",
                   "            ltid_in_bounds_234472;\n                    \n                    if (thread_active_234474) {\n                        // read operands\n                        {\n                            x_234466 = ((volatile __local\n                                         double *) scan_arr_mem_234461)[sext_i32_i64(local_tid_234457) -\n                                                                        sext_i32_i64(skip_threads_234473)];\n                        }\n                    }\n                    // perform operation\n                    {\n                        bool inactive_234475 =\n                             slt64(srem64(sext_i32_i64(local_tid_234457) +\n                                          chunk_offset_234464, n_203490),\n                                   sext_i32_i64(local_tid_234457) +\n                                   chunk_offset_234464 -\n                                   (sext_i32_i64(local_tid_234457 -\n                                    skip_threads_234473) +\n                                    chunk_offset_234464));\n                        \n                        if (thread_active_234474 && inactive_234475) {\n                            x_234466 = x_234467;\n                        }\n                        if (thread_active_234474) {\n                            if (!inactive_234475) {\n                                double defunc_1_op_res_234468 = x_234466 +\n                                       x_234467;\n                                \n                                x_234466 = defunc_1_op_res_234468;\n                            }\n                        }\n                    }\n                    if (sle32(wave_sizze_234459, skip_threads_234473)) {\n                        barrier(CLK_LOCAL_MEM_FENCE);\n                    }\n                    if (thread_active_234474) {\n                        // write result\n                        {\n                            ((volatile __local\n                              double *) scan_arr_mem_",
                   "234461)[sext_i32_i64(local_tid_234457)] =\n                                x_234466;\n                            x_234467 = x_234466;\n                        }\n                    }\n                    if (sle32(wave_sizze_234459, skip_threads_234473)) {\n                        barrier(CLK_LOCAL_MEM_FENCE);\n                    }\n                    skip_threads_234473 *= 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_234457 - squot32(local_tid_234457, 32) * 32) ==\n                    31 && ltid_in_bounds_234472) {\n                    ((volatile __local\n                      double *) scan_arr_mem_234461)[sext_i32_i64(squot32(local_tid_234457,\n                                                                          32))] =\n                        x_234466;\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_234476;\n                \n                // read input for in-block scan\n                {\n                    if (squot32(local_tid_234457, 32) == 0 &&\n                        ltid_in_bounds_234472) {\n                        x_234470 = ((volatile __local\n                                     double *) scan_arr_mem_234461)[sext_i32_i64(local_tid_234457)];\n                        if ((local_tid_234457 - squot32(local_tid_234457, 32) *\n                             32) == 0) {\n                            x_234469 = x_234470;\n                        }\n                    }\n                }\n                // in-block scan (hopefully no barriers needed)\n                {\n                    skip_threads_234476 = 1;\n                    while (slt32(skip_threads_234476, 32)) {\n                        bool thread_active_234477 = sle32(skip_threads_234476,\n        ",
                   "                                                  local_tid_234457 -\n                                                          squot32(local_tid_234457,\n                                                                  32) * 32) &&\n                             (squot32(local_tid_234457, 32) == 0 &&\n                              ltid_in_bounds_234472);\n                        \n                        if (thread_active_234477) {\n                            // read operands\n                            {\n                                x_234469 = ((volatile __local\n                                             double *) scan_arr_mem_234461)[sext_i32_i64(local_tid_234457) -\n                                                                            sext_i32_i64(skip_threads_234476)];\n                            }\n                        }\n                        // perform operation\n                        {\n                            bool inactive_234478 =\n                                 slt64(srem64(sext_i32_i64(local_tid_234457 *\n                                              32 + 32 - 1) +\n                                              chunk_offset_234464, n_203490),\n                                       sext_i32_i64(local_tid_234457 * 32 + 32 -\n                                       1) + chunk_offset_234464 -\n                                       (sext_i32_i64((local_tid_234457 -\n                                                      skip_threads_234476) *\n                                        32 + 32 - 1) + chunk_offset_234464));\n                            \n                            if (thread_active_234477 && inactive_234478) {\n                                x_234469 = x_234470;\n                            }\n                            if (thread_active_234477) {\n                                if (!inactive_234478) {\n                                    double defunc_1_op_res_234471 = x_234469 +\n                                           x_234470;\n          ",
                   "                          \n                                    x_234469 = defunc_1_op_res_234471;\n                                }\n                            }\n                        }\n                        if (sle32(wave_sizze_234459, skip_threads_234476)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        if (thread_active_234477) {\n                            // write result\n                            {\n                                ((volatile __local\n                                  double *) scan_arr_mem_234461)[sext_i32_i64(local_tid_234457)] =\n                                    x_234469;\n                                x_234470 = x_234469;\n                            }\n                        }\n                        if (sle32(wave_sizze_234459, skip_threads_234476)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        skip_threads_234476 *= 2;\n                    }\n                }\n            }\n            barrier(CLK_LOCAL_MEM_FENCE);\n            \n            bool no_carry_in_234479 = squot32(local_tid_234457, 32) == 0 ||\n                 !ltid_in_bounds_234472;\n            \n            // carry-in for every block except the first\n            {\n                // read operands\n                {\n                    if (!no_carry_in_234479) {\n                        x_234467 = x_234466;\n                        x_234466 = ((__local\n                                     double *) scan_arr_mem_234461)[sext_i32_i64(squot32(local_tid_234457,\n                                                                                         32)) -\n                                                                    (int64_t) 1];\n                    }\n                }\n                // perform operation\n                {\n                    bool inactive_234480 =\n                         slt64(srem64(sext_i32_i64(local_tid_234457) +\n                 ",
                   "                     chunk_offset_234464, n_203490),\n                               sext_i32_i64(local_tid_234457) +\n                               chunk_offset_234464 -\n                               (sext_i32_i64(squot32(local_tid_234457, 32) *\n                                32 - 1) + chunk_offset_234464));\n                    \n                    if (!no_carry_in_234479) {\n                        if (inactive_234480) {\n                            x_234466 = x_234467;\n                        }\n                    }\n                    if (!no_carry_in_234479) {\n                        if (!inactive_234480) {\n                            double defunc_1_op_res_234468 = x_234466 + x_234467;\n                            \n                            x_234466 = defunc_1_op_res_234468;\n                        }\n                    }\n                }\n                // write final result\n                {\n                    if (!no_carry_in_234479) {\n                        ((__local\n                          double *) scan_arr_mem_234461)[sext_i32_i64(local_tid_234457)] =\n                            x_234466;\n                    }\n                }\n            }\n            barrier(CLK_LOCAL_MEM_FENCE);\n            // restore correct values for first block\n            {\n                if (squot32(local_tid_234457, 32) == 0 &&\n                    ltid_in_bounds_234472) {\n                    ((__local\n                      double *) scan_arr_mem_234461)[sext_i32_i64(local_tid_234457)] =\n                        x_234467;\n                }\n            }\n            barrier(CLK_LOCAL_MEM_FENCE);\n            // threads in bounds write partial scan result\n            {\n                if (slt64(gtid_218943, partition_sizze_203577) &&\n                    slt64(gtid_218944, n_203490)) {\n                    double tmp_234481;\n                    \n                    tmp_234481 = ((__local\n                                   double *) scan_arr_mem_234461)[sext_i32_i64(local_tid_2",
                   "34457)];\n                    ((__global double *) mem_230551)[gtid_218943 * n_203490 +\n                                                     gtid_218944] = tmp_234481;\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_234482 = slt64(srem64(chunk_offset_234464 +\n                                                           segscan_group_sizze_218939,\n                                                           n_203490),\n                                                    chunk_offset_234464 +\n                                                    segscan_group_sizze_218939 -\n                                                    (chunk_offset_234464 +\n                                                     segscan_group_sizze_218939 -\n                                                     (int64_t) 1));\n                bool should_load_carry_234483 = local_tid_234457 == 0 &&\n                     !crosses_segment_234482;\n                \n                if (should_load_carry_234483) {\n                    x_218946 = ((__local\n                                 double *) scan_arr_mem_234461)[segscan_group_sizze_218939 -\n                                                                (int64_t) 1];\n                }\n                if (!should_load_carry_234483) {\n                    x_218946 = 0.0;\n                }\n            }\n            barrier(CLK_LOCAL_MEM_FENCE);\n        }\n    }\n    \n  error_1:\n    return;\n    #undef segscan_group_sizze_218939\n}\n__kernel void mainziscan_stage1_227915(__global int *global_failure,\n                                       __local volatile\n                                       int64_t *scan_arr_mem_236456_backing_aligned_0,\n                                       __local volatile\n                                       int64_t *scan_arr_mem_236454_backing_aligned_1,\n                                     ",
                   "  __local volatile\n                                       int64_t *scan_arr_mem_236452_backing_aligned_2,\n                                       __local volatile\n                                       int64_t *scan_arr_mem_236450_backing_aligned_3,\n                                       int64_t n_203490,\n                                       int64_t partition_sizze_203577,\n                                       unsigned char cond_f_res_227801_bits,\n                                       unsigned char cond_f_res_227802_bits,\n                                       int64_t unsign_arg_227803,\n                                       int64_t unsign_arg_227804,\n                                       int32_t num_threads_236444, __global\n                                       unsigned char *mem_param_231733, __global\n                                       unsigned char *mem_231769, __global\n                                       unsigned char *mem_231773, __global\n                                       unsigned char *mem_231777, __global\n                                       unsigned char *mem_231781, __global\n                                       unsigned char *mem_231785)\n{\n    bool cond_f_res_227801 = cond_f_res_227801_bits;\n    bool cond_f_res_227802 = cond_f_res_227802_bits;\n    \n    #define segscan_group_sizze_227905 (mainzisegscan_group_sizze_227625)\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_236456_backing_3 =\n                                   (__local volatile\n                                    unsigned char *) scan_arr_mem_236456_backing_aligned_0;\n    __local volatile unsigned char *restrict scan_arr_mem_236454_backing_2 =\n                                   (__local volatile\n                                    unsigned char *) scan_arr_mem_236454_backing_aligned_1;\n    __local volatile unsigned char *restrict scan_arr_mem_236452_backing_1 =\n           ",
                   "                        (__local volatile\n                                    unsigned char *) scan_arr_mem_236452_backing_aligned_2;\n    __local volatile unsigned char *restrict scan_arr_mem_236450_backing_0 =\n                                   (__local volatile\n                                    unsigned char *) scan_arr_mem_236450_backing_aligned_3;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_236445;\n    int32_t local_tid_236446;\n    int64_t group_sizze_236449;\n    int32_t wave_sizze_236448;\n    int32_t group_tid_236447;\n    \n    global_tid_236445 = get_global_id(0);\n    local_tid_236446 = get_local_id(0);\n    group_sizze_236449 = get_local_size(0);\n    wave_sizze_236448 = LOCKSTEP_WIDTH;\n    group_tid_236447 = get_group_id(0);\n    \n    int32_t phys_tid_227915 = global_tid_236445;\n    __local unsigned char *scan_arr_mem_236450;\n    __local unsigned char *scan_arr_mem_236452;\n    __local unsigned char *scan_arr_mem_236454;\n    __local unsigned char *scan_arr_mem_236456;\n    \n    scan_arr_mem_236450 = (__local\n                           unsigned char *) scan_arr_mem_236450_backing_0;\n    scan_arr_mem_236452 = (__local\n                           unsigned char *) scan_arr_mem_236452_backing_1;\n    scan_arr_mem_236454 = (__local\n                           unsigned char *) scan_arr_mem_236454_backing_2;\n    scan_arr_mem_236456 = (__local\n                           unsigned char *) scan_arr_mem_236456_backing_3;\n    \n    int64_t x_227916;\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    \n    x_227916 = (int64_t) 0;\n    x_227917 = (int64_t) 0;\n    x_227918 = (int64_t) 0;\n    x_227919 = (int64_t) 0;\n    for (int64_t j_236458 = 0; j_236458 < sdiv_up64(partition_sizze_203577 *\n                                                    n_203490,\n                                                    sext_i32_i64(num_threads_236444));\n        ",
                   " j_236458++) {\n        int64_t chunk_offset_236459 = segscan_group_sizze_227905 * j_236458 +\n                sext_i32_i64(group_tid_236447) * (segscan_group_sizze_227905 *\n                                                  sdiv_up64(partition_sizze_203577 *\n                                                            n_203490,\n                                                            sext_i32_i64(num_threads_236444)));\n        int64_t flat_idx_236460 = chunk_offset_236459 +\n                sext_i32_i64(local_tid_236446);\n        int64_t gtid_227913 = squot64(flat_idx_236460, n_203490);\n        int64_t gtid_227914 = flat_idx_236460 - squot64(flat_idx_236460,\n                                                        n_203490) * n_203490;\n        \n        // threads in bounds read input\n        {\n            if (slt64(gtid_227913, partition_sizze_203577) && slt64(gtid_227914,\n                                                                    n_203490)) {\n                double x_227929;\n                \n                x_227929 = ((__global double *) mem_param_231733)[gtid_227913 *\n                                                                  n_203490 +\n                                                                  gtid_227914];\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,\n                                                   unsign_arg_227803);\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,\n                                                   (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                b",
                   "ool cond_227937 = to_i32_res_227936 == 1;\n                bool x_227938 = !cond_227937;\n                bool y_227939 = cond_f_res_227801 && 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 ^\n                            to_i32_res_227933;\n                    \n                    defunc_1_get_bit_res_227941 =\n                        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,\n                                                   unsign_arg_227804);\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_227802 && 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 ^\n                            to_i32_res_227946;\n                    \n                    defunc_1_get_bit_res_227949 =\n                        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 =\n                            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 =\n                            defunc_0_f_res_f_res_f_res_227962;\n                        defunc_0_f_res_f_res_227960 =\n                            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                // write to-scan values to parameters\n                {\n                    x_227920 = defunc_0_f_res_227953;\n                    x_227921 = defunc_0_f_res_227954;\n                    x_227922 = defunc_0_f_res_227955;\n    ",
                   "                x_227923 = defunc_0_f_res_227956;\n                }\n                // write mapped values results to global memory\n                {\n                    ((__global int32_t *) mem_231785)[gtid_227913 * n_203490 +\n                                                      gtid_227914] =\n                        defunc_0_f_res_227951;\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_227913, partition_sizze_203577) &&\n                      slt64(gtid_227914, n_203490))) {\n                    x_227920 = (int64_t) 0;\n                    x_227921 = (int64_t) 0;\n                    x_227922 = (int64_t) 0;\n                    x_227923 = (int64_t) 0;\n                }\n            }\n            // combine with carry and write to local memory\n            {\n                int64_t defunc_1_op_res_227924 = add64(x_227916, x_227920);\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                \n                ((__local\n                  int64_t *) scan_arr_mem_236450)[sext_i32_i64(local_tid_236446)] =\n                    defunc_1_op_res_227924;\n                ((__local\n                  int64_t *) scan_arr_mem_236452)[sext_i32_i64(local_tid_236446)] =\n                    defunc_1_op_res_227925;\n                ((__local\n                  int64_t *) scan_arr_mem_236454)[sext_i32_i64(local_tid_236446)] =\n                    defunc_1_op_res_227926;\n                ((__local\n                  int64_t *) scan_arr_mem_236456)[sext_i32_i64(local_tid_236446)] =\n                    defunc_1_op_res_227927;\n            }\n            barrier(CLK_LOCAL_MEM_FENCE);\n            \n            int64_t x_236461;\n            int64_t x_2",
                   "36462;\n            int64_t x_236463;\n            int64_t x_236464;\n            int64_t x_236465;\n            int64_t x_236466;\n            int64_t x_236467;\n            int64_t x_236468;\n            int64_t x_236473;\n            int64_t x_236474;\n            int64_t x_236475;\n            int64_t x_236476;\n            int64_t x_236477;\n            int64_t x_236478;\n            int64_t x_236479;\n            int64_t x_236480;\n            bool ltid_in_bounds_236485 = slt64(sext_i32_i64(local_tid_236446),\n                                               segscan_group_sizze_227905);\n            int32_t skip_threads_236486;\n            \n            // read input for in-block scan\n            {\n                if (ltid_in_bounds_236485) {\n                    x_236465 = ((volatile __local\n                                 int64_t *) scan_arr_mem_236450)[sext_i32_i64(local_tid_236446)];\n                    x_236466 = ((volatile __local\n                                 int64_t *) scan_arr_mem_236452)[sext_i32_i64(local_tid_236446)];\n                    x_236467 = ((volatile __local\n                                 int64_t *) scan_arr_mem_236454)[sext_i32_i64(local_tid_236446)];\n                    x_236468 = ((volatile __local\n                                 int64_t *) scan_arr_mem_236456)[sext_i32_i64(local_tid_236446)];\n                    if ((local_tid_236446 - squot32(local_tid_236446, 32) *\n                         32) == 0) {\n                        x_236461 = x_236465;\n                        x_236462 = x_236466;\n                        x_236463 = x_236467;\n                        x_236464 = x_236468;\n                    }\n                }\n            }\n            // in-block scan (hopefully no barriers needed)\n            {\n                skip_threads_236486 = 1;\n                while (slt32(skip_threads_236486, 32)) {\n                    bool thread_active_236487 = sle32(skip_threads_236486,\n                                                      local_tid_236446 -\n  ",
                   "                                                    squot32(local_tid_236446,\n                                                              32) * 32) &&\n                         ltid_in_bounds_236485;\n                    \n                    if (thread_active_236487) {\n                        // read operands\n                        {\n                            x_236461 = ((volatile __local\n                                         int64_t *) scan_arr_mem_236450)[sext_i32_i64(local_tid_236446) -\n                                                                         sext_i32_i64(skip_threads_236486)];\n                            x_236462 = ((volatile __local\n                                         int64_t *) scan_arr_mem_236452)[sext_i32_i64(local_tid_236446) -\n                                                                         sext_i32_i64(skip_threads_236486)];\n                            x_236463 = ((volatile __local\n                                         int64_t *) scan_arr_mem_236454)[sext_i32_i64(local_tid_236446) -\n                                                                         sext_i32_i64(skip_threads_236486)];\n                            x_236464 = ((volatile __local\n                                         int64_t *) scan_arr_mem_236456)[sext_i32_i64(local_tid_236446) -\n                                                                         sext_i32_i64(skip_threads_236486)];\n                        }\n                    }\n                    // perform operation\n                    {\n                        bool inactive_236488 =\n                             slt64(srem64(sext_i32_i64(local_tid_236446) +\n                                          chunk_offset_236459, n_203490),\n                                   sext_i32_i64(local_tid_236446) +\n                                   chunk_offset_236459 -\n                                   (sext_i32_i64(local_tid_236446 -\n                                    skip_threads_236486) +\n            ",
                   "                        chunk_offset_236459));\n                        \n                        if (thread_active_236487 && inactive_236488) {\n                            x_236461 = x_236465;\n                            x_236462 = x_236466;\n                            x_236463 = x_236467;\n                            x_236464 = x_236468;\n                        }\n                        if (thread_active_236487) {\n                            if (!inactive_236488) {\n                                int64_t defunc_1_op_res_236469 = add64(x_236461,\n                                                                       x_236465);\n                                int64_t defunc_1_op_res_236470 = add64(x_236462,\n                                                                       x_236466);\n                                int64_t defunc_1_op_res_236471 = add64(x_236463,\n                                                                       x_236467);\n                                int64_t defunc_1_op_res_236472 = add64(x_236464,\n                                                                       x_236468);\n                                \n                                x_236461 = defunc_1_op_res_236469;\n                                x_236462 = defunc_1_op_res_236470;\n                                x_236463 = defunc_1_op_res_236471;\n                                x_236464 = defunc_1_op_res_236472;\n                            }\n                        }\n                    }\n                    if (sle32(wave_sizze_236448, skip_threads_236486)) {\n                        barrier(CLK_LOCAL_MEM_FENCE);\n                    }\n                    if (thread_active_236487) {\n                        // write result\n                        {\n                            ((volatile __local\n                              int64_t *) scan_arr_mem_236450)[sext_i32_i64(local_tid_236446)] =\n                                x_236461;\n                            x_236465 = x_236461;\n   ",
                   "                         ((volatile __local\n                              int64_t *) scan_arr_mem_236452)[sext_i32_i64(local_tid_236446)] =\n                                x_236462;\n                            x_236466 = x_236462;\n                            ((volatile __local\n                              int64_t *) scan_arr_mem_236454)[sext_i32_i64(local_tid_236446)] =\n                                x_236463;\n                            x_236467 = x_236463;\n                            ((volatile __local\n                              int64_t *) scan_arr_mem_236456)[sext_i32_i64(local_tid_236446)] =\n                                x_236464;\n                            x_236468 = x_236464;\n                        }\n                    }\n                    if (sle32(wave_sizze_236448, skip_threads_236486)) {\n                        barrier(CLK_LOCAL_MEM_FENCE);\n                    }\n                    skip_threads_236486 *= 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_236446 - squot32(local_tid_236446, 32) * 32) ==\n                    31 && ltid_in_bounds_236485) {\n                    ((volatile __local\n                      int64_t *) scan_arr_mem_236450)[sext_i32_i64(squot32(local_tid_236446,\n                                                                           32))] =\n                        x_236461;\n                    ((volatile __local\n                      int64_t *) scan_arr_mem_236452)[sext_i32_i64(squot32(local_tid_236446,\n                                                                           32))] =\n                        x_236462;\n                    ((volatile __local\n                      int64_t *) scan_arr_mem_236454)[sext_i32_i64(squot32(local_tid_236446,\n                                                                           32))] =\n                        x_236463;\n                    (",
                   "(volatile __local\n                      int64_t *) scan_arr_mem_236456)[sext_i32_i64(squot32(local_tid_236446,\n                                                                           32))] =\n                        x_236464;\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_236489;\n                \n                // read input for in-block scan\n                {\n                    if (squot32(local_tid_236446, 32) == 0 &&\n                        ltid_in_bounds_236485) {\n                        x_236477 = ((volatile __local\n                                     int64_t *) scan_arr_mem_236450)[sext_i32_i64(local_tid_236446)];\n                        x_236478 = ((volatile __local\n                                     int64_t *) scan_arr_mem_236452)[sext_i32_i64(local_tid_236446)];\n                        x_236479 = ((volatile __local\n                                     int64_t *) scan_arr_mem_236454)[sext_i32_i64(local_tid_236446)];\n                        x_236480 = ((volatile __local\n                                     int64_t *) scan_arr_mem_236456)[sext_i32_i64(local_tid_236446)];\n                        if ((local_tid_236446 - squot32(local_tid_236446, 32) *\n                             32) == 0) {\n                            x_236473 = x_236477;\n                            x_236474 = x_236478;\n                            x_236475 = x_236479;\n                            x_236476 = x_236480;\n                        }\n                    }\n                }\n                // in-block scan (hopefully no barriers needed)\n                {\n                    skip_threads_236489 = 1;\n                    while (slt32(skip_threads_236489, 32)) {\n                        bool thread_active_236490 = sle32(skip_threads_236489,\n                                                          local_tid_236446 -\n",
                   "                                                          squot32(local_tid_236446,\n                                                                  32) * 32) &&\n                             (squot32(local_tid_236446, 32) == 0 &&\n                              ltid_in_bounds_236485);\n                        \n                        if (thread_active_236490) {\n                            // read operands\n                            {\n                                x_236473 = ((volatile __local\n                                             int64_t *) scan_arr_mem_236450)[sext_i32_i64(local_tid_236446) -\n                                                                             sext_i32_i64(skip_threads_236489)];\n                                x_236474 = ((volatile __local\n                                             int64_t *) scan_arr_mem_236452)[sext_i32_i64(local_tid_236446) -\n                                                                             sext_i32_i64(skip_threads_236489)];\n                                x_236475 = ((volatile __local\n                                             int64_t *) scan_arr_mem_236454)[sext_i32_i64(local_tid_236446) -\n                                                                             sext_i32_i64(skip_threads_236489)];\n                                x_236476 = ((volatile __local\n                                             int64_t *) scan_arr_mem_236456)[sext_i32_i64(local_tid_236446) -\n                                                                             sext_i32_i64(skip_threads_236489)];\n                            }\n                        }\n                        // perform operation\n                        {\n                            bool inactive_236491 =\n                                 slt64(srem64(sext_i32_i64(local_tid_236446 *\n                                              32 + 32 - 1) +\n                                              chunk_offset_236459, n_203490),\n                            ",
                   "           sext_i32_i64(local_tid_236446 * 32 + 32 -\n                                       1) + chunk_offset_236459 -\n                                       (sext_i32_i64((local_tid_236446 -\n                                                      skip_threads_236489) *\n                                        32 + 32 - 1) + chunk_offset_236459));\n                            \n                            if (thread_active_236490 && inactive_236491) {\n                                x_236473 = x_236477;\n                                x_236474 = x_236478;\n                                x_236475 = x_236479;\n                                x_236476 = x_236480;\n                            }\n                            if (thread_active_236490) {\n                                if (!inactive_236491) {\n                                    int64_t defunc_1_op_res_236481 =\n                                            add64(x_236473, x_236477);\n                                    int64_t defunc_1_op_res_236482 =\n                                            add64(x_236474, x_236478);\n                                    int64_t defunc_1_op_res_236483 =\n                                            add64(x_236475, x_236479);\n                                    int64_t defunc_1_op_res_236484 =\n                                            add64(x_236476, x_236480);\n                                    \n                                    x_236473 = defunc_1_op_res_236481;\n                                    x_236474 = defunc_1_op_res_236482;\n                                    x_236475 = defunc_1_op_res_236483;\n                                    x_236476 = defunc_1_op_res_236484;\n                                }\n                            }\n                        }\n                        if (sle32(wave_sizze_236448, skip_threads_236489)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        if (thread_active_236490) {\n           ",
                   "                 // write result\n                            {\n                                ((volatile __local\n                                  int64_t *) scan_arr_mem_236450)[sext_i32_i64(local_tid_236446)] =\n                                    x_236473;\n                                x_236477 = x_236473;\n                                ((volatile __local\n                                  int64_t *) scan_arr_mem_236452)[sext_i32_i64(local_tid_236446)] =\n                                    x_236474;\n                                x_236478 = x_236474;\n                                ((volatile __local\n                                  int64_t *) scan_arr_mem_236454)[sext_i32_i64(local_tid_236446)] =\n                                    x_236475;\n                                x_236479 = x_236475;\n                                ((volatile __local\n                                  int64_t *) scan_arr_mem_236456)[sext_i32_i64(local_tid_236446)] =\n                                    x_236476;\n                                x_236480 = x_236476;\n                            }\n                        }\n                        if (sle32(wave_sizze_236448, skip_threads_236489)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        skip_threads_236489 *= 2;\n                    }\n                }\n            }\n            barrier(CLK_LOCAL_MEM_FENCE);\n            \n            bool no_carry_in_236492 = squot32(local_tid_236446, 32) == 0 ||\n                 !ltid_in_bounds_236485;\n            \n            // carry-in for every block except the first\n            {\n                // read operands\n                {\n                    if (!no_carry_in_236492) {\n                        x_236465 = x_236461;\n                        x_236466 = x_236462;\n                        x_236467 = x_236463;\n                        x_236468 = x_236464;\n                        x_236461 = ((__local\n                                     ",
                   "int64_t *) scan_arr_mem_236450)[sext_i32_i64(squot32(local_tid_236446,\n                                                                                          32)) -\n                                                                     (int64_t) 1];\n                        x_236462 = ((__local\n                                     int64_t *) scan_arr_mem_236452)[sext_i32_i64(squot32(local_tid_236446,\n                                                                                          32)) -\n                                                                     (int64_t) 1];\n                        x_236463 = ((__local\n                                     int64_t *) scan_arr_mem_236454)[sext_i32_i64(squot32(local_tid_236446,\n                                                                                          32)) -\n                                                                     (int64_t) 1];\n                        x_236464 = ((__local\n                                     int64_t *) scan_arr_mem_236456)[sext_i32_i64(squot32(local_tid_236446,\n                                                                                          32)) -\n                                                                     (int64_t) 1];\n                    }\n                }\n                // perform operation\n                {\n                    bool inactive_236493 =\n                         slt64(srem64(sext_i32_i64(local_tid_236446) +\n                                      chunk_offset_236459, n_203490),\n                               sext_i32_i64(local_tid_236446) +\n                               chunk_offset_236459 -\n                               (sext_i32_i64(squot32(local_tid_236446, 32) *\n                                32 - 1) + chunk_offset_236459));\n                    \n                    if (!no_carry_in_236492) {\n                        if (inactive_236493) {\n                            x_236461 = x_236465;\n                            x_236462 = x_236466;",
                   "\n                            x_236463 = x_236467;\n                            x_236464 = x_236468;\n                        }\n                    }\n                    if (!no_carry_in_236492) {\n                        if (!inactive_236493) {\n                            int64_t defunc_1_op_res_236469 = add64(x_236461,\n                                                                   x_236465);\n                            int64_t defunc_1_op_res_236470 = add64(x_236462,\n                                                                   x_236466);\n                            int64_t defunc_1_op_res_236471 = add64(x_236463,\n                                                                   x_236467);\n                            int64_t defunc_1_op_res_236472 = add64(x_236464,\n                                                                   x_236468);\n                            \n                            x_236461 = defunc_1_op_res_236469;\n                            x_236462 = defunc_1_op_res_236470;\n                            x_236463 = defunc_1_op_res_236471;\n                            x_236464 = defunc_1_op_res_236472;\n                        }\n                    }\n                }\n                // write final result\n                {\n                    if (!no_carry_in_236492) {\n                        ((__local\n                          int64_t *) scan_arr_mem_236450)[sext_i32_i64(local_tid_236446)] =\n                            x_236461;\n                        ((__local\n                          int64_t *) scan_arr_mem_236452)[sext_i32_i64(local_tid_236446)] =\n                            x_236462;\n                        ((__local\n                          int64_t *) scan_arr_mem_236454)[sext_i32_i64(local_tid_236446)] =\n                            x_236463;\n                        ((__local\n                          int64_t *) scan_arr_mem_236456)[sext_i32_i64(local_tid_236446)] =\n                            x_236464;\n                    }\n          ",
                   "      }\n            }\n            barrier(CLK_LOCAL_MEM_FENCE);\n            // restore correct values for first block\n            {\n                if (squot32(local_tid_236446, 32) == 0 &&\n                    ltid_in_bounds_236485) {\n                    ((__local\n                      int64_t *) scan_arr_mem_236450)[sext_i32_i64(local_tid_236446)] =\n                        x_236465;\n                    ((__local\n                      int64_t *) scan_arr_mem_236452)[sext_i32_i64(local_tid_236446)] =\n                        x_236466;\n                    ((__local\n                      int64_t *) scan_arr_mem_236454)[sext_i32_i64(local_tid_236446)] =\n                        x_236467;\n                    ((__local\n                      int64_t *) scan_arr_mem_236456)[sext_i32_i64(local_tid_236446)] =\n                        x_236468;\n                }\n            }\n            barrier(CLK_LOCAL_MEM_FENCE);\n            // threads in bounds write partial scan result\n            {\n                if (slt64(gtid_227913, partition_sizze_203577) &&\n                    slt64(gtid_227914, n_203490)) {\n                    int64_t tmp_236494;\n                    \n                    tmp_236494 = ((__local\n                                   int64_t *) scan_arr_mem_236450)[sext_i32_i64(local_tid_236446)];\n                    ((__global int64_t *) mem_231769)[gtid_227913 * n_203490 +\n                                                      gtid_227914] = tmp_236494;\n                    \n                    int64_t tmp_236495;\n                    \n                    tmp_236495 = ((__local\n                                   int64_t *) scan_arr_mem_236452)[sext_i32_i64(local_tid_236446)];\n                    ((__global int64_t *) mem_231773)[gtid_227913 * n_203490 +\n                                                      gtid_227914] = tmp_236495;\n                    \n                    int64_t tmp_236496;\n                    \n                    tmp_236496 = ((__local\n                  ",
                   "                 int64_t *) scan_arr_mem_236454)[sext_i32_i64(local_tid_236446)];\n                    ((__global int64_t *) mem_231777)[gtid_227913 * n_203490 +\n                                                      gtid_227914] = tmp_236496;\n                    \n                    int64_t tmp_236497;\n                    \n                    tmp_236497 = ((__local\n                                   int64_t *) scan_arr_mem_236456)[sext_i32_i64(local_tid_236446)];\n                    ((__global int64_t *) mem_231781)[gtid_227913 * n_203490 +\n                                                      gtid_227914] = tmp_236497;\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_236498 = slt64(srem64(chunk_offset_236459 +\n                                                           segscan_group_sizze_227905,\n                                                           n_203490),\n                                                    chunk_offset_236459 +\n                                                    segscan_group_sizze_227905 -\n                                                    (chunk_offset_236459 +\n                                                     segscan_group_sizze_227905 -\n                                                     (int64_t) 1));\n                bool should_load_carry_236499 = local_tid_236446 == 0 &&\n                     !crosses_segment_236498;\n                \n                if (should_load_carry_236499) {\n                    x_227916 = ((__local\n                                 int64_t *) scan_arr_mem_236450)[segscan_group_sizze_227905 -\n                                                                 (int64_t) 1];\n                    x_227917 = ((__local\n                                 int64_t *) scan_arr_mem_236452)[segscan_group_sizze_227905 -\n                                                        ",
                   "         (int64_t) 1];\n                    x_227918 = ((__local\n                                 int64_t *) scan_arr_mem_236454)[segscan_group_sizze_227905 -\n                                                                 (int64_t) 1];\n                    x_227919 = ((__local\n                                 int64_t *) scan_arr_mem_236456)[segscan_group_sizze_227905 -\n                                                                 (int64_t) 1];\n                }\n                if (!should_load_carry_236499) {\n                    x_227916 = (int64_t) 0;\n                    x_227917 = (int64_t) 0;\n                    x_227918 = (int64_t) 0;\n                    x_227919 = (int64_t) 0;\n                }\n            }\n            barrier(CLK_LOCAL_MEM_FENCE);\n        }\n    }\n    \n  error_1:\n    return;\n    #undef segscan_group_sizze_227905\n}\n__kernel void mainziscan_stage2_206867(__global int *global_failure,\n                                       __local volatile\n                                       int64_t *scan_arr_mem_232286_backing_aligned_0,\n                                       int64_t m_203489,\n                                       int64_t stage1_num_groups_232252,\n                                       int32_t num_threads_232253, __global\n                                       unsigned char *mem_229152)\n{\n    #define segscan_group_sizze_206862 (mainzisegscan_group_sizze_206861)\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_232286_backing_0 =\n                                   (__local volatile\n                                    unsigned char *) scan_arr_mem_232286_backing_aligned_0;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_232281;\n    int32_t local_tid_232282;\n    int64_t group_sizze_232285;\n    int32_t wave_sizze_232284;\n    int32_t group_tid_232283;\n    \n    global_tid_232281 = get_global_id(0);\n    local_tid_",
                   "232282 = get_local_id(0);\n    group_sizze_232285 = get_local_size(0);\n    wave_sizze_232284 = LOCKSTEP_WIDTH;\n    group_tid_232283 = get_group_id(0);\n    \n    int32_t phys_tid_206867 = global_tid_232281;\n    __local unsigned char *scan_arr_mem_232286;\n    \n    scan_arr_mem_232286 = (__local\n                           unsigned char *) scan_arr_mem_232286_backing_0;\n    \n    int64_t flat_idx_232288 = (sext_i32_i64(local_tid_232282) + (int64_t) 1) *\n            (segscan_group_sizze_206862 * sdiv_up64(m_203489,\n                                                    sext_i32_i64(num_threads_232253))) -\n            (int64_t) 1;\n    int64_t gtid_206866 = flat_idx_232288;\n    \n    // threads in bound read carries; others get neutral element\n    {\n        if (slt64(gtid_206866, m_203489)) {\n            int64_t tmp_232289;\n            \n            tmp_232289 = ((__global int64_t *) mem_229152)[gtid_206866];\n            ((__local\n              int64_t *) scan_arr_mem_232286)[sext_i32_i64(local_tid_232282)] =\n                tmp_232289;\n        } else {\n            ((__local\n              int64_t *) scan_arr_mem_232286)[sext_i32_i64(local_tid_232282)] =\n                (int64_t) 0;\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int64_t x_203544;\n    int64_t y_203545;\n    int64_t x_232290;\n    int64_t y_232291;\n    bool ltid_in_bounds_232293 = slt64(sext_i32_i64(local_tid_232282),\n                                       stage1_num_groups_232252);\n    int32_t skip_threads_232294;\n    \n    // read input for in-block scan\n    {\n        if (ltid_in_bounds_232293) {\n            y_203545 = ((volatile __local\n                         int64_t *) scan_arr_mem_232286)[sext_i32_i64(local_tid_232282)];\n            if ((local_tid_232282 - squot32(local_tid_232282, 32) * 32) == 0) {\n                x_203544 = y_203545;\n            }\n        }\n    }\n    // in-block scan (hopefully no barriers needed)\n    {\n        skip_threads_232294 = 1;\n        while (slt32(skip_threads_232294, 32)) ",
                   "{\n            bool thread_active_232295 = sle32(skip_threads_232294,\n                                              local_tid_232282 -\n                                              squot32(local_tid_232282, 32) *\n                                              32) && ltid_in_bounds_232293;\n            \n            if (thread_active_232295) {\n                // read operands\n                {\n                    x_203544 = ((volatile __local\n                                 int64_t *) scan_arr_mem_232286)[sext_i32_i64(local_tid_232282) -\n                                                                 sext_i32_i64(skip_threads_232294)];\n                }\n            }\n            // perform operation\n            {\n                if (thread_active_232295) {\n                    int64_t zz_203546 = x_203544 + y_203545;\n                    \n                    x_203544 = zz_203546;\n                }\n            }\n            if (sle32(wave_sizze_232284, skip_threads_232294)) {\n                barrier(CLK_LOCAL_MEM_FENCE);\n            }\n            if (thread_active_232295) {\n                // write result\n                {\n                    ((volatile __local\n                      int64_t *) scan_arr_mem_232286)[sext_i32_i64(local_tid_232282)] =\n                        x_203544;\n                    y_203545 = x_203544;\n                }\n            }\n            if (sle32(wave_sizze_232284, skip_threads_232294)) {\n                barrier(CLK_LOCAL_MEM_FENCE);\n            }\n            skip_threads_232294 *= 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_232282 - squot32(local_tid_232282, 32) * 32) == 31 &&\n            ltid_in_bounds_232293) {\n            ((volatile __local\n              int64_t *) scan_arr_mem_232286)[sext_i32_i64(squot32(local_tid_232282,\n                                                                   32))] =\n                x_203544;\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_232296;\n        \n        // read input for in-block scan\n        {\n            if (squot32(local_tid_232282, 32) == 0 && ltid_in_bounds_232293) {\n                y_232291 = ((volatile __local\n                             int64_t *) scan_arr_mem_232286)[sext_i32_i64(local_tid_232282)];\n                if ((local_tid_232282 - squot32(local_tid_232282, 32) * 32) ==\n                    0) {\n                    x_232290 = y_232291;\n                }\n            }\n        }\n        // in-block scan (hopefully no barriers needed)\n        {\n            skip_threads_232296 = 1;\n            while (slt32(skip_threads_232296, 32)) {\n                bool thread_active_232297 = sle32(skip_threads_232296,\n                                                  local_tid_232282 -\n                                                  squot32(local_tid_232282,\n                                                          32) * 32) &&\n                     (squot32(local_tid_232282, 32) == 0 &&\n                      ltid_in_bounds_232293);\n                \n                if (thread_active_232297) {\n                    // read operands\n                    {\n                        x_232290 = ((volatile __local\n                                     int64_t *) scan_arr_mem_232286)[sext_i32_i64(local_tid_232282) -\n                                                                     sext_i32_i64(skip_threads_232296)];\n                    }\n                }\n                // perform operation\n                {\n                    if (thread_active_232297) {\n                        int64_t zz_232292 = x_232290 + y_232291;\n                        \n                        x_232290 = zz_232292;\n                    }\n                }\n                if (sle32(wave_sizze_232284, skip_threads_232296)) {\n                    barrier(CLK_LOCAL_MEM_FENCE);\n     ",
                   "           }\n                if (thread_active_232297) {\n                    // write result\n                    {\n                        ((volatile __local\n                          int64_t *) scan_arr_mem_232286)[sext_i32_i64(local_tid_232282)] =\n                            x_232290;\n                        y_232291 = x_232290;\n                    }\n                }\n                if (sle32(wave_sizze_232284, skip_threads_232296)) {\n                    barrier(CLK_LOCAL_MEM_FENCE);\n                }\n                skip_threads_232296 *= 2;\n            }\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    bool no_carry_in_232298 = squot32(local_tid_232282, 32) == 0 ||\n         !ltid_in_bounds_232293;\n    \n    // carry-in for every block except the first\n    {\n        // read operands\n        {\n            if (!no_carry_in_232298) {\n                y_203545 = x_203544;\n                x_203544 = ((__local\n                             int64_t *) scan_arr_mem_232286)[sext_i32_i64(squot32(local_tid_232282,\n                                                                                  32)) -\n                                                             (int64_t) 1];\n            }\n        }\n        // perform operation\n        {\n            if (!no_carry_in_232298) {\n                int64_t zz_203546 = x_203544 + y_203545;\n                \n                x_203544 = zz_203546;\n            }\n        }\n        // write final result\n        {\n            if (!no_carry_in_232298) {\n                ((__local\n                  int64_t *) scan_arr_mem_232286)[sext_i32_i64(local_tid_232282)] =\n                    x_203544;\n            }\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    // restore correct values for first block\n    {\n        if (squot32(local_tid_232282, 32) == 0 && ltid_in_bounds_232293) {\n            ((__local\n              int64_t *) scan_arr_mem_232286)[sext_i32_i64(local_tid_232282)] =\n                y_203545;\n        }\n    }\n    barrier(CL",
                   "K_LOCAL_MEM_FENCE);\n    // threads in bounds write scanned carries\n    {\n        if (slt64(gtid_206866, m_203489)) {\n            int64_t tmp_232299;\n            \n            tmp_232299 = ((__local\n                           int64_t *) scan_arr_mem_232286)[sext_i32_i64(local_tid_232282)];\n            ((__global int64_t *) mem_229152)[gtid_206866] = tmp_232299;\n        }\n    }\n    \n  error_0:\n    return;\n    #undef segscan_group_sizze_206862\n}\n__kernel void mainziscan_stage2_207007(__global int *global_failure,\n                                       __local volatile\n                                       int64_t *scan_arr_mem_232388_backing_aligned_0,\n                                       int64_t n_203490,\n                                       int64_t partition_sizze_203577,\n                                       int64_t stage1_num_groups_232353,\n                                       int32_t num_threads_232354, __global\n                                       unsigned char *mem_229186)\n{\n    #define segscan_group_sizze_207001 (mainzisegscan_group_sizze_206981)\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_232388_backing_0 =\n                                   (__local volatile\n                                    unsigned char *) scan_arr_mem_232388_backing_aligned_0;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_232383;\n    int32_t local_tid_232384;\n    int64_t group_sizze_232387;\n    int32_t wave_sizze_232386;\n    int32_t group_tid_232385;\n    \n    global_tid_232383 = get_global_id(0);\n    local_tid_232384 = get_local_id(0);\n    group_sizze_232387 = get_local_size(0);\n    wave_sizze_232386 = LOCKSTEP_WIDTH;\n    group_tid_232385 = get_group_id(0);\n    \n    int32_t phys_tid_207007 = global_tid_232383;\n    __local unsigned char *scan_arr_mem_232388;\n    \n    scan_arr_mem_232388 = (__local\n                           unsigned char *)",
                   " scan_arr_mem_232388_backing_0;\n    \n    int64_t flat_idx_232390 = (sext_i32_i64(local_tid_232384) + (int64_t) 1) *\n            (segscan_group_sizze_207001 * sdiv_up64(partition_sizze_203577 *\n                                                    n_203490,\n                                                    sext_i32_i64(num_threads_232354))) -\n            (int64_t) 1;\n    int64_t gtid_207005 = squot64(flat_idx_232390, n_203490);\n    int64_t gtid_207006 = flat_idx_232390 - squot64(flat_idx_232390, n_203490) *\n            n_203490;\n    \n    // threads in bound read carries; others get neutral element\n    {\n        if (slt64(gtid_207005, partition_sizze_203577) && slt64(gtid_207006,\n                                                                n_203490)) {\n            int64_t tmp_232391;\n            \n            tmp_232391 = ((__global int64_t *) mem_229186)[gtid_207005 *\n                                                           n_203490 +\n                                                           gtid_207006];\n            ((__local\n              int64_t *) scan_arr_mem_232388)[sext_i32_i64(local_tid_232384)] =\n                tmp_232391;\n        } else {\n            ((__local\n              int64_t *) scan_arr_mem_232388)[sext_i32_i64(local_tid_232384)] =\n                (int64_t) 0;\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int64_t x_207008;\n    int64_t x_207009;\n    int64_t x_232392;\n    int64_t x_232393;\n    bool ltid_in_bounds_232395 = slt64(sext_i32_i64(local_tid_232384),\n                                       stage1_num_groups_232353);\n    int32_t skip_threads_232396;\n    \n    // read input for in-block scan\n    {\n        if (ltid_in_bounds_232395) {\n            x_207009 = ((volatile __local\n                         int64_t *) scan_arr_mem_232388)[sext_i32_i64(local_tid_232384)];\n            if ((local_tid_232384 - squot32(local_tid_232384, 32) * 32) == 0) {\n                x_207008 = x_207009;\n            }\n        }\n    }\n    // in-block scan ",
                   "(hopefully no barriers needed)\n    {\n        skip_threads_232396 = 1;\n        while (slt32(skip_threads_232396, 32)) {\n            bool thread_active_232397 = sle32(skip_threads_232396,\n                                              local_tid_232384 -\n                                              squot32(local_tid_232384, 32) *\n                                              32) && ltid_in_bounds_232395;\n            \n            if (thread_active_232397) {\n                // read operands\n                {\n                    x_207008 = ((volatile __local\n                                 int64_t *) scan_arr_mem_232388)[sext_i32_i64(local_tid_232384) -\n                                                                 sext_i32_i64(skip_threads_232396)];\n                }\n            }\n            // perform operation\n            {\n                bool inactive_232398 =\n                     slt64(srem64((sext_i32_i64(local_tid_232384) +\n                                   (int64_t) 1) * (segscan_group_sizze_207001 *\n                                                   sdiv_up64(partition_sizze_203577 *\n                                                             n_203490,\n                                                             sext_i32_i64(num_threads_232354))) -\n                                  (int64_t) 1, n_203490),\n                           (sext_i32_i64(local_tid_232384) + (int64_t) 1) *\n                           (segscan_group_sizze_207001 *\n                            sdiv_up64(partition_sizze_203577 * n_203490,\n                                      sext_i32_i64(num_threads_232354))) -\n                           (int64_t) 1 - ((sext_i32_i64(local_tid_232384 -\n                                           skip_threads_232396) + (int64_t) 1) *\n                                          (segscan_group_sizze_207001 *\n                                           sdiv_up64(partition_sizze_203577 *\n                                                     n_203490,\n             ",
                   "                                        sext_i32_i64(num_threads_232354))) -\n                                          (int64_t) 1));\n                \n                if (thread_active_232397 && inactive_232398) {\n                    x_207008 = x_207009;\n                }\n                if (thread_active_232397) {\n                    if (!inactive_232398) {\n                        int64_t defunc_1_op_res_207010 = add64(x_207008,\n                                                               x_207009);\n                        \n                        x_207008 = defunc_1_op_res_207010;\n                    }\n                }\n            }\n            if (sle32(wave_sizze_232386, skip_threads_232396)) {\n                barrier(CLK_LOCAL_MEM_FENCE);\n            }\n            if (thread_active_232397) {\n                // write result\n                {\n                    ((volatile __local\n                      int64_t *) scan_arr_mem_232388)[sext_i32_i64(local_tid_232384)] =\n                        x_207008;\n                    x_207009 = x_207008;\n                }\n            }\n            if (sle32(wave_sizze_232386, skip_threads_232396)) {\n                barrier(CLK_LOCAL_MEM_FENCE);\n            }\n            skip_threads_232396 *= 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_232384 - squot32(local_tid_232384, 32) * 32) == 31 &&\n            ltid_in_bounds_232395) {\n            ((volatile __local\n              int64_t *) scan_arr_mem_232388)[sext_i32_i64(squot32(local_tid_232384,\n                                                                   32))] =\n                x_207008;\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_232399;\n        \n        // read input for in-block scan\n        {\n            if (squot32(local_tid_232384, 32) == 0 &&",
                   " ltid_in_bounds_232395) {\n                x_232393 = ((volatile __local\n                             int64_t *) scan_arr_mem_232388)[sext_i32_i64(local_tid_232384)];\n                if ((local_tid_232384 - squot32(local_tid_232384, 32) * 32) ==\n                    0) {\n                    x_232392 = x_232393;\n                }\n            }\n        }\n        // in-block scan (hopefully no barriers needed)\n        {\n            skip_threads_232399 = 1;\n            while (slt32(skip_threads_232399, 32)) {\n                bool thread_active_232400 = sle32(skip_threads_232399,\n                                                  local_tid_232384 -\n                                                  squot32(local_tid_232384,\n                                                          32) * 32) &&\n                     (squot32(local_tid_232384, 32) == 0 &&\n                      ltid_in_bounds_232395);\n                \n                if (thread_active_232400) {\n                    // read operands\n                    {\n                        x_232392 = ((volatile __local\n                                     int64_t *) scan_arr_mem_232388)[sext_i32_i64(local_tid_232384) -\n                                                                     sext_i32_i64(skip_threads_232399)];\n                    }\n                }\n                // perform operation\n                {\n                    bool inactive_232401 =\n                         slt64(srem64((sext_i32_i64(local_tid_232384 * 32 + 32 -\n                                       1) + (int64_t) 1) *\n                                      (segscan_group_sizze_207001 *\n                                       sdiv_up64(partition_sizze_203577 *\n                                                 n_203490,\n                                                 sext_i32_i64(num_threads_232354))) -\n                                      (int64_t) 1, n_203490),\n                               (sext_i32_i64(local_tid_232384 * 32 + 32 - 1) +\n           ",
                   "                     (int64_t) 1) * (segscan_group_sizze_207001 *\n                                                sdiv_up64(partition_sizze_203577 *\n                                                          n_203490,\n                                                          sext_i32_i64(num_threads_232354))) -\n                               (int64_t) 1 - ((sext_i32_i64((local_tid_232384 -\n                                                             skip_threads_232399) *\n                                               32 + 32 - 1) + (int64_t) 1) *\n                                              (segscan_group_sizze_207001 *\n                                               sdiv_up64(partition_sizze_203577 *\n                                                         n_203490,\n                                                         sext_i32_i64(num_threads_232354))) -\n                                              (int64_t) 1));\n                    \n                    if (thread_active_232400 && inactive_232401) {\n                        x_232392 = x_232393;\n                    }\n                    if (thread_active_232400) {\n                        if (!inactive_232401) {\n                            int64_t defunc_1_op_res_232394 = add64(x_232392,\n                                                                   x_232393);\n                            \n                            x_232392 = defunc_1_op_res_232394;\n                        }\n                    }\n                }\n                if (sle32(wave_sizze_232386, skip_threads_232399)) {\n                    barrier(CLK_LOCAL_MEM_FENCE);\n                }\n                if (thread_active_232400) {\n                    // write result\n                    {\n                        ((volatile __local\n                          int64_t *) scan_arr_mem_232388)[sext_i32_i64(local_tid_232384)] =\n                            x_232392;\n                        x_232393 = x_232392;\n                    }\n                }\n      ",
                   "          if (sle32(wave_sizze_232386, skip_threads_232399)) {\n                    barrier(CLK_LOCAL_MEM_FENCE);\n                }\n                skip_threads_232399 *= 2;\n            }\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    bool no_carry_in_232402 = squot32(local_tid_232384, 32) == 0 ||\n         !ltid_in_bounds_232395;\n    \n    // carry-in for every block except the first\n    {\n        // read operands\n        {\n            if (!no_carry_in_232402) {\n                x_207009 = x_207008;\n                x_207008 = ((__local\n                             int64_t *) scan_arr_mem_232388)[sext_i32_i64(squot32(local_tid_232384,\n                                                                                  32)) -\n                                                             (int64_t) 1];\n            }\n        }\n        // perform operation\n        {\n            bool inactive_232403 =\n                 slt64(srem64((sext_i32_i64(local_tid_232384) + (int64_t) 1) *\n                              (segscan_group_sizze_207001 *\n                               sdiv_up64(partition_sizze_203577 * n_203490,\n                                         sext_i32_i64(num_threads_232354))) -\n                              (int64_t) 1, n_203490),\n                       (sext_i32_i64(local_tid_232384) + (int64_t) 1) *\n                       (segscan_group_sizze_207001 *\n                        sdiv_up64(partition_sizze_203577 * n_203490,\n                                  sext_i32_i64(num_threads_232354))) -\n                       (int64_t) 1 - ((sext_i32_i64(squot32(local_tid_232384,\n                                                            32) * 32 - 1) +\n                                       (int64_t) 1) *\n                                      (segscan_group_sizze_207001 *\n                                       sdiv_up64(partition_sizze_203577 *\n                                                 n_203490,\n                                                 sext_i32_i64(num_",
                   "threads_232354))) -\n                                      (int64_t) 1));\n            \n            if (!no_carry_in_232402) {\n                if (inactive_232403) {\n                    x_207008 = x_207009;\n                }\n            }\n            if (!no_carry_in_232402) {\n                if (!inactive_232403) {\n                    int64_t defunc_1_op_res_207010 = add64(x_207008, x_207009);\n                    \n                    x_207008 = defunc_1_op_res_207010;\n                }\n            }\n        }\n        // write final result\n        {\n            if (!no_carry_in_232402) {\n                ((__local\n                  int64_t *) scan_arr_mem_232388)[sext_i32_i64(local_tid_232384)] =\n                    x_207008;\n            }\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    // restore correct values for first block\n    {\n        if (squot32(local_tid_232384, 32) == 0 && ltid_in_bounds_232395) {\n            ((__local\n              int64_t *) scan_arr_mem_232388)[sext_i32_i64(local_tid_232384)] =\n                x_207009;\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    // threads in bounds write scanned carries\n    {\n        if (slt64(gtid_207005, partition_sizze_203577) && slt64(gtid_207006,\n                                                                n_203490)) {\n            int64_t tmp_232404;\n            \n            tmp_232404 = ((__local\n                           int64_t *) scan_arr_mem_232388)[sext_i32_i64(local_tid_232384)];\n            ((__global int64_t *) mem_229186)[gtid_207005 * n_203490 +\n                                              gtid_207006] = tmp_232404;\n        }\n    }\n    \n  error_0:\n    return;\n    #undef segscan_group_sizze_207001\n}\n__kernel void mainziscan_stage2_207559(__global int *global_failure,\n                                       __local volatile\n                                       int64_t *scan_arr_mem_232557_backing_aligned_0,\n                                       int64_t n_p_203492,\n                    ",
                   "                   int64_t partition_sizze_203577,\n                                       int64_t defunc_0_f_res_203631,\n                                       int64_t stage1_num_groups_232522,\n                                       int32_t num_threads_232523, __global\n                                       unsigned char *mem_229250)\n{\n    #define segscan_group_sizze_207552 (mainzisegscan_group_sizze_207419)\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_232557_backing_0 =\n                                   (__local volatile\n                                    unsigned char *) scan_arr_mem_232557_backing_aligned_0;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_232552;\n    int32_t local_tid_232553;\n    int64_t group_sizze_232556;\n    int32_t wave_sizze_232555;\n    int32_t group_tid_232554;\n    \n    global_tid_232552 = get_global_id(0);\n    local_tid_232553 = get_local_id(0);\n    group_sizze_232556 = get_local_size(0);\n    wave_sizze_232555 = LOCKSTEP_WIDTH;\n    group_tid_232554 = get_group_id(0);\n    \n    int32_t phys_tid_207559 = global_tid_232552;\n    __local unsigned char *scan_arr_mem_232557;\n    \n    scan_arr_mem_232557 = (__local\n                           unsigned char *) scan_arr_mem_232557_backing_0;\n    \n    int64_t flat_idx_232559 = (sext_i32_i64(local_tid_232553) + (int64_t) 1) *\n            (segscan_group_sizze_207552 * sdiv_up64(partition_sizze_203577 *\n                                                    n_p_203492 *\n                                                    defunc_0_f_res_203631,\n                                                    sext_i32_i64(num_threads_232523))) -\n            (int64_t) 1;\n    int64_t gtid_207556 = squot64(flat_idx_232559, n_p_203492 *\n                                  defunc_0_f_res_203631);\n    int64_t gtid_207557 = squot64(flat_idx_232559 - squot64(flat_idx_232559,\n                   ",
                   "                                         n_p_203492 *\n                                                            defunc_0_f_res_203631) *\n                                  (n_p_203492 * defunc_0_f_res_203631),\n                                  defunc_0_f_res_203631);\n    int64_t gtid_207558 = flat_idx_232559 - squot64(flat_idx_232559,\n                                                    n_p_203492 *\n                                                    defunc_0_f_res_203631) *\n            (n_p_203492 * defunc_0_f_res_203631) - squot64(flat_idx_232559 -\n                                                           squot64(flat_idx_232559,\n                                                                   n_p_203492 *\n                                                                   defunc_0_f_res_203631) *\n                                                           (n_p_203492 *\n                                                            defunc_0_f_res_203631),\n                                                           defunc_0_f_res_203631) *\n            defunc_0_f_res_203631;\n    \n    // threads in bound read carries; others get neutral element\n    {\n        if ((slt64(gtid_207556, partition_sizze_203577) && slt64(gtid_207557,\n                                                                 n_p_203492)) &&\n            slt64(gtid_207558, defunc_0_f_res_203631)) {\n            int64_t tmp_232560;\n            \n            tmp_232560 = ((__global int64_t *) mem_229250)[gtid_207556 *\n                                                           (defunc_0_f_res_203631 *\n                                                            n_p_203492) +\n                                                           gtid_207557 *\n                                                           defunc_0_f_res_203631 +\n                                                           gtid_207558];\n            ((__local\n              int64_t *) scan_arr_mem_232557)[sext_i32_i64(local_tid_232553)] =\n            ",
                   "    tmp_232560;\n        } else {\n            ((__local\n              int64_t *) scan_arr_mem_232557)[sext_i32_i64(local_tid_232553)] =\n                (int64_t) 0;\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int64_t x_207560;\n    int64_t x_207561;\n    int64_t x_232561;\n    int64_t x_232562;\n    bool ltid_in_bounds_232564 = slt64(sext_i32_i64(local_tid_232553),\n                                       stage1_num_groups_232522);\n    int32_t skip_threads_232565;\n    \n    // read input for in-block scan\n    {\n        if (ltid_in_bounds_232564) {\n            x_207561 = ((volatile __local\n                         int64_t *) scan_arr_mem_232557)[sext_i32_i64(local_tid_232553)];\n            if ((local_tid_232553 - squot32(local_tid_232553, 32) * 32) == 0) {\n                x_207560 = x_207561;\n            }\n        }\n    }\n    // in-block scan (hopefully no barriers needed)\n    {\n        skip_threads_232565 = 1;\n        while (slt32(skip_threads_232565, 32)) {\n            bool thread_active_232566 = sle32(skip_threads_232565,\n                                              local_tid_232553 -\n                                              squot32(local_tid_232553, 32) *\n                                              32) && ltid_in_bounds_232564;\n            \n            if (thread_active_232566) {\n                // read operands\n                {\n                    x_207560 = ((volatile __local\n                                 int64_t *) scan_arr_mem_232557)[sext_i32_i64(local_tid_232553) -\n                                                                 sext_i32_i64(skip_threads_232565)];\n                }\n            }\n            // perform operation\n            {\n                bool inactive_232567 =\n                     slt64(srem64((sext_i32_i64(local_tid_232553) +\n                                   (int64_t) 1) * (segscan_group_sizze_207552 *\n                                                   sdiv_up64(partition_sizze_203577 *\n                             ",
                   "                                n_p_203492 *\n                                                             defunc_0_f_res_203631,\n                                                             sext_i32_i64(num_threads_232523))) -\n                                  (int64_t) 1, defunc_0_f_res_203631),\n                           (sext_i32_i64(local_tid_232553) + (int64_t) 1) *\n                           (segscan_group_sizze_207552 *\n                            sdiv_up64(partition_sizze_203577 * n_p_203492 *\n                                      defunc_0_f_res_203631,\n                                      sext_i32_i64(num_threads_232523))) -\n                           (int64_t) 1 - ((sext_i32_i64(local_tid_232553 -\n                                           skip_threads_232565) + (int64_t) 1) *\n                                          (segscan_group_sizze_207552 *\n                                           sdiv_up64(partition_sizze_203577 *\n                                                     n_p_203492 *\n                                                     defunc_0_f_res_203631,\n                                                     sext_i32_i64(num_threads_232523))) -\n                                          (int64_t) 1));\n                \n                if (thread_active_232566 && inactive_232567) {\n                    x_207560 = x_207561;\n                }\n                if (thread_active_232566) {\n                    if (!inactive_232567) {\n                        int64_t defunc_1_op_res_207562 = add64(x_207560,\n                                                               x_207561);\n                        \n                        x_207560 = defunc_1_op_res_207562;\n                    }\n                }\n            }\n            if (sle32(wave_sizze_232555, skip_threads_232565)) {\n                barrier(CLK_LOCAL_MEM_FENCE);\n            }\n            if (thread_active_232566) {\n                // write result\n                {\n                    ((volatile __lo",
                   "cal\n                      int64_t *) scan_arr_mem_232557)[sext_i32_i64(local_tid_232553)] =\n                        x_207560;\n                    x_207561 = x_207560;\n                }\n            }\n            if (sle32(wave_sizze_232555, skip_threads_232565)) {\n                barrier(CLK_LOCAL_MEM_FENCE);\n            }\n            skip_threads_232565 *= 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_232553 - squot32(local_tid_232553, 32) * 32) == 31 &&\n            ltid_in_bounds_232564) {\n            ((volatile __local\n              int64_t *) scan_arr_mem_232557)[sext_i32_i64(squot32(local_tid_232553,\n                                                                   32))] =\n                x_207560;\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_232568;\n        \n        // read input for in-block scan\n        {\n            if (squot32(local_tid_232553, 32) == 0 && ltid_in_bounds_232564) {\n                x_232562 = ((volatile __local\n                             int64_t *) scan_arr_mem_232557)[sext_i32_i64(local_tid_232553)];\n                if ((local_tid_232553 - squot32(local_tid_232553, 32) * 32) ==\n                    0) {\n                    x_232561 = x_232562;\n                }\n            }\n        }\n        // in-block scan (hopefully no barriers needed)\n        {\n            skip_threads_232568 = 1;\n            while (slt32(skip_threads_232568, 32)) {\n                bool thread_active_232569 = sle32(skip_threads_232568,\n                                                  local_tid_232553 -\n                                                  squot32(local_tid_232553,\n                                                          32) * 32) &&\n                     (squot32(local_tid_232553, 32) == 0 &&\n                      ltid_in_bounds_232",
                   "564);\n                \n                if (thread_active_232569) {\n                    // read operands\n                    {\n                        x_232561 = ((volatile __local\n                                     int64_t *) scan_arr_mem_232557)[sext_i32_i64(local_tid_232553) -\n                                                                     sext_i32_i64(skip_threads_232568)];\n                    }\n                }\n                // perform operation\n                {\n                    bool inactive_232570 =\n                         slt64(srem64((sext_i32_i64(local_tid_232553 * 32 + 32 -\n                                       1) + (int64_t) 1) *\n                                      (segscan_group_sizze_207552 *\n                                       sdiv_up64(partition_sizze_203577 *\n                                                 n_p_203492 *\n                                                 defunc_0_f_res_203631,\n                                                 sext_i32_i64(num_threads_232523))) -\n                                      (int64_t) 1, defunc_0_f_res_203631),\n                               (sext_i32_i64(local_tid_232553 * 32 + 32 - 1) +\n                                (int64_t) 1) * (segscan_group_sizze_207552 *\n                                                sdiv_up64(partition_sizze_203577 *\n                                                          n_p_203492 *\n                                                          defunc_0_f_res_203631,\n                                                          sext_i32_i64(num_threads_232523))) -\n                               (int64_t) 1 - ((sext_i32_i64((local_tid_232553 -\n                                                             skip_threads_232568) *\n                                               32 + 32 - 1) + (int64_t) 1) *\n                                              (segscan_group_sizze_207552 *\n                                               sdiv_up64(partition_sizze_203577 *\n             ",
                   "                                            n_p_203492 *\n                                                         defunc_0_f_res_203631,\n                                                         sext_i32_i64(num_threads_232523))) -\n                                              (int64_t) 1));\n                    \n                    if (thread_active_232569 && inactive_232570) {\n                        x_232561 = x_232562;\n                    }\n                    if (thread_active_232569) {\n                        if (!inactive_232570) {\n                            int64_t defunc_1_op_res_232563 = add64(x_232561,\n                                                                   x_232562);\n                            \n                            x_232561 = defunc_1_op_res_232563;\n                        }\n                    }\n                }\n                if (sle32(wave_sizze_232555, skip_threads_232568)) {\n                    barrier(CLK_LOCAL_MEM_FENCE);\n                }\n                if (thread_active_232569) {\n                    // write result\n                    {\n                        ((volatile __local\n                          int64_t *) scan_arr_mem_232557)[sext_i32_i64(local_tid_232553)] =\n                            x_232561;\n                        x_232562 = x_232561;\n                    }\n                }\n                if (sle32(wave_sizze_232555, skip_threads_232568)) {\n                    barrier(CLK_LOCAL_MEM_FENCE);\n                }\n                skip_threads_232568 *= 2;\n            }\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    bool no_carry_in_232571 = squot32(local_tid_232553, 32) == 0 ||\n         !ltid_in_bounds_232564;\n    \n    // carry-in for every block except the first\n    {\n        // read operands\n        {\n            if (!no_carry_in_232571) {\n                x_207561 = x_207560;\n                x_207560 = ((__local\n                             int64_t *) scan_arr_mem_232557)[sext_i32_i64(squot32(local_ti",
                   "d_232553,\n                                                                                  32)) -\n                                                             (int64_t) 1];\n            }\n        }\n        // perform operation\n        {\n            bool inactive_232572 =\n                 slt64(srem64((sext_i32_i64(local_tid_232553) + (int64_t) 1) *\n                              (segscan_group_sizze_207552 *\n                               sdiv_up64(partition_sizze_203577 * n_p_203492 *\n                                         defunc_0_f_res_203631,\n                                         sext_i32_i64(num_threads_232523))) -\n                              (int64_t) 1, defunc_0_f_res_203631),\n                       (sext_i32_i64(local_tid_232553) + (int64_t) 1) *\n                       (segscan_group_sizze_207552 *\n                        sdiv_up64(partition_sizze_203577 * n_p_203492 *\n                                  defunc_0_f_res_203631,\n                                  sext_i32_i64(num_threads_232523))) -\n                       (int64_t) 1 - ((sext_i32_i64(squot32(local_tid_232553,\n                                                            32) * 32 - 1) +\n                                       (int64_t) 1) *\n                                      (segscan_group_sizze_207552 *\n                                       sdiv_up64(partition_sizze_203577 *\n                                                 n_p_203492 *\n                                                 defunc_0_f_res_203631,\n                                                 sext_i32_i64(num_threads_232523))) -\n                                      (int64_t) 1));\n            \n            if (!no_carry_in_232571) {\n                if (inactive_232572) {\n                    x_207560 = x_207561;\n                }\n            }\n            if (!no_carry_in_232571) {\n                if (!inactive_232572) {\n                    int64_t defunc_1_op_res_207562 = add64(x_207560, x_207561);\n                    \n         ",
                   "           x_207560 = defunc_1_op_res_207562;\n                }\n            }\n        }\n        // write final result\n        {\n            if (!no_carry_in_232571) {\n                ((__local\n                  int64_t *) scan_arr_mem_232557)[sext_i32_i64(local_tid_232553)] =\n                    x_207560;\n            }\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    // restore correct values for first block\n    {\n        if (squot32(local_tid_232553, 32) == 0 && ltid_in_bounds_232564) {\n            ((__local\n              int64_t *) scan_arr_mem_232557)[sext_i32_i64(local_tid_232553)] =\n                x_207561;\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    // threads in bounds write scanned carries\n    {\n        if ((slt64(gtid_207556, partition_sizze_203577) && slt64(gtid_207557,\n                                                                 n_p_203492)) &&\n            slt64(gtid_207558, defunc_0_f_res_203631)) {\n            int64_t tmp_232573;\n            \n            tmp_232573 = ((__local\n                           int64_t *) scan_arr_mem_232557)[sext_i32_i64(local_tid_232553)];\n            ((__global int64_t *) mem_229250)[gtid_207556 *\n                                              (defunc_0_f_res_203631 *\n                                               n_p_203492) + gtid_207557 *\n                                              defunc_0_f_res_203631 +\n                                              gtid_207558] = tmp_232573;\n        }\n    }\n    \n  error_0:\n    return;\n    #undef segscan_group_sizze_207552\n}\n__kernel void mainziscan_stage2_218683(__global int *global_failure,\n                                       __local volatile\n                                       int64_t *scan_arr_mem_234203_backing_aligned_0,\n                                       int64_t partition_sizze_203577,\n                                       int64_t lifted_single_ma_l_arg_204134,\n                                       int64_t stage1_num_groups_234168,\n                ",
                   "                       int32_t num_threads_234169, __global\n                                       unsigned char *mem_230517)\n{\n    #define segscan_group_sizze_218677 (mainzisegscan_group_sizze_218641)\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_234203_backing_0 =\n                                   (__local volatile\n                                    unsigned char *) scan_arr_mem_234203_backing_aligned_0;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_234198;\n    int32_t local_tid_234199;\n    int64_t group_sizze_234202;\n    int32_t wave_sizze_234201;\n    int32_t group_tid_234200;\n    \n    global_tid_234198 = get_global_id(0);\n    local_tid_234199 = get_local_id(0);\n    group_sizze_234202 = get_local_size(0);\n    wave_sizze_234201 = LOCKSTEP_WIDTH;\n    group_tid_234200 = get_group_id(0);\n    \n    int32_t phys_tid_218683 = global_tid_234198;\n    __local unsigned char *scan_arr_mem_234203;\n    \n    scan_arr_mem_234203 = (__local\n                           unsigned char *) scan_arr_mem_234203_backing_0;\n    \n    int64_t flat_idx_234205 = (sext_i32_i64(local_tid_234199) + (int64_t) 1) *\n            (segscan_group_sizze_218677 * sdiv_up64(partition_sizze_203577 *\n                                                    lifted_single_ma_l_arg_204134,\n                                                    sext_i32_i64(num_threads_234169))) -\n            (int64_t) 1;\n    int64_t gtid_218681 = squot64(flat_idx_234205,\n                                  lifted_single_ma_l_arg_204134);\n    int64_t gtid_218682 = flat_idx_234205 - squot64(flat_idx_234205,\n                                                    lifted_single_ma_l_arg_204134) *\n            lifted_single_ma_l_arg_204134;\n    \n    // threads in bound read carries; others get neutral element\n    {\n        if (slt64(gtid_218681, partition_sizze_203577) && slt64(gtid_218682,\n                  ",
                   "                                              lifted_single_ma_l_arg_204134)) {\n            double tmp_234206;\n            \n            tmp_234206 = ((__global double *) mem_230517)[gtid_218681 *\n                                                          lifted_single_ma_l_arg_204134 +\n                                                          gtid_218682];\n            ((__local\n              double *) scan_arr_mem_234203)[sext_i32_i64(local_tid_234199)] =\n                tmp_234206;\n        } else {\n            ((__local\n              double *) scan_arr_mem_234203)[sext_i32_i64(local_tid_234199)] =\n                0.0;\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    double x_218684;\n    double x_218685;\n    double x_234207;\n    double x_234208;\n    bool ltid_in_bounds_234210 = slt64(sext_i32_i64(local_tid_234199),\n                                       stage1_num_groups_234168);\n    int32_t skip_threads_234211;\n    \n    // read input for in-block scan\n    {\n        if (ltid_in_bounds_234210) {\n            x_218685 = ((volatile __local\n                         double *) scan_arr_mem_234203)[sext_i32_i64(local_tid_234199)];\n            if ((local_tid_234199 - squot32(local_tid_234199, 32) * 32) == 0) {\n                x_218684 = x_218685;\n            }\n        }\n    }\n    // in-block scan (hopefully no barriers needed)\n    {\n        skip_threads_234211 = 1;\n        while (slt32(skip_threads_234211, 32)) {\n            bool thread_active_234212 = sle32(skip_threads_234211,\n                                              local_tid_234199 -\n                                              squot32(local_tid_234199, 32) *\n                                              32) && ltid_in_bounds_234210;\n            \n            if (thread_active_234212) {\n                // read operands\n                {\n                    x_218684 = ((volatile __local\n                                 double *) scan_arr_mem_234203)[sext_i32_i64(local_tid_234199) -\n                          ",
                   "                                      sext_i32_i64(skip_threads_234211)];\n                }\n            }\n            // perform operation\n            {\n                bool inactive_234213 =\n                     slt64(srem64((sext_i32_i64(local_tid_234199) +\n                                   (int64_t) 1) * (segscan_group_sizze_218677 *\n                                                   sdiv_up64(partition_sizze_203577 *\n                                                             lifted_single_ma_l_arg_204134,\n                                                             sext_i32_i64(num_threads_234169))) -\n                                  (int64_t) 1, lifted_single_ma_l_arg_204134),\n                           (sext_i32_i64(local_tid_234199) + (int64_t) 1) *\n                           (segscan_group_sizze_218677 *\n                            sdiv_up64(partition_sizze_203577 *\n                                      lifted_single_ma_l_arg_204134,\n                                      sext_i32_i64(num_threads_234169))) -\n                           (int64_t) 1 - ((sext_i32_i64(local_tid_234199 -\n                                           skip_threads_234211) + (int64_t) 1) *\n                                          (segscan_group_sizze_218677 *\n                                           sdiv_up64(partition_sizze_203577 *\n                                                     lifted_single_ma_l_arg_204134,\n                                                     sext_i32_i64(num_threads_234169))) -\n                                          (int64_t) 1));\n                \n                if (thread_active_234212 && inactive_234213) {\n                    x_218684 = x_218685;\n                }\n                if (thread_active_234212) {\n                    if (!inactive_234213) {\n                        double defunc_1_op_res_218686 = x_218684 + x_218685;\n                        \n                        x_218684 = defunc_1_op_res_218686;\n                    }\n                }\n",
                   "            }\n            if (sle32(wave_sizze_234201, skip_threads_234211)) {\n                barrier(CLK_LOCAL_MEM_FENCE);\n            }\n            if (thread_active_234212) {\n                // write result\n                {\n                    ((volatile __local\n                      double *) scan_arr_mem_234203)[sext_i32_i64(local_tid_234199)] =\n                        x_218684;\n                    x_218685 = x_218684;\n                }\n            }\n            if (sle32(wave_sizze_234201, skip_threads_234211)) {\n                barrier(CLK_LOCAL_MEM_FENCE);\n            }\n            skip_threads_234211 *= 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_234199 - squot32(local_tid_234199, 32) * 32) == 31 &&\n            ltid_in_bounds_234210) {\n            ((volatile __local\n              double *) scan_arr_mem_234203)[sext_i32_i64(squot32(local_tid_234199,\n                                                                  32))] =\n                x_218684;\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_234214;\n        \n        // read input for in-block scan\n        {\n            if (squot32(local_tid_234199, 32) == 0 && ltid_in_bounds_234210) {\n                x_234208 = ((volatile __local\n                             double *) scan_arr_mem_234203)[sext_i32_i64(local_tid_234199)];\n                if ((local_tid_234199 - squot32(local_tid_234199, 32) * 32) ==\n                    0) {\n                    x_234207 = x_234208;\n                }\n            }\n        }\n        // in-block scan (hopefully no barriers needed)\n        {\n            skip_threads_234214 = 1;\n            while (slt32(skip_threads_234214, 32)) {\n                bool thread_active_234215 = sle32(skip_threads_234214,\n                                                  local_",
                   "tid_234199 -\n                                                  squot32(local_tid_234199,\n                                                          32) * 32) &&\n                     (squot32(local_tid_234199, 32) == 0 &&\n                      ltid_in_bounds_234210);\n                \n                if (thread_active_234215) {\n                    // read operands\n                    {\n                        x_234207 = ((volatile __local\n                                     double *) scan_arr_mem_234203)[sext_i32_i64(local_tid_234199) -\n                                                                    sext_i32_i64(skip_threads_234214)];\n                    }\n                }\n                // perform operation\n                {\n                    bool inactive_234216 =\n                         slt64(srem64((sext_i32_i64(local_tid_234199 * 32 + 32 -\n                                       1) + (int64_t) 1) *\n                                      (segscan_group_sizze_218677 *\n                                       sdiv_up64(partition_sizze_203577 *\n                                                 lifted_single_ma_l_arg_204134,\n                                                 sext_i32_i64(num_threads_234169))) -\n                                      (int64_t) 1,\n                                      lifted_single_ma_l_arg_204134),\n                               (sext_i32_i64(local_tid_234199 * 32 + 32 - 1) +\n                                (int64_t) 1) * (segscan_group_sizze_218677 *\n                                                sdiv_up64(partition_sizze_203577 *\n                                                          lifted_single_ma_l_arg_204134,\n                                                          sext_i32_i64(num_threads_234169))) -\n                               (int64_t) 1 - ((sext_i32_i64((local_tid_234199 -\n                                                             skip_threads_234214) *\n                                               32 + 32 - 1) +",
                   " (int64_t) 1) *\n                                              (segscan_group_sizze_218677 *\n                                               sdiv_up64(partition_sizze_203577 *\n                                                         lifted_single_ma_l_arg_204134,\n                                                         sext_i32_i64(num_threads_234169))) -\n                                              (int64_t) 1));\n                    \n                    if (thread_active_234215 && inactive_234216) {\n                        x_234207 = x_234208;\n                    }\n                    if (thread_active_234215) {\n                        if (!inactive_234216) {\n                            double defunc_1_op_res_234209 = x_234207 + x_234208;\n                            \n                            x_234207 = defunc_1_op_res_234209;\n                        }\n                    }\n                }\n                if (sle32(wave_sizze_234201, skip_threads_234214)) {\n                    barrier(CLK_LOCAL_MEM_FENCE);\n                }\n                if (thread_active_234215) {\n                    // write result\n                    {\n                        ((volatile __local\n                          double *) scan_arr_mem_234203)[sext_i32_i64(local_tid_234199)] =\n                            x_234207;\n                        x_234208 = x_234207;\n                    }\n                }\n                if (sle32(wave_sizze_234201, skip_threads_234214)) {\n                    barrier(CLK_LOCAL_MEM_FENCE);\n                }\n                skip_threads_234214 *= 2;\n            }\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    bool no_carry_in_234217 = squot32(local_tid_234199, 32) == 0 ||\n         !ltid_in_bounds_234210;\n    \n    // carry-in for every block except the first\n    {\n        // read operands\n        {\n            if (!no_carry_in_234217) {\n                x_218685 = x_218684;\n                x_218684 = ((__local\n                             double *) s",
                   "can_arr_mem_234203)[sext_i32_i64(squot32(local_tid_234199,\n                                                                                 32)) -\n                                                            (int64_t) 1];\n            }\n        }\n        // perform operation\n        {\n            bool inactive_234218 =\n                 slt64(srem64((sext_i32_i64(local_tid_234199) + (int64_t) 1) *\n                              (segscan_group_sizze_218677 *\n                               sdiv_up64(partition_sizze_203577 *\n                                         lifted_single_ma_l_arg_204134,\n                                         sext_i32_i64(num_threads_234169))) -\n                              (int64_t) 1, lifted_single_ma_l_arg_204134),\n                       (sext_i32_i64(local_tid_234199) + (int64_t) 1) *\n                       (segscan_group_sizze_218677 *\n                        sdiv_up64(partition_sizze_203577 *\n                                  lifted_single_ma_l_arg_204134,\n                                  sext_i32_i64(num_threads_234169))) -\n                       (int64_t) 1 - ((sext_i32_i64(squot32(local_tid_234199,\n                                                            32) * 32 - 1) +\n                                       (int64_t) 1) *\n                                      (segscan_group_sizze_218677 *\n                                       sdiv_up64(partition_sizze_203577 *\n                                                 lifted_single_ma_l_arg_204134,\n                                                 sext_i32_i64(num_threads_234169))) -\n                                      (int64_t) 1));\n            \n            if (!no_carry_in_234217) {\n                if (inactive_234218) {\n                    x_218684 = x_218685;\n                }\n            }\n            if (!no_carry_in_234217) {\n                if (!inactive_234218) {\n                    double defunc_1_op_res_218686 = x_218684 + x_218685;\n                    \n                    x_218",
                   "684 = defunc_1_op_res_218686;\n                }\n            }\n        }\n        // write final result\n        {\n            if (!no_carry_in_234217) {\n                ((__local\n                  double *) scan_arr_mem_234203)[sext_i32_i64(local_tid_234199)] =\n                    x_218684;\n            }\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    // restore correct values for first block\n    {\n        if (squot32(local_tid_234199, 32) == 0 && ltid_in_bounds_234210) {\n            ((__local\n              double *) scan_arr_mem_234203)[sext_i32_i64(local_tid_234199)] =\n                x_218685;\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    // threads in bounds write scanned carries\n    {\n        if (slt64(gtid_218681, partition_sizze_203577) && slt64(gtid_218682,\n                                                                lifted_single_ma_l_arg_204134)) {\n            double tmp_234219;\n            \n            tmp_234219 = ((__local\n                           double *) scan_arr_mem_234203)[sext_i32_i64(local_tid_234199)];\n            ((__global double *) mem_230517)[gtid_218681 *\n                                             lifted_single_ma_l_arg_204134 +\n                                             gtid_218682] = tmp_234219;\n        }\n    }\n    \n  error_0:\n    return;\n    #undef segscan_group_sizze_218677\n}\n__kernel void mainziscan_stage2_218814(__global int *global_failure,\n                                       __local volatile\n                                       int64_t *scan_arr_mem_234346_backing_aligned_0,\n                                       int64_t partition_sizze_203577,\n                                       int64_t dyn_lifted_single_ma_l_arg_204144,\n                                       int64_t stage1_num_groups_234311,\n                                       int32_t num_threads_234312, __global\n                                       unsigned char *mem_230534)\n{\n    #define segscan_group_sizze_218808 (mainzisegscan_group_sizze_2187",
                   "72)\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_234346_backing_0 =\n                                   (__local volatile\n                                    unsigned char *) scan_arr_mem_234346_backing_aligned_0;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_234341;\n    int32_t local_tid_234342;\n    int64_t group_sizze_234345;\n    int32_t wave_sizze_234344;\n    int32_t group_tid_234343;\n    \n    global_tid_234341 = get_global_id(0);\n    local_tid_234342 = get_local_id(0);\n    group_sizze_234345 = get_local_size(0);\n    wave_sizze_234344 = LOCKSTEP_WIDTH;\n    group_tid_234343 = get_group_id(0);\n    \n    int32_t phys_tid_218814 = global_tid_234341;\n    __local unsigned char *scan_arr_mem_234346;\n    \n    scan_arr_mem_234346 = (__local\n                           unsigned char *) scan_arr_mem_234346_backing_0;\n    \n    int64_t flat_idx_234348 = (sext_i32_i64(local_tid_234342) + (int64_t) 1) *\n            (segscan_group_sizze_218808 * sdiv_up64(partition_sizze_203577 *\n                                                    dyn_lifted_single_ma_l_arg_204144,\n                                                    sext_i32_i64(num_threads_234312))) -\n            (int64_t) 1;\n    int64_t gtid_218812 = squot64(flat_idx_234348,\n                                  dyn_lifted_single_ma_l_arg_204144);\n    int64_t gtid_218813 = flat_idx_234348 - squot64(flat_idx_234348,\n                                                    dyn_lifted_single_ma_l_arg_204144) *\n            dyn_lifted_single_ma_l_arg_204144;\n    \n    // threads in bound read carries; others get neutral element\n    {\n        if (slt64(gtid_218812, partition_sizze_203577) && slt64(gtid_218813,\n                                                                dyn_lifted_single_ma_l_arg_204144)) {\n            double tmp_234349;\n            \n            tmp_234349 = ((__global double *) mem_2305",
                   "34)[gtid_218812 *\n                                                          dyn_lifted_single_ma_l_arg_204144 +\n                                                          gtid_218813];\n            ((__local\n              double *) scan_arr_mem_234346)[sext_i32_i64(local_tid_234342)] =\n                tmp_234349;\n        } else {\n            ((__local\n              double *) scan_arr_mem_234346)[sext_i32_i64(local_tid_234342)] =\n                0.0;\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    double x_218815;\n    double x_218816;\n    double x_234350;\n    double x_234351;\n    bool ltid_in_bounds_234353 = slt64(sext_i32_i64(local_tid_234342),\n                                       stage1_num_groups_234311);\n    int32_t skip_threads_234354;\n    \n    // read input for in-block scan\n    {\n        if (ltid_in_bounds_234353) {\n            x_218816 = ((volatile __local\n                         double *) scan_arr_mem_234346)[sext_i32_i64(local_tid_234342)];\n            if ((local_tid_234342 - squot32(local_tid_234342, 32) * 32) == 0) {\n                x_218815 = x_218816;\n            }\n        }\n    }\n    // in-block scan (hopefully no barriers needed)\n    {\n        skip_threads_234354 = 1;\n        while (slt32(skip_threads_234354, 32)) {\n            bool thread_active_234355 = sle32(skip_threads_234354,\n                                              local_tid_234342 -\n                                              squot32(local_tid_234342, 32) *\n                                              32) && ltid_in_bounds_234353;\n            \n            if (thread_active_234355) {\n                // read operands\n                {\n                    x_218815 = ((volatile __local\n                                 double *) scan_arr_mem_234346)[sext_i32_i64(local_tid_234342) -\n                                                                sext_i32_i64(skip_threads_234354)];\n                }\n            }\n            // perform operation\n            {\n                bool ",
                   "inactive_234356 =\n                     slt64(srem64((sext_i32_i64(local_tid_234342) +\n                                   (int64_t) 1) * (segscan_group_sizze_218808 *\n                                                   sdiv_up64(partition_sizze_203577 *\n                                                             dyn_lifted_single_ma_l_arg_204144,\n                                                             sext_i32_i64(num_threads_234312))) -\n                                  (int64_t) 1,\n                                  dyn_lifted_single_ma_l_arg_204144),\n                           (sext_i32_i64(local_tid_234342) + (int64_t) 1) *\n                           (segscan_group_sizze_218808 *\n                            sdiv_up64(partition_sizze_203577 *\n                                      dyn_lifted_single_ma_l_arg_204144,\n                                      sext_i32_i64(num_threads_234312))) -\n                           (int64_t) 1 - ((sext_i32_i64(local_tid_234342 -\n                                           skip_threads_234354) + (int64_t) 1) *\n                                          (segscan_group_sizze_218808 *\n                                           sdiv_up64(partition_sizze_203577 *\n                                                     dyn_lifted_single_ma_l_arg_204144,\n                                                     sext_i32_i64(num_threads_234312))) -\n                                          (int64_t) 1));\n                \n                if (thread_active_234355 && inactive_234356) {\n                    x_218815 = x_218816;\n                }\n                if (thread_active_234355) {\n                    if (!inactive_234356) {\n                        double defunc_1_op_res_218817 = x_218815 + x_218816;\n                        \n                        x_218815 = defunc_1_op_res_218817;\n                    }\n                }\n            }\n            if (sle32(wave_sizze_234344, skip_threads_234354)) {\n                barrier(CLK_LOCAL_MEM_FENCE);",
                   "\n            }\n            if (thread_active_234355) {\n                // write result\n                {\n                    ((volatile __local\n                      double *) scan_arr_mem_234346)[sext_i32_i64(local_tid_234342)] =\n                        x_218815;\n                    x_218816 = x_218815;\n                }\n            }\n            if (sle32(wave_sizze_234344, skip_threads_234354)) {\n                barrier(CLK_LOCAL_MEM_FENCE);\n            }\n            skip_threads_234354 *= 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_234342 - squot32(local_tid_234342, 32) * 32) == 31 &&\n            ltid_in_bounds_234353) {\n            ((volatile __local\n              double *) scan_arr_mem_234346)[sext_i32_i64(squot32(local_tid_234342,\n                                                                  32))] =\n                x_218815;\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_234357;\n        \n        // read input for in-block scan\n        {\n            if (squot32(local_tid_234342, 32) == 0 && ltid_in_bounds_234353) {\n                x_234351 = ((volatile __local\n                             double *) scan_arr_mem_234346)[sext_i32_i64(local_tid_234342)];\n                if ((local_tid_234342 - squot32(local_tid_234342, 32) * 32) ==\n                    0) {\n                    x_234350 = x_234351;\n                }\n            }\n        }\n        // in-block scan (hopefully no barriers needed)\n        {\n            skip_threads_234357 = 1;\n            while (slt32(skip_threads_234357, 32)) {\n                bool thread_active_234358 = sle32(skip_threads_234357,\n                                                  local_tid_234342 -\n                                                  squot32(local_tid_234342,\n                                   ",
                   "                       32) * 32) &&\n                     (squot32(local_tid_234342, 32) == 0 &&\n                      ltid_in_bounds_234353);\n                \n                if (thread_active_234358) {\n                    // read operands\n                    {\n                        x_234350 = ((volatile __local\n                                     double *) scan_arr_mem_234346)[sext_i32_i64(local_tid_234342) -\n                                                                    sext_i32_i64(skip_threads_234357)];\n                    }\n                }\n                // perform operation\n                {\n                    bool inactive_234359 =\n                         slt64(srem64((sext_i32_i64(local_tid_234342 * 32 + 32 -\n                                       1) + (int64_t) 1) *\n                                      (segscan_group_sizze_218808 *\n                                       sdiv_up64(partition_sizze_203577 *\n                                                 dyn_lifted_single_ma_l_arg_204144,\n                                                 sext_i32_i64(num_threads_234312))) -\n                                      (int64_t) 1,\n                                      dyn_lifted_single_ma_l_arg_204144),\n                               (sext_i32_i64(local_tid_234342 * 32 + 32 - 1) +\n                                (int64_t) 1) * (segscan_group_sizze_218808 *\n                                                sdiv_up64(partition_sizze_203577 *\n                                                          dyn_lifted_single_ma_l_arg_204144,\n                                                          sext_i32_i64(num_threads_234312))) -\n                               (int64_t) 1 - ((sext_i32_i64((local_tid_234342 -\n                                                             skip_threads_234357) *\n                                               32 + 32 - 1) + (int64_t) 1) *\n                                              (segscan_group_sizze_218808 *\n                    ",
                   "                           sdiv_up64(partition_sizze_203577 *\n                                                         dyn_lifted_single_ma_l_arg_204144,\n                                                         sext_i32_i64(num_threads_234312))) -\n                                              (int64_t) 1));\n                    \n                    if (thread_active_234358 && inactive_234359) {\n                        x_234350 = x_234351;\n                    }\n                    if (thread_active_234358) {\n                        if (!inactive_234359) {\n                            double defunc_1_op_res_234352 = x_234350 + x_234351;\n                            \n                            x_234350 = defunc_1_op_res_234352;\n                        }\n                    }\n                }\n                if (sle32(wave_sizze_234344, skip_threads_234357)) {\n                    barrier(CLK_LOCAL_MEM_FENCE);\n                }\n                if (thread_active_234358) {\n                    // write result\n                    {\n                        ((volatile __local\n                          double *) scan_arr_mem_234346)[sext_i32_i64(local_tid_234342)] =\n                            x_234350;\n                        x_234351 = x_234350;\n                    }\n                }\n                if (sle32(wave_sizze_234344, skip_threads_234357)) {\n                    barrier(CLK_LOCAL_MEM_FENCE);\n                }\n                skip_threads_234357 *= 2;\n            }\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    bool no_carry_in_234360 = squot32(local_tid_234342, 32) == 0 ||\n         !ltid_in_bounds_234353;\n    \n    // carry-in for every block except the first\n    {\n        // read operands\n        {\n            if (!no_carry_in_234360) {\n                x_218816 = x_218815;\n                x_218815 = ((__local\n                             double *) scan_arr_mem_234346)[sext_i32_i64(squot32(local_tid_234342,\n                                                 ",
                   "                                32)) -\n                                                            (int64_t) 1];\n            }\n        }\n        // perform operation\n        {\n            bool inactive_234361 =\n                 slt64(srem64((sext_i32_i64(local_tid_234342) + (int64_t) 1) *\n                              (segscan_group_sizze_218808 *\n                               sdiv_up64(partition_sizze_203577 *\n                                         dyn_lifted_single_ma_l_arg_204144,\n                                         sext_i32_i64(num_threads_234312))) -\n                              (int64_t) 1, dyn_lifted_single_ma_l_arg_204144),\n                       (sext_i32_i64(local_tid_234342) + (int64_t) 1) *\n                       (segscan_group_sizze_218808 *\n                        sdiv_up64(partition_sizze_203577 *\n                                  dyn_lifted_single_ma_l_arg_204144,\n                                  sext_i32_i64(num_threads_234312))) -\n                       (int64_t) 1 - ((sext_i32_i64(squot32(local_tid_234342,\n                                                            32) * 32 - 1) +\n                                       (int64_t) 1) *\n                                      (segscan_group_sizze_218808 *\n                                       sdiv_up64(partition_sizze_203577 *\n                                                 dyn_lifted_single_ma_l_arg_204144,\n                                                 sext_i32_i64(num_threads_234312))) -\n                                      (int64_t) 1));\n            \n            if (!no_carry_in_234360) {\n                if (inactive_234361) {\n                    x_218815 = x_218816;\n                }\n            }\n            if (!no_carry_in_234360) {\n                if (!inactive_234361) {\n                    double defunc_1_op_res_218817 = x_218815 + x_218816;\n                    \n                    x_218815 = defunc_1_op_res_218817;\n                }\n            }\n        }\n        // write fin",
                   "al result\n        {\n            if (!no_carry_in_234360) {\n                ((__local\n                  double *) scan_arr_mem_234346)[sext_i32_i64(local_tid_234342)] =\n                    x_218815;\n            }\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    // restore correct values for first block\n    {\n        if (squot32(local_tid_234342, 32) == 0 && ltid_in_bounds_234353) {\n            ((__local\n              double *) scan_arr_mem_234346)[sext_i32_i64(local_tid_234342)] =\n                x_218816;\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    // threads in bounds write scanned carries\n    {\n        if (slt64(gtid_218812, partition_sizze_203577) && slt64(gtid_218813,\n                                                                dyn_lifted_single_ma_l_arg_204144)) {\n            double tmp_234362;\n            \n            tmp_234362 = ((__local\n                           double *) scan_arr_mem_234346)[sext_i32_i64(local_tid_234342)];\n            ((__global double *) mem_230534)[gtid_218812 *\n                                             dyn_lifted_single_ma_l_arg_204144 +\n                                             gtid_218813] = tmp_234362;\n        }\n    }\n    \n  error_0:\n    return;\n    #undef segscan_group_sizze_218808\n}\n__kernel void mainziscan_stage2_218945(__global int *global_failure,\n                                       __local volatile\n                                       int64_t *scan_arr_mem_234489_backing_aligned_0,\n                                       int64_t n_203490,\n                                       int64_t partition_sizze_203577,\n                                       int64_t stage1_num_groups_234454,\n                                       int32_t num_threads_234455, __global\n                                       unsigned char *mem_230551)\n{\n    #define segscan_group_sizze_218939 (mainzisegscan_group_sizze_218903)\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 scan_arr_mem_234489_backing_0 =\n                                   (__local volatile\n                                    unsigned char *) scan_arr_mem_234489_backing_aligned_0;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_234484;\n    int32_t local_tid_234485;\n    int64_t group_sizze_234488;\n    int32_t wave_sizze_234487;\n    int32_t group_tid_234486;\n    \n    global_tid_234484 = get_global_id(0);\n    local_tid_234485 = get_local_id(0);\n    group_sizze_234488 = get_local_size(0);\n    wave_sizze_234487 = LOCKSTEP_WIDTH;\n    group_tid_234486 = get_group_id(0);\n    \n    int32_t phys_tid_218945 = global_tid_234484;\n    __local unsigned char *scan_arr_mem_234489;\n    \n    scan_arr_mem_234489 = (__local\n                           unsigned char *) scan_arr_mem_234489_backing_0;\n    \n    int64_t flat_idx_234491 = (sext_i32_i64(local_tid_234485) + (int64_t) 1) *\n            (segscan_group_sizze_218939 * sdiv_up64(partition_sizze_203577 *\n                                                    n_203490,\n                                                    sext_i32_i64(num_threads_234455))) -\n            (int64_t) 1;\n    int64_t gtid_218943 = squot64(flat_idx_234491, n_203490);\n    int64_t gtid_218944 = flat_idx_234491 - squot64(flat_idx_234491, n_203490) *\n            n_203490;\n    \n    // threads in bound read carries; others get neutral element\n    {\n        if (slt64(gtid_218943, partition_sizze_203577) && slt64(gtid_218944,\n                                                                n_203490)) {\n            double tmp_234492;\n            \n            tmp_234492 = ((__global double *) mem_230551)[gtid_218943 *\n                                                          n_203490 +\n                                                          gtid_218944];\n            ((__local\n              double *) scan_arr_mem_234489)[sext_i32_i64(local_tid_234485)] =\n                tmp_234492;\n        } else {\n            ((_",
                   "_local\n              double *) scan_arr_mem_234489)[sext_i32_i64(local_tid_234485)] =\n                0.0;\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    double x_218946;\n    double x_218947;\n    double x_234493;\n    double x_234494;\n    bool ltid_in_bounds_234496 = slt64(sext_i32_i64(local_tid_234485),\n                                       stage1_num_groups_234454);\n    int32_t skip_threads_234497;\n    \n    // read input for in-block scan\n    {\n        if (ltid_in_bounds_234496) {\n            x_218947 = ((volatile __local\n                         double *) scan_arr_mem_234489)[sext_i32_i64(local_tid_234485)];\n            if ((local_tid_234485 - squot32(local_tid_234485, 32) * 32) == 0) {\n                x_218946 = x_218947;\n            }\n        }\n    }\n    // in-block scan (hopefully no barriers needed)\n    {\n        skip_threads_234497 = 1;\n        while (slt32(skip_threads_234497, 32)) {\n            bool thread_active_234498 = sle32(skip_threads_234497,\n                                              local_tid_234485 -\n                                              squot32(local_tid_234485, 32) *\n                                              32) && ltid_in_bounds_234496;\n            \n            if (thread_active_234498) {\n                // read operands\n                {\n                    x_218946 = ((volatile __local\n                                 double *) scan_arr_mem_234489)[sext_i32_i64(local_tid_234485) -\n                                                                sext_i32_i64(skip_threads_234497)];\n                }\n            }\n            // perform operation\n            {\n                bool inactive_234499 =\n                     slt64(srem64((sext_i32_i64(local_tid_234485) +\n                                   (int64_t) 1) * (segscan_group_sizze_218939 *\n                                                   sdiv_up64(partition_sizze_203577 *\n                                                             n_203490,\n                      ",
                   "                                       sext_i32_i64(num_threads_234455))) -\n                                  (int64_t) 1, n_203490),\n                           (sext_i32_i64(local_tid_234485) + (int64_t) 1) *\n                           (segscan_group_sizze_218939 *\n                            sdiv_up64(partition_sizze_203577 * n_203490,\n                                      sext_i32_i64(num_threads_234455))) -\n                           (int64_t) 1 - ((sext_i32_i64(local_tid_234485 -\n                                           skip_threads_234497) + (int64_t) 1) *\n                                          (segscan_group_sizze_218939 *\n                                           sdiv_up64(partition_sizze_203577 *\n                                                     n_203490,\n                                                     sext_i32_i64(num_threads_234455))) -\n                                          (int64_t) 1));\n                \n                if (thread_active_234498 && inactive_234499) {\n                    x_218946 = x_218947;\n                }\n                if (thread_active_234498) {\n                    if (!inactive_234499) {\n                        double defunc_1_op_res_218948 = x_218946 + x_218947;\n                        \n                        x_218946 = defunc_1_op_res_218948;\n                    }\n                }\n            }\n            if (sle32(wave_sizze_234487, skip_threads_234497)) {\n                barrier(CLK_LOCAL_MEM_FENCE);\n            }\n            if (thread_active_234498) {\n                // write result\n                {\n                    ((volatile __local\n                      double *) scan_arr_mem_234489)[sext_i32_i64(local_tid_234485)] =\n                        x_218946;\n                    x_218947 = x_218946;\n                }\n            }\n            if (sle32(wave_sizze_234487, skip_threads_234497)) {\n                barrier(CLK_LOCAL_MEM_FENCE);\n            }\n            skip_threads_234497 *= 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_234485 - squot32(local_tid_234485, 32) * 32) == 31 &&\n            ltid_in_bounds_234496) {\n            ((volatile __local\n              double *) scan_arr_mem_234489)[sext_i32_i64(squot32(local_tid_234485,\n                                                                  32))] =\n                x_218946;\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_234500;\n        \n        // read input for in-block scan\n        {\n            if (squot32(local_tid_234485, 32) == 0 && ltid_in_bounds_234496) {\n                x_234494 = ((volatile __local\n                             double *) scan_arr_mem_234489)[sext_i32_i64(local_tid_234485)];\n                if ((local_tid_234485 - squot32(local_tid_234485, 32) * 32) ==\n                    0) {\n                    x_234493 = x_234494;\n                }\n            }\n        }\n        // in-block scan (hopefully no barriers needed)\n        {\n            skip_threads_234500 = 1;\n            while (slt32(skip_threads_234500, 32)) {\n                bool thread_active_234501 = sle32(skip_threads_234500,\n                                                  local_tid_234485 -\n                                                  squot32(local_tid_234485,\n                                                          32) * 32) &&\n                     (squot32(local_tid_234485, 32) == 0 &&\n                      ltid_in_bounds_234496);\n                \n                if (thread_active_234501) {\n                    // read operands\n                    {\n                        x_234493 = ((volatile __local\n                                     double *) scan_arr_mem_234489)[sext_i32_i64(local_tid_234485) -\n                                                                    sext_i32_i64(skip_threads_234500",
                   ")];\n                    }\n                }\n                // perform operation\n                {\n                    bool inactive_234502 =\n                         slt64(srem64((sext_i32_i64(local_tid_234485 * 32 + 32 -\n                                       1) + (int64_t) 1) *\n                                      (segscan_group_sizze_218939 *\n                                       sdiv_up64(partition_sizze_203577 *\n                                                 n_203490,\n                                                 sext_i32_i64(num_threads_234455))) -\n                                      (int64_t) 1, n_203490),\n                               (sext_i32_i64(local_tid_234485 * 32 + 32 - 1) +\n                                (int64_t) 1) * (segscan_group_sizze_218939 *\n                                                sdiv_up64(partition_sizze_203577 *\n                                                          n_203490,\n                                                          sext_i32_i64(num_threads_234455))) -\n                               (int64_t) 1 - ((sext_i32_i64((local_tid_234485 -\n                                                             skip_threads_234500) *\n                                               32 + 32 - 1) + (int64_t) 1) *\n                                              (segscan_group_sizze_218939 *\n                                               sdiv_up64(partition_sizze_203577 *\n                                                         n_203490,\n                                                         sext_i32_i64(num_threads_234455))) -\n                                              (int64_t) 1));\n                    \n                    if (thread_active_234501 && inactive_234502) {\n                        x_234493 = x_234494;\n                    }\n                    if (thread_active_234501) {\n                        if (!inactive_234502) {\n                            double defunc_1_op_res_234495 = x_234493 + x_234494;\n              ",
                   "              \n                            x_234493 = defunc_1_op_res_234495;\n                        }\n                    }\n                }\n                if (sle32(wave_sizze_234487, skip_threads_234500)) {\n                    barrier(CLK_LOCAL_MEM_FENCE);\n                }\n                if (thread_active_234501) {\n                    // write result\n                    {\n                        ((volatile __local\n                          double *) scan_arr_mem_234489)[sext_i32_i64(local_tid_234485)] =\n                            x_234493;\n                        x_234494 = x_234493;\n                    }\n                }\n                if (sle32(wave_sizze_234487, skip_threads_234500)) {\n                    barrier(CLK_LOCAL_MEM_FENCE);\n                }\n                skip_threads_234500 *= 2;\n            }\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    bool no_carry_in_234503 = squot32(local_tid_234485, 32) == 0 ||\n         !ltid_in_bounds_234496;\n    \n    // carry-in for every block except the first\n    {\n        // read operands\n        {\n            if (!no_carry_in_234503) {\n                x_218947 = x_218946;\n                x_218946 = ((__local\n                             double *) scan_arr_mem_234489)[sext_i32_i64(squot32(local_tid_234485,\n                                                                                 32)) -\n                                                            (int64_t) 1];\n            }\n        }\n        // perform operation\n        {\n            bool inactive_234504 =\n                 slt64(srem64((sext_i32_i64(local_tid_234485) + (int64_t) 1) *\n                              (segscan_group_sizze_218939 *\n                               sdiv_up64(partition_sizze_203577 * n_203490,\n                                         sext_i32_i64(num_threads_234455))) -\n                              (int64_t) 1, n_203490),\n                       (sext_i32_i64(local_tid_234485) + (int64_t) 1) *\n                       (s",
                   "egscan_group_sizze_218939 *\n                        sdiv_up64(partition_sizze_203577 * n_203490,\n                                  sext_i32_i64(num_threads_234455))) -\n                       (int64_t) 1 - ((sext_i32_i64(squot32(local_tid_234485,\n                                                            32) * 32 - 1) +\n                                       (int64_t) 1) *\n                                      (segscan_group_sizze_218939 *\n                                       sdiv_up64(partition_sizze_203577 *\n                                                 n_203490,\n                                                 sext_i32_i64(num_threads_234455))) -\n                                      (int64_t) 1));\n            \n            if (!no_carry_in_234503) {\n                if (inactive_234504) {\n                    x_218946 = x_218947;\n                }\n            }\n            if (!no_carry_in_234503) {\n                if (!inactive_234504) {\n                    double defunc_1_op_res_218948 = x_218946 + x_218947;\n                    \n                    x_218946 = defunc_1_op_res_218948;\n                }\n            }\n        }\n        // write final result\n        {\n            if (!no_carry_in_234503) {\n                ((__local\n                  double *) scan_arr_mem_234489)[sext_i32_i64(local_tid_234485)] =\n                    x_218946;\n            }\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    // restore correct values for first block\n    {\n        if (squot32(local_tid_234485, 32) == 0 && ltid_in_bounds_234496) {\n            ((__local\n              double *) scan_arr_mem_234489)[sext_i32_i64(local_tid_234485)] =\n                x_218947;\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    // threads in bounds write scanned carries\n    {\n        if (slt64(gtid_218943, partition_sizze_203577) && slt64(gtid_218944,\n                                                                n_203490)) {\n            double tmp_234505;\n            \n            t",
                   "mp_234505 = ((__local\n                           double *) scan_arr_mem_234489)[sext_i32_i64(local_tid_234485)];\n            ((__global double *) mem_230551)[gtid_218943 * n_203490 +\n                                             gtid_218944] = tmp_234505;\n        }\n    }\n    \n  error_0:\n    return;\n    #undef segscan_group_sizze_218939\n}\n__kernel void mainziscan_stage2_227915(__global int *global_failure,\n                                       __local volatile\n                                       int64_t *scan_arr_mem_236511_backing_aligned_0,\n                                       __local volatile\n                                       int64_t *scan_arr_mem_236509_backing_aligned_1,\n                                       __local volatile\n                                       int64_t *scan_arr_mem_236507_backing_aligned_2,\n                                       __local volatile\n                                       int64_t *scan_arr_mem_236505_backing_aligned_3,\n                                       int64_t n_203490,\n                                       int64_t partition_sizze_203577,\n                                       int64_t stage1_num_groups_236443,\n                                       int32_t num_threads_236444, __global\n                                       unsigned char *mem_231769, __global\n                                       unsigned char *mem_231773, __global\n                                       unsigned char *mem_231777, __global\n                                       unsigned char *mem_231781)\n{\n    #define segscan_group_sizze_227905 (mainzisegscan_group_sizze_227625)\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_236511_backing_3 =\n                                   (__local volatile\n                                    unsigned char *) scan_arr_mem_236511_backing_aligned_0;\n    __local volatile unsigned char *restrict scan_arr_mem_2",
                   "36509_backing_2 =\n                                   (__local volatile\n                                    unsigned char *) scan_arr_mem_236509_backing_aligned_1;\n    __local volatile unsigned char *restrict scan_arr_mem_236507_backing_1 =\n                                   (__local volatile\n                                    unsigned char *) scan_arr_mem_236507_backing_aligned_2;\n    __local volatile unsigned char *restrict scan_arr_mem_236505_backing_0 =\n                                   (__local volatile\n                                    unsigned char *) scan_arr_mem_236505_backing_aligned_3;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_236500;\n    int32_t local_tid_236501;\n    int64_t group_sizze_236504;\n    int32_t wave_sizze_236503;\n    int32_t group_tid_236502;\n    \n    global_tid_236500 = get_global_id(0);\n    local_tid_236501 = get_local_id(0);\n    group_sizze_236504 = get_local_size(0);\n    wave_sizze_236503 = LOCKSTEP_WIDTH;\n    group_tid_236502 = get_group_id(0);\n    \n    int32_t phys_tid_227915 = global_tid_236500;\n    __local unsigned char *scan_arr_mem_236505;\n    __local unsigned char *scan_arr_mem_236507;\n    __local unsigned char *scan_arr_mem_236509;\n    __local unsigned char *scan_arr_mem_236511;\n    \n    scan_arr_mem_236505 = (__local\n                           unsigned char *) scan_arr_mem_236505_backing_0;\n    scan_arr_mem_236507 = (__local\n                           unsigned char *) scan_arr_mem_236507_backing_1;\n    scan_arr_mem_236509 = (__local\n                           unsigned char *) scan_arr_mem_236509_backing_2;\n    scan_arr_mem_236511 = (__local\n                           unsigned char *) scan_arr_mem_236511_backing_3;\n    \n    int64_t flat_idx_236513 = (sext_i32_i64(local_tid_236501) + (int64_t) 1) *\n            (segscan_group_sizze_227905 * sdiv_up64(partition_sizze_203577 *\n                                                    n_203490,\n                                                    sext_i",
                   "32_i64(num_threads_236444))) -\n            (int64_t) 1;\n    int64_t gtid_227913 = squot64(flat_idx_236513, n_203490);\n    int64_t gtid_227914 = flat_idx_236513 - squot64(flat_idx_236513, n_203490) *\n            n_203490;\n    \n    // threads in bound read carries; others get neutral element\n    {\n        if (slt64(gtid_227913, partition_sizze_203577) && slt64(gtid_227914,\n                                                                n_203490)) {\n            int64_t tmp_236514;\n            \n            tmp_236514 = ((__global int64_t *) mem_231769)[gtid_227913 *\n                                                           n_203490 +\n                                                           gtid_227914];\n            ((__local\n              int64_t *) scan_arr_mem_236505)[sext_i32_i64(local_tid_236501)] =\n                tmp_236514;\n            \n            int64_t tmp_236515;\n            \n            tmp_236515 = ((__global int64_t *) mem_231773)[gtid_227913 *\n                                                           n_203490 +\n                                                           gtid_227914];\n            ((__local\n              int64_t *) scan_arr_mem_236507)[sext_i32_i64(local_tid_236501)] =\n                tmp_236515;\n            \n            int64_t tmp_236516;\n            \n            tmp_236516 = ((__global int64_t *) mem_231777)[gtid_227913 *\n                                                           n_203490 +\n                                                           gtid_227914];\n            ((__local\n              int64_t *) scan_arr_mem_236509)[sext_i32_i64(local_tid_236501)] =\n                tmp_236516;\n            \n            int64_t tmp_236517;\n            \n            tmp_236517 = ((__global int64_t *) mem_231781)[gtid_227913 *\n                                                           n_203490 +\n                                                           gtid_227914];\n            ((__local\n              int64_t *) scan_arr_mem_236511)[sext_i32",
                   "_i64(local_tid_236501)] =\n                tmp_236517;\n        } else {\n            ((__local\n              int64_t *) scan_arr_mem_236505)[sext_i32_i64(local_tid_236501)] =\n                (int64_t) 0;\n            ((__local\n              int64_t *) scan_arr_mem_236507)[sext_i32_i64(local_tid_236501)] =\n                (int64_t) 0;\n            ((__local\n              int64_t *) scan_arr_mem_236509)[sext_i32_i64(local_tid_236501)] =\n                (int64_t) 0;\n            ((__local\n              int64_t *) scan_arr_mem_236511)[sext_i32_i64(local_tid_236501)] =\n                (int64_t) 0;\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int64_t x_227916;\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_236518;\n    int64_t x_236519;\n    int64_t x_236520;\n    int64_t x_236521;\n    int64_t x_236522;\n    int64_t x_236523;\n    int64_t x_236524;\n    int64_t x_236525;\n    bool ltid_in_bounds_236530 = slt64(sext_i32_i64(local_tid_236501),\n                                       stage1_num_groups_236443);\n    int32_t skip_threads_236531;\n    \n    // read input for in-block scan\n    {\n        if (ltid_in_bounds_236530) {\n            x_227920 = ((volatile __local\n                         int64_t *) scan_arr_mem_236505)[sext_i32_i64(local_tid_236501)];\n            x_227921 = ((volatile __local\n                         int64_t *) scan_arr_mem_236507)[sext_i32_i64(local_tid_236501)];\n            x_227922 = ((volatile __local\n                         int64_t *) scan_arr_mem_236509)[sext_i32_i64(local_tid_236501)];\n            x_227923 = ((volatile __local\n                         int64_t *) scan_arr_mem_236511)[sext_i32_i64(local_tid_236501)];\n            if ((local_tid_236501 - squot32(local_tid_236501, 32) * 32) == 0) {\n                x_227916 = x_227920;\n                x_227917 = x_227921;\n                x_227918 = x_227922;\n                x_227919 ",
                   "= x_227923;\n            }\n        }\n    }\n    // in-block scan (hopefully no barriers needed)\n    {\n        skip_threads_236531 = 1;\n        while (slt32(skip_threads_236531, 32)) {\n            bool thread_active_236532 = sle32(skip_threads_236531,\n                                              local_tid_236501 -\n                                              squot32(local_tid_236501, 32) *\n                                              32) && ltid_in_bounds_236530;\n            \n            if (thread_active_236532) {\n                // read operands\n                {\n                    x_227916 = ((volatile __local\n                                 int64_t *) scan_arr_mem_236505)[sext_i32_i64(local_tid_236501) -\n                                                                 sext_i32_i64(skip_threads_236531)];\n                    x_227917 = ((volatile __local\n                                 int64_t *) scan_arr_mem_236507)[sext_i32_i64(local_tid_236501) -\n                                                                 sext_i32_i64(skip_threads_236531)];\n                    x_227918 = ((volatile __local\n                                 int64_t *) scan_arr_mem_236509)[sext_i32_i64(local_tid_236501) -\n                                                                 sext_i32_i64(skip_threads_236531)];\n                    x_227919 = ((volatile __local\n                                 int64_t *) scan_arr_mem_236511)[sext_i32_i64(local_tid_236501) -\n                                                                 sext_i32_i64(skip_threads_236531)];\n                }\n            }\n            // perform operation\n            {\n                bool inactive_236533 =\n                     slt64(srem64((sext_i32_i64(local_tid_236501) +\n                                   (int64_t) 1) * (segscan_group_sizze_227905 *\n                                                   sdiv_up64(partition_sizze_203577 *\n                                                             n_203490,\n         ",
                   "                                                    sext_i32_i64(num_threads_236444))) -\n                                  (int64_t) 1, n_203490),\n                           (sext_i32_i64(local_tid_236501) + (int64_t) 1) *\n                           (segscan_group_sizze_227905 *\n                            sdiv_up64(partition_sizze_203577 * n_203490,\n                                      sext_i32_i64(num_threads_236444))) -\n                           (int64_t) 1 - ((sext_i32_i64(local_tid_236501 -\n                                           skip_threads_236531) + (int64_t) 1) *\n                                          (segscan_group_sizze_227905 *\n                                           sdiv_up64(partition_sizze_203577 *\n                                                     n_203490,\n                                                     sext_i32_i64(num_threads_236444))) -\n                                          (int64_t) 1));\n                \n                if (thread_active_236532 && inactive_236533) {\n                    x_227916 = x_227920;\n                    x_227917 = x_227921;\n                    x_227918 = x_227922;\n                    x_227919 = x_227923;\n                }\n                if (thread_active_236532) {\n                    if (!inactive_236533) {\n                        int64_t defunc_1_op_res_227924 = add64(x_227916,\n                                                               x_227920);\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                        \n                        x_227916 = defunc_1_op_res_227924;\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                    }\n                }\n            }\n            if (sle32(wave_sizze_236503, skip_threads_236531)) {\n                barrier(CLK_LOCAL_MEM_FENCE);\n            }\n            if (thread_active_236532) {\n                // write result\n                {\n                    ((volatile __local\n                      int64_t *) scan_arr_mem_236505)[sext_i32_i64(local_tid_236501)] =\n                        x_227916;\n                    x_227920 = x_227916;\n                    ((volatile __local\n                      int64_t *) scan_arr_mem_236507)[sext_i32_i64(local_tid_236501)] =\n                        x_227917;\n                    x_227921 = x_227917;\n                    ((volatile __local\n                      int64_t *) scan_arr_mem_236509)[sext_i32_i64(local_tid_236501)] =\n                        x_227918;\n                    x_227922 = x_227918;\n                    ((volatile __local\n                      int64_t *) scan_arr_mem_236511)[sext_i32_i64(local_tid_236501)] =\n                        x_227919;\n                    x_227923 = x_227919;\n                }\n            }\n            if (sle32(wave_sizze_236503, skip_threads_236531)) {\n                barrier(CLK_LOCAL_MEM_FENCE);\n            }\n            skip_threads_236531 *= 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_236501 - squot32(local_tid_236501, 32) * 32) == 31 &&\n            ltid_in_bounds_236530) {\n            ((volatile __local\n              int64_t *) scan_arr_mem_236505)[sext_i32_i64(squot32(local_tid_236501,\n                                                                   32))] =\n                x_227916;\n            ((volatile __local\n              int64_t *) scan_arr_mem_236507)[sext_i32_i64(squot32(local_tid_236501,\n                  ",
                   "                                                 32))] =\n                x_227917;\n            ((volatile __local\n              int64_t *) scan_arr_mem_236509)[sext_i32_i64(squot32(local_tid_236501,\n                                                                   32))] =\n                x_227918;\n            ((volatile __local\n              int64_t *) scan_arr_mem_236511)[sext_i32_i64(squot32(local_tid_236501,\n                                                                   32))] =\n                x_227919;\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_236534;\n        \n        // read input for in-block scan\n        {\n            if (squot32(local_tid_236501, 32) == 0 && ltid_in_bounds_236530) {\n                x_236522 = ((volatile __local\n                             int64_t *) scan_arr_mem_236505)[sext_i32_i64(local_tid_236501)];\n                x_236523 = ((volatile __local\n                             int64_t *) scan_arr_mem_236507)[sext_i32_i64(local_tid_236501)];\n                x_236524 = ((volatile __local\n                             int64_t *) scan_arr_mem_236509)[sext_i32_i64(local_tid_236501)];\n                x_236525 = ((volatile __local\n                             int64_t *) scan_arr_mem_236511)[sext_i32_i64(local_tid_236501)];\n                if ((local_tid_236501 - squot32(local_tid_236501, 32) * 32) ==\n                    0) {\n                    x_236518 = x_236522;\n                    x_236519 = x_236523;\n                    x_236520 = x_236524;\n                    x_236521 = x_236525;\n                }\n            }\n        }\n        // in-block scan (hopefully no barriers needed)\n        {\n            skip_threads_236534 = 1;\n            while (slt32(skip_threads_236534, 32)) {\n                bool thread_active_236535 = sle32(skip_threads_236534,\n                                                  local_tid_236501 -\n",
                   "                                                  squot32(local_tid_236501,\n                                                          32) * 32) &&\n                     (squot32(local_tid_236501, 32) == 0 &&\n                      ltid_in_bounds_236530);\n                \n                if (thread_active_236535) {\n                    // read operands\n                    {\n                        x_236518 = ((volatile __local\n                                     int64_t *) scan_arr_mem_236505)[sext_i32_i64(local_tid_236501) -\n                                                                     sext_i32_i64(skip_threads_236534)];\n                        x_236519 = ((volatile __local\n                                     int64_t *) scan_arr_mem_236507)[sext_i32_i64(local_tid_236501) -\n                                                                     sext_i32_i64(skip_threads_236534)];\n                        x_236520 = ((volatile __local\n                                     int64_t *) scan_arr_mem_236509)[sext_i32_i64(local_tid_236501) -\n                                                                     sext_i32_i64(skip_threads_236534)];\n                        x_236521 = ((volatile __local\n                                     int64_t *) scan_arr_mem_236511)[sext_i32_i64(local_tid_236501) -\n                                                                     sext_i32_i64(skip_threads_236534)];\n                    }\n                }\n                // perform operation\n                {\n                    bool inactive_236536 =\n                         slt64(srem64((sext_i32_i64(local_tid_236501 * 32 + 32 -\n                                       1) + (int64_t) 1) *\n                                      (segscan_group_sizze_227905 *\n                                       sdiv_up64(partition_sizze_203577 *\n                                                 n_203490,\n                                                 sext_i32_i64(num_threads_236444))) -\n                  ",
                   "                    (int64_t) 1, n_203490),\n                               (sext_i32_i64(local_tid_236501 * 32 + 32 - 1) +\n                                (int64_t) 1) * (segscan_group_sizze_227905 *\n                                                sdiv_up64(partition_sizze_203577 *\n                                                          n_203490,\n                                                          sext_i32_i64(num_threads_236444))) -\n                               (int64_t) 1 - ((sext_i32_i64((local_tid_236501 -\n                                                             skip_threads_236534) *\n                                               32 + 32 - 1) + (int64_t) 1) *\n                                              (segscan_group_sizze_227905 *\n                                               sdiv_up64(partition_sizze_203577 *\n                                                         n_203490,\n                                                         sext_i32_i64(num_threads_236444))) -\n                                              (int64_t) 1));\n                    \n                    if (thread_active_236535 && inactive_236536) {\n                        x_236518 = x_236522;\n                        x_236519 = x_236523;\n                        x_236520 = x_236524;\n                        x_236521 = x_236525;\n                    }\n                    if (thread_active_236535) {\n                        if (!inactive_236536) {\n                            int64_t defunc_1_op_res_236526 = add64(x_236518,\n                                                                   x_236522);\n                            int64_t defunc_1_op_res_236527 = add64(x_236519,\n                                                                   x_236523);\n                            int64_t defunc_1_op_res_236528 = add64(x_236520,\n                                                                   x_236524);\n                            int64_t defunc_1_op_res_236529 = add64(x_236521,\n     ",
                   "                                                              x_236525);\n                            \n                            x_236518 = defunc_1_op_res_236526;\n                            x_236519 = defunc_1_op_res_236527;\n                            x_236520 = defunc_1_op_res_236528;\n                            x_236521 = defunc_1_op_res_236529;\n                        }\n                    }\n                }\n                if (sle32(wave_sizze_236503, skip_threads_236534)) {\n                    barrier(CLK_LOCAL_MEM_FENCE);\n                }\n                if (thread_active_236535) {\n                    // write result\n                    {\n                        ((volatile __local\n                          int64_t *) scan_arr_mem_236505)[sext_i32_i64(local_tid_236501)] =\n                            x_236518;\n                        x_236522 = x_236518;\n                        ((volatile __local\n                          int64_t *) scan_arr_mem_236507)[sext_i32_i64(local_tid_236501)] =\n                            x_236519;\n                        x_236523 = x_236519;\n                        ((volatile __local\n                          int64_t *) scan_arr_mem_236509)[sext_i32_i64(local_tid_236501)] =\n                            x_236520;\n                        x_236524 = x_236520;\n                        ((volatile __local\n                          int64_t *) scan_arr_mem_236511)[sext_i32_i64(local_tid_236501)] =\n                            x_236521;\n                        x_236525 = x_236521;\n                    }\n                }\n                if (sle32(wave_sizze_236503, skip_threads_236534)) {\n                    barrier(CLK_LOCAL_MEM_FENCE);\n                }\n                skip_threads_236534 *= 2;\n            }\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    bool no_carry_in_236537 = squot32(local_tid_236501, 32) == 0 ||\n         !ltid_in_bounds_236530;\n    \n    // carry-in for every block except the first\n    {\n        // read oper",
                   "ands\n        {\n            if (!no_carry_in_236537) {\n                x_227920 = x_227916;\n                x_227921 = x_227917;\n                x_227922 = x_227918;\n                x_227923 = x_227919;\n                x_227916 = ((__local\n                             int64_t *) scan_arr_mem_236505)[sext_i32_i64(squot32(local_tid_236501,\n                                                                                  32)) -\n                                                             (int64_t) 1];\n                x_227917 = ((__local\n                             int64_t *) scan_arr_mem_236507)[sext_i32_i64(squot32(local_tid_236501,\n                                                                                  32)) -\n                                                             (int64_t) 1];\n                x_227918 = ((__local\n                             int64_t *) scan_arr_mem_236509)[sext_i32_i64(squot32(local_tid_236501,\n                                                                                  32)) -\n                                                             (int64_t) 1];\n                x_227919 = ((__local\n                             int64_t *) scan_arr_mem_236511)[sext_i32_i64(squot32(local_tid_236501,\n                                                                                  32)) -\n                                                             (int64_t) 1];\n            }\n        }\n        // perform operation\n        {\n            bool inactive_236538 =\n                 slt64(srem64((sext_i32_i64(local_tid_236501) + (int64_t) 1) *\n                              (segscan_group_sizze_227905 *\n                               sdiv_up64(partition_sizze_203577 * n_203490,\n                                         sext_i32_i64(num_threads_236444))) -\n                              (int64_t) 1, n_203490),\n                       (sext_i32_i64(local_tid_236501) + (int64_t) 1) *\n                       (segscan_group_sizze_227905 *\n                        ",
                   "sdiv_up64(partition_sizze_203577 * n_203490,\n                                  sext_i32_i64(num_threads_236444))) -\n                       (int64_t) 1 - ((sext_i32_i64(squot32(local_tid_236501,\n                                                            32) * 32 - 1) +\n                                       (int64_t) 1) *\n                                      (segscan_group_sizze_227905 *\n                                       sdiv_up64(partition_sizze_203577 *\n                                                 n_203490,\n                                                 sext_i32_i64(num_threads_236444))) -\n                                      (int64_t) 1));\n            \n            if (!no_carry_in_236537) {\n                if (inactive_236538) {\n                    x_227916 = x_227920;\n                    x_227917 = x_227921;\n                    x_227918 = x_227922;\n                    x_227919 = x_227923;\n                }\n            }\n            if (!no_carry_in_236537) {\n                if (!inactive_236538) {\n                    int64_t defunc_1_op_res_227924 = add64(x_227916, x_227920);\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                    \n                    x_227916 = defunc_1_op_res_227924;\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                }\n            }\n        }\n        // write final result\n        {\n            if (!no_carry_in_236537) {\n                ((__local\n                  int64_t *) scan_arr_mem_236505)[sext_i32_i64(local_tid_236501)] =\n                    x_227916;\n                ((__local\n                  int64_t *) scan_arr_mem_236507)[sext_i32_i64(local_tid_236501)] =\n                    x_227917;\n        ",
                   "        ((__local\n                  int64_t *) scan_arr_mem_236509)[sext_i32_i64(local_tid_236501)] =\n                    x_227918;\n                ((__local\n                  int64_t *) scan_arr_mem_236511)[sext_i32_i64(local_tid_236501)] =\n                    x_227919;\n            }\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    // restore correct values for first block\n    {\n        if (squot32(local_tid_236501, 32) == 0 && ltid_in_bounds_236530) {\n            ((__local\n              int64_t *) scan_arr_mem_236505)[sext_i32_i64(local_tid_236501)] =\n                x_227920;\n            ((__local\n              int64_t *) scan_arr_mem_236507)[sext_i32_i64(local_tid_236501)] =\n                x_227921;\n            ((__local\n              int64_t *) scan_arr_mem_236509)[sext_i32_i64(local_tid_236501)] =\n                x_227922;\n            ((__local\n              int64_t *) scan_arr_mem_236511)[sext_i32_i64(local_tid_236501)] =\n                x_227923;\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    // threads in bounds write scanned carries\n    {\n        if (slt64(gtid_227913, partition_sizze_203577) && slt64(gtid_227914,\n                                                                n_203490)) {\n            int64_t tmp_236539;\n            \n            tmp_236539 = ((__local\n                           int64_t *) scan_arr_mem_236505)[sext_i32_i64(local_tid_236501)];\n            ((__global int64_t *) mem_231769)[gtid_227913 * n_203490 +\n                                              gtid_227914] = tmp_236539;\n            \n            int64_t tmp_236540;\n            \n            tmp_236540 = ((__local\n                           int64_t *) scan_arr_mem_236507)[sext_i32_i64(local_tid_236501)];\n            ((__global int64_t *) mem_231773)[gtid_227913 * n_203490 +\n                                              gtid_227914] = tmp_236540;\n            \n            int64_t tmp_236541;\n            \n            tmp_236541 = ((__local\n                           int",
                   "64_t *) scan_arr_mem_236509)[sext_i32_i64(local_tid_236501)];\n            ((__global int64_t *) mem_231777)[gtid_227913 * n_203490 +\n                                              gtid_227914] = tmp_236541;\n            \n            int64_t tmp_236542;\n            \n            tmp_236542 = ((__local\n                           int64_t *) scan_arr_mem_236511)[sext_i32_i64(local_tid_236501)];\n            ((__global int64_t *) mem_231781)[gtid_227913 * n_203490 +\n                                              gtid_227914] = tmp_236542;\n        }\n    }\n    \n  error_0:\n    return;\n    #undef segscan_group_sizze_227905\n}\n__kernel void mainziscan_stage3_206867(__global int *global_failure,\n                                       int64_t m_203489,\n                                       int64_t num_groups_206864,\n                                       int32_t num_threads_232253,\n                                       int32_t required_groups_232300, __global\n                                       unsigned char *mem_229152)\n{\n    #define segscan_group_sizze_206862 (mainzisegscan_group_sizze_206861)\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_232301;\n    int32_t local_tid_232302;\n    int64_t group_sizze_232305;\n    int32_t wave_sizze_232304;\n    int32_t group_tid_232303;\n    \n    global_tid_232301 = get_global_id(0);\n    local_tid_232302 = get_local_id(0);\n    group_sizze_232305 = get_local_size(0);\n    wave_sizze_232304 = LOCKSTEP_WIDTH;\n    group_tid_232303 = get_group_id(0);\n    \n    int32_t phys_tid_206867 = global_tid_232301;\n    int32_t phys_group_id_232306;\n    \n    phys_group_id_232306 = get_group_id(0);\n    for (int32_t i_232307 = 0; i_232307 < sdiv_up32(required_groups_232300 -\n                                                    phys_group_id_232306,\n                                                    sext_i64_i32(num_groups_206864));\n         i",
                   "_232307++) {\n        int32_t virt_group_id_232308 = phys_group_id_232306 + i_232307 *\n                sext_i64_i32(num_groups_206864);\n        int64_t flat_idx_232309 = sext_i32_i64(virt_group_id_232308) *\n                segscan_group_sizze_206862 + sext_i32_i64(local_tid_232302);\n        int64_t gtid_206866 = flat_idx_232309;\n        int64_t orig_group_232310 = squot64(flat_idx_232309,\n                                            segscan_group_sizze_206862 *\n                                            sdiv_up64(m_203489,\n                                                      sext_i32_i64(num_threads_232253)));\n        int64_t carry_in_flat_idx_232311 = orig_group_232310 *\n                (segscan_group_sizze_206862 * sdiv_up64(m_203489,\n                                                        sext_i32_i64(num_threads_232253))) -\n                (int64_t) 1;\n        \n        if (slt64(gtid_206866, m_203489)) {\n            if (!(orig_group_232310 == (int64_t) 0 || flat_idx_232309 ==\n                  (orig_group_232310 + (int64_t) 1) *\n                  (segscan_group_sizze_206862 * sdiv_up64(m_203489,\n                                                          sext_i32_i64(num_threads_232253))) -\n                  (int64_t) 1)) {\n                int64_t x_203544;\n                int64_t y_203545;\n                \n                x_203544 = ((__global\n                             int64_t *) mem_229152)[carry_in_flat_idx_232311];\n                y_203545 = ((__global int64_t *) mem_229152)[gtid_206866];\n                \n                int64_t zz_203546 = x_203544 + y_203545;\n                \n                x_203544 = zz_203546;\n                ((__global int64_t *) mem_229152)[gtid_206866] = x_203544;\n            }\n        }\n        barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n    }\n    \n  error_0:\n    return;\n    #undef segscan_group_sizze_206862\n}\n__kernel void mainziscan_stage3_207007(__global int *global_failure,\n                                       int64_",
                   "t n_203490,\n                                       int64_t partition_sizze_203577,\n                                       int64_t num_groups_207002,\n                                       int32_t num_threads_232354,\n                                       int32_t required_groups_232405, __global\n                                       unsigned char *mem_229186)\n{\n    #define segscan_group_sizze_207001 (mainzisegscan_group_sizze_206981)\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_232406;\n    int32_t local_tid_232407;\n    int64_t group_sizze_232410;\n    int32_t wave_sizze_232409;\n    int32_t group_tid_232408;\n    \n    global_tid_232406 = get_global_id(0);\n    local_tid_232407 = get_local_id(0);\n    group_sizze_232410 = get_local_size(0);\n    wave_sizze_232409 = LOCKSTEP_WIDTH;\n    group_tid_232408 = get_group_id(0);\n    \n    int32_t phys_tid_207007 = global_tid_232406;\n    int32_t phys_group_id_232411;\n    \n    phys_group_id_232411 = get_group_id(0);\n    for (int32_t i_232412 = 0; i_232412 < sdiv_up32(required_groups_232405 -\n                                                    phys_group_id_232411,\n                                                    sext_i64_i32(num_groups_207002));\n         i_232412++) {\n        int32_t virt_group_id_232413 = phys_group_id_232411 + i_232412 *\n                sext_i64_i32(num_groups_207002);\n        int64_t flat_idx_232414 = sext_i32_i64(virt_group_id_232413) *\n                segscan_group_sizze_207001 + sext_i32_i64(local_tid_232407);\n        int64_t gtid_207005 = squot64(flat_idx_232414, n_203490);\n        int64_t gtid_207006 = flat_idx_232414 - squot64(flat_idx_232414,\n                                                        n_203490) * n_203490;\n        int64_t orig_group_232415 = squot64(flat_idx_232414,\n                                            segscan_group_sizze_207001 *\n                            ",
                   "                sdiv_up64(partition_sizze_203577 *\n                                                      n_203490,\n                                                      sext_i32_i64(num_threads_232354)));\n        int64_t carry_in_flat_idx_232416 = orig_group_232415 *\n                (segscan_group_sizze_207001 * sdiv_up64(partition_sizze_203577 *\n                                                        n_203490,\n                                                        sext_i32_i64(num_threads_232354))) -\n                (int64_t) 1;\n        \n        if (slt64(gtid_207005, partition_sizze_203577) && slt64(gtid_207006,\n                                                                n_203490)) {\n            if (!(orig_group_232415 == (int64_t) 0 || (flat_idx_232414 ==\n                                                       (orig_group_232415 +\n                                                        (int64_t) 1) *\n                                                       (segscan_group_sizze_207001 *\n                                                        sdiv_up64(partition_sizze_203577 *\n                                                                  n_203490,\n                                                                  sext_i32_i64(num_threads_232354))) -\n                                                       (int64_t) 1 ||\n                                                       slt64(srem64(flat_idx_232414,\n                                                                    n_203490),\n                                                             flat_idx_232414 -\n                                                             carry_in_flat_idx_232416)))) {\n                int64_t x_207008;\n                int64_t x_207009;\n                \n                x_207008 = ((__global\n                             int64_t *) mem_229186)[squot64(carry_in_flat_idx_232416,\n                                                            n_203490) *\n                                      ",
                   "              n_203490 +\n                                                    (carry_in_flat_idx_232416 -\n                                                     squot64(carry_in_flat_idx_232416,\n                                                             n_203490) *\n                                                     n_203490)];\n                x_207009 = ((__global int64_t *) mem_229186)[gtid_207005 *\n                                                             n_203490 +\n                                                             gtid_207006];\n                \n                int64_t defunc_1_op_res_207010 = add64(x_207008, x_207009);\n                \n                x_207008 = defunc_1_op_res_207010;\n                ((__global int64_t *) mem_229186)[gtid_207005 * n_203490 +\n                                                  gtid_207006] = x_207008;\n            }\n        }\n        barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n    }\n    \n  error_0:\n    return;\n    #undef segscan_group_sizze_207001\n}\n__kernel void mainziscan_stage3_207559(__global int *global_failure,\n                                       int64_t n_p_203492,\n                                       int64_t partition_sizze_203577,\n                                       int64_t defunc_0_f_res_203631,\n                                       int64_t num_groups_207553,\n                                       int32_t num_threads_232523,\n                                       int32_t required_groups_232574, __global\n                                       unsigned char *mem_229250)\n{\n    #define segscan_group_sizze_207552 (mainzisegscan_group_sizze_207419)\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_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_207559 = global_tid_232575;\n    int32_t phys_group_id_232580;\n    \n    phys_group_id_232580 = get_group_id(0);\n    for (int32_t i_232581 = 0; i_232581 < sdiv_up32(required_groups_232574 -\n                                                    phys_group_id_232580,\n                                                    sext_i64_i32(num_groups_207553));\n         i_232581++) {\n        int32_t virt_group_id_232582 = phys_group_id_232580 + i_232581 *\n                sext_i64_i32(num_groups_207553);\n        int64_t flat_idx_232583 = sext_i32_i64(virt_group_id_232582) *\n                segscan_group_sizze_207552 + sext_i32_i64(local_tid_232576);\n        int64_t gtid_207556 = squot64(flat_idx_232583, n_p_203492 *\n                                      defunc_0_f_res_203631);\n        int64_t gtid_207557 = squot64(flat_idx_232583 - squot64(flat_idx_232583,\n                                                                n_p_203492 *\n                                                                defunc_0_f_res_203631) *\n                                      (n_p_203492 * defunc_0_f_res_203631),\n                                      defunc_0_f_res_203631);\n        int64_t gtid_207558 = flat_idx_232583 - squot64(flat_idx_232583,\n                                                        n_p_203492 *\n                                                        defunc_0_f_res_203631) *\n                (n_p_203492 * defunc_0_f_res_203631) - squot64(flat_idx_232583 -\n                                                               squot64(flat_idx_232583,\n                                                                       n_p_203492 *\n                                                                       defunc_0_f_res_203631) *\n                                                               (n_p_203492 *\n       ",
                   "                                                         defunc_0_f_res_203631),\n                                                               defunc_0_f_res_203631) *\n                defunc_0_f_res_203631;\n        int64_t orig_group_232584 = squot64(flat_idx_232583,\n                                            segscan_group_sizze_207552 *\n                                            sdiv_up64(partition_sizze_203577 *\n                                                      n_p_203492 *\n                                                      defunc_0_f_res_203631,\n                                                      sext_i32_i64(num_threads_232523)));\n        int64_t carry_in_flat_idx_232585 = orig_group_232584 *\n                (segscan_group_sizze_207552 * sdiv_up64(partition_sizze_203577 *\n                                                        n_p_203492 *\n                                                        defunc_0_f_res_203631,\n                                                        sext_i32_i64(num_threads_232523))) -\n                (int64_t) 1;\n        \n        if ((slt64(gtid_207556, partition_sizze_203577) && slt64(gtid_207557,\n                                                                 n_p_203492)) &&\n            slt64(gtid_207558, defunc_0_f_res_203631)) {\n            if (!(orig_group_232584 == (int64_t) 0 || (flat_idx_232583 ==\n                                                       (orig_group_232584 +\n                                                        (int64_t) 1) *\n                                                       (segscan_group_sizze_207552 *\n                                                        sdiv_up64(partition_sizze_203577 *\n                                                                  n_p_203492 *\n                                                                  defunc_0_f_res_203631,\n                                                                  sext_i32_i64(num_threads_232523))) -\n                                      ",
                   "                 (int64_t) 1 ||\n                                                       slt64(srem64(flat_idx_232583,\n                                                                    defunc_0_f_res_203631),\n                                                             flat_idx_232583 -\n                                                             carry_in_flat_idx_232585)))) {\n                int64_t x_207560;\n                int64_t x_207561;\n                \n                x_207560 = ((__global\n                             int64_t *) mem_229250)[squot64(carry_in_flat_idx_232585,\n                                                            n_p_203492 *\n                                                            defunc_0_f_res_203631) *\n                                                    (defunc_0_f_res_203631 *\n                                                     n_p_203492) +\n                                                    squot64(carry_in_flat_idx_232585 -\n                                                            squot64(carry_in_flat_idx_232585,\n                                                                    n_p_203492 *\n                                                                    defunc_0_f_res_203631) *\n                                                            (n_p_203492 *\n                                                             defunc_0_f_res_203631),\n                                                            defunc_0_f_res_203631) *\n                                                    defunc_0_f_res_203631 +\n                                                    (carry_in_flat_idx_232585 -\n                                                     squot64(carry_in_flat_idx_232585,\n                                                             n_p_203492 *\n                                                             defunc_0_f_res_203631) *\n                                                     (n_p_203492 *\n                                        ",
                   "              defunc_0_f_res_203631) -\n                                                     squot64(carry_in_flat_idx_232585 -\n                                                             squot64(carry_in_flat_idx_232585,\n                                                                     n_p_203492 *\n                                                                     defunc_0_f_res_203631) *\n                                                             (n_p_203492 *\n                                                              defunc_0_f_res_203631),\n                                                             defunc_0_f_res_203631) *\n                                                     defunc_0_f_res_203631)];\n                x_207561 = ((__global int64_t *) mem_229250)[gtid_207556 *\n                                                             (defunc_0_f_res_203631 *\n                                                              n_p_203492) +\n                                                             gtid_207557 *\n                                                             defunc_0_f_res_203631 +\n                                                             gtid_207558];\n                \n                int64_t defunc_1_op_res_207562 = add64(x_207560, x_207561);\n                \n                x_207560 = defunc_1_op_res_207562;\n                ((__global int64_t *) mem_229250)[gtid_207556 *\n                                                  (defunc_0_f_res_203631 *\n                                                   n_p_203492) + gtid_207557 *\n                                                  defunc_0_f_res_203631 +\n                                                  gtid_207558] = x_207560;\n            }\n        }\n        barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n    }\n    \n  error_0:\n    return;\n    #undef segscan_group_sizze_207552\n}\n__kernel void mainziscan_stage3_218683(__global int *global_failure,\n                                       int64_t pa",
                   "rtition_sizze_203577,\n                                       int64_t lifted_single_ma_l_arg_204134,\n                                       int64_t num_groups_218678,\n                                       int32_t num_threads_234169,\n                                       int32_t required_groups_234220, __global\n                                       unsigned char *mem_230517)\n{\n    #define segscan_group_sizze_218677 (mainzisegscan_group_sizze_218641)\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_234221;\n    int32_t local_tid_234222;\n    int64_t group_sizze_234225;\n    int32_t wave_sizze_234224;\n    int32_t group_tid_234223;\n    \n    global_tid_234221 = get_global_id(0);\n    local_tid_234222 = get_local_id(0);\n    group_sizze_234225 = get_local_size(0);\n    wave_sizze_234224 = LOCKSTEP_WIDTH;\n    group_tid_234223 = get_group_id(0);\n    \n    int32_t phys_tid_218683 = global_tid_234221;\n    int32_t phys_group_id_234226;\n    \n    phys_group_id_234226 = get_group_id(0);\n    for (int32_t i_234227 = 0; i_234227 < sdiv_up32(required_groups_234220 -\n                                                    phys_group_id_234226,\n                                                    sext_i64_i32(num_groups_218678));\n         i_234227++) {\n        int32_t virt_group_id_234228 = phys_group_id_234226 + i_234227 *\n                sext_i64_i32(num_groups_218678);\n        int64_t flat_idx_234229 = sext_i32_i64(virt_group_id_234228) *\n                segscan_group_sizze_218677 + sext_i32_i64(local_tid_234222);\n        int64_t gtid_218681 = squot64(flat_idx_234229,\n                                      lifted_single_ma_l_arg_204134);\n        int64_t gtid_218682 = flat_idx_234229 - squot64(flat_idx_234229,\n                                                        lifted_single_ma_l_arg_204134) *\n                lifted_single_ma_l_arg_204134;\n        int64_t orig_group_2",
                   "34230 = squot64(flat_idx_234229,\n                                            segscan_group_sizze_218677 *\n                                            sdiv_up64(partition_sizze_203577 *\n                                                      lifted_single_ma_l_arg_204134,\n                                                      sext_i32_i64(num_threads_234169)));\n        int64_t carry_in_flat_idx_234231 = orig_group_234230 *\n                (segscan_group_sizze_218677 * sdiv_up64(partition_sizze_203577 *\n                                                        lifted_single_ma_l_arg_204134,\n                                                        sext_i32_i64(num_threads_234169))) -\n                (int64_t) 1;\n        \n        if (slt64(gtid_218681, partition_sizze_203577) && slt64(gtid_218682,\n                                                                lifted_single_ma_l_arg_204134)) {\n            if (!(orig_group_234230 == (int64_t) 0 || (flat_idx_234229 ==\n                                                       (orig_group_234230 +\n                                                        (int64_t) 1) *\n                                                       (segscan_group_sizze_218677 *\n                                                        sdiv_up64(partition_sizze_203577 *\n                                                                  lifted_single_ma_l_arg_204134,\n                                                                  sext_i32_i64(num_threads_234169))) -\n                                                       (int64_t) 1 ||\n                                                       slt64(srem64(flat_idx_234229,\n                                                                    lifted_single_ma_l_arg_204134),\n                                                             flat_idx_234229 -\n                                                             carry_in_flat_idx_234231)))) {\n                double x_218684;\n                double x_218685;\n              ",
                   "  \n                x_218684 = ((__global\n                             double *) mem_230517)[squot64(carry_in_flat_idx_234231,\n                                                           lifted_single_ma_l_arg_204134) *\n                                                   lifted_single_ma_l_arg_204134 +\n                                                   (carry_in_flat_idx_234231 -\n                                                    squot64(carry_in_flat_idx_234231,\n                                                            lifted_single_ma_l_arg_204134) *\n                                                    lifted_single_ma_l_arg_204134)];\n                x_218685 = ((__global double *) mem_230517)[gtid_218681 *\n                                                            lifted_single_ma_l_arg_204134 +\n                                                            gtid_218682];\n                \n                double defunc_1_op_res_218686 = x_218684 + x_218685;\n                \n                x_218684 = defunc_1_op_res_218686;\n                ((__global double *) mem_230517)[gtid_218681 *\n                                                 lifted_single_ma_l_arg_204134 +\n                                                 gtid_218682] = x_218684;\n            }\n        }\n        barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n    }\n    \n  error_0:\n    return;\n    #undef segscan_group_sizze_218677\n}\n__kernel void mainziscan_stage3_218814(__global int *global_failure,\n                                       int64_t partition_sizze_203577,\n                                       int64_t dyn_lifted_single_ma_l_arg_204144,\n                                       int64_t num_groups_218809,\n                                       int32_t num_threads_234312,\n                                       int32_t required_groups_234363, __global\n                                       unsigned char *mem_230534)\n{\n    #define segscan_group_sizze_218808 (mainzisegscan_group_sizze_218772)\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_234364;\n    int32_t local_tid_234365;\n    int64_t group_sizze_234368;\n    int32_t wave_sizze_234367;\n    int32_t group_tid_234366;\n    \n    global_tid_234364 = get_global_id(0);\n    local_tid_234365 = get_local_id(0);\n    group_sizze_234368 = get_local_size(0);\n    wave_sizze_234367 = LOCKSTEP_WIDTH;\n    group_tid_234366 = get_group_id(0);\n    \n    int32_t phys_tid_218814 = global_tid_234364;\n    int32_t phys_group_id_234369;\n    \n    phys_group_id_234369 = get_group_id(0);\n    for (int32_t i_234370 = 0; i_234370 < sdiv_up32(required_groups_234363 -\n                                                    phys_group_id_234369,\n                                                    sext_i64_i32(num_groups_218809));\n         i_234370++) {\n        int32_t virt_group_id_234371 = phys_group_id_234369 + i_234370 *\n                sext_i64_i32(num_groups_218809);\n        int64_t flat_idx_234372 = sext_i32_i64(virt_group_id_234371) *\n                segscan_group_sizze_218808 + sext_i32_i64(local_tid_234365);\n        int64_t gtid_218812 = squot64(flat_idx_234372,\n                                      dyn_lifted_single_ma_l_arg_204144);\n        int64_t gtid_218813 = flat_idx_234372 - squot64(flat_idx_234372,\n                                                        dyn_lifted_single_ma_l_arg_204144) *\n                dyn_lifted_single_ma_l_arg_204144;\n        int64_t orig_group_234373 = squot64(flat_idx_234372,\n                                            segscan_group_sizze_218808 *\n                                            sdiv_up64(partition_sizze_203577 *\n                                                      dyn_lifted_single_ma_l_arg_204144,\n                                                      sext_i32_i64(num_threads_234312)));\n        int64_t carry_in_flat_idx_234374 = orig_group_234373 *\n                (segscan",
                   "_group_sizze_218808 * sdiv_up64(partition_sizze_203577 *\n                                                        dyn_lifted_single_ma_l_arg_204144,\n                                                        sext_i32_i64(num_threads_234312))) -\n                (int64_t) 1;\n        \n        if (slt64(gtid_218812, partition_sizze_203577) && slt64(gtid_218813,\n                                                                dyn_lifted_single_ma_l_arg_204144)) {\n            if (!(orig_group_234373 == (int64_t) 0 || (flat_idx_234372 ==\n                                                       (orig_group_234373 +\n                                                        (int64_t) 1) *\n                                                       (segscan_group_sizze_218808 *\n                                                        sdiv_up64(partition_sizze_203577 *\n                                                                  dyn_lifted_single_ma_l_arg_204144,\n                                                                  sext_i32_i64(num_threads_234312))) -\n                                                       (int64_t) 1 ||\n                                                       slt64(srem64(flat_idx_234372,\n                                                                    dyn_lifted_single_ma_l_arg_204144),\n                                                             flat_idx_234372 -\n                                                             carry_in_flat_idx_234374)))) {\n                double x_218815;\n                double x_218816;\n                \n                x_218815 = ((__global\n                             double *) mem_230534)[squot64(carry_in_flat_idx_234374,\n                                                           dyn_lifted_single_ma_l_arg_204144) *\n                                                   dyn_lifted_single_ma_l_arg_204144 +\n                                                   (carry_in_flat_idx_234374 -\n                                           ",
                   "         squot64(carry_in_flat_idx_234374,\n                                                            dyn_lifted_single_ma_l_arg_204144) *\n                                                    dyn_lifted_single_ma_l_arg_204144)];\n                x_218816 = ((__global double *) mem_230534)[gtid_218812 *\n                                                            dyn_lifted_single_ma_l_arg_204144 +\n                                                            gtid_218813];\n                \n                double defunc_1_op_res_218817 = x_218815 + x_218816;\n                \n                x_218815 = defunc_1_op_res_218817;\n                ((__global double *) mem_230534)[gtid_218812 *\n                                                 dyn_lifted_single_ma_l_arg_204144 +\n                                                 gtid_218813] = x_218815;\n            }\n        }\n        barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n    }\n    \n  error_0:\n    return;\n    #undef segscan_group_sizze_218808\n}\n__kernel void mainziscan_stage3_218945(__global int *global_failure,\n                                       int64_t n_203490,\n                                       int64_t partition_sizze_203577,\n                                       int64_t num_groups_218940,\n                                       int32_t num_threads_234455,\n                                       int32_t required_groups_234506, __global\n                                       unsigned char *mem_230551)\n{\n    #define segscan_group_sizze_218939 (mainzisegscan_group_sizze_218903)\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_234507;\n    int32_t local_tid_234508;\n    int64_t group_sizze_234511;\n    int32_t wave_sizze_234510;\n    int32_t group_tid_234509;\n    \n    global_tid_234507 = get_global_id(0);\n    local_tid_234508 = get_local_id(0);\n    group_sizze_234511 = get_local_size(0);\n    ",
                   "wave_sizze_234510 = LOCKSTEP_WIDTH;\n    group_tid_234509 = get_group_id(0);\n    \n    int32_t phys_tid_218945 = global_tid_234507;\n    int32_t phys_group_id_234512;\n    \n    phys_group_id_234512 = get_group_id(0);\n    for (int32_t i_234513 = 0; i_234513 < sdiv_up32(required_groups_234506 -\n                                                    phys_group_id_234512,\n                                                    sext_i64_i32(num_groups_218940));\n         i_234513++) {\n        int32_t virt_group_id_234514 = phys_group_id_234512 + i_234513 *\n                sext_i64_i32(num_groups_218940);\n        int64_t flat_idx_234515 = sext_i32_i64(virt_group_id_234514) *\n                segscan_group_sizze_218939 + sext_i32_i64(local_tid_234508);\n        int64_t gtid_218943 = squot64(flat_idx_234515, n_203490);\n        int64_t gtid_218944 = flat_idx_234515 - squot64(flat_idx_234515,\n                                                        n_203490) * n_203490;\n        int64_t orig_group_234516 = squot64(flat_idx_234515,\n                                            segscan_group_sizze_218939 *\n                                            sdiv_up64(partition_sizze_203577 *\n                                                      n_203490,\n                                                      sext_i32_i64(num_threads_234455)));\n        int64_t carry_in_flat_idx_234517 = orig_group_234516 *\n                (segscan_group_sizze_218939 * sdiv_up64(partition_sizze_203577 *\n                                                        n_203490,\n                                                        sext_i32_i64(num_threads_234455))) -\n                (int64_t) 1;\n        \n        if (slt64(gtid_218943, partition_sizze_203577) && slt64(gtid_218944,\n                                                                n_203490)) {\n            if (!(orig_group_234516 == (int64_t) 0 || (flat_idx_234515 ==\n                                                       (orig_group_234516 +\n                            ",
                   "                            (int64_t) 1) *\n                                                       (segscan_group_sizze_218939 *\n                                                        sdiv_up64(partition_sizze_203577 *\n                                                                  n_203490,\n                                                                  sext_i32_i64(num_threads_234455))) -\n                                                       (int64_t) 1 ||\n                                                       slt64(srem64(flat_idx_234515,\n                                                                    n_203490),\n                                                             flat_idx_234515 -\n                                                             carry_in_flat_idx_234517)))) {\n                double x_218946;\n                double x_218947;\n                \n                x_218946 = ((__global\n                             double *) mem_230551)[squot64(carry_in_flat_idx_234517,\n                                                           n_203490) *\n                                                   n_203490 +\n                                                   (carry_in_flat_idx_234517 -\n                                                    squot64(carry_in_flat_idx_234517,\n                                                            n_203490) *\n                                                    n_203490)];\n                x_218947 = ((__global double *) mem_230551)[gtid_218943 *\n                                                            n_203490 +\n                                                            gtid_218944];\n                \n                double defunc_1_op_res_218948 = x_218946 + x_218947;\n                \n                x_218946 = defunc_1_op_res_218948;\n                ((__global double *) mem_230551)[gtid_218943 * n_203490 +\n                                                 gtid_218944] = x_218946;\n            }\n        }\n        barr",
                   "ier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n    }\n    \n  error_0:\n    return;\n    #undef segscan_group_sizze_218939\n}\n__kernel void mainziscan_stage3_227915(__global int *global_failure,\n                                       int64_t n_203490,\n                                       int64_t partition_sizze_203577,\n                                       int64_t num_groups_227906,\n                                       int32_t num_threads_236444,\n                                       int32_t required_groups_236543, __global\n                                       unsigned char *mem_231769, __global\n                                       unsigned char *mem_231773, __global\n                                       unsigned char *mem_231777, __global\n                                       unsigned char *mem_231781)\n{\n    #define segscan_group_sizze_227905 (mainzisegscan_group_sizze_227625)\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_236544;\n    int32_t local_tid_236545;\n    int64_t group_sizze_236548;\n    int32_t wave_sizze_236547;\n    int32_t group_tid_236546;\n    \n    global_tid_236544 = get_global_id(0);\n    local_tid_236545 = get_local_id(0);\n    group_sizze_236548 = get_local_size(0);\n    wave_sizze_236547 = LOCKSTEP_WIDTH;\n    group_tid_236546 = get_group_id(0);\n    \n    int32_t phys_tid_227915 = global_tid_236544;\n    int32_t phys_group_id_236549;\n    \n    phys_group_id_236549 = get_group_id(0);\n    for (int32_t i_236550 = 0; i_236550 < sdiv_up32(required_groups_236543 -\n                                                    phys_group_id_236549,\n                                                    sext_i64_i32(num_groups_227906));\n         i_236550++) {\n        int32_t virt_group_id_236551 = phys_group_id_236549 + i_236550 *\n                sext_i64_i32(num_groups_227906);\n        int64_t flat_idx_236552 = sext_i32_i64(virt_group_id_2365",
                   "51) *\n                segscan_group_sizze_227905 + sext_i32_i64(local_tid_236545);\n        int64_t gtid_227913 = squot64(flat_idx_236552, n_203490);\n        int64_t gtid_227914 = flat_idx_236552 - squot64(flat_idx_236552,\n                                                        n_203490) * n_203490;\n        int64_t orig_group_236553 = squot64(flat_idx_236552,\n                                            segscan_group_sizze_227905 *\n                                            sdiv_up64(partition_sizze_203577 *\n                                                      n_203490,\n                                                      sext_i32_i64(num_threads_236444)));\n        int64_t carry_in_flat_idx_236554 = orig_group_236553 *\n                (segscan_group_sizze_227905 * sdiv_up64(partition_sizze_203577 *\n                                                        n_203490,\n                                                        sext_i32_i64(num_threads_236444))) -\n                (int64_t) 1;\n        \n        if (slt64(gtid_227913, partition_sizze_203577) && slt64(gtid_227914,\n                                                                n_203490)) {\n            if (!(orig_group_236553 == (int64_t) 0 || (flat_idx_236552 ==\n                                                       (orig_group_236553 +\n                                                        (int64_t) 1) *\n                                                       (segscan_group_sizze_227905 *\n                                                        sdiv_up64(partition_sizze_203577 *\n                                                                  n_203490,\n                                                                  sext_i32_i64(num_threads_236444))) -\n                                                       (int64_t) 1 ||\n                                                       slt64(srem64(flat_idx_236552,\n                                                                    n_203490),\n                            ",
                   "                                 flat_idx_236552 -\n                                                             carry_in_flat_idx_236554)))) {\n                int64_t x_227916;\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                \n                x_227916 = ((__global\n                             int64_t *) mem_231769)[squot64(carry_in_flat_idx_236554,\n                                                            n_203490) *\n                                                    n_203490 +\n                                                    (carry_in_flat_idx_236554 -\n                                                     squot64(carry_in_flat_idx_236554,\n                                                             n_203490) *\n                                                     n_203490)];\n                x_227917 = ((__global\n                             int64_t *) mem_231773)[squot64(carry_in_flat_idx_236554,\n                                                            n_203490) *\n                                                    n_203490 +\n                                                    (carry_in_flat_idx_236554 -\n                                                     squot64(carry_in_flat_idx_236554,\n                                                             n_203490) *\n                                                     n_203490)];\n                x_227918 = ((__global\n                             int64_t *) mem_231777)[squot64(carry_in_flat_idx_236554,\n                                                            n_203490) *\n                                                    n_203490 +\n                                                    (carry_in_flat_idx_236554 -\n                                                     squot64(carry_in_flat_idx_236554,\n              ",
                   "                                               n_203490) *\n                                                     n_203490)];\n                x_227919 = ((__global\n                             int64_t *) mem_231781)[squot64(carry_in_flat_idx_236554,\n                                                            n_203490) *\n                                                    n_203490 +\n                                                    (carry_in_flat_idx_236554 -\n                                                     squot64(carry_in_flat_idx_236554,\n                                                             n_203490) *\n                                                     n_203490)];\n                x_227920 = ((__global int64_t *) mem_231769)[gtid_227913 *\n                                                             n_203490 +\n                                                             gtid_227914];\n                x_227921 = ((__global int64_t *) mem_231773)[gtid_227913 *\n                                                             n_203490 +\n                                                             gtid_227914];\n                x_227922 = ((__global int64_t *) mem_231777)[gtid_227913 *\n                                                             n_203490 +\n                                                             gtid_227914];\n                x_227923 = ((__global int64_t *) mem_231781)[gtid_227913 *\n                                                             n_203490 +\n                                                             gtid_227914];\n                \n                int64_t defunc_1_op_res_227924 = add64(x_227916, x_227920);\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                \n                x_227916 = defunc_1_op_res_227924;\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                ((__global int64_t *) mem_231769)[gtid_227913 * n_203490 +\n                                                  gtid_227914] = x_227916;\n                ((__global int64_t *) mem_231773)[gtid_227913 * n_203490 +\n                                                  gtid_227914] = x_227917;\n                ((__global int64_t *) mem_231777)[gtid_227913 * n_203490 +\n                                                  gtid_227914] = x_227918;\n                ((__global int64_t *) mem_231781)[gtid_227913 * n_203490 +\n                                                  gtid_227914] = x_227919;\n            }\n        }\n        barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n    }\n    \n  error_0:\n    return;\n    #undef segscan_group_sizze_227905\n}\n__kernel void mainzisegmap_206869(__global int *global_failure,\n                                  int64_t m_203489, int64_t n_203490,\n                                  int64_t num_groups_206874, __global\n                                  unsigned char *mem_229148, __global\n                                  unsigned char *mem_229152, __global\n                                  unsigned char *mem_229155, __global\n                                  unsigned char *mem_229161, __global\n                                  unsigned char *mem_229164)\n{\n    #define segmap_group_sizze_206872 (mainzisegmap_group_sizze_206871)\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_232313;\n    int32_t local_tid_232314;\n    int64_t group_sizze_232317;\n    int32_t wave_sizze_232316;\n    int32_t group_tid_232315;\n    \n    global_tid_232313 = get_global_id(0);\n    local_tid_232314 = get_local_id(0);\n    group_sizze_232317 = get_local_size(0);\n    wave_sizze_232316 = LOCKSTEP_WIDTH;\n    group_tid_232315 = get_g",
                   "roup_id(0);\n    \n    int32_t phys_tid_206869 = global_tid_232313;\n    int32_t phys_group_id_232318;\n    \n    phys_group_id_232318 = get_group_id(0);\n    for (int32_t i_232319 = 0; i_232319 <\n         sdiv_up32(sext_i64_i32(sdiv_up64(m_203489,\n                                          segmap_group_sizze_206872)) -\n                   phys_group_id_232318, sext_i64_i32(num_groups_206874));\n         i_232319++) {\n        int32_t virt_group_id_232320 = phys_group_id_232318 + i_232319 *\n                sext_i64_i32(num_groups_206874);\n        int64_t global_tid_232321 = sext_i32_i64(virt_group_id_232320) *\n                segmap_group_sizze_206872 + sext_i32_i64(local_tid_232314);\n        int64_t slice_232322 = m_203489;\n        int64_t write_i_206868 = global_tid_232321;\n        int64_t remnant_232323 = global_tid_232321 - write_i_206868;\n        \n        if (slt64(write_i_206868, m_203489)) {\n            int64_t c_203583;\n            \n            c_203583 = ((__global int64_t *) mem_229155)[write_i_206868];\n            \n            int64_t offset_203584;\n            \n            offset_203584 = ((__global int64_t *) mem_229152)[write_i_206868];\n            \n            bool is_this_one_203588 = c_203583 == (int64_t) 0;\n            int64_t this_offset_203589 = (int64_t) -1 + offset_203584;\n            int64_t total_res_203590;\n            \n            if (is_this_one_203588) {\n                total_res_203590 = this_offset_203589;\n            } else {\n                total_res_203590 = (int64_t) -1;\n            }\n            if (sle64((int64_t) 0, total_res_203590) && slt64(total_res_203590,\n                                                              m_203489)) {\n                for (int64_t i_232324 = 0; i_232324 < n_203490; i_232324++) {\n                    double tmp_232325;\n                    \n                    tmp_232325 = ((__global\n                                   double *) mem_229148)[write_i_206868 +\n                                                       ",
                   "  i_232324 * m_203489];\n                    ((__global double *) mem_229161)[total_res_203590 *\n                                                     n_203490 + i_232324] =\n                        tmp_232325;\n                }\n            }\n            if (sle64((int64_t) 0, total_res_203590) && slt64(total_res_203590,\n                                                              m_203489)) {\n                ((__global int64_t *) mem_229164)[total_res_203590] =\n                    write_i_206868;\n            }\n        }\n        barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_206872\n}\n__kernel void mainzisegmap_207045(__global int *global_failure,\n                                  int64_t n_203490,\n                                  int64_t partition_sizze_203577, __global\n                                  unsigned char *mem_229161, __global\n                                  unsigned char *mem_229186, __global\n                                  unsigned char *mem_229190)\n{\n    #define segmap_group_sizze_207040 (mainzisegmap_group_sizze_206925)\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_232429;\n    int32_t local_tid_232430;\n    int64_t group_sizze_232433;\n    int32_t wave_sizze_232432;\n    int32_t group_tid_232431;\n    \n    global_tid_232429 = get_global_id(0);\n    local_tid_232430 = get_local_id(0);\n    group_sizze_232433 = get_local_size(0);\n    wave_sizze_232432 = LOCKSTEP_WIDTH;\n    group_tid_232431 = get_group_id(0);\n    \n    int32_t phys_tid_207045 = global_tid_232429;\n    int64_t global_tid_232434 = sext_i32_i64(group_tid_232431) *\n            segmap_group_sizze_207040 + sext_i32_i64(local_tid_232430);\n    int64_t slice_232435 = n_203490;\n    int64_t slice_232436 = partition_sizze_203577 * slice_232435;\n    int64_t gtid_207043 = squot64(global_tid_232434, slice_232435",
                   ");\n    int64_t remnant_232437 = global_tid_232434 - gtid_207043 * slice_232435;\n    int64_t gtid_207044 = remnant_232437;\n    int64_t remnant_232438 = remnant_232437 - gtid_207044;\n    \n    if (slt64(gtid_207043, partition_sizze_203577) && slt64(gtid_207044,\n                                                            n_203490)) {\n        double x_207046;\n        \n        x_207046 = ((__global double *) mem_229161)[gtid_207043 * n_203490 +\n                                                    gtid_207044];\n        \n        bool isnan_res_207049;\n        \n        isnan_res_207049 = futrts_isnan64(x_207046);\n        \n        bool defunc_0_p_res_207050 = !isnan_res_207049;\n        int64_t defunc_1_f_res_207051;\n        \n        if (defunc_0_p_res_207050) {\n            int64_t x_207047;\n            \n            x_207047 = ((__global int64_t *) mem_229186)[gtid_207043 *\n                                                         n_203490 +\n                                                         gtid_207044];\n            \n            int64_t defunc_1_f_res_t_res_207052 = sub64(x_207047, (int64_t) 1);\n            \n            defunc_1_f_res_207051 = defunc_1_f_res_t_res_207052;\n        } else {\n            defunc_1_f_res_207051 = (int64_t) -1;\n        }\n        if ((sle64((int64_t) 0, gtid_207043) && slt64(gtid_207043,\n                                                      partition_sizze_203577)) &&\n            (sle64((int64_t) 0, defunc_1_f_res_207051) &&\n             slt64(defunc_1_f_res_207051, n_203490))) {\n            ((__global int64_t *) mem_229190)[gtid_207043 * n_203490 +\n                                              defunc_1_f_res_207051] =\n                gtid_207044;\n        }\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_207040\n}\n__kernel void mainzisegmap_207170(__global int *global_failure,\n                                  int failure_is_an_option, __global\n                                  int64_t *global_failure_args,\n                        ",
                   "          int64_t n_203490, int64_t n_p_203492,\n                                  int64_t partition_sizze_203577,\n                                  int64_t defunc_0_f_res_203631,\n                                  int64_t i_203670, __global\n                                  unsigned char *mem_229200, __global\n                                  unsigned char *mem_229206)\n{\n    #define segmap_group_sizze_207164 (mainzisegmap_group_sizze_207082)\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_232449;\n    int32_t local_tid_232450;\n    int64_t group_sizze_232453;\n    int32_t wave_sizze_232452;\n    int32_t group_tid_232451;\n    \n    global_tid_232449 = get_global_id(0);\n    local_tid_232450 = get_local_id(0);\n    group_sizze_232453 = get_local_size(0);\n    wave_sizze_232452 = LOCKSTEP_WIDTH;\n    group_tid_232451 = get_group_id(0);\n    \n    int32_t phys_tid_207170 = global_tid_232449;\n    int64_t global_tid_232454 = sext_i32_i64(group_tid_232451) *\n            segmap_group_sizze_207164 + sext_i32_i64(local_tid_232450);\n    int64_t slice_232455 = defunc_0_f_res_203631;\n    int64_t slice_232456 = n_p_203492 * slice_232455;\n    int64_t slice_232457 = partition_sizze_203577 * slice_232456;\n    int64_t gtid_207167 = squot64(global_tid_232454, slice_232456);\n    int64_t remnant_232458 = global_tid_232454 - gtid_207167 * slice_232456;\n    int64_t gtid_207168 = squot64(remnant_232458, slice_232455);\n    int64_t remnant_232459 = remnant_232458 - gtid_207168 * slice_232455;\n    int64_t gtid_207169 = remnant_232459;\n    int64_t remnant_232460 = remnant_232459 - gtid_207169;\n    \n    if ((slt64(gtid_207167, partition_sizze_203577) && slt64(gtid_207168,\n                                                             n_p_203492)) &&\n        slt64(gtid_207169, defunc_0_f_res_203631)) {\n        int64_t y_207174 = mul64(n_p_203492, gtid_207169);\n        int64_t new_i_207",
                   "175 = add64(gtid_207168, y_207174);\n        bool cond_207176 = slt64(i_203670, new_i_207175);\n        double defunc_0_f_res_207177;\n        \n        if (cond_207176) {\n            defunc_0_f_res_207177 = NAN;\n        } else {\n            bool x_207178 = sle64((int64_t) 0, new_i_207175);\n            bool y_207179 = slt64(new_i_207175, n_203490);\n            bool bounds_check_207180 = x_207178 && y_207179;\n            bool index_certs_207181;\n            \n            if (!bounds_check_207180) {\n                {\n                    if (atomic_cmpxchg_i32_global(global_failure, -1, 1) ==\n                        -1) {\n                        global_failure_args[0] = (int64_t) new_i_207175;\n                        global_failure_args[1] = (int64_t) n_203490;\n                        ;\n                    }\n                    return;\n                }\n            }\n            \n            double defunc_0_f_res_f_res_207182;\n            \n            defunc_0_f_res_f_res_207182 = ((__global\n                                            double *) mem_229200)[gtid_207167 *\n                                                                  n_203490 +\n                                                                  new_i_207175];\n            defunc_0_f_res_207177 = defunc_0_f_res_f_res_207182;\n        }\n        ((__global double *) mem_229206)[gtid_207167 * (defunc_0_f_res_203631 *\n                                                        n_p_203492) +\n                                         gtid_207168 * defunc_0_f_res_203631 +\n                                         gtid_207169] = defunc_0_f_res_207177;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_207164\n}\n__kernel void mainzisegmap_207605(__global int *global_failure,\n                                  int64_t n_p_203492,\n                                  int64_t partition_sizze_203577,\n                                  int64_t defunc_0_f_res_203631, __global\n                                  unsigned char *",
                   "mem_229206, __global\n                                  unsigned char *mem_229250, __global\n                                  unsigned char *mem_229255)\n{\n    #define segmap_group_sizze_207599 (mainzisegmap_group_sizze_207350)\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_232586;\n    int32_t local_tid_232587;\n    int64_t group_sizze_232590;\n    int32_t wave_sizze_232589;\n    int32_t group_tid_232588;\n    \n    global_tid_232586 = get_global_id(0);\n    local_tid_232587 = get_local_id(0);\n    group_sizze_232590 = get_local_size(0);\n    wave_sizze_232589 = LOCKSTEP_WIDTH;\n    group_tid_232588 = get_group_id(0);\n    \n    int32_t phys_tid_207605 = global_tid_232586;\n    int64_t global_tid_232591 = sext_i32_i64(group_tid_232588) *\n            segmap_group_sizze_207599 + sext_i32_i64(local_tid_232587);\n    int64_t slice_232592 = defunc_0_f_res_203631;\n    int64_t slice_232593 = n_p_203492 * slice_232592;\n    int64_t slice_232594 = partition_sizze_203577 * slice_232593;\n    int64_t gtid_207602 = squot64(global_tid_232591, slice_232593);\n    int64_t remnant_232595 = global_tid_232591 - gtid_207602 * slice_232593;\n    int64_t gtid_207603 = squot64(remnant_232595, slice_232592);\n    int64_t remnant_232596 = remnant_232595 - gtid_207603 * slice_232592;\n    int64_t gtid_207604 = remnant_232596;\n    int64_t remnant_232597 = remnant_232596 - gtid_207604;\n    \n    if ((slt64(gtid_207602, partition_sizze_203577) && slt64(gtid_207603,\n                                                             n_p_203492)) &&\n        slt64(gtid_207604, defunc_0_f_res_203631)) {\n        double x_207606;\n        \n        x_207606 = ((__global double *) mem_229206)[gtid_207602 *\n                                                    (defunc_0_f_res_203631 *\n                                                     n_p_203492) + gtid_207603 *\n                                             ",
                   "       defunc_0_f_res_203631 +\n                                                    gtid_207604];\n        \n        bool isnan_res_207609;\n        \n        isnan_res_207609 = futrts_isnan64(x_207606);\n        \n        bool defunc_0_p_res_207610 = !isnan_res_207609;\n        int64_t defunc_1_f_res_207611;\n        \n        if (defunc_0_p_res_207610) {\n            int64_t x_207607;\n            \n            x_207607 = ((__global int64_t *) mem_229250)[gtid_207602 *\n                                                         (defunc_0_f_res_203631 *\n                                                          n_p_203492) +\n                                                         gtid_207603 *\n                                                         defunc_0_f_res_203631 +\n                                                         gtid_207604];\n            \n            int64_t defunc_1_f_res_t_res_207612 = sub64(x_207607, (int64_t) 1);\n            \n            defunc_1_f_res_207611 = defunc_1_f_res_t_res_207612;\n        } else {\n            defunc_1_f_res_207611 = (int64_t) -1;\n        }\n        if (((sle64((int64_t) 0, gtid_207602) && slt64(gtid_207602,\n                                                       partition_sizze_203577)) &&\n             (sle64((int64_t) 0, gtid_207603) && slt64(gtid_207603,\n                                                       n_p_203492))) &&\n            (sle64((int64_t) 0, defunc_1_f_res_207611) &&\n             slt64(defunc_1_f_res_207611, defunc_0_f_res_203631))) {\n            ((__global int64_t *) mem_229255)[gtid_207602 *\n                                              (defunc_0_f_res_203631 *\n                                               n_p_203492) + gtid_207603 *\n                                              defunc_0_f_res_203631 +\n                                              defunc_1_f_res_207611] =\n                gtid_207604;\n        }\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_207599\n}\n__kernel void mainzisegmap_208818(_",
                   "_global int *global_failure,\n                                  int64_t n_p_203492,\n                                  int64_t partition_sizze_203577,\n                                  int64_t defunc_0_f_res_203631, __global\n                                  unsigned char *ext_mem_229265, __global\n                                  unsigned char *mem_229331)\n{\n    #define segmap_group_sizze_208812 (mainzisegmap_group_sizze_208475)\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_232671;\n    int32_t local_tid_232672;\n    int64_t group_sizze_232675;\n    int32_t wave_sizze_232674;\n    int32_t group_tid_232673;\n    \n    global_tid_232671 = get_global_id(0);\n    local_tid_232672 = get_local_id(0);\n    group_sizze_232675 = get_local_size(0);\n    wave_sizze_232674 = LOCKSTEP_WIDTH;\n    group_tid_232673 = get_group_id(0);\n    \n    int32_t phys_tid_208818 = global_tid_232671;\n    int64_t global_tid_232676 = sext_i32_i64(group_tid_232673) *\n            segmap_group_sizze_208812 + sext_i32_i64(local_tid_232672);\n    int64_t slice_232677 = defunc_0_f_res_203631;\n    int64_t slice_232678 = n_p_203492 * slice_232677;\n    int64_t slice_232679 = partition_sizze_203577 * slice_232678;\n    int64_t gtid_208815 = squot64(global_tid_232676, slice_232678);\n    int64_t remnant_232680 = global_tid_232676 - gtid_208815 * slice_232678;\n    int64_t gtid_208816 = squot64(remnant_232680, slice_232677);\n    int64_t remnant_232681 = remnant_232680 - gtid_208816 * slice_232677;\n    int64_t gtid_208817 = remnant_232681;\n    int64_t remnant_232682 = remnant_232681 - gtid_208817;\n    \n    if ((slt64(gtid_208815, partition_sizze_203577) && slt64(gtid_208816,\n                                                             n_p_203492)) &&\n        slt64(gtid_208817, defunc_0_f_res_203631)) {\n        int64_t x_208819;\n        \n        x_208819 = ((__global int64_t *) ext_mem_229265)[gtid_",
                   "208815 *\n                                                         (defunc_0_f_res_203631 *\n                                                          n_p_203492) +\n                                                         gtid_208816 *\n                                                         defunc_0_f_res_203631 +\n                                                         gtid_208817];\n        \n        int64_t defunc_0_f_res_208820 = add64((int64_t) 1, x_208819);\n        \n        ((__global int64_t *) mem_229331)[gtid_208815 * (defunc_0_f_res_203631 *\n                                                         n_p_203492) +\n                                          gtid_208816 * defunc_0_f_res_203631 +\n                                          gtid_208817] = defunc_0_f_res_208820;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_208812\n}\n__kernel void mainzisegmap_208832(__global int *global_failure,\n                                  int64_t n_p_203492, int64_t q_s_203493,\n                                  int64_t partition_sizze_203577,\n                                  int64_t min_res_203749, double i64_res_203755,\n                                  __global unsigned char *ext_mem_229264,\n                                  __global unsigned char *mem_229336, __global\n                                  unsigned char *mem_229340, __global\n                                  unsigned char *mem_229344, __global\n                                  unsigned char *mem_229348)\n{\n    #define segmap_group_sizze_208824 (mainzisegmap_group_sizze_208444)\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_232683;\n    int32_t local_tid_232684;\n    int64_t group_sizze_232687;\n    int32_t wave_sizze_232686;\n    int32_t group_tid_232685;\n    \n    global_tid_232683 = get_global_id(0);\n    local_tid_232684 = get_local_id(0);\n    group_sizze_232687 = get_local_s",
                   "ize(0);\n    wave_sizze_232686 = LOCKSTEP_WIDTH;\n    group_tid_232685 = get_group_id(0);\n    \n    int32_t phys_tid_208832 = global_tid_232683;\n    int64_t global_tid_232688 = sext_i32_i64(group_tid_232685) *\n            segmap_group_sizze_208824 + sext_i32_i64(local_tid_232684);\n    int64_t slice_232689 = n_p_203492;\n    int64_t slice_232690 = partition_sizze_203577 * slice_232689;\n    int64_t gtid_208830 = squot64(global_tid_232688, slice_232689);\n    int64_t remnant_232691 = global_tid_232688 - gtid_208830 * slice_232689;\n    int64_t gtid_208831 = remnant_232691;\n    int64_t remnant_232692 = remnant_232691 - gtid_208831;\n    \n    if (slt64(gtid_208830, partition_sizze_203577) && slt64(gtid_208831,\n                                                            n_p_203492)) {\n        int64_t x_208833;\n        \n        x_208833 = ((__global int64_t *) ext_mem_229264)[gtid_208830 *\n                                                         n_p_203492 +\n                                                         gtid_208831];\n        \n        int64_t min_arg_208834 = sub64(x_208833, (int64_t) 1);\n        int64_t min_arg_208835 = sub64(x_208833, min_res_203749);\n        int64_t min_res_208836 = smin64(q_s_203493, x_208833);\n        double i64_res_208837 = sitofp_i64_f64(x_208833);\n        double x_208838 = i64_res_203755 - i64_res_208837;\n        double max_arg_208839 = x_208838 / 2.0;\n        double max_res_208840 = fmax64(0.0, max_arg_208839);\n        \n        ((__global int64_t *) mem_229336)[gtid_208830 * n_p_203492 +\n                                          gtid_208831] = min_arg_208834;\n        ((__global int64_t *) mem_229340)[gtid_208830 * n_p_203492 +\n                                          gtid_208831] = min_arg_208835;\n        ((__global int64_t *) mem_229344)[gtid_208830 * n_p_203492 +\n                                          gtid_208831] = min_res_208836;\n        ((__global double *) mem_229348)[gtid_208830 * n_p_203492 +\n                                        ",
                   " gtid_208831] = max_res_208840;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_208824\n}\n__kernel void mainzisegmap_208856(__global int *global_failure,\n                                  int failure_is_an_option, __global\n                                  int64_t *global_failure_args,\n                                  int64_t n_p_203492, int64_t jump_s_203499,\n                                  int64_t partition_sizze_203577,\n                                  int64_t defunc_0_f_res_203631,\n                                  int64_t pad_css_len_203632,\n                                  int64_t s_n_m_203636, int64_t i_203718,\n                                  unsigned char x_203719_bits,\n                                  int64_t min_res_203749,\n                                  unsigned char loop_cond_203754_bits, __global\n                                  unsigned char *mem_229331, __global\n                                  unsigned char *mem_229336, __global\n                                  unsigned char *mem_229340, __global\n                                  unsigned char *mem_229344, __global\n                                  unsigned char *mem_229348, __global\n                                  unsigned char *mem_229354, __global\n                                  unsigned char *mem_229359)\n{\n    bool x_203719 = x_203719_bits;\n    bool loop_cond_203754 = loop_cond_203754_bits;\n    \n    #define segmap_group_sizze_208849 (mainzisegmap_group_sizze_208205)\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_232693;\n    int32_t local_tid_232694;\n    int64_t group_sizze_232697;\n    int32_t wave_sizze_232696;\n    int32_t group_tid_232695;\n    \n    global_tid_232693 = get_global_id(0);\n    local_tid_232694 = get_local_id(0);\n    group_sizze_232697 = get_local_size(0);\n    wave_sizze_232696 = LOCKSTEP_WIDTH;\n    group_tid_232695 = get_grou",
                   "p_id(0);\n    \n    int32_t phys_tid_208856 = global_tid_232693;\n    int64_t global_tid_232698 = sext_i32_i64(group_tid_232695) *\n            segmap_group_sizze_208849 + sext_i32_i64(local_tid_232694);\n    int64_t slice_232699 = s_n_m_203636;\n    int64_t slice_232700 = n_p_203492 * slice_232699;\n    int64_t slice_232701 = partition_sizze_203577 * slice_232700;\n    int64_t gtid_208853 = squot64(global_tid_232698, slice_232700);\n    int64_t remnant_232702 = global_tid_232698 - gtid_208853 * slice_232700;\n    int64_t gtid_208854 = squot64(remnant_232702, slice_232699);\n    int64_t remnant_232703 = remnant_232702 - gtid_208854 * slice_232699;\n    int64_t gtid_208855 = remnant_232703;\n    int64_t remnant_232704 = remnant_232703 - gtid_208855;\n    \n    if ((slt64(gtid_208853, partition_sizze_203577) && slt64(gtid_208854,\n                                                             n_p_203492)) &&\n        slt64(gtid_208855, s_n_m_203636)) {\n        int64_t min_arg_208858;\n        \n        min_arg_208858 = ((__global int64_t *) mem_229336)[gtid_208853 *\n                                                           n_p_203492 +\n                                                           gtid_208854];\n        \n        int64_t min_arg_208859;\n        \n        min_arg_208859 = ((__global int64_t *) mem_229340)[gtid_208853 *\n                                                           n_p_203492 +\n                                                           gtid_208854];\n        \n        int64_t min_res_208860;\n        \n        min_res_208860 = ((__global int64_t *) mem_229344)[gtid_208853 *\n                                                           n_p_203492 +\n                                                           gtid_208854];\n        \n        double max_res_208861;\n        \n        max_res_208861 = ((__global double *) mem_229348)[gtid_208853 *\n                                                          n_p_203492 +\n                                                          gtid_2088",
                   "54];\n        \n        bool cond_208863 = gtid_208855 == (int64_t) 0;\n        int64_t defunc_0_m_fun_res_208864;\n        \n        if (cond_208863) {\n            defunc_0_m_fun_res_208864 = (int64_t) 0;\n        } else {\n            int64_t y_208865 = sub64(s_n_m_203636, (int64_t) 1);\n            bool cond_208866 = gtid_208855 == y_208865;\n            int64_t defunc_0_m_fun_res_f_res_208867;\n            \n            if (cond_208866) {\n                int64_t defunc_0_m_fun_res_f_res_t_res_208868 =\n                        sub64(pad_css_len_203632, (int64_t) 1);\n                \n                defunc_0_m_fun_res_f_res_208867 =\n                    defunc_0_m_fun_res_f_res_t_res_208868;\n            } else {\n                int64_t x_208869 = sub64(gtid_208855, (int64_t) 1);\n                int64_t x_208870 = mul64(jump_s_203499, x_208869);\n                int64_t min_arg_208871 = add64((int64_t) 1, x_208870);\n                int64_t min_res_208872 = smin64(defunc_0_f_res_203631,\n                                                min_arg_208871);\n                \n                defunc_0_m_fun_res_f_res_208867 = min_res_208872;\n            }\n            defunc_0_m_fun_res_208864 = defunc_0_m_fun_res_f_res_208867;\n        }\n        \n        bool init_idx_208873;\n        int64_t init_idx_208874;\n        int64_t init_idx_208875;\n        bool loop_while_208876;\n        int64_t low_208877;\n        int64_t high_208878;\n        \n        loop_while_208876 = x_203719;\n        low_208877 = (int64_t) 0;\n        high_208878 = i_203718;\n        while (loop_while_208876) {\n            int64_t x_208879 = add64(low_208877, high_208878);\n            int64_t mid_208880 = sdiv64(x_208879, (int64_t) 2);\n            bool x_208881 = sle64((int64_t) 0, mid_208880);\n            bool y_208882 = slt64(mid_208880, defunc_0_f_res_203631);\n            bool bounds_check_208883 = x_208881 && y_208882;\n            bool index_certs_208884;\n            \n            if (!bounds_check_208883) {\n                ",
                   "{\n                    if (atomic_cmpxchg_i32_global(global_failure, -1, 12) ==\n                        -1) {\n                        global_failure_args[0] = (int64_t) mid_208880;\n                        global_failure_args[1] =\n                            (int64_t) defunc_0_f_res_203631;\n                        ;\n                    }\n                    return;\n                }\n            }\n            \n            int64_t mid_id_208885;\n            \n            mid_id_208885 = ((__global int64_t *) mem_229331)[gtid_208853 *\n                                                              (defunc_0_f_res_203631 *\n                                                               n_p_203492) +\n                                                              gtid_208854 *\n                                                              defunc_0_f_res_203631 +\n                                                              mid_208880];\n            \n            bool cond_208886 = slt64(mid_id_208885, (int64_t) 0);\n            int64_t mid_idx_208887;\n            \n            if (cond_208886) {\n                mid_idx_208887 = (int64_t) 9223372036854775807;\n            } else {\n                mid_idx_208887 = mid_id_208885;\n            }\n            \n            bool cond_208888 = sle64(defunc_0_m_fun_res_208864, mid_idx_208887);\n            int64_t loopres_208889;\n            int64_t loopres_208890;\n            \n            if (cond_208888) {\n                int64_t loopres_t_res_208891 = sub64(mid_208880, (int64_t) 1);\n                \n                loopres_208889 = low_208877;\n                loopres_208890 = loopres_t_res_208891;\n            } else {\n                int64_t loopres_f_res_208892 = add64((int64_t) 1, mid_208880);\n                \n                loopres_208889 = loopres_f_res_208892;\n                loopres_208890 = high_208878;\n            }\n            \n            bool loop_cond_208893 = sle64(loopres_208889, loopres_208890);\n            bool loop_while_tmp_",
                   "232705 = loop_cond_208893;\n            int64_t low_tmp_232706 = loopres_208889;\n            int64_t high_tmp_232707 = loopres_208890;\n            \n            loop_while_208876 = loop_while_tmp_232705;\n            low_208877 = low_tmp_232706;\n            high_208878 = high_tmp_232707;\n        }\n        init_idx_208873 = loop_while_208876;\n        init_idx_208874 = low_208877;\n        init_idx_208875 = high_208878;\n        \n        bool idx_208894;\n        int64_t idx_208895;\n        int64_t idx_208896;\n        int64_t idx_208897;\n        bool loop_while_208898;\n        int64_t l_idx_208899;\n        int64_t r_idx_208900;\n        int64_t span_208901;\n        \n        loop_while_208898 = loop_cond_203754;\n        l_idx_208899 = init_idx_208874;\n        r_idx_208900 = init_idx_208874;\n        span_208901 = (int64_t) 1;\n        while (loop_while_208898) {\n            int64_t max_arg_208902 = sub64(l_idx_208899, (int64_t) 1);\n            int64_t max_res_208903 = smax64((int64_t) 0, max_arg_208902);\n            int64_t min_arg_208904 = add64((int64_t) 1, r_idx_208900);\n            int64_t min_res_208905 = smin64(min_arg_208858, min_arg_208904);\n            bool x_208906 = sle64((int64_t) 0, max_res_208903);\n            bool y_208907 = slt64(max_res_208903, defunc_0_f_res_203631);\n            bool bounds_check_208908 = x_208906 && y_208907;\n            bool index_certs_208909;\n            \n            if (!bounds_check_208908) {\n                {\n                    if (atomic_cmpxchg_i32_global(global_failure, -1, 13) ==\n                        -1) {\n                        global_failure_args[0] = (int64_t) max_res_208903;\n                        global_failure_args[1] =\n                            (int64_t) defunc_0_f_res_203631;\n                        ;\n                    }\n                    return;\n                }\n            }\n            \n            int64_t x_208910;\n            \n            x_208910 = ((__global int64_t *) mem_229331)[gtid_208853 *\n          ",
                   "                                               (defunc_0_f_res_203631 *\n                                                          n_p_203492) +\n                                                         gtid_208854 *\n                                                         defunc_0_f_res_203631 +\n                                                         max_res_208903];\n            \n            int64_t abs_arg_208911 = sub64(x_208910, defunc_0_m_fun_res_208864);\n            int64_t abs_res_208912 = abs64(abs_arg_208911);\n            bool x_208913 = sle64((int64_t) 0, min_res_208905);\n            bool y_208914 = slt64(min_res_208905, defunc_0_f_res_203631);\n            bool bounds_check_208915 = x_208913 && y_208914;\n            bool index_certs_208916;\n            \n            if (!bounds_check_208915) {\n                {\n                    if (atomic_cmpxchg_i32_global(global_failure, -1, 14) ==\n                        -1) {\n                        global_failure_args[0] = (int64_t) min_res_208905;\n                        global_failure_args[1] =\n                            (int64_t) defunc_0_f_res_203631;\n                        ;\n                    }\n                    return;\n                }\n            }\n            \n            int64_t x_208917;\n            \n            x_208917 = ((__global int64_t *) mem_229331)[gtid_208853 *\n                                                         (defunc_0_f_res_203631 *\n                                                          n_p_203492) +\n                                                         gtid_208854 *\n                                                         defunc_0_f_res_203631 +\n                                                         min_res_208905];\n            \n            int64_t abs_arg_208918 = sub64(x_208917, defunc_0_m_fun_res_208864);\n            int64_t abs_res_208919 = abs64(abs_arg_208918);\n            bool cond_208920 = max_res_208903 == l_idx_208899;\n            int64_t loopres_208921;\n         ",
                   "   int64_t loopres_208922;\n            int64_t loopres_208923;\n            \n            if (cond_208920) {\n                loopres_208921 = l_idx_208899;\n                loopres_208922 = r_idx_208900;\n                loopres_208923 = min_res_203749;\n            } else {\n                bool cond_208924 = slt64(abs_res_208912, abs_res_208919);\n                bool cond_f_res_208925 = min_res_208905 == r_idx_208900;\n                bool x_208926 = !cond_208924;\n                bool y_208927 = cond_f_res_208925 && x_208926;\n                bool cond_208928 = cond_208924 || y_208927;\n                int64_t loopres_f_res_208929;\n                \n                if (cond_208928) {\n                    loopres_f_res_208929 = max_res_208903;\n                } else {\n                    loopres_f_res_208929 = l_idx_208899;\n                }\n                \n                int64_t loopres_f_res_208930;\n                \n                if (cond_208928) {\n                    loopres_f_res_208930 = r_idx_208900;\n                } else {\n                    loopres_f_res_208930 = min_res_208905;\n                }\n                \n                int64_t loopres_f_res_208931;\n                \n                if (cond_208928) {\n                    int64_t loopres_f_res_t_res_208932 = add64((int64_t) 1,\n                                                               span_208901);\n                    \n                    loopres_f_res_208931 = loopres_f_res_t_res_208932;\n                } else {\n                    int64_t loopres_f_res_f_res_208933 = add64((int64_t) 1,\n                                                               span_208901);\n                    \n                    loopres_f_res_208931 = loopres_f_res_f_res_208933;\n                }\n                loopres_208921 = loopres_f_res_208929;\n                loopres_208922 = loopres_f_res_208930;\n                loopres_208923 = loopres_f_res_208931;\n            }\n            \n            bool loop_cond_208934 = slt64(",
                   "loopres_208923, min_res_203749);\n            bool loop_while_tmp_232708 = loop_cond_208934;\n            int64_t l_idx_tmp_232709 = loopres_208921;\n            int64_t r_idx_tmp_232710 = loopres_208922;\n            int64_t span_tmp_232711 = loopres_208923;\n            \n            loop_while_208898 = loop_while_tmp_232708;\n            l_idx_208899 = l_idx_tmp_232709;\n            r_idx_208900 = r_idx_tmp_232710;\n            span_208901 = span_tmp_232711;\n        }\n        idx_208894 = loop_while_208898;\n        idx_208895 = l_idx_208899;\n        idx_208896 = r_idx_208900;\n        idx_208897 = span_208901;\n        \n        int64_t min_res_208935 = smin64(min_arg_208859, idx_208895);\n        int64_t max_res_208936 = smax64((int64_t) 0, min_res_208935);\n        int64_t defunc_0_m_fun_res_208937;\n        \n        if (cond_208863) {\n            defunc_0_m_fun_res_208937 = (int64_t) 0;\n        } else {\n            int64_t y_208938 = sub64(s_n_m_203636, (int64_t) 1);\n            bool cond_208939 = gtid_208855 == y_208938;\n            int64_t defunc_0_m_fun_res_f_res_208940;\n            \n            if (cond_208939) {\n                int64_t defunc_0_m_fun_res_f_res_t_res_208941 =\n                        sub64(pad_css_len_203632, (int64_t) 1);\n                \n                defunc_0_m_fun_res_f_res_208940 =\n                    defunc_0_m_fun_res_f_res_t_res_208941;\n            } else {\n                int64_t x_208942 = sub64(gtid_208855, (int64_t) 1);\n                int64_t x_208943 = mul64(jump_s_203499, x_208942);\n                int64_t min_arg_208944 = add64((int64_t) 1, x_208943);\n                int64_t min_res_208945 = smin64(defunc_0_f_res_203631,\n                                                min_arg_208944);\n                \n                defunc_0_m_fun_res_f_res_208940 = min_res_208945;\n            }\n            defunc_0_m_fun_res_208937 = defunc_0_m_fun_res_f_res_208940;\n        }\n        \n        int64_t x_208946 = add64(min_res_208860, max_res_208936);\n  ",
                   "      int64_t r_208947 = sub64(x_208946, (int64_t) 1);\n        bool x_208948 = sle64((int64_t) 0, r_208947);\n        bool y_208949 = slt64(r_208947, defunc_0_f_res_203631);\n        bool bounds_check_208950 = x_208948 && y_208949;\n        bool index_certs_208951;\n        \n        if (!bounds_check_208950) {\n            {\n                if (atomic_cmpxchg_i32_global(global_failure, -1, 15) == -1) {\n                    global_failure_args[0] = (int64_t) r_208947;\n                    global_failure_args[1] = (int64_t) defunc_0_f_res_203631;\n                    ;\n                }\n                return;\n            }\n        }\n        \n        int64_t x_208952;\n        \n        x_208952 = ((__global int64_t *) mem_229331)[gtid_208853 *\n                                                     (defunc_0_f_res_203631 *\n                                                      n_p_203492) +\n                                                     gtid_208854 *\n                                                     defunc_0_f_res_203631 +\n                                                     r_208947];\n        \n        int64_t abs_arg_208953 = sub64(x_208952, defunc_0_m_fun_res_208937);\n        int64_t abs_res_208954 = abs64(abs_arg_208953);\n        bool x_208955 = sle64((int64_t) 0, max_res_208936);\n        bool y_208956 = slt64(max_res_208936, defunc_0_f_res_203631);\n        bool bounds_check_208957 = x_208955 && y_208956;\n        bool index_certs_208958;\n        \n        if (!bounds_check_208957) {\n            {\n                if (atomic_cmpxchg_i32_global(global_failure, -1, 16) == -1) {\n                    global_failure_args[0] = (int64_t) max_res_208936;\n                    global_failure_args[1] = (int64_t) defunc_0_f_res_203631;\n                    ;\n                }\n                return;\n            }\n        }\n        \n        int64_t x_208959;\n        \n        x_208959 = ((__global int64_t *) mem_229331)[gtid_208853 *\n                                                     (d",
                   "efunc_0_f_res_203631 *\n                                                      n_p_203492) +\n                                                     gtid_208854 *\n                                                     defunc_0_f_res_203631 +\n                                                     max_res_208936];\n        \n        int64_t abs_arg_208960 = sub64(x_208959, defunc_0_m_fun_res_208937);\n        int64_t abs_res_208961 = abs64(abs_arg_208960);\n        int64_t max_res_208962 = smax64(abs_res_208954, abs_res_208961);\n        double defunc_0_f_res_208963 = sitofp_i64_f64(max_res_208962);\n        double defunc_1_f_res_208964 = max_res_208861 + defunc_0_f_res_208963;\n        \n        ((__global double *) mem_229354)[gtid_208853 * (s_n_m_203636 *\n                                                        n_p_203492) +\n                                         gtid_208854 * s_n_m_203636 +\n                                         gtid_208855] = defunc_1_f_res_208964;\n        ((__global int64_t *) mem_229359)[gtid_208853 * (s_n_m_203636 *\n                                                         n_p_203492) +\n                                          gtid_208854 * s_n_m_203636 +\n                                          gtid_208855] = max_res_208936;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_208849\n}\n__kernel void mainzisegmap_209466(__global int *global_failure,\n                                  int64_t n_203490,\n                                  int64_t partition_sizze_203577, __global\n                                  unsigned char *ext_mem_229197, __global\n                                  unsigned char *mem_229388)\n{\n    #define segmap_group_sizze_209461 (mainzisegmap_group_sizze_209437)\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_232738;\n    int32_t local_tid_232739;\n    int64_t group_sizze_232742;\n    int32_t wave_sizze_2327",
                   "41;\n    int32_t group_tid_232740;\n    \n    global_tid_232738 = get_global_id(0);\n    local_tid_232739 = get_local_id(0);\n    group_sizze_232742 = get_local_size(0);\n    wave_sizze_232741 = LOCKSTEP_WIDTH;\n    group_tid_232740 = get_group_id(0);\n    \n    int32_t phys_tid_209466 = global_tid_232738;\n    int64_t global_tid_232743 = sext_i32_i64(group_tid_232740) *\n            segmap_group_sizze_209461 + sext_i32_i64(local_tid_232739);\n    int64_t slice_232744 = n_203490;\n    int64_t slice_232745 = partition_sizze_203577 * slice_232744;\n    int64_t gtid_209464 = squot64(global_tid_232743, slice_232744);\n    int64_t remnant_232746 = global_tid_232743 - gtid_209464 * slice_232744;\n    int64_t gtid_209465 = remnant_232746;\n    int64_t remnant_232747 = remnant_232746 - gtid_209465;\n    \n    if (slt64(gtid_209464, partition_sizze_203577) && slt64(gtid_209465,\n                                                            n_203490)) {\n        int64_t x_209467;\n        \n        x_209467 = ((__global int64_t *) ext_mem_229197)[gtid_209464 *\n                                                         n_203490 +\n                                                         gtid_209465];\n        \n        int64_t defunc_0_f_res_209468 = add64((int64_t) 1, x_209467);\n        \n        ((__global int64_t *) mem_229388)[gtid_209464 * n_203490 +\n                                          gtid_209465] = defunc_0_f_res_209468;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_209461\n}\n__kernel void mainzisegmap_209478(__global int *global_failure,\n                                  int64_t q_l_203495,\n                                  int64_t partition_sizze_203577,\n                                  int64_t min_res_203881, double i64_res_203887,\n                                  __global unsigned char *ext_mem_229196,\n                                  __global unsigned char *mem_229392, __global\n                                  unsigned char *mem_229395, __global\n                       ",
                   "           unsigned char *mem_229398, __global\n                                  unsigned char *mem_229401)\n{\n    #define segmap_group_sizze_209471 (mainzisegmap_group_sizze_209411)\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_232748;\n    int32_t local_tid_232749;\n    int64_t group_sizze_232752;\n    int32_t wave_sizze_232751;\n    int32_t group_tid_232750;\n    \n    global_tid_232748 = get_global_id(0);\n    local_tid_232749 = get_local_id(0);\n    group_sizze_232752 = get_local_size(0);\n    wave_sizze_232751 = LOCKSTEP_WIDTH;\n    group_tid_232750 = get_group_id(0);\n    \n    int32_t phys_tid_209478 = global_tid_232748;\n    int64_t global_tid_232753 = sext_i32_i64(group_tid_232750) *\n            segmap_group_sizze_209471 + sext_i32_i64(local_tid_232749);\n    int64_t slice_232754 = partition_sizze_203577;\n    int64_t gtid_209477 = global_tid_232753;\n    int64_t remnant_232755 = global_tid_232753 - gtid_209477;\n    \n    if (slt64(gtid_209477, partition_sizze_203577)) {\n        int64_t x_209479;\n        \n        x_209479 = ((__global int64_t *) ext_mem_229196)[gtid_209477];\n        \n        int64_t min_arg_209480 = sub64(x_209479, (int64_t) 1);\n        int64_t min_arg_209481 = sub64(x_209479, min_res_203881);\n        int64_t min_res_209482 = smin64(q_l_203495, x_209479);\n        double i64_res_209483 = sitofp_i64_f64(x_209479);\n        double x_209484 = i64_res_203887 - i64_res_209483;\n        double max_arg_209485 = x_209484 / 2.0;\n        double max_res_209486 = fmax64(0.0, max_arg_209485);\n        \n        ((__global int64_t *) mem_229392)[gtid_209477] = min_arg_209480;\n        ((__global int64_t *) mem_229395)[gtid_209477] = min_arg_209481;\n        ((__global int64_t *) mem_229398)[gtid_209477] = min_res_209482;\n        ((__global double *) mem_229401)[gtid_209477] = max_res_209486;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_siz",
                   "ze_209471\n}\n__kernel void mainzisegmap_209499(__global int *global_failure,\n                                  int failure_is_an_option, __global\n                                  int64_t *global_failure_args,\n                                  int64_t n_203490, int64_t jump_l_203501,\n                                  int64_t partition_sizze_203577,\n                                  int64_t l_n_m_203643, int64_t i_203670,\n                                  unsigned char x_203671_bits,\n                                  int64_t min_res_203881,\n                                  unsigned char loop_cond_203886_bits, __global\n                                  unsigned char *ext_mem_229197, __global\n                                  unsigned char *mem_229388, __global\n                                  unsigned char *mem_229392, __global\n                                  unsigned char *mem_229395, __global\n                                  unsigned char *mem_229398, __global\n                                  unsigned char *mem_229401, __global\n                                  unsigned char *mem_229406, __global\n                                  unsigned char *mem_229410)\n{\n    bool x_203671 = x_203671_bits;\n    bool loop_cond_203886 = loop_cond_203886_bits;\n    \n    #define segmap_group_sizze_209493 (mainzisegmap_group_sizze_209207)\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_232756;\n    int32_t local_tid_232757;\n    int64_t group_sizze_232760;\n    int32_t wave_sizze_232759;\n    int32_t group_tid_232758;\n    \n    global_tid_232756 = get_global_id(0);\n    local_tid_232757 = get_local_id(0);\n    group_sizze_232760 = get_local_size(0);\n    wave_sizze_232759 = LOCKSTEP_WIDTH;\n    group_tid_232758 = get_group_id(0);\n    \n    int32_t phys_tid_209499 = global_tid_232756;\n    int64_t global_tid_232761 = sext_i32_i64(group_tid_232758) *\n            segmap_g",
                   "roup_sizze_209493 + sext_i32_i64(local_tid_232757);\n    int64_t slice_232762 = l_n_m_203643;\n    int64_t slice_232763 = partition_sizze_203577 * slice_232762;\n    int64_t gtid_209497 = squot64(global_tid_232761, slice_232762);\n    int64_t remnant_232764 = global_tid_232761 - gtid_209497 * slice_232762;\n    int64_t gtid_209498 = remnant_232764;\n    int64_t remnant_232765 = remnant_232764 - gtid_209498;\n    \n    if (slt64(gtid_209497, partition_sizze_203577) && slt64(gtid_209498,\n                                                            l_n_m_203643)) {\n        int64_t min_arg_209502;\n        \n        min_arg_209502 = ((__global int64_t *) mem_229392)[gtid_209497];\n        \n        int64_t min_arg_209503;\n        \n        min_arg_209503 = ((__global int64_t *) mem_229395)[gtid_209497];\n        \n        int64_t min_res_209504;\n        \n        min_res_209504 = ((__global int64_t *) mem_229398)[gtid_209497];\n        \n        double max_res_209505;\n        \n        max_res_209505 = ((__global double *) mem_229401)[gtid_209497];\n        \n        int64_t min_arg_209507 = mul64(jump_l_203501, gtid_209498);\n        int64_t min_res_209508 = smin64(i_203670, min_arg_209507);\n        int64_t defunc_0_g_res_209509 = add64((int64_t) 1, min_res_209508);\n        bool init_idx_209510;\n        int64_t init_idx_209511;\n        int64_t init_idx_209512;\n        bool loop_while_209513;\n        int64_t low_209514;\n        int64_t high_209515;\n        \n        loop_while_209513 = x_203671;\n        low_209514 = (int64_t) 0;\n        high_209515 = i_203670;\n        while (loop_while_209513) {\n            int64_t x_209516 = add64(low_209514, high_209515);\n            int64_t mid_209517 = sdiv64(x_209516, (int64_t) 2);\n            bool x_209518 = sle64((int64_t) 0, mid_209517);\n            bool y_209519 = slt64(mid_209517, n_203490);\n            bool bounds_check_209520 = x_209518 && y_209519;\n            bool index_certs_209521;\n            \n            if (!bounds_check_209520) {\n          ",
                   "      {\n                    if (atomic_cmpxchg_i32_global(global_failure, -1, 22) ==\n                        -1) {\n                        global_failure_args[0] = (int64_t) mid_209517;\n                        global_failure_args[1] = (int64_t) n_203490;\n                        ;\n                    }\n                    return;\n                }\n            }\n            \n            int64_t mid_id_209522;\n            \n            mid_id_209522 = ((__global int64_t *) mem_229388)[gtid_209497 *\n                                                              n_203490 +\n                                                              mid_209517];\n            \n            bool cond_209523 = slt64(mid_id_209522, (int64_t) 0);\n            int64_t mid_idx_209524;\n            \n            if (cond_209523) {\n                mid_idx_209524 = (int64_t) 9223372036854775807;\n            } else {\n                mid_idx_209524 = mid_id_209522;\n            }\n            \n            bool cond_209525 = sle64(defunc_0_g_res_209509, mid_idx_209524);\n            int64_t loopres_209526;\n            int64_t loopres_209527;\n            \n            if (cond_209525) {\n                int64_t loopres_t_res_209528 = sub64(mid_209517, (int64_t) 1);\n                \n                loopres_209526 = low_209514;\n                loopres_209527 = loopres_t_res_209528;\n            } else {\n                int64_t loopres_f_res_209529 = add64((int64_t) 1, mid_209517);\n                \n                loopres_209526 = loopres_f_res_209529;\n                loopres_209527 = high_209515;\n            }\n            \n            bool loop_cond_209530 = sle64(loopres_209526, loopres_209527);\n            bool loop_while_tmp_232766 = loop_cond_209530;\n            int64_t low_tmp_232767 = loopres_209526;\n            int64_t high_tmp_232768 = loopres_209527;\n            \n            loop_while_209513 = loop_while_tmp_232766;\n            low_209514 = low_tmp_232767;\n            high_209515 = high_tmp_232768;\n      ",
                   "  }\n        init_idx_209510 = loop_while_209513;\n        init_idx_209511 = low_209514;\n        init_idx_209512 = high_209515;\n        \n        bool idx_209531;\n        int64_t idx_209532;\n        int64_t idx_209533;\n        int64_t idx_209534;\n        bool loop_while_209535;\n        int64_t l_idx_209536;\n        int64_t r_idx_209537;\n        int64_t span_209538;\n        \n        loop_while_209535 = loop_cond_203886;\n        l_idx_209536 = init_idx_209511;\n        r_idx_209537 = init_idx_209511;\n        span_209538 = (int64_t) 1;\n        while (loop_while_209535) {\n            int64_t max_arg_209539 = sub64(l_idx_209536, (int64_t) 1);\n            int64_t max_res_209540 = smax64((int64_t) 0, max_arg_209539);\n            int64_t min_arg_209541 = add64((int64_t) 1, r_idx_209537);\n            int64_t min_res_209542 = smin64(min_arg_209502, min_arg_209541);\n            bool x_209543 = sle64((int64_t) 0, max_res_209540);\n            bool y_209544 = slt64(max_res_209540, n_203490);\n            bool bounds_check_209545 = x_209543 && y_209544;\n            bool index_certs_209546;\n            \n            if (!bounds_check_209545) {\n                {\n                    if (atomic_cmpxchg_i32_global(global_failure, -1, 23) ==\n                        -1) {\n                        global_failure_args[0] = (int64_t) max_res_209540;\n                        global_failure_args[1] = (int64_t) n_203490;\n                        ;\n                    }\n                    return;\n                }\n            }\n            \n            int64_t x_209547;\n            \n            x_209547 = ((__global int64_t *) mem_229388)[gtid_209497 *\n                                                         n_203490 +\n                                                         max_res_209540];\n            \n            int64_t abs_arg_209548 = sub64(x_209547, defunc_0_g_res_209509);\n            int64_t abs_res_209549 = abs64(abs_arg_209548);\n            bool x_209550 = sle64((int64_t) 0, min_res_209542);\n",
                   "            bool y_209551 = slt64(min_res_209542, n_203490);\n            bool bounds_check_209552 = x_209550 && y_209551;\n            bool index_certs_209553;\n            \n            if (!bounds_check_209552) {\n                {\n                    if (atomic_cmpxchg_i32_global(global_failure, -1, 24) ==\n                        -1) {\n                        global_failure_args[0] = (int64_t) min_res_209542;\n                        global_failure_args[1] = (int64_t) n_203490;\n                        ;\n                    }\n                    return;\n                }\n            }\n            \n            int64_t x_209554;\n            \n            x_209554 = ((__global int64_t *) mem_229388)[gtid_209497 *\n                                                         n_203490 +\n                                                         min_res_209542];\n            \n            int64_t abs_arg_209555 = sub64(x_209554, defunc_0_g_res_209509);\n            int64_t abs_res_209556 = abs64(abs_arg_209555);\n            bool cond_209557 = max_res_209540 == l_idx_209536;\n            int64_t loopres_209558;\n            int64_t loopres_209559;\n            int64_t loopres_209560;\n            \n            if (cond_209557) {\n                loopres_209558 = l_idx_209536;\n                loopres_209559 = r_idx_209537;\n                loopres_209560 = min_res_203881;\n            } else {\n                bool cond_209561 = slt64(abs_res_209549, abs_res_209556);\n                bool cond_f_res_209562 = min_res_209542 == r_idx_209537;\n                bool x_209563 = !cond_209561;\n                bool y_209564 = cond_f_res_209562 && x_209563;\n                bool cond_209565 = cond_209561 || y_209564;\n                int64_t loopres_f_res_209566;\n                \n                if (cond_209565) {\n                    loopres_f_res_209566 = max_res_209540;\n                } else {\n                    loopres_f_res_209566 = l_idx_209536;\n                }\n                \n                int64_t",
                   " loopres_f_res_209567;\n                \n                if (cond_209565) {\n                    loopres_f_res_209567 = r_idx_209537;\n                } else {\n                    loopres_f_res_209567 = min_res_209542;\n                }\n                \n                int64_t loopres_f_res_209568;\n                \n                if (cond_209565) {\n                    int64_t loopres_f_res_t_res_209569 = add64((int64_t) 1,\n                                                               span_209538);\n                    \n                    loopres_f_res_209568 = loopres_f_res_t_res_209569;\n                } else {\n                    int64_t loopres_f_res_f_res_209570 = add64((int64_t) 1,\n                                                               span_209538);\n                    \n                    loopres_f_res_209568 = loopres_f_res_f_res_209570;\n                }\n                loopres_209558 = loopres_f_res_209566;\n                loopres_209559 = loopres_f_res_209567;\n                loopres_209560 = loopres_f_res_209568;\n            }\n            \n            bool loop_cond_209571 = slt64(loopres_209560, min_res_203881);\n            bool loop_while_tmp_232769 = loop_cond_209571;\n            int64_t l_idx_tmp_232770 = loopres_209558;\n            int64_t r_idx_tmp_232771 = loopres_209559;\n            int64_t span_tmp_232772 = loopres_209560;\n            \n            loop_while_209535 = loop_while_tmp_232769;\n            l_idx_209536 = l_idx_tmp_232770;\n            r_idx_209537 = r_idx_tmp_232771;\n            span_209538 = span_tmp_232772;\n        }\n        idx_209531 = loop_while_209535;\n        idx_209532 = l_idx_209536;\n        idx_209533 = r_idx_209537;\n        idx_209534 = span_209538;\n        \n        int64_t min_res_209572 = smin64(min_arg_209503, idx_209532);\n        int64_t max_res_209573 = smax64((int64_t) 0, min_res_209572);\n        int64_t x_209574 = add64(min_res_209504, max_res_209573);\n        int64_t r_209575 = sub64(x_209574, (int64_t) 1);\n  ",
                   "      bool x_209576 = sle64((int64_t) 0, r_209575);\n        bool y_209577 = slt64(r_209575, n_203490);\n        bool bounds_check_209578 = x_209576 && y_209577;\n        bool index_certs_209579;\n        \n        if (!bounds_check_209578) {\n            {\n                if (atomic_cmpxchg_i32_global(global_failure, -1, 25) == -1) {\n                    global_failure_args[0] = (int64_t) r_209575;\n                    global_failure_args[1] = (int64_t) n_203490;\n                    ;\n                }\n                return;\n            }\n        }\n        \n        int64_t x_209580;\n        \n        x_209580 = ((__global int64_t *) ext_mem_229197)[gtid_209497 *\n                                                         n_203490 + r_209575];\n        \n        int64_t abs_arg_209581 = sub64(x_209580, min_res_209508);\n        int64_t abs_res_209582 = abs64(abs_arg_209581);\n        bool x_209583 = sle64((int64_t) 0, max_res_209573);\n        bool y_209584 = slt64(max_res_209573, n_203490);\n        bool bounds_check_209585 = x_209583 && y_209584;\n        bool index_certs_209586;\n        \n        if (!bounds_check_209585) {\n            {\n                if (atomic_cmpxchg_i32_global(global_failure, -1, 26) == -1) {\n                    global_failure_args[0] = (int64_t) max_res_209573;\n                    global_failure_args[1] = (int64_t) n_203490;\n                    ;\n                }\n                return;\n            }\n        }\n        \n        int64_t x_209587;\n        \n        x_209587 = ((__global int64_t *) ext_mem_229197)[gtid_209497 *\n                                                         n_203490 +\n                                                         max_res_209573];\n        \n        int64_t abs_arg_209588 = sub64(x_209587, min_res_209508);\n        int64_t abs_res_209589 = abs64(abs_arg_209588);\n        int64_t max_res_209590 = smax64(abs_res_209582, abs_res_209589);\n        double defunc_0_f_res_209591 = sitofp_i64_f64(max_res_209590);\n        double defunc_1_f",
                   "_res_209592 = max_res_209505 + defunc_0_f_res_209591;\n        \n        ((__global double *) mem_229406)[gtid_209497 * l_n_m_203643 +\n                                         gtid_209498] = defunc_1_f_res_209592;\n        ((__global int64_t *) mem_229410)[gtid_209497 * l_n_m_203643 +\n                                          gtid_209498] = max_res_209573;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_209493\n}\n__kernel void mainzisegmap_210092(__global int *global_failure,\n                                  int64_t n_203490,\n                                  int64_t partition_sizze_203577, __global\n                                  unsigned char *ext_mem_229197, __global\n                                  unsigned char *mem_229437)\n{\n    #define segmap_group_sizze_210087 (mainzisegmap_group_sizze_210063)\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_232798;\n    int32_t local_tid_232799;\n    int64_t group_sizze_232802;\n    int32_t wave_sizze_232801;\n    int32_t group_tid_232800;\n    \n    global_tid_232798 = get_global_id(0);\n    local_tid_232799 = get_local_id(0);\n    group_sizze_232802 = get_local_size(0);\n    wave_sizze_232801 = LOCKSTEP_WIDTH;\n    group_tid_232800 = get_group_id(0);\n    \n    int32_t phys_tid_210092 = global_tid_232798;\n    int64_t global_tid_232803 = sext_i32_i64(group_tid_232800) *\n            segmap_group_sizze_210087 + sext_i32_i64(local_tid_232799);\n    int64_t slice_232804 = n_203490;\n    int64_t slice_232805 = partition_sizze_203577 * slice_232804;\n    int64_t gtid_210090 = squot64(global_tid_232803, slice_232804);\n    int64_t remnant_232806 = global_tid_232803 - gtid_210090 * slice_232804;\n    int64_t gtid_210091 = remnant_232806;\n    int64_t remnant_232807 = remnant_232806 - gtid_210091;\n    \n    if (slt64(gtid_210090, partition_sizze_203577) && slt64(gtid_210091,\n                                     ",
                   "                       n_203490)) {\n        int64_t x_210093;\n        \n        x_210093 = ((__global int64_t *) ext_mem_229197)[gtid_210090 *\n                                                         n_203490 +\n                                                         gtid_210091];\n        \n        int64_t defunc_0_f_res_210094 = add64((int64_t) 1, x_210093);\n        \n        ((__global int64_t *) mem_229437)[gtid_210090 * n_203490 +\n                                          gtid_210091] = defunc_0_f_res_210094;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_210087\n}\n__kernel void mainzisegmap_210104(__global int *global_failure,\n                                  int64_t q_t_203494,\n                                  int64_t partition_sizze_203577,\n                                  int64_t min_res_203993, double i64_res_203999,\n                                  __global unsigned char *ext_mem_229196,\n                                  __global unsigned char *mem_229441, __global\n                                  unsigned char *mem_229444, __global\n                                  unsigned char *mem_229447, __global\n                                  unsigned char *mem_229450)\n{\n    #define segmap_group_sizze_210097 (mainzisegmap_group_sizze_210037)\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_232808;\n    int32_t local_tid_232809;\n    int64_t group_sizze_232812;\n    int32_t wave_sizze_232811;\n    int32_t group_tid_232810;\n    \n    global_tid_232808 = get_global_id(0);\n    local_tid_232809 = get_local_id(0);\n    group_sizze_232812 = get_local_size(0);\n    wave_sizze_232811 = LOCKSTEP_WIDTH;\n    group_tid_232810 = get_group_id(0);\n    \n    int32_t phys_tid_210104 = global_tid_232808;\n    int64_t global_tid_232813 = sext_i32_i64(group_tid_232810) *\n            segmap_group_sizze_210097 + sext_i32_i64(local_tid_232809);\n    int64_t",
                   " slice_232814 = partition_sizze_203577;\n    int64_t gtid_210103 = global_tid_232813;\n    int64_t remnant_232815 = global_tid_232813 - gtid_210103;\n    \n    if (slt64(gtid_210103, partition_sizze_203577)) {\n        int64_t x_210105;\n        \n        x_210105 = ((__global int64_t *) ext_mem_229196)[gtid_210103];\n        \n        int64_t min_arg_210106 = sub64(x_210105, (int64_t) 1);\n        int64_t min_arg_210107 = sub64(x_210105, min_res_203993);\n        int64_t min_res_210108 = smin64(q_t_203494, x_210105);\n        double i64_res_210109 = sitofp_i64_f64(x_210105);\n        double x_210110 = i64_res_203999 - i64_res_210109;\n        double max_arg_210111 = x_210110 / 2.0;\n        double max_res_210112 = fmax64(0.0, max_arg_210111);\n        \n        ((__global int64_t *) mem_229441)[gtid_210103] = min_arg_210106;\n        ((__global int64_t *) mem_229444)[gtid_210103] = min_arg_210107;\n        ((__global int64_t *) mem_229447)[gtid_210103] = min_res_210108;\n        ((__global double *) mem_229450)[gtid_210103] = max_res_210112;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_210097\n}\n__kernel void mainzisegmap_210125(__global int *global_failure,\n                                  int failure_is_an_option, __global\n                                  int64_t *global_failure_args,\n                                  int64_t n_203490, int64_t jump_t_203500,\n                                  int64_t partition_sizze_203577,\n                                  int64_t t_n_m_203650, int64_t i_203670,\n                                  unsigned char x_203671_bits,\n                                  int64_t min_res_203993,\n                                  unsigned char loop_cond_203998_bits, __global\n                                  unsigned char *ext_mem_229197, __global\n                                  unsigned char *mem_229437, __global\n                                  unsigned char *mem_229441, __global\n                                  unsigned char *mem_229444, ",
                   "__global\n                                  unsigned char *mem_229447, __global\n                                  unsigned char *mem_229450, __global\n                                  unsigned char *mem_229455, __global\n                                  unsigned char *mem_229459)\n{\n    bool x_203671 = x_203671_bits;\n    bool loop_cond_203998 = loop_cond_203998_bits;\n    \n    #define segmap_group_sizze_210119 (mainzisegmap_group_sizze_209833)\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_232816;\n    int32_t local_tid_232817;\n    int64_t group_sizze_232820;\n    int32_t wave_sizze_232819;\n    int32_t group_tid_232818;\n    \n    global_tid_232816 = get_global_id(0);\n    local_tid_232817 = get_local_id(0);\n    group_sizze_232820 = get_local_size(0);\n    wave_sizze_232819 = LOCKSTEP_WIDTH;\n    group_tid_232818 = get_group_id(0);\n    \n    int32_t phys_tid_210125 = global_tid_232816;\n    int64_t global_tid_232821 = sext_i32_i64(group_tid_232818) *\n            segmap_group_sizze_210119 + sext_i32_i64(local_tid_232817);\n    int64_t slice_232822 = t_n_m_203650;\n    int64_t slice_232823 = partition_sizze_203577 * slice_232822;\n    int64_t gtid_210123 = squot64(global_tid_232821, slice_232822);\n    int64_t remnant_232824 = global_tid_232821 - gtid_210123 * slice_232822;\n    int64_t gtid_210124 = remnant_232824;\n    int64_t remnant_232825 = remnant_232824 - gtid_210124;\n    \n    if (slt64(gtid_210123, partition_sizze_203577) && slt64(gtid_210124,\n                                                            t_n_m_203650)) {\n        int64_t min_arg_210128;\n        \n        min_arg_210128 = ((__global int64_t *) mem_229441)[gtid_210123];\n        \n        int64_t min_arg_210129;\n        \n        min_arg_210129 = ((__global int64_t *) mem_229444)[gtid_210123];\n        \n        int64_t min_res_210130;\n        \n        min_res_210130 = ((__global int64_t *) mem_22",
                   "9447)[gtid_210123];\n        \n        double max_res_210131;\n        \n        max_res_210131 = ((__global double *) mem_229450)[gtid_210123];\n        \n        int64_t min_arg_210133 = mul64(jump_t_203500, gtid_210124);\n        int64_t min_res_210134 = smin64(i_203670, min_arg_210133);\n        int64_t defunc_0_g_res_210135 = add64((int64_t) 1, min_res_210134);\n        bool init_idx_210136;\n        int64_t init_idx_210137;\n        int64_t init_idx_210138;\n        bool loop_while_210139;\n        int64_t low_210140;\n        int64_t high_210141;\n        \n        loop_while_210139 = x_203671;\n        low_210140 = (int64_t) 0;\n        high_210141 = i_203670;\n        while (loop_while_210139) {\n            int64_t x_210142 = add64(low_210140, high_210141);\n            int64_t mid_210143 = sdiv64(x_210142, (int64_t) 2);\n            bool x_210144 = sle64((int64_t) 0, mid_210143);\n            bool y_210145 = slt64(mid_210143, n_203490);\n            bool bounds_check_210146 = x_210144 && y_210145;\n            bool index_certs_210147;\n            \n            if (!bounds_check_210146) {\n                {\n                    if (atomic_cmpxchg_i32_global(global_failure, -1, 32) ==\n                        -1) {\n                        global_failure_args[0] = (int64_t) mid_210143;\n                        global_failure_args[1] = (int64_t) n_203490;\n                        ;\n                    }\n                    return;\n                }\n            }\n            \n            int64_t mid_id_210148;\n            \n            mid_id_210148 = ((__global int64_t *) mem_229437)[gtid_210123 *\n                                                              n_203490 +\n                                                              mid_210143];\n            \n            bool cond_210149 = slt64(mid_id_210148, (int64_t) 0);\n            int64_t mid_idx_210150;\n            \n            if (cond_210149) {\n                mid_idx_210150 = (int64_t) 9223372036854775807;\n            } else {\n        ",
                   "        mid_idx_210150 = mid_id_210148;\n            }\n            \n            bool cond_210151 = sle64(defunc_0_g_res_210135, mid_idx_210150);\n            int64_t loopres_210152;\n            int64_t loopres_210153;\n            \n            if (cond_210151) {\n                int64_t loopres_t_res_210154 = sub64(mid_210143, (int64_t) 1);\n                \n                loopres_210152 = low_210140;\n                loopres_210153 = loopres_t_res_210154;\n            } else {\n                int64_t loopres_f_res_210155 = add64((int64_t) 1, mid_210143);\n                \n                loopres_210152 = loopres_f_res_210155;\n                loopres_210153 = high_210141;\n            }\n            \n            bool loop_cond_210156 = sle64(loopres_210152, loopres_210153);\n            bool loop_while_tmp_232826 = loop_cond_210156;\n            int64_t low_tmp_232827 = loopres_210152;\n            int64_t high_tmp_232828 = loopres_210153;\n            \n            loop_while_210139 = loop_while_tmp_232826;\n            low_210140 = low_tmp_232827;\n            high_210141 = high_tmp_232828;\n        }\n        init_idx_210136 = loop_while_210139;\n        init_idx_210137 = low_210140;\n        init_idx_210138 = high_210141;\n        \n        bool idx_210157;\n        int64_t idx_210158;\n        int64_t idx_210159;\n        int64_t idx_210160;\n        bool loop_while_210161;\n        int64_t l_idx_210162;\n        int64_t r_idx_210163;\n        int64_t span_210164;\n        \n        loop_while_210161 = loop_cond_203998;\n        l_idx_210162 = init_idx_210137;\n        r_idx_210163 = init_idx_210137;\n        span_210164 = (int64_t) 1;\n        while (loop_while_210161) {\n            int64_t max_arg_210165 = sub64(l_idx_210162, (int64_t) 1);\n            int64_t max_res_210166 = smax64((int64_t) 0, max_arg_210165);\n            int64_t min_arg_210167 = add64((int64_t) 1, r_idx_210163);\n            int64_t min_res_210168 = smin64(min_arg_210128, min_arg_210167);\n            bool x_210169 = sle64((i",
                   "nt64_t) 0, max_res_210166);\n            bool y_210170 = slt64(max_res_210166, n_203490);\n            bool bounds_check_210171 = x_210169 && y_210170;\n            bool index_certs_210172;\n            \n            if (!bounds_check_210171) {\n                {\n                    if (atomic_cmpxchg_i32_global(global_failure, -1, 33) ==\n                        -1) {\n                        global_failure_args[0] = (int64_t) max_res_210166;\n                        global_failure_args[1] = (int64_t) n_203490;\n                        ;\n                    }\n                    return;\n                }\n            }\n            \n            int64_t x_210173;\n            \n            x_210173 = ((__global int64_t *) mem_229437)[gtid_210123 *\n                                                         n_203490 +\n                                                         max_res_210166];\n            \n            int64_t abs_arg_210174 = sub64(x_210173, defunc_0_g_res_210135);\n            int64_t abs_res_210175 = abs64(abs_arg_210174);\n            bool x_210176 = sle64((int64_t) 0, min_res_210168);\n            bool y_210177 = slt64(min_res_210168, n_203490);\n            bool bounds_check_210178 = x_210176 && y_210177;\n            bool index_certs_210179;\n            \n            if (!bounds_check_210178) {\n                {\n                    if (atomic_cmpxchg_i32_global(global_failure, -1, 34) ==\n                        -1) {\n                        global_failure_args[0] = (int64_t) min_res_210168;\n                        global_failure_args[1] = (int64_t) n_203490;\n                        ;\n                    }\n                    return;\n                }\n            }\n            \n            int64_t x_210180;\n            \n            x_210180 = ((__global int64_t *) mem_229437)[gtid_210123 *\n                                                         n_203490 +\n                                                         min_res_210168];\n            \n            int64_t abs_arg_2",
                   "10181 = sub64(x_210180, defunc_0_g_res_210135);\n            int64_t abs_res_210182 = abs64(abs_arg_210181);\n            bool cond_210183 = max_res_210166 == l_idx_210162;\n            int64_t loopres_210184;\n            int64_t loopres_210185;\n            int64_t loopres_210186;\n            \n            if (cond_210183) {\n                loopres_210184 = l_idx_210162;\n                loopres_210185 = r_idx_210163;\n                loopres_210186 = min_res_203993;\n            } else {\n                bool cond_210187 = slt64(abs_res_210175, abs_res_210182);\n                bool cond_f_res_210188 = min_res_210168 == r_idx_210163;\n                bool x_210189 = !cond_210187;\n                bool y_210190 = cond_f_res_210188 && x_210189;\n                bool cond_210191 = cond_210187 || y_210190;\n                int64_t loopres_f_res_210192;\n                \n                if (cond_210191) {\n                    loopres_f_res_210192 = max_res_210166;\n                } else {\n                    loopres_f_res_210192 = l_idx_210162;\n                }\n                \n                int64_t loopres_f_res_210193;\n                \n                if (cond_210191) {\n                    loopres_f_res_210193 = r_idx_210163;\n                } else {\n                    loopres_f_res_210193 = min_res_210168;\n                }\n                \n                int64_t loopres_f_res_210194;\n                \n                if (cond_210191) {\n                    int64_t loopres_f_res_t_res_210195 = add64((int64_t) 1,\n                                                               span_210164);\n                    \n                    loopres_f_res_210194 = loopres_f_res_t_res_210195;\n                } else {\n                    int64_t loopres_f_res_f_res_210196 = add64((int64_t) 1,\n                                                               span_210164);\n                    \n                    loopres_f_res_210194 = loopres_f_res_f_res_210196;\n                }\n                lo",
                   "opres_210184 = loopres_f_res_210192;\n                loopres_210185 = loopres_f_res_210193;\n                loopres_210186 = loopres_f_res_210194;\n            }\n            \n            bool loop_cond_210197 = slt64(loopres_210186, min_res_203993);\n            bool loop_while_tmp_232829 = loop_cond_210197;\n            int64_t l_idx_tmp_232830 = loopres_210184;\n            int64_t r_idx_tmp_232831 = loopres_210185;\n            int64_t span_tmp_232832 = loopres_210186;\n            \n            loop_while_210161 = loop_while_tmp_232829;\n            l_idx_210162 = l_idx_tmp_232830;\n            r_idx_210163 = r_idx_tmp_232831;\n            span_210164 = span_tmp_232832;\n        }\n        idx_210157 = loop_while_210161;\n        idx_210158 = l_idx_210162;\n        idx_210159 = r_idx_210163;\n        idx_210160 = span_210164;\n        \n        int64_t min_res_210198 = smin64(min_arg_210129, idx_210158);\n        int64_t max_res_210199 = smax64((int64_t) 0, min_res_210198);\n        int64_t x_210200 = add64(min_res_210130, max_res_210199);\n        int64_t r_210201 = sub64(x_210200, (int64_t) 1);\n        bool x_210202 = sle64((int64_t) 0, r_210201);\n        bool y_210203 = slt64(r_210201, n_203490);\n        bool bounds_check_210204 = x_210202 && y_210203;\n        bool index_certs_210205;\n        \n        if (!bounds_check_210204) {\n            {\n                if (atomic_cmpxchg_i32_global(global_failure, -1, 35) == -1) {\n                    global_failure_args[0] = (int64_t) r_210201;\n                    global_failure_args[1] = (int64_t) n_203490;\n                    ;\n                }\n                return;\n            }\n        }\n        \n        int64_t x_210206;\n        \n        x_210206 = ((__global int64_t *) ext_mem_229197)[gtid_210123 *\n                                                         n_203490 + r_210201];\n        \n        int64_t abs_arg_210207 = sub64(x_210206, min_res_210134);\n        int64_t abs_res_210208 = abs64(abs_arg_210207);\n        bool x_210209 = sl",
                   "e64((int64_t) 0, max_res_210199);\n        bool y_210210 = slt64(max_res_210199, n_203490);\n        bool bounds_check_210211 = x_210209 && y_210210;\n        bool index_certs_210212;\n        \n        if (!bounds_check_210211) {\n            {\n                if (atomic_cmpxchg_i32_global(global_failure, -1, 36) == -1) {\n                    global_failure_args[0] = (int64_t) max_res_210199;\n                    global_failure_args[1] = (int64_t) n_203490;\n                    ;\n                }\n                return;\n            }\n        }\n        \n        int64_t x_210213;\n        \n        x_210213 = ((__global int64_t *) ext_mem_229197)[gtid_210123 *\n                                                         n_203490 +\n                                                         max_res_210199];\n        \n        int64_t abs_arg_210214 = sub64(x_210213, min_res_210134);\n        int64_t abs_res_210215 = abs64(abs_arg_210214);\n        int64_t max_res_210216 = smax64(abs_res_210208, abs_res_210215);\n        double defunc_0_f_res_210217 = sitofp_i64_f64(max_res_210216);\n        double defunc_1_f_res_210218 = max_res_210131 + defunc_0_f_res_210217;\n        \n        ((__global double *) mem_229455)[gtid_210123 * t_n_m_203650 +\n                                         gtid_210124] = defunc_1_f_res_210218;\n        ((__global int64_t *) mem_229459)[gtid_210123 * t_n_m_203650 +\n                                          gtid_210124] = max_res_210199;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_210119\n}\n__kernel void mainzisegmap_210267(__global int *global_failure,\n                                  int64_t n_203490,\n                                  int64_t partition_sizze_203577,\n                                  int64_t ctx_param_ext_229511, __global\n                                  unsigned char *mem_229161, __global\n                                  unsigned char *mem_param_229515, __global\n                                  unsigned char *mem_229520)\n{\n    #de",
                   "fine segmap_group_sizze_210262 (mainzisegmap_group_sizze_210236)\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_232873;\n    int32_t local_tid_232874;\n    int64_t group_sizze_232877;\n    int32_t wave_sizze_232876;\n    int32_t group_tid_232875;\n    \n    global_tid_232873 = get_global_id(0);\n    local_tid_232874 = get_local_id(0);\n    group_sizze_232877 = get_local_size(0);\n    wave_sizze_232876 = LOCKSTEP_WIDTH;\n    group_tid_232875 = get_group_id(0);\n    \n    int32_t phys_tid_210267 = global_tid_232873;\n    int64_t global_tid_232878 = sext_i32_i64(group_tid_232875) *\n            segmap_group_sizze_210262 + sext_i32_i64(local_tid_232874);\n    int64_t slice_232879 = n_203490;\n    int64_t slice_232880 = partition_sizze_203577 * slice_232879;\n    int64_t gtid_210265 = squot64(global_tid_232878, slice_232879);\n    int64_t remnant_232881 = global_tid_232878 - gtid_210265 * slice_232879;\n    int64_t gtid_210266 = remnant_232881;\n    int64_t remnant_232882 = remnant_232881 - gtid_210266;\n    \n    if (slt64(gtid_210265, partition_sizze_203577) && slt64(gtid_210266,\n                                                            n_203490)) {\n        double x_210268;\n        \n        x_210268 = ((__global double *) mem_229161)[gtid_210265 * n_203490 +\n                                                    gtid_210266];\n        \n        double x_210269;\n        \n        x_210269 = ((__global double *) mem_param_229515)[gtid_210265 *\n                                                          ctx_param_ext_229511 +\n                                                          gtid_210266];\n        \n        double defunc_1_f_res_210270 = x_210268 - x_210269;\n        \n        ((__global double *) mem_229520)[gtid_210265 * n_203490 + gtid_210266] =\n            defunc_1_f_res_210270;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_210262\n}\n__kernel void ma",
                   "inzisegmap_210412(__global int *global_failure,\n                                  int failure_is_an_option, __global\n                                  int64_t *global_failure_args,\n                                  int64_t n_203490, int64_t n_p_203492,\n                                  int64_t partition_sizze_203577,\n                                  int64_t defunc_0_f_res_203631,\n                                  int64_t i_203670,\n                                  int64_t ctx_param_ext_229488,\n                                  int64_t ctx_param_ext_229489,\n                                  int64_t ctx_param_ext_229491, __global\n                                  unsigned char *ext_mem_229265, __global\n                                  unsigned char *mem_param_229493, __global\n                                  unsigned char *mem_229520, __global\n                                  unsigned char *mem_229526, __global\n                                  unsigned char *mem_229531)\n{\n    #define segmap_group_sizze_210405 (mainzisegmap_group_sizze_210299)\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_232883;\n    int32_t local_tid_232884;\n    int64_t group_sizze_232887;\n    int32_t wave_sizze_232886;\n    int32_t group_tid_232885;\n    \n    global_tid_232883 = get_global_id(0);\n    local_tid_232884 = get_local_id(0);\n    group_sizze_232887 = get_local_size(0);\n    wave_sizze_232886 = LOCKSTEP_WIDTH;\n    group_tid_232885 = get_group_id(0);\n    \n    int32_t phys_tid_210412 = global_tid_232883;\n    int64_t global_tid_232888 = sext_i32_i64(group_tid_232885) *\n            segmap_group_sizze_210405 + sext_i32_i64(local_tid_232884);\n    int64_t slice_232889 = defunc_0_f_res_203631;\n    int64_t slice_232890 = n_p_203492 * slice_232889;\n    int64_t slice_232891 = partition_sizze_203577 * slice_232890;\n    int64_t gtid_210409 = squot64(global_tid_232888, slice_23",
                   "2890);\n    int64_t remnant_232892 = global_tid_232888 - gtid_210409 * slice_232890;\n    int64_t gtid_210410 = squot64(remnant_232892, slice_232889);\n    int64_t remnant_232893 = remnant_232892 - gtid_210410 * slice_232889;\n    int64_t gtid_210411 = remnant_232893;\n    int64_t remnant_232894 = remnant_232893 - gtid_210411;\n    \n    if ((slt64(gtid_210409, partition_sizze_203577) && slt64(gtid_210410,\n                                                             n_p_203492)) &&\n        slt64(gtid_210411, defunc_0_f_res_203631)) {\n        int64_t x_210416;\n        \n        x_210416 = ((__global int64_t *) ext_mem_229265)[gtid_210409 *\n                                                         (defunc_0_f_res_203631 *\n                                                          n_p_203492) +\n                                                         gtid_210410 *\n                                                         defunc_0_f_res_203631 +\n                                                         gtid_210411];\n        \n        int64_t x_210417 = mul64(n_p_203492, x_210416);\n        int64_t idx_210418 = add64(gtid_210410, x_210417);\n        bool cond_210419 = slt64(i_203670, idx_210418);\n        bool cond_f_res_210420 = slt64(x_210416, (int64_t) 0);\n        bool x_210421 = !cond_210419;\n        bool y_210422 = cond_f_res_210420 && x_210421;\n        bool cond_210423 = cond_210419 || y_210422;\n        double defunc_0_f_res_210424;\n        double defunc_0_f_res_210425;\n        \n        if (cond_210423) {\n            defunc_0_f_res_210424 = 0.0;\n            defunc_0_f_res_210425 = 0.0;\n        } else {\n            bool x_210426 = sle64((int64_t) 0, idx_210418);\n            bool y_210427 = slt64(idx_210418, n_203490);\n            bool bounds_check_210428 = x_210426 && y_210427;\n            bool index_certs_210429;\n            \n            if (!bounds_check_210428) {\n                {\n                    if (atomic_cmpxchg_i32_global(global_failure, -1, 37) ==\n                      ",
                   "  -1) {\n                        global_failure_args[0] = (int64_t) idx_210418;\n                        global_failure_args[1] = (int64_t) n_203490;\n                        ;\n                    }\n                    return;\n                }\n            }\n            \n            double defunc_0_f_res_f_res_210430;\n            \n            defunc_0_f_res_f_res_210430 = ((__global\n                                            double *) mem_229520)[gtid_210409 *\n                                                                  n_203490 +\n                                                                  idx_210418];\n            \n            double defunc_0_f_res_f_res_210431;\n            \n            defunc_0_f_res_f_res_210431 = ((__global\n                                            double *) mem_param_229493)[ctx_param_ext_229488 +\n                                                                        (gtid_210409 *\n                                                                         ctx_param_ext_229489 +\n                                                                         idx_210418 *\n                                                                         ctx_param_ext_229491)];\n            defunc_0_f_res_210424 = defunc_0_f_res_f_res_210430;\n            defunc_0_f_res_210425 = defunc_0_f_res_f_res_210431;\n        }\n        ((__global double *) mem_229526)[gtid_210409 * (defunc_0_f_res_203631 *\n                                                        n_p_203492) +\n                                         gtid_210410 * defunc_0_f_res_203631 +\n                                         gtid_210411] = defunc_0_f_res_210424;\n        ((__global double *) mem_229531)[gtid_210409 * (defunc_0_f_res_203631 *\n                                                        n_p_203492) +\n                                         gtid_210410 * defunc_0_f_res_203631 +\n                                         gtid_210411] = defunc_0_f_res_210425;\n    }\n    \n  error_0:\n    return;\n   ",
                   " #undef segmap_group_sizze_210405\n}\n__kernel void mainzisegmap_210542(__global int *global_failure,\n                                  int64_t n_p_203492, int64_t q_s_203493,\n                                  int64_t jump_s_203499,\n                                  int64_t partition_sizze_203577,\n                                  int64_t defunc_0_f_res_203631,\n                                  int64_t pad_css_len_203632,\n                                  int64_t s_n_m_203636,\n                                  int64_t num_groups_210538,\n                                  int64_t num_threads_232109, __global\n                                  unsigned char *mem_229540, __global\n                                  unsigned char *mem_229543, __global\n                                  unsigned char *mem_229547, __global\n                                  unsigned char *mem_229551, __global\n                                  unsigned char *mem_229555, __global\n                                  unsigned char *mem_229559, __global\n                                  unsigned char *mem_229608, __global\n                                  unsigned char *color_231986)\n{\n    #define segmap_group_sizze_210537 (mainzisegmap_group_sizze_210441)\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_232899;\n    int32_t local_tid_232900;\n    int64_t group_sizze_232903;\n    int32_t wave_sizze_232902;\n    int32_t group_tid_232901;\n    \n    global_tid_232899 = get_global_id(0);\n    local_tid_232900 = get_local_id(0);\n    group_sizze_232903 = get_local_size(0);\n    wave_sizze_232902 = LOCKSTEP_WIDTH;\n    group_tid_232901 = get_group_id(0);\n    \n    int32_t phys_tid_210542 = global_tid_232899;\n    int32_t phys_group_id_232904;\n    \n    phys_group_id_232904 = get_group_id(0);\n    for (int32_t i_232905 = 0; i_232905 <\n         sdiv_up32(sext_i64_i32(sdiv_up64(partition_sizze_203577,\n",
                   "                                          segmap_group_sizze_210537)) -\n                   phys_group_id_232904, sext_i64_i32(num_groups_210538));\n         i_232905++) {\n        int32_t virt_group_id_232906 = phys_group_id_232904 + i_232905 *\n                sext_i64_i32(num_groups_210538);\n        int64_t global_tid_232907 = sext_i32_i64(virt_group_id_232906) *\n                segmap_group_sizze_210537 + sext_i32_i64(local_tid_232900);\n        int64_t slice_232908 = partition_sizze_203577;\n        int64_t gtid_210541 = global_tid_232907;\n        int64_t remnant_232909 = global_tid_232907 - gtid_210541;\n        \n        if (slt64(gtid_210541, partition_sizze_203577)) {\n            for (int64_t i_228927 = 0; i_228927 < n_p_203492; i_228927++) {\n                int64_t x_210553;\n                \n                x_210553 = ((__global int64_t *) mem_229543)[i_228927 *\n                                                             partition_sizze_203577 +\n                                                             gtid_210541];\n                for (int64_t i_228931 = 0; i_228931 < s_n_m_203636;\n                     i_228931++) {\n                    int64_t x_210558;\n                    \n                    x_210558 = ((__global int64_t *) mem_229551)[i_228927 *\n                                                                 (partition_sizze_203577 *\n                                                                  s_n_m_203636) +\n                                                                 i_228931 *\n                                                                 partition_sizze_203577 +\n                                                                 gtid_210541];\n                    \n                    double x_210559;\n                    \n                    x_210559 = ((__global double *) mem_229540)[i_228927 *\n                                                                (partition_sizze_203577 *\n                                                              ",
                   "   s_n_m_203636) +\n                                                                i_228931 *\n                                                                partition_sizze_203577 +\n                                                                gtid_210541];\n                    \n                    bool cond_210560 = i_228931 == (int64_t) 0;\n                    int64_t defunc_0_m_fun_res_210561;\n                    \n                    if (cond_210560) {\n                        defunc_0_m_fun_res_210561 = (int64_t) 0;\n                    } else {\n                        int64_t y_210562 = sub64(s_n_m_203636, (int64_t) 1);\n                        bool cond_210563 = i_228931 == y_210562;\n                        int64_t defunc_0_m_fun_res_f_res_210564;\n                        \n                        if (cond_210563) {\n                            int64_t defunc_0_m_fun_res_f_res_t_res_210565 =\n                                    sub64(pad_css_len_203632, (int64_t) 1);\n                            \n                            defunc_0_m_fun_res_f_res_210564 =\n                                defunc_0_m_fun_res_f_res_t_res_210565;\n                        } else {\n                            int64_t x_210566 = sub64(i_228931, (int64_t) 1);\n                            int64_t x_210567 = mul64(jump_s_203499, x_210566);\n                            int64_t min_arg_210568 = add64((int64_t) 1,\n                                                           x_210567);\n                            int64_t min_res_210569 =\n                                    smin64(defunc_0_f_res_203631,\n                                           min_arg_210568);\n                            \n                            defunc_0_m_fun_res_f_res_210564 = min_res_210569;\n                        }\n                        defunc_0_m_fun_res_210561 =\n                            defunc_0_m_fun_res_f_res_210564;\n                    }\n                    \n                    double defunc_2_reduce_res_210570;\n  ",
                   "                  double redout_228447 = 0.0;\n                    \n                    for (int64_t i_228448 = 0; i_228448 < q_s_203493;\n                         i_228448++) {\n                        bool cond_210575 = sle64(x_210553, i_228448);\n                        int64_t defunc_0_f_res_210576;\n                        \n                        if (cond_210575) {\n                            defunc_0_f_res_210576 = (int64_t) 0;\n                        } else {\n                            int64_t i_210577 = add64(x_210558, i_228448);\n                            int64_t defunc_0_add_arg_210578;\n                            \n                            defunc_0_add_arg_210578 = ((__global\n                                                        int64_t *) mem_229559)[i_228927 *\n                                                                               (partition_sizze_203577 *\n                                                                                defunc_0_f_res_203631) +\n                                                                               i_210577 *\n                                                                               partition_sizze_203577 +\n                                                                               gtid_210541];\n                            \n                            int64_t defunc_1_add_res_210579 = add64((int64_t) 1,\n                                                                    defunc_0_add_arg_210578);\n                            \n                            defunc_0_f_res_210576 = defunc_1_add_res_210579;\n                        }\n                        \n                        double defunc_0_f_res_210580;\n                        \n                        if (cond_210575) {\n                            defunc_0_f_res_210580 = 0.0;\n                        } else {\n                            int64_t i_210581 = add64(x_210558, i_228448);\n                            double defunc_0_add_arg_210582;\n          ",
                   "                  \n                            defunc_0_add_arg_210582 = ((__global\n                                                        double *) mem_229547)[i_228927 *\n                                                                              (partition_sizze_203577 *\n                                                                               defunc_0_f_res_203631) +\n                                                                              i_210581 *\n                                                                              partition_sizze_203577 +\n                                                                              gtid_210541];\n                            defunc_0_f_res_210580 = defunc_0_add_arg_210582;\n                        }\n                        \n                        int64_t binop_p_210583 = sub64(defunc_0_f_res_210576,\n                                                       defunc_0_m_fun_res_210561);\n                        double defunc_0_f_res_210584 =\n                               sitofp_i64_f64(binop_p_210583);\n                        double abs_res_210585 = fabs(defunc_0_f_res_210584);\n                        double tmp1_210586 = abs_res_210585 / x_210559;\n                        double x_210587 = tmp1_210586 * tmp1_210586;\n                        double y_210588 = tmp1_210586 * x_210587;\n                        double tmp2_210589 = 1.0 - y_210588;\n                        double x_210590 = tmp2_210589 * tmp2_210589;\n                        double tmp3_210591 = tmp2_210589 * x_210590;\n                        double w_j_210592 = defunc_0_f_res_210580 * tmp3_210591;\n                        double defunc_1_op_res_210573 = w_j_210592 +\n                               redout_228447;\n                        double redout_tmp_232912 = defunc_1_op_res_210573;\n                        \n                        redout_228447 = redout_tmp_232912;\n                    }\n                    defunc_2_reduce_res_210570 = redout_228447;\n    ",
                   "                \n                    double a0_210593 = 1.0 / defunc_2_reduce_res_210570;\n                    int64_t defunc_0_m_fun_res_210594;\n                    \n                    if (cond_210560) {\n                        defunc_0_m_fun_res_210594 = (int64_t) 0;\n                    } else {\n                        int64_t y_210595 = sub64(s_n_m_203636, (int64_t) 1);\n                        bool cond_210596 = i_228931 == y_210595;\n                        int64_t defunc_0_m_fun_res_f_res_210597;\n                        \n                        if (cond_210596) {\n                            int64_t defunc_0_m_fun_res_f_res_t_res_210598 =\n                                    sub64(pad_css_len_203632, (int64_t) 1);\n                            \n                            defunc_0_m_fun_res_f_res_210597 =\n                                defunc_0_m_fun_res_f_res_t_res_210598;\n                        } else {\n                            int64_t x_210599 = sub64(i_228931, (int64_t) 1);\n                            int64_t x_210600 = mul64(jump_s_203499, x_210599);\n                            int64_t min_arg_210601 = add64((int64_t) 1,\n                                                           x_210600);\n                            int64_t min_res_210602 =\n                                    smin64(defunc_0_f_res_203631,\n                                           min_arg_210601);\n                            \n                            defunc_0_m_fun_res_f_res_210597 = min_res_210602;\n                        }\n                        defunc_0_m_fun_res_210594 =\n                            defunc_0_m_fun_res_f_res_210597;\n                    }\n                    \n                    double defunc_2_reduce_res_210603;\n                    double redout_228449 = 0.0;\n                    \n                    for (int64_t i_228450 = 0; i_228450 < q_s_203493;\n                         i_228450++) {\n                        bool cond_210608 = sle64(x_210553, i_228450);\n          ",
                   "              int64_t defunc_0_f_res_210609;\n                        \n                        if (cond_210608) {\n                            defunc_0_f_res_210609 = (int64_t) 0;\n                        } else {\n                            int64_t i_210610 = add64(x_210558, i_228450);\n                            int64_t defunc_0_add_arg_210611;\n                            \n                            defunc_0_add_arg_210611 = ((__global\n                                                        int64_t *) mem_229559)[i_228927 *\n                                                                               (partition_sizze_203577 *\n                                                                                defunc_0_f_res_203631) +\n                                                                               i_210610 *\n                                                                               partition_sizze_203577 +\n                                                                               gtid_210541];\n                            \n                            int64_t defunc_1_add_res_210612 = add64((int64_t) 1,\n                                                                    defunc_0_add_arg_210611);\n                            \n                            defunc_0_f_res_210609 = defunc_1_add_res_210612;\n                        }\n                        \n                        double defunc_0_f_res_210613;\n                        \n                        if (cond_210608) {\n                            defunc_0_f_res_210613 = 0.0;\n                        } else {\n                            int64_t i_210614 = add64(x_210558, i_228450);\n                            double defunc_0_add_arg_210615;\n                            \n                            defunc_0_add_arg_210615 = ((__global\n                                                        double *) mem_229547)[i_228927 *\n                                                                              (part",
                   "ition_sizze_203577 *\n                                                                               defunc_0_f_res_203631) +\n                                                                              i_210614 *\n                                                                              partition_sizze_203577 +\n                                                                              gtid_210541];\n                            defunc_0_f_res_210613 = defunc_0_add_arg_210615;\n                        }\n                        \n                        int64_t binop_p_210616 = sub64(defunc_0_f_res_210609,\n                                                       defunc_0_m_fun_res_210594);\n                        double defunc_0_f_res_210617 =\n                               sitofp_i64_f64(binop_p_210616);\n                        double abs_res_210618 = fabs(defunc_0_f_res_210617);\n                        double tmp1_210619 = abs_res_210618 / x_210559;\n                        double x_210620 = tmp1_210619 * tmp1_210619;\n                        double y_210621 = tmp1_210619 * x_210620;\n                        double tmp2_210622 = 1.0 - y_210621;\n                        double x_210623 = tmp2_210622 * tmp2_210622;\n                        double tmp3_210624 = tmp2_210622 * x_210623;\n                        double tmp4_210625 = defunc_0_f_res_210613 *\n                               tmp3_210624;\n                        double defunc_0_f_res_210626;\n                        \n                        if (cond_210608) {\n                            defunc_0_f_res_210626 = 0.0;\n                        } else {\n                            int64_t i_210627 = add64(x_210558, i_228450);\n                            double defunc_0_add_arg_210628;\n                            \n                            defunc_0_add_arg_210628 = ((__global\n                                                        double *) mem_229555)[i_228927 *\n                                                           ",
                   "                   (partition_sizze_203577 *\n                                                                               defunc_0_f_res_203631) +\n                                                                              i_210627 *\n                                                                              partition_sizze_203577 +\n                                                                              gtid_210541];\n                            defunc_0_f_res_210626 = defunc_0_add_arg_210628;\n                        }\n                        \n                        double x_210629 = a0_210593 * tmp4_210625;\n                        double defunc_9_fit_fun_res_210630 =\n                               defunc_0_f_res_210626 * x_210629;\n                        double defunc_1_op_res_210606 =\n                               defunc_9_fit_fun_res_210630 + redout_228449;\n                        double redout_tmp_232913 = defunc_1_op_res_210606;\n                        \n                        redout_228449 = redout_tmp_232913;\n                    }\n                    defunc_2_reduce_res_210603 = redout_228449;\n                    ((__global double *) color_231986)[phys_tid_210542 +\n                                                       (i_228927 *\n                                                        (num_threads_232109 *\n                                                         s_n_m_203636) +\n                                                        i_228931 *\n                                                        num_threads_232109)] =\n                        defunc_2_reduce_res_210603;\n                }\n            }\n            for (int64_t i_232914 = 0; i_232914 < n_p_203492; i_232914++) {\n                for (int64_t i_232915 = 0; i_232915 < s_n_m_203636;\n                     i_232915++) {\n                    double tmp_232916;\n                    \n                    tmp_232916 = ((__global\n                                   double *) color_231986)[phys_t",
                   "id_210542 +\n                                                           (i_232914 *\n                                                            (num_threads_232109 *\n                                                             s_n_m_203636) +\n                                                            i_232915 *\n                                                            num_threads_232109)];\n                    ((__global double *) mem_229608)[gtid_210541 + (i_232914 *\n                                                                    (partition_sizze_203577 *\n                                                                     s_n_m_203636) +\n                                                                    i_232915 *\n                                                                    partition_sizze_203577)] =\n                        tmp_232916;\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_210537\n}\n__kernel void mainzisegmap_211682(__global int *global_failure,\n                                  int64_t n_p_203492, int64_t q_s_203493,\n                                  int64_t jump_s_203499,\n                                  int64_t partition_sizze_203577,\n                                  int64_t defunc_0_f_res_203631,\n                                  int64_t pad_css_len_203632,\n                                  int64_t s_n_m_203636,\n                                  int64_t num_groups_211662,\n                                  int64_t num_threads_232111, __global\n                                  unsigned char *ext_mem_229264, __global\n                                  unsigned char *mem_229612, __global\n                                  unsigned char *mem_229616, __global\n                                  unsigned char *mem_229620, __global\n                                  unsigned char *mem_229624, __global\n                               ",
                   "   unsigned char *mem_229628, __global\n                                  unsigned char *mem_229648, __global\n                                  unsigned char *color_231987)\n{\n    #define segmap_group_sizze_211661 (mainzisegmap_group_sizze_210636)\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_232917;\n    int32_t local_tid_232918;\n    int64_t group_sizze_232921;\n    int32_t wave_sizze_232920;\n    int32_t group_tid_232919;\n    \n    global_tid_232917 = get_global_id(0);\n    local_tid_232918 = get_local_id(0);\n    group_sizze_232921 = get_local_size(0);\n    wave_sizze_232920 = LOCKSTEP_WIDTH;\n    group_tid_232919 = get_group_id(0);\n    \n    int32_t phys_tid_211682 = global_tid_232917;\n    int32_t phys_group_id_232922;\n    \n    phys_group_id_232922 = get_group_id(0);\n    for (int32_t i_232923 = 0; i_232923 <\n         sdiv_up32(sext_i64_i32(sdiv_up64(partition_sizze_203577 * n_p_203492,\n                                          segmap_group_sizze_211661)) -\n                   phys_group_id_232922, sext_i64_i32(num_groups_211662));\n         i_232923++) {\n        int32_t virt_group_id_232924 = phys_group_id_232922 + i_232923 *\n                sext_i64_i32(num_groups_211662);\n        int64_t global_tid_232925 = sext_i32_i64(virt_group_id_232924) *\n                segmap_group_sizze_211661 + sext_i32_i64(local_tid_232918);\n        int64_t slice_232926 = n_p_203492;\n        int64_t slice_232927 = partition_sizze_203577 * slice_232926;\n        int64_t gtid_211680 = squot64(global_tid_232925, slice_232926);\n        int64_t remnant_232928 = global_tid_232925 - gtid_211680 * slice_232926;\n        int64_t gtid_211681 = remnant_232928;\n        int64_t remnant_232929 = remnant_232928 - gtid_211681;\n        \n        if (slt64(gtid_211680, partition_sizze_203577) && slt64(gtid_211681,\n                                                                n_p_203492)) {",
                   "\n            int64_t x_211686;\n            \n            x_211686 = ((__global int64_t *) ext_mem_229264)[gtid_211680 *\n                                                             n_p_203492 +\n                                                             gtid_211681];\n            for (int64_t i_228935 = 0; i_228935 < s_n_m_203636; i_228935++) {\n                int64_t x_211691;\n                \n                x_211691 = ((__global int64_t *) mem_229612)[i_228935 *\n                                                             (n_p_203492 *\n                                                              partition_sizze_203577) +\n                                                             gtid_211680 *\n                                                             n_p_203492 +\n                                                             gtid_211681];\n                \n                double x_211692;\n                \n                x_211692 = ((__global double *) mem_229616)[i_228935 *\n                                                            (n_p_203492 *\n                                                             partition_sizze_203577) +\n                                                            gtid_211680 *\n                                                            n_p_203492 +\n                                                            gtid_211681];\n                \n                bool cond_211693 = i_228935 == (int64_t) 0;\n                int64_t defunc_0_m_fun_res_211694;\n                \n                if (cond_211693) {\n                    defunc_0_m_fun_res_211694 = (int64_t) 0;\n                } else {\n                    int64_t y_211695 = sub64(s_n_m_203636, (int64_t) 1);\n                    bool cond_211696 = i_228935 == y_211695;\n                    int64_t defunc_0_m_fun_res_f_res_211697;\n                    \n                    if (cond_211696) {\n                        int64_t defunc_0_m_fun_res_f_res_t_res_211698 =\n                               ",
                   " sub64(pad_css_len_203632, (int64_t) 1);\n                        \n                        defunc_0_m_fun_res_f_res_211697 =\n                            defunc_0_m_fun_res_f_res_t_res_211698;\n                    } else {\n                        int64_t x_211699 = sub64(i_228935, (int64_t) 1);\n                        int64_t x_211700 = mul64(jump_s_203499, x_211699);\n                        int64_t min_arg_211701 = add64((int64_t) 1, x_211700);\n                        int64_t min_res_211702 = smin64(defunc_0_f_res_203631,\n                                                        min_arg_211701);\n                        \n                        defunc_0_m_fun_res_f_res_211697 = min_res_211702;\n                    }\n                    defunc_0_m_fun_res_211694 = defunc_0_m_fun_res_f_res_211697;\n                }\n                \n                double defunc_2_reduce_res_211703;\n                double redout_228455 = 0.0;\n                \n                for (int64_t i_228456 = 0; i_228456 < q_s_203493; i_228456++) {\n                    bool cond_211708 = sle64(x_211686, i_228456);\n                    int64_t defunc_0_f_res_211709;\n                    \n                    if (cond_211708) {\n                        defunc_0_f_res_211709 = (int64_t) 0;\n                    } else {\n                        int64_t i_211710 = add64(x_211691, i_228456);\n                        int64_t defunc_0_add_arg_211711;\n                        \n                        defunc_0_add_arg_211711 = ((__global\n                                                    int64_t *) mem_229620)[i_211710 *\n                                                                           (n_p_203492 *\n                                                                            partition_sizze_203577) +\n                                                                           gtid_211680 *\n                                                                           n_p_203492 +\n                                      ",
                   "                                     gtid_211681];\n                        \n                        int64_t defunc_1_add_res_211712 = add64((int64_t) 1,\n                                                                defunc_0_add_arg_211711);\n                        \n                        defunc_0_f_res_211709 = defunc_1_add_res_211712;\n                    }\n                    \n                    double defunc_0_f_res_211713;\n                    \n                    if (cond_211708) {\n                        defunc_0_f_res_211713 = 0.0;\n                    } else {\n                        int64_t i_211714 = add64(x_211691, i_228456);\n                        double defunc_0_add_arg_211715;\n                        \n                        defunc_0_add_arg_211715 = ((__global\n                                                    double *) mem_229624)[i_211714 *\n                                                                          (n_p_203492 *\n                                                                           partition_sizze_203577) +\n                                                                          gtid_211680 *\n                                                                          n_p_203492 +\n                                                                          gtid_211681];\n                        defunc_0_f_res_211713 = defunc_0_add_arg_211715;\n                    }\n                    \n                    int64_t binop_p_211716 = sub64(defunc_0_f_res_211709,\n                                                   defunc_0_m_fun_res_211694);\n                    double defunc_0_f_res_211717 =\n                           sitofp_i64_f64(binop_p_211716);\n                    double abs_res_211718 = fabs(defunc_0_f_res_211717);\n                    double tmp1_211719 = abs_res_211718 / x_211692;\n                    double x_211720 = tmp1_211719 * tmp1_211719;\n                    double y_211721 = tmp1_211719 * x_211720;\n                    double t",
                   "mp2_211722 = 1.0 - y_211721;\n                    double x_211723 = tmp2_211722 * tmp2_211722;\n                    double tmp3_211724 = tmp2_211722 * x_211723;\n                    double w_j_211725 = defunc_0_f_res_211713 * tmp3_211724;\n                    double defunc_1_op_res_211706 = w_j_211725 + redout_228455;\n                    double redout_tmp_232931 = defunc_1_op_res_211706;\n                    \n                    redout_228455 = redout_tmp_232931;\n                }\n                defunc_2_reduce_res_211703 = redout_228455;\n                \n                double a0_211726 = 1.0 / defunc_2_reduce_res_211703;\n                int64_t defunc_0_m_fun_res_211727;\n                \n                if (cond_211693) {\n                    defunc_0_m_fun_res_211727 = (int64_t) 0;\n                } else {\n                    int64_t y_211728 = sub64(s_n_m_203636, (int64_t) 1);\n                    bool cond_211729 = i_228935 == y_211728;\n                    int64_t defunc_0_m_fun_res_f_res_211730;\n                    \n                    if (cond_211729) {\n                        int64_t defunc_0_m_fun_res_f_res_t_res_211731 =\n                                sub64(pad_css_len_203632, (int64_t) 1);\n                        \n                        defunc_0_m_fun_res_f_res_211730 =\n                            defunc_0_m_fun_res_f_res_t_res_211731;\n                    } else {\n                        int64_t x_211732 = sub64(i_228935, (int64_t) 1);\n                        int64_t x_211733 = mul64(jump_s_203499, x_211732);\n                        int64_t min_arg_211734 = add64((int64_t) 1, x_211733);\n                        int64_t min_res_211735 = smin64(defunc_0_f_res_203631,\n                                                        min_arg_211734);\n                        \n                        defunc_0_m_fun_res_f_res_211730 = min_res_211735;\n                    }\n                    defunc_0_m_fun_res_211727 = defunc_0_m_fun_res_f_res_211730;\n                }\n       ",
                   "         \n                double defunc_2_reduce_res_211736;\n                double redout_228457 = 0.0;\n                \n                for (int64_t i_228458 = 0; i_228458 < q_s_203493; i_228458++) {\n                    bool cond_211741 = sle64(x_211686, i_228458);\n                    int64_t defunc_0_f_res_211742;\n                    \n                    if (cond_211741) {\n                        defunc_0_f_res_211742 = (int64_t) 0;\n                    } else {\n                        int64_t i_211743 = add64(x_211691, i_228458);\n                        int64_t defunc_0_add_arg_211744;\n                        \n                        defunc_0_add_arg_211744 = ((__global\n                                                    int64_t *) mem_229620)[i_211743 *\n                                                                           (n_p_203492 *\n                                                                            partition_sizze_203577) +\n                                                                           gtid_211680 *\n                                                                           n_p_203492 +\n                                                                           gtid_211681];\n                        \n                        int64_t defunc_1_add_res_211745 = add64((int64_t) 1,\n                                                                defunc_0_add_arg_211744);\n                        \n                        defunc_0_f_res_211742 = defunc_1_add_res_211745;\n                    }\n                    \n                    double defunc_0_f_res_211746;\n                    \n                    if (cond_211741) {\n                        defunc_0_f_res_211746 = 0.0;\n                    } else {\n                        int64_t i_211747 = add64(x_211691, i_228458);\n                        double defunc_0_add_arg_211748;\n                        \n                        defunc_0_add_arg_211748 = ((__global\n                                      ",
                   "              double *) mem_229624)[i_211747 *\n                                                                          (n_p_203492 *\n                                                                           partition_sizze_203577) +\n                                                                          gtid_211680 *\n                                                                          n_p_203492 +\n                                                                          gtid_211681];\n                        defunc_0_f_res_211746 = defunc_0_add_arg_211748;\n                    }\n                    \n                    int64_t binop_p_211749 = sub64(defunc_0_f_res_211742,\n                                                   defunc_0_m_fun_res_211727);\n                    double defunc_0_f_res_211750 =\n                           sitofp_i64_f64(binop_p_211749);\n                    double abs_res_211751 = fabs(defunc_0_f_res_211750);\n                    double tmp1_211752 = abs_res_211751 / x_211692;\n                    double x_211753 = tmp1_211752 * tmp1_211752;\n                    double y_211754 = tmp1_211752 * x_211753;\n                    double tmp2_211755 = 1.0 - y_211754;\n                    double x_211756 = tmp2_211755 * tmp2_211755;\n                    double tmp3_211757 = tmp2_211755 * x_211756;\n                    double tmp4_211758 = defunc_0_f_res_211746 * tmp3_211757;\n                    double defunc_0_f_res_211759;\n                    \n                    if (cond_211741) {\n                        defunc_0_f_res_211759 = 0.0;\n                    } else {\n                        int64_t i_211760 = add64(x_211691, i_228458);\n                        double defunc_0_add_arg_211761;\n                        \n                        defunc_0_add_arg_211761 = ((__global\n                                                    double *) mem_229628)[i_211760 *\n                                                                          (n_p_203492 *\n            ",
                   "                                                               partition_sizze_203577) +\n                                                                          gtid_211680 *\n                                                                          n_p_203492 +\n                                                                          gtid_211681];\n                        defunc_0_f_res_211759 = defunc_0_add_arg_211761;\n                    }\n                    \n                    double x_211762 = a0_211726 * tmp4_211758;\n                    double defunc_9_fit_fun_res_211763 = defunc_0_f_res_211759 *\n                           x_211762;\n                    double defunc_1_op_res_211739 =\n                           defunc_9_fit_fun_res_211763 + redout_228457;\n                    double redout_tmp_232932 = defunc_1_op_res_211739;\n                    \n                    redout_228457 = redout_tmp_232932;\n                }\n                defunc_2_reduce_res_211736 = redout_228457;\n                ((__global double *) color_231987)[phys_tid_211682 + i_228935 *\n                                                   num_threads_232111] =\n                    defunc_2_reduce_res_211736;\n            }\n            for (int64_t i_232933 = 0; i_232933 < s_n_m_203636; i_232933++) {\n                double tmp_232934;\n                \n                tmp_232934 = ((__global\n                               double *) color_231987)[phys_tid_211682 +\n                                                       i_232933 *\n                                                       num_threads_232111];\n                ((__global double *) mem_229648)[gtid_211680 * n_p_203492 +\n                                                 gtid_211681 + i_232933 *\n                                                 (n_p_203492 *\n                                                  partition_sizze_203577)] =\n                    tmp_232934;\n            }\n        }\n        barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FEN",
                   "CE);\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_211661\n}\n__kernel void mainzisegmap_211890(__global int *global_failure,\n                                  int64_t n_p_203492, int64_t q_s_203493,\n                                  int64_t jump_s_203499,\n                                  int64_t partition_sizze_203577,\n                                  int64_t defunc_0_f_res_203631,\n                                  int64_t pad_css_len_203632,\n                                  int64_t s_n_m_203636, __global\n                                  unsigned char *ext_mem_229264, __global\n                                  unsigned char *ext_mem_229265, __global\n                                  unsigned char *ext_mem_229362, __global\n                                  unsigned char *ext_mem_229363, __global\n                                  unsigned char *mem_229526, __global\n                                  unsigned char *mem_229531, __global\n                                  unsigned char *mem_229681)\n{\n    #define segmap_group_sizze_211879 (mainzisegmap_group_sizze_210971)\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_232991;\n    int32_t local_tid_232992;\n    int64_t group_sizze_232995;\n    int32_t wave_sizze_232994;\n    int32_t group_tid_232993;\n    \n    global_tid_232991 = get_global_id(0);\n    local_tid_232992 = get_local_id(0);\n    group_sizze_232995 = get_local_size(0);\n    wave_sizze_232994 = LOCKSTEP_WIDTH;\n    group_tid_232993 = get_group_id(0);\n    \n    int32_t phys_tid_211890 = global_tid_232991;\n    int64_t global_tid_232996 = sext_i32_i64(group_tid_232993) *\n            segmap_group_sizze_211879 + sext_i32_i64(local_tid_232992);\n    int64_t slice_232997 = s_n_m_203636;\n    int64_t slice_232998 = n_p_203492 * slice_232997;\n    int64_t slice_232999 = partition_sizze_203577 * slice_232998;\n    int64_t gtid_211887 = squo",
                   "t64(global_tid_232996, slice_232998);\n    int64_t remnant_233000 = global_tid_232996 - gtid_211887 * slice_232998;\n    int64_t gtid_211888 = squot64(remnant_233000, slice_232997);\n    int64_t remnant_233001 = remnant_233000 - gtid_211888 * slice_232997;\n    int64_t gtid_211889 = remnant_233001;\n    int64_t remnant_233002 = remnant_233001 - gtid_211889;\n    \n    if ((slt64(gtid_211887, partition_sizze_203577) && slt64(gtid_211888,\n                                                             n_p_203492)) &&\n        slt64(gtid_211889, s_n_m_203636)) {\n        int64_t x_211894;\n        \n        x_211894 = ((__global int64_t *) ext_mem_229264)[gtid_211887 *\n                                                         n_p_203492 +\n                                                         gtid_211888];\n        \n        int64_t x_211896;\n        \n        x_211896 = ((__global int64_t *) ext_mem_229363)[gtid_211887 *\n                                                         (s_n_m_203636 *\n                                                          n_p_203492) +\n                                                         gtid_211888 *\n                                                         s_n_m_203636 +\n                                                         gtid_211889];\n        \n        double x_211897;\n        \n        x_211897 = ((__global double *) ext_mem_229362)[gtid_211887 *\n                                                        (s_n_m_203636 *\n                                                         n_p_203492) +\n                                                        gtid_211888 *\n                                                        s_n_m_203636 +\n                                                        gtid_211889];\n        \n        bool cond_211898 = gtid_211889 == (int64_t) 0;\n        int64_t defunc_0_m_fun_res_211899;\n        \n        if (cond_211898) {\n            defunc_0_m_fun_res_211899 = (int64_t) 0;\n        } else {\n            int64_t y_211900 = sub64(s_n_m_2",
                   "03636, (int64_t) 1);\n            bool cond_211901 = gtid_211889 == y_211900;\n            int64_t defunc_0_m_fun_res_f_res_211902;\n            \n            if (cond_211901) {\n                int64_t defunc_0_m_fun_res_f_res_t_res_211903 =\n                        sub64(pad_css_len_203632, (int64_t) 1);\n                \n                defunc_0_m_fun_res_f_res_211902 =\n                    defunc_0_m_fun_res_f_res_t_res_211903;\n            } else {\n                int64_t x_211904 = sub64(gtid_211889, (int64_t) 1);\n                int64_t x_211905 = mul64(jump_s_203499, x_211904);\n                int64_t min_arg_211906 = add64((int64_t) 1, x_211905);\n                int64_t min_res_211907 = smin64(defunc_0_f_res_203631,\n                                                min_arg_211906);\n                \n                defunc_0_m_fun_res_f_res_211902 = min_res_211907;\n            }\n            defunc_0_m_fun_res_211899 = defunc_0_m_fun_res_f_res_211902;\n        }\n        \n        double defunc_2_reduce_res_211908;\n        double redout_228471 = 0.0;\n        \n        for (int64_t i_228472 = 0; i_228472 < q_s_203493; i_228472++) {\n            bool cond_211913 = sle64(x_211894, i_228472);\n            int64_t defunc_0_f_res_211914;\n            \n            if (cond_211913) {\n                defunc_0_f_res_211914 = (int64_t) 0;\n            } else {\n                int64_t i_211915 = add64(x_211896, i_228472);\n                int64_t defunc_0_add_arg_211916;\n                \n                defunc_0_add_arg_211916 = ((__global\n                                            int64_t *) ext_mem_229265)[gtid_211887 *\n                                                                       (defunc_0_f_res_203631 *\n                                                                        n_p_203492) +\n                                                                       gtid_211888 *\n                                                                       defunc_0_f_res_203631 +\n             ",
                   "                                                          i_211915];\n                \n                int64_t defunc_1_add_res_211917 = add64((int64_t) 1,\n                                                        defunc_0_add_arg_211916);\n                \n                defunc_0_f_res_211914 = defunc_1_add_res_211917;\n            }\n            \n            double defunc_0_f_res_211918;\n            \n            if (cond_211913) {\n                defunc_0_f_res_211918 = 0.0;\n            } else {\n                int64_t i_211919 = add64(x_211896, i_228472);\n                double defunc_0_add_arg_211920;\n                \n                defunc_0_add_arg_211920 = ((__global\n                                            double *) mem_229531)[gtid_211887 *\n                                                                  (defunc_0_f_res_203631 *\n                                                                   n_p_203492) +\n                                                                  gtid_211888 *\n                                                                  defunc_0_f_res_203631 +\n                                                                  i_211919];\n                defunc_0_f_res_211918 = defunc_0_add_arg_211920;\n            }\n            \n            int64_t binop_p_211921 = sub64(defunc_0_f_res_211914,\n                                           defunc_0_m_fun_res_211899);\n            double defunc_0_f_res_211922 = sitofp_i64_f64(binop_p_211921);\n            double abs_res_211923 = fabs(defunc_0_f_res_211922);\n            double tmp1_211924 = abs_res_211923 / x_211897;\n            double x_211925 = tmp1_211924 * tmp1_211924;\n            double y_211926 = tmp1_211924 * x_211925;\n            double tmp2_211927 = 1.0 - y_211926;\n            double x_211928 = tmp2_211927 * tmp2_211927;\n            double tmp3_211929 = tmp2_211927 * x_211928;\n            double w_j_211930 = defunc_0_f_res_211918 * tmp3_211929;\n            double defunc_1_op_res_211911 = w_j_211",
                   "930 + redout_228471;\n            double redout_tmp_233003 = defunc_1_op_res_211911;\n            \n            redout_228471 = redout_tmp_233003;\n        }\n        defunc_2_reduce_res_211908 = redout_228471;\n        \n        double a0_211931 = 1.0 / defunc_2_reduce_res_211908;\n        int64_t defunc_0_m_fun_res_211932;\n        \n        if (cond_211898) {\n            defunc_0_m_fun_res_211932 = (int64_t) 0;\n        } else {\n            int64_t y_211933 = sub64(s_n_m_203636, (int64_t) 1);\n            bool cond_211934 = gtid_211889 == y_211933;\n            int64_t defunc_0_m_fun_res_f_res_211935;\n            \n            if (cond_211934) {\n                int64_t defunc_0_m_fun_res_f_res_t_res_211936 =\n                        sub64(pad_css_len_203632, (int64_t) 1);\n                \n                defunc_0_m_fun_res_f_res_211935 =\n                    defunc_0_m_fun_res_f_res_t_res_211936;\n            } else {\n                int64_t x_211937 = sub64(gtid_211889, (int64_t) 1);\n                int64_t x_211938 = mul64(jump_s_203499, x_211937);\n                int64_t min_arg_211939 = add64((int64_t) 1, x_211938);\n                int64_t min_res_211940 = smin64(defunc_0_f_res_203631,\n                                                min_arg_211939);\n                \n                defunc_0_m_fun_res_f_res_211935 = min_res_211940;\n            }\n            defunc_0_m_fun_res_211932 = defunc_0_m_fun_res_f_res_211935;\n        }\n        \n        double defunc_2_reduce_res_211941;\n        double redout_228473 = 0.0;\n        \n        for (int64_t i_228474 = 0; i_228474 < q_s_203493; i_228474++) {\n            bool cond_211946 = sle64(x_211894, i_228474);\n            int64_t defunc_0_f_res_211947;\n            \n            if (cond_211946) {\n                defunc_0_f_res_211947 = (int64_t) 0;\n            } else {\n                int64_t i_211948 = add64(x_211896, i_228474);\n                int64_t defunc_0_add_arg_211949;\n                \n                defunc_0_add_arg_211949 = ((",
                   "__global\n                                            int64_t *) ext_mem_229265)[gtid_211887 *\n                                                                       (defunc_0_f_res_203631 *\n                                                                        n_p_203492) +\n                                                                       gtid_211888 *\n                                                                       defunc_0_f_res_203631 +\n                                                                       i_211948];\n                \n                int64_t defunc_1_add_res_211950 = add64((int64_t) 1,\n                                                        defunc_0_add_arg_211949);\n                \n                defunc_0_f_res_211947 = defunc_1_add_res_211950;\n            }\n            \n            double defunc_0_f_res_211951;\n            \n            if (cond_211946) {\n                defunc_0_f_res_211951 = 0.0;\n            } else {\n                int64_t i_211952 = add64(x_211896, i_228474);\n                double defunc_0_add_arg_211953;\n                \n                defunc_0_add_arg_211953 = ((__global\n                                            double *) mem_229531)[gtid_211887 *\n                                                                  (defunc_0_f_res_203631 *\n                                                                   n_p_203492) +\n                                                                  gtid_211888 *\n                                                                  defunc_0_f_res_203631 +\n                                                                  i_211952];\n                defunc_0_f_res_211951 = defunc_0_add_arg_211953;\n            }\n            \n            int64_t binop_p_211954 = sub64(defunc_0_f_res_211947,\n                                           defunc_0_m_fun_res_211932);\n            double defunc_0_f_res_211955 = sitofp_i64_f64(binop_p_211954);\n            double abs_res_211956 = fabs(defunc_0_",
                   "f_res_211955);\n            double tmp1_211957 = abs_res_211956 / x_211897;\n            double x_211958 = tmp1_211957 * tmp1_211957;\n            double y_211959 = tmp1_211957 * x_211958;\n            double tmp2_211960 = 1.0 - y_211959;\n            double x_211961 = tmp2_211960 * tmp2_211960;\n            double tmp3_211962 = tmp2_211960 * x_211961;\n            double tmp4_211963 = defunc_0_f_res_211951 * tmp3_211962;\n            double defunc_0_f_res_211964;\n            \n            if (cond_211946) {\n                defunc_0_f_res_211964 = 0.0;\n            } else {\n                int64_t i_211965 = add64(x_211896, i_228474);\n                double defunc_0_add_arg_211966;\n                \n                defunc_0_add_arg_211966 = ((__global\n                                            double *) mem_229526)[gtid_211887 *\n                                                                  (defunc_0_f_res_203631 *\n                                                                   n_p_203492) +\n                                                                  gtid_211888 *\n                                                                  defunc_0_f_res_203631 +\n                                                                  i_211965];\n                defunc_0_f_res_211964 = defunc_0_add_arg_211966;\n            }\n            \n            double x_211967 = a0_211931 * tmp4_211963;\n            double defunc_9_fit_fun_res_211968 = defunc_0_f_res_211964 *\n                   x_211967;\n            double defunc_1_op_res_211944 = defunc_9_fit_fun_res_211968 +\n                   redout_228473;\n            double redout_tmp_233004 = defunc_1_op_res_211944;\n            \n            redout_228473 = redout_tmp_233004;\n        }\n        defunc_2_reduce_res_211941 = redout_228473;\n        ((__global double *) mem_229681)[gtid_211887 * (s_n_m_203636 *\n                                                        n_p_203492) +\n                                         gtid_211888 * s_n_m_203636",
                   " +\n                                         gtid_211889] =\n            defunc_2_reduce_res_211941;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_211879\n}\n__kernel void mainzisegmap_211979(__global int *global_failure,\n                                  int64_t n_p_203492, int64_t jump_s_203499,\n                                  int64_t partition_sizze_203577,\n                                  int64_t defunc_0_f_res_203631,\n                                  int64_t pad_css_len_203632,\n                                  int64_t s_n_m_203636, __global\n                                  unsigned char *mem_229687, __global\n                                  unsigned char *mem_229691)\n{\n    #define segmap_group_sizze_211972 (mainzisegmap_group_sizze_211232)\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_233005;\n    int32_t local_tid_233006;\n    int64_t group_sizze_233009;\n    int32_t wave_sizze_233008;\n    int32_t group_tid_233007;\n    \n    global_tid_233005 = get_global_id(0);\n    local_tid_233006 = get_local_id(0);\n    group_sizze_233009 = get_local_size(0);\n    wave_sizze_233008 = LOCKSTEP_WIDTH;\n    group_tid_233007 = get_group_id(0);\n    \n    int32_t phys_tid_211979 = global_tid_233005;\n    int64_t global_tid_233010 = sext_i32_i64(group_tid_233007) *\n            segmap_group_sizze_211972 + sext_i32_i64(local_tid_233006);\n    int64_t slice_233011 = s_n_m_203636;\n    int64_t slice_233012 = n_p_203492 * slice_233011;\n    int64_t slice_233013 = partition_sizze_203577 * slice_233012;\n    int64_t gtid_211976 = squot64(global_tid_233010, slice_233012);\n    int64_t remnant_233014 = global_tid_233010 - gtid_211976 * slice_233012;\n    int64_t gtid_211977 = squot64(remnant_233014, slice_233011);\n    int64_t remnant_233015 = remnant_233014 - gtid_211977 * slice_233011;\n    int64_t gtid_211978 = remnant_233015;\n    int64_t remnant_233016 = r",
                   "emnant_233015 - gtid_211978;\n    \n    if ((slt64(gtid_211976, partition_sizze_203577) && slt64(gtid_211977,\n                                                             n_p_203492)) &&\n        slt64(gtid_211978, s_n_m_203636)) {\n        bool cond_211981 = gtid_211978 == (int64_t) 0;\n        int64_t defunc_0_m_fun_res_211982;\n        \n        if (cond_211981) {\n            defunc_0_m_fun_res_211982 = (int64_t) 0;\n        } else {\n            int64_t y_211983 = sub64(s_n_m_203636, (int64_t) 1);\n            bool cond_211984 = gtid_211978 == y_211983;\n            int64_t defunc_0_m_fun_res_f_res_211985;\n            \n            if (cond_211984) {\n                int64_t defunc_0_m_fun_res_f_res_t_res_211986 =\n                        sub64(pad_css_len_203632, (int64_t) 1);\n                \n                defunc_0_m_fun_res_f_res_211985 =\n                    defunc_0_m_fun_res_f_res_t_res_211986;\n            } else {\n                int64_t x_211987 = sub64(gtid_211978, (int64_t) 1);\n                int64_t x_211988 = mul64(jump_s_203499, x_211987);\n                int64_t min_arg_211989 = add64((int64_t) 1, x_211988);\n                int64_t min_res_211990 = smin64(defunc_0_f_res_203631,\n                                                min_arg_211989);\n                \n                defunc_0_m_fun_res_f_res_211985 = min_res_211990;\n            }\n            defunc_0_m_fun_res_211982 = defunc_0_m_fun_res_f_res_211985;\n        }\n        ((__global int64_t *) mem_229687)[gtid_211976 * (s_n_m_203636 *\n                                                         n_p_203492) +\n                                          gtid_211977 * s_n_m_203636 +\n                                          gtid_211978] =\n            defunc_0_m_fun_res_211982;\n        ((__global bool *) mem_229691)[gtid_211976 * (s_n_m_203636 *\n                                                      n_p_203492) +\n                                       gtid_211977 * s_n_m_203636 +\n                                     ",
                   "  gtid_211978] = cond_211981;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_211972\n}\n__kernel void mainzisegmap_212051(__global int *global_failure,\n                                  int64_t n_p_203492, int64_t jump_s_203499,\n                                  int64_t partition_sizze_203577,\n                                  int64_t defunc_0_f_res_203631,\n                                  int64_t pad_css_len_203632,\n                                  int64_t s_n_m_203636, __global\n                                  unsigned char *mem_229697, __global\n                                  unsigned char *mem_229703, __global\n                                  unsigned char *mem_229708)\n{\n    #define segmap_group_sizze_212044 (mainzisegmap_group_sizze_211146)\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_233093;\n    int32_t local_tid_233094;\n    int64_t group_sizze_233097;\n    int32_t wave_sizze_233096;\n    int32_t group_tid_233095;\n    \n    global_tid_233093 = get_global_id(0);\n    local_tid_233094 = get_local_id(0);\n    group_sizze_233097 = get_local_size(0);\n    wave_sizze_233096 = LOCKSTEP_WIDTH;\n    group_tid_233095 = get_group_id(0);\n    \n    int32_t phys_tid_212051 = global_tid_233093;\n    int64_t global_tid_233098 = sext_i32_i64(group_tid_233095) *\n            segmap_group_sizze_212044 + sext_i32_i64(local_tid_233094);\n    int64_t slice_233099 = s_n_m_203636;\n    int64_t slice_233100 = n_p_203492 * slice_233099;\n    int64_t slice_233101 = partition_sizze_203577 * slice_233100;\n    int64_t gtid_212048 = squot64(global_tid_233098, slice_233100);\n    int64_t remnant_233102 = global_tid_233098 - gtid_212048 * slice_233100;\n    int64_t gtid_212049 = squot64(remnant_233102, slice_233099);\n    int64_t remnant_233103 = remnant_233102 - gtid_212049 * slice_233099;\n    int64_t gtid_212050 = remnant_233103;\n    int64_t remnant_233104 = ",
                   "remnant_233103 - gtid_212050;\n    \n    if ((slt64(gtid_212048, partition_sizze_203577) && slt64(gtid_212049,\n                                                             n_p_203492)) &&\n        slt64(gtid_212050, s_n_m_203636)) {\n        bool index_primexp_228722 = gtid_212050 == (int64_t) 0;\n        double defunc_2_reduce_res_212054;\n        \n        defunc_2_reduce_res_212054 = ((__global\n                                       double *) mem_229697)[gtid_212048 *\n                                                             (s_n_m_203636 *\n                                                              n_p_203492) +\n                                                             gtid_212049 *\n                                                             s_n_m_203636 +\n                                                             gtid_212050];\n        \n        double a0_212055 = 1.0 / defunc_2_reduce_res_212054;\n        int64_t defunc_0_m_fun_res_212056;\n        \n        if (index_primexp_228722) {\n            defunc_0_m_fun_res_212056 = (int64_t) 0;\n        } else {\n            int64_t y_212057 = sub64(s_n_m_203636, (int64_t) 1);\n            bool cond_212058 = gtid_212050 == y_212057;\n            int64_t defunc_0_m_fun_res_f_res_212059;\n            \n            if (cond_212058) {\n                int64_t defunc_0_m_fun_res_f_res_t_res_212060 =\n                        sub64(pad_css_len_203632, (int64_t) 1);\n                \n                defunc_0_m_fun_res_f_res_212059 =\n                    defunc_0_m_fun_res_f_res_t_res_212060;\n            } else {\n                int64_t x_212061 = sub64(gtid_212050, (int64_t) 1);\n                int64_t x_212062 = mul64(jump_s_203499, x_212061);\n                int64_t min_arg_212063 = add64((int64_t) 1, x_212062);\n                int64_t min_res_212064 = smin64(defunc_0_f_res_203631,\n                                                min_arg_212063);\n                \n                defunc_0_m_fun_res_f_res_212059 = min_res_212064;\n      ",
                   "      }\n            defunc_0_m_fun_res_212056 = defunc_0_m_fun_res_f_res_212059;\n        }\n        ((__global double *) mem_229703)[gtid_212048 * (s_n_m_203636 *\n                                                        n_p_203492) +\n                                         gtid_212049 * s_n_m_203636 +\n                                         gtid_212050] = a0_212055;\n        ((__global int64_t *) mem_229708)[gtid_212048 * (s_n_m_203636 *\n                                                         n_p_203492) +\n                                          gtid_212049 * s_n_m_203636 +\n                                          gtid_212050] =\n            defunc_0_m_fun_res_212056;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_212044\n}\n__kernel void mainzisegmap_212265(__global int *global_failure,\n                                  int64_t n_p_203492, int64_t q_s_203493,\n                                  int64_t jump_s_203499,\n                                  int64_t partition_sizze_203577,\n                                  int64_t defunc_0_f_res_203631,\n                                  int64_t pad_css_len_203632,\n                                  int64_t s_n_m_203636,\n                                  int64_t num_groups_212260,\n                                  int64_t num_threads_232119, __global\n                                  unsigned char *mem_229734, __global\n                                  unsigned char *mem_229737, __global\n                                  unsigned char *mem_229741, __global\n                                  unsigned char *mem_229745, __global\n                                  unsigned char *mem_229749, __global\n                                  unsigned char *mem_229753, __global\n                                  unsigned char *mem_229846, __global\n                                  unsigned char *mem_229850, __global\n                                  unsigned char *color_231992, __global\n                                  unsign",
                   "ed char *color_231993)\n{\n    #define segmap_group_sizze_212259 (mainzisegmap_group_sizze_212133)\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_233189;\n    int32_t local_tid_233190;\n    int64_t group_sizze_233193;\n    int32_t wave_sizze_233192;\n    int32_t group_tid_233191;\n    \n    global_tid_233189 = get_global_id(0);\n    local_tid_233190 = get_local_id(0);\n    group_sizze_233193 = get_local_size(0);\n    wave_sizze_233192 = LOCKSTEP_WIDTH;\n    group_tid_233191 = get_group_id(0);\n    \n    int32_t phys_tid_212265 = global_tid_233189;\n    int32_t phys_group_id_233194;\n    \n    phys_group_id_233194 = get_group_id(0);\n    for (int32_t i_233195 = 0; i_233195 <\n         sdiv_up32(sext_i64_i32(sdiv_up64(partition_sizze_203577,\n                                          segmap_group_sizze_212259)) -\n                   phys_group_id_233194, sext_i64_i32(num_groups_212260));\n         i_233195++) {\n        int32_t virt_group_id_233196 = phys_group_id_233194 + i_233195 *\n                sext_i64_i32(num_groups_212260);\n        int64_t global_tid_233197 = sext_i32_i64(virt_group_id_233196) *\n                segmap_group_sizze_212259 + sext_i32_i64(local_tid_233190);\n        int64_t slice_233198 = partition_sizze_203577;\n        int64_t gtid_212264 = global_tid_233197;\n        int64_t remnant_233199 = global_tid_233197 - gtid_212264;\n        \n        if (slt64(gtid_212264, partition_sizze_203577)) {\n            for (int64_t i_228941 = 0; i_228941 < n_p_203492; i_228941++) {\n                int64_t x_212277;\n                \n                x_212277 = ((__global int64_t *) mem_229737)[i_228941 *\n                                                             partition_sizze_203577 +\n                                                             gtid_212264];\n                for (int64_t i_228948 = 0; i_228948 < s_n_m_203636;\n                     i_228948++) {\n ",
                   "                   int64_t x_212283;\n                    \n                    x_212283 = ((__global int64_t *) mem_229745)[i_228941 *\n                                                                 (partition_sizze_203577 *\n                                                                  s_n_m_203636) +\n                                                                 i_228948 *\n                                                                 partition_sizze_203577 +\n                                                                 gtid_212264];\n                    \n                    double x_212284;\n                    \n                    x_212284 = ((__global double *) mem_229734)[i_228941 *\n                                                                (partition_sizze_203577 *\n                                                                 s_n_m_203636) +\n                                                                i_228948 *\n                                                                partition_sizze_203577 +\n                                                                gtid_212264];\n                    \n                    bool cond_212285 = i_228948 == (int64_t) 0;\n                    int64_t defunc_0_m_fun_res_212286;\n                    \n                    if (cond_212285) {\n                        defunc_0_m_fun_res_212286 = (int64_t) 0;\n                    } else {\n                        int64_t y_212287 = sub64(s_n_m_203636, (int64_t) 1);\n                        bool cond_212288 = i_228948 == y_212287;\n                        int64_t defunc_0_m_fun_res_f_res_212289;\n                        \n                        if (cond_212288) {\n                            int64_t defunc_0_m_fun_res_f_res_t_res_212290 =\n                                    sub64(pad_css_len_203632, (int64_t) 1);\n                            \n                            defunc_0_m_fun_res_f_res_212289 =\n                                defunc_0_m_fun_res_f_res_t_res_212290",
                   ";\n                        } else {\n                            int64_t x_212291 = sub64(i_228948, (int64_t) 1);\n                            int64_t x_212292 = mul64(jump_s_203499, x_212291);\n                            int64_t min_arg_212293 = add64((int64_t) 1,\n                                                           x_212292);\n                            int64_t min_res_212294 =\n                                    smin64(defunc_0_f_res_203631,\n                                           min_arg_212293);\n                            \n                            defunc_0_m_fun_res_f_res_212289 = min_res_212294;\n                        }\n                        defunc_0_m_fun_res_212286 =\n                            defunc_0_m_fun_res_f_res_212289;\n                    }\n                    \n                    double defunc_2_reduce_res_212295;\n                    double defunc_2_reduce_res_212296;\n                    double defunc_2_reduce_res_212297;\n                    double redout_228489;\n                    double redout_228490;\n                    double redout_228491;\n                    \n                    redout_228489 = 0.0;\n                    redout_228490 = 0.0;\n                    redout_228491 = 0.0;\n                    for (int64_t i_228492 = 0; i_228492 < q_s_203493;\n                         i_228492++) {\n                        bool cond_212308 = sle64(x_212277, i_228492);\n                        int64_t defunc_0_f_res_212309;\n                        \n                        if (cond_212308) {\n                            defunc_0_f_res_212309 = (int64_t) 0;\n                        } else {\n                            int64_t i_212310 = add64(x_212283, i_228492);\n                            int64_t defunc_0_add_arg_212311;\n                            \n                            defunc_0_add_arg_212311 = ((__global\n                                                        int64_t *) mem_229753)[i_228941 *\n                                             ",
                   "                                  (partition_sizze_203577 *\n                                                                                defunc_0_f_res_203631) +\n                                                                               i_212310 *\n                                                                               partition_sizze_203577 +\n                                                                               gtid_212264];\n                            \n                            int64_t defunc_1_add_res_212312 = add64((int64_t) 1,\n                                                                    defunc_0_add_arg_212311);\n                            \n                            defunc_0_f_res_212309 = defunc_1_add_res_212312;\n                        }\n                        \n                        double defunc_0_f_res_212313;\n                        \n                        if (cond_212308) {\n                            defunc_0_f_res_212313 = 0.0;\n                        } else {\n                            int64_t i_212314 = add64(x_212283, i_228492);\n                            double defunc_0_add_arg_212315;\n                            \n                            defunc_0_add_arg_212315 = ((__global\n                                                        double *) mem_229741)[i_228941 *\n                                                                              (partition_sizze_203577 *\n                                                                               defunc_0_f_res_203631) +\n                                                                              i_212314 *\n                                                                              partition_sizze_203577 +\n                                                                              gtid_212264];\n                            defunc_0_f_res_212313 = defunc_0_add_arg_212315;\n                        }\n                        \n                        int64_t binop_",
                   "p_212316 = sub64(defunc_0_f_res_212309,\n                                                       defunc_0_m_fun_res_212286);\n                        double defunc_0_f_res_212317 =\n                               sitofp_i64_f64(binop_p_212316);\n                        double abs_res_212318 = fabs(defunc_0_f_res_212317);\n                        double tmp1_212319 = abs_res_212318 / x_212284;\n                        double x_212320 = tmp1_212319 * tmp1_212319;\n                        double y_212321 = tmp1_212319 * x_212320;\n                        double tmp2_212322 = 1.0 - y_212321;\n                        double x_212323 = tmp2_212322 * tmp2_212322;\n                        double tmp3_212324 = tmp2_212322 * x_212323;\n                        double w_j_212325 = defunc_0_f_res_212313 * tmp3_212324;\n                        double xw_j_212326 = defunc_0_f_res_212317 * w_j_212325;\n                        double x2w_j_212327 = defunc_0_f_res_212317 *\n                               xw_j_212326;\n                        double defunc_1_op_res_212300 = w_j_212325 +\n                               redout_228489;\n                        double defunc_1_op_res_212303 = xw_j_212326 +\n                               redout_228490;\n                        double defunc_1_op_res_212306 = x2w_j_212327 +\n                               redout_228491;\n                        double redout_tmp_233204 = defunc_1_op_res_212300;\n                        double redout_tmp_233205 = defunc_1_op_res_212303;\n                        double redout_tmp_233206 = defunc_1_op_res_212306;\n                        \n                        redout_228489 = redout_tmp_233204;\n                        redout_228490 = redout_tmp_233205;\n                        redout_228491 = redout_tmp_233206;\n                    }\n                    defunc_2_reduce_res_212295 = redout_228489;\n                    defunc_2_reduce_res_212296 = redout_228490;\n                    defunc_2_reduce_res_212297 = redout_228491;\n           ",
                   "         \n                    double x_212328 = defunc_2_reduce_res_212295 *\n                           defunc_2_reduce_res_212297;\n                    double y_212329 = defunc_2_reduce_res_212296 *\n                           defunc_2_reduce_res_212296;\n                    double y_212330 = x_212328 - y_212329;\n                    double det1_212331 = 1.0 / y_212330;\n                    double a11_212332 = defunc_2_reduce_res_212297 *\n                           det1_212331;\n                    double x_212333 = 0.0 - defunc_2_reduce_res_212296;\n                    double b11_212334 = det1_212331 * x_212333;\n                    double c11_212335 = defunc_2_reduce_res_212295 *\n                           det1_212331;\n                    int64_t defunc_0_m_fun_res_212336;\n                    \n                    if (cond_212285) {\n                        defunc_0_m_fun_res_212336 = (int64_t) 0;\n                    } else {\n                        int64_t y_212337 = sub64(s_n_m_203636, (int64_t) 1);\n                        bool cond_212338 = i_228948 == y_212337;\n                        int64_t defunc_0_m_fun_res_f_res_212339;\n                        \n                        if (cond_212338) {\n                            int64_t defunc_0_m_fun_res_f_res_t_res_212340 =\n                                    sub64(pad_css_len_203632, (int64_t) 1);\n                            \n                            defunc_0_m_fun_res_f_res_212339 =\n                                defunc_0_m_fun_res_f_res_t_res_212340;\n                        } else {\n                            int64_t x_212341 = sub64(i_228948, (int64_t) 1);\n                            int64_t x_212342 = mul64(jump_s_203499, x_212341);\n                            int64_t min_arg_212343 = add64((int64_t) 1,\n                                                           x_212342);\n                            int64_t min_res_212344 =\n                                    smin64(defunc_0_f_res_203631,\n                            ",
                   "               min_arg_212343);\n                            \n                            defunc_0_m_fun_res_f_res_212339 = min_res_212344;\n                        }\n                        defunc_0_m_fun_res_212336 =\n                            defunc_0_m_fun_res_f_res_212339;\n                    }\n                    \n                    double defunc_2_reduce_res_212345;\n                    double defunc_2_reduce_res_212346;\n                    double redout_228493;\n                    double redout_228494;\n                    \n                    redout_228493 = 0.0;\n                    redout_228494 = 0.0;\n                    for (int64_t i_228495 = 0; i_228495 < q_s_203493;\n                         i_228495++) {\n                        bool cond_212354 = sle64(x_212277, i_228495);\n                        int64_t defunc_0_f_res_212355;\n                        \n                        if (cond_212354) {\n                            defunc_0_f_res_212355 = (int64_t) 0;\n                        } else {\n                            int64_t i_212356 = add64(x_212283, i_228495);\n                            int64_t defunc_0_add_arg_212357;\n                            \n                            defunc_0_add_arg_212357 = ((__global\n                                                        int64_t *) mem_229753)[i_228941 *\n                                                                               (partition_sizze_203577 *\n                                                                                defunc_0_f_res_203631) +\n                                                                               i_212356 *\n                                                                               partition_sizze_203577 +\n                                                                               gtid_212264];\n                            \n                            int64_t defunc_1_add_res_212358 = add64((int64_t) 1,\n                                                        ",
                   "            defunc_0_add_arg_212357);\n                            \n                            defunc_0_f_res_212355 = defunc_1_add_res_212358;\n                        }\n                        \n                        double defunc_0_f_res_212359;\n                        \n                        if (cond_212354) {\n                            defunc_0_f_res_212359 = 0.0;\n                        } else {\n                            int64_t i_212360 = add64(x_212283, i_228495);\n                            double defunc_0_add_arg_212361;\n                            \n                            defunc_0_add_arg_212361 = ((__global\n                                                        double *) mem_229741)[i_228941 *\n                                                                              (partition_sizze_203577 *\n                                                                               defunc_0_f_res_203631) +\n                                                                              i_212360 *\n                                                                              partition_sizze_203577 +\n                                                                              gtid_212264];\n                            defunc_0_f_res_212359 = defunc_0_add_arg_212361;\n                        }\n                        \n                        int64_t binop_p_212362 = sub64(defunc_0_f_res_212355,\n                                                       defunc_0_m_fun_res_212336);\n                        double defunc_0_f_res_212363 =\n                               sitofp_i64_f64(binop_p_212362);\n                        double abs_res_212364 = fabs(defunc_0_f_res_212363);\n                        double tmp1_212365 = abs_res_212364 / x_212284;\n                        double x_212366 = tmp1_212365 * tmp1_212365;\n                        double y_212367 = tmp1_212365 * x_212366;\n                        double tmp2_212368 = 1.0 - y_212367;\n                        double x",
                   "_212369 = tmp2_212368 * tmp2_212368;\n                        double tmp3_212370 = tmp2_212368 * x_212369;\n                        double tmp4_212371 = defunc_0_f_res_212359 *\n                               tmp3_212370;\n                        double defunc_1_f_res_212372 = defunc_0_f_res_212363 *\n                               tmp4_212371;\n                        double defunc_0_f_res_212373;\n                        \n                        if (cond_212354) {\n                            defunc_0_f_res_212373 = 0.0;\n                        } else {\n                            int64_t i_212374 = add64(x_212283, i_228495);\n                            double defunc_0_add_arg_212375;\n                            \n                            defunc_0_add_arg_212375 = ((__global\n                                                        double *) mem_229749)[i_228941 *\n                                                                              (partition_sizze_203577 *\n                                                                               defunc_0_f_res_203631) +\n                                                                              i_212374 *\n                                                                              partition_sizze_203577 +\n                                                                              gtid_212264];\n                            defunc_0_f_res_212373 = defunc_0_add_arg_212375;\n                        }\n                        \n                        double x_212376 = a11_212332 * tmp4_212371;\n                        double y_212377 = b11_212334 * defunc_1_f_res_212372;\n                        double x_212378 = x_212376 + y_212377;\n                        double defunc_9_fit_fun_res_212379 =\n                               defunc_0_f_res_212373 * x_212378;\n                        double x_212380 = b11_212334 * tmp4_212371;\n                        double y_212381 = c11_212335 * defunc_1_f_res_212372;\n                        doub",
                   "le x_212382 = x_212380 + y_212381;\n                        double defunc_9_slope_fun_res_212383 =\n                               defunc_0_f_res_212373 * x_212382;\n                        double defunc_1_op_res_212349 =\n                               defunc_9_fit_fun_res_212379 + redout_228493;\n                        double defunc_1_op_res_212352 =\n                               defunc_9_slope_fun_res_212383 + redout_228494;\n                        double redout_tmp_233207 = defunc_1_op_res_212349;\n                        double redout_tmp_233208 = defunc_1_op_res_212352;\n                        \n                        redout_228493 = redout_tmp_233207;\n                        redout_228494 = redout_tmp_233208;\n                    }\n                    defunc_2_reduce_res_212345 = redout_228493;\n                    defunc_2_reduce_res_212346 = redout_228494;\n                    ((__global double *) color_231993)[phys_tid_212265 +\n                                                       (i_228941 *\n                                                        (num_threads_232119 *\n                                                         s_n_m_203636) +\n                                                        i_228948 *\n                                                        num_threads_232119)] =\n                        defunc_2_reduce_res_212345;\n                    ((__global double *) color_231992)[phys_tid_212265 +\n                                                       (i_228941 *\n                                                        (num_threads_232119 *\n                                                         s_n_m_203636) +\n                                                        i_228948 *\n                                                        num_threads_232119)] =\n                        defunc_2_reduce_res_212346;\n                }\n            }\n            for (int64_t i_233209 = 0; i_233209 < n_p_203492; i_233209++) {\n                for (int64_t i_233210 = 0;",
                   " i_233210 < s_n_m_203636;\n                     i_233210++) {\n                    double tmp_233211;\n                    \n                    tmp_233211 = ((__global\n                                   double *) color_231993)[phys_tid_212265 +\n                                                           (i_233209 *\n                                                            (num_threads_232119 *\n                                                             s_n_m_203636) +\n                                                            i_233210 *\n                                                            num_threads_232119)];\n                    ((__global double *) mem_229846)[gtid_212264 + (i_233209 *\n                                                                    (partition_sizze_203577 *\n                                                                     s_n_m_203636) +\n                                                                    i_233210 *\n                                                                    partition_sizze_203577)] =\n                        tmp_233211;\n                }\n            }\n            for (int64_t i_233212 = 0; i_233212 < n_p_203492; i_233212++) {\n                for (int64_t i_233213 = 0; i_233213 < s_n_m_203636;\n                     i_233213++) {\n                    double tmp_233214;\n                    \n                    tmp_233214 = ((__global\n                                   double *) color_231992)[phys_tid_212265 +\n                                                           (i_233212 *\n                                                            (num_threads_232119 *\n                                                             s_n_m_203636) +\n                                                            i_233213 *\n                                                            num_threads_232119)];\n                    ((__global double *) mem_229850)[gtid_212264 + (i_233212 *\n                                                     ",
                   "               (partition_sizze_203577 *\n                                                                     s_n_m_203636) +\n                                                                    i_233213 *\n                                                                    partition_sizze_203577)] =\n                        tmp_233214;\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_212259\n}\n__kernel void mainzisegmap_213719(__global int *global_failure,\n                                  int64_t n_p_203492, int64_t q_s_203493,\n                                  int64_t jump_s_203499,\n                                  int64_t partition_sizze_203577,\n                                  int64_t defunc_0_f_res_203631,\n                                  int64_t pad_css_len_203632,\n                                  int64_t s_n_m_203636,\n                                  int64_t num_groups_213697,\n                                  int64_t num_threads_232122, __global\n                                  unsigned char *ext_mem_229264, __global\n                                  unsigned char *mem_229854, __global\n                                  unsigned char *mem_229858, __global\n                                  unsigned char *mem_229862, __global\n                                  unsigned char *mem_229866, __global\n                                  unsigned char *mem_229870, __global\n                                  unsigned char *mem_229905, __global\n                                  unsigned char *mem_229909, __global\n                                  unsigned char *color_231994, __global\n                                  unsigned char *color_231995)\n{\n    #define segmap_group_sizze_213696 (mainzisegmap_group_sizze_212389)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    \n    if (*global_failure >= 0)\n        r",
                   "eturn;\n    \n    int32_t global_tid_233215;\n    int32_t local_tid_233216;\n    int64_t group_sizze_233219;\n    int32_t wave_sizze_233218;\n    int32_t group_tid_233217;\n    \n    global_tid_233215 = get_global_id(0);\n    local_tid_233216 = get_local_id(0);\n    group_sizze_233219 = get_local_size(0);\n    wave_sizze_233218 = LOCKSTEP_WIDTH;\n    group_tid_233217 = get_group_id(0);\n    \n    int32_t phys_tid_213719 = global_tid_233215;\n    int32_t phys_group_id_233220;\n    \n    phys_group_id_233220 = get_group_id(0);\n    for (int32_t i_233221 = 0; i_233221 <\n         sdiv_up32(sext_i64_i32(sdiv_up64(partition_sizze_203577 * n_p_203492,\n                                          segmap_group_sizze_213696)) -\n                   phys_group_id_233220, sext_i64_i32(num_groups_213697));\n         i_233221++) {\n        int32_t virt_group_id_233222 = phys_group_id_233220 + i_233221 *\n                sext_i64_i32(num_groups_213697);\n        int64_t global_tid_233223 = sext_i32_i64(virt_group_id_233222) *\n                segmap_group_sizze_213696 + sext_i32_i64(local_tid_233216);\n        int64_t slice_233224 = n_p_203492;\n        int64_t slice_233225 = partition_sizze_203577 * slice_233224;\n        int64_t gtid_213717 = squot64(global_tid_233223, slice_233224);\n        int64_t remnant_233226 = global_tid_233223 - gtid_213717 * slice_233224;\n        int64_t gtid_213718 = remnant_233226;\n        int64_t remnant_233227 = remnant_233226 - gtid_213718;\n        \n        if (slt64(gtid_213717, partition_sizze_203577) && slt64(gtid_213718,\n                                                                n_p_203492)) {\n            int64_t x_213723;\n            \n            x_213723 = ((__global int64_t *) ext_mem_229264)[gtid_213717 *\n                                                             n_p_203492 +\n                                                             gtid_213718];\n            for (int64_t i_228955 = 0; i_228955 < s_n_m_203636; i_228955++) {\n                int64_t x_213729;\n     ",
                   "           \n                x_213729 = ((__global int64_t *) mem_229854)[i_228955 *\n                                                             (n_p_203492 *\n                                                              partition_sizze_203577) +\n                                                             gtid_213717 *\n                                                             n_p_203492 +\n                                                             gtid_213718];\n                \n                double x_213730;\n                \n                x_213730 = ((__global double *) mem_229858)[i_228955 *\n                                                            (n_p_203492 *\n                                                             partition_sizze_203577) +\n                                                            gtid_213717 *\n                                                            n_p_203492 +\n                                                            gtid_213718];\n                \n                bool cond_213731 = i_228955 == (int64_t) 0;\n                int64_t defunc_0_m_fun_res_213732;\n                \n                if (cond_213731) {\n                    defunc_0_m_fun_res_213732 = (int64_t) 0;\n                } else {\n                    int64_t y_213733 = sub64(s_n_m_203636, (int64_t) 1);\n                    bool cond_213734 = i_228955 == y_213733;\n                    int64_t defunc_0_m_fun_res_f_res_213735;\n                    \n                    if (cond_213734) {\n                        int64_t defunc_0_m_fun_res_f_res_t_res_213736 =\n                                sub64(pad_css_len_203632, (int64_t) 1);\n                        \n                        defunc_0_m_fun_res_f_res_213735 =\n                            defunc_0_m_fun_res_f_res_t_res_213736;\n                    } else {\n                        int64_t x_213737 = sub64(i_228955, (int64_t) 1);\n                        int64_t x_213738 = mul64(jump_s_203499, x_213737);\n                 ",
                   "       int64_t min_arg_213739 = add64((int64_t) 1, x_213738);\n                        int64_t min_res_213740 = smin64(defunc_0_f_res_203631,\n                                                        min_arg_213739);\n                        \n                        defunc_0_m_fun_res_f_res_213735 = min_res_213740;\n                    }\n                    defunc_0_m_fun_res_213732 = defunc_0_m_fun_res_f_res_213735;\n                }\n                \n                double defunc_2_reduce_res_213741;\n                double defunc_2_reduce_res_213742;\n                double defunc_2_reduce_res_213743;\n                double redout_228500;\n                double redout_228501;\n                double redout_228502;\n                \n                redout_228500 = 0.0;\n                redout_228501 = 0.0;\n                redout_228502 = 0.0;\n                for (int64_t i_228503 = 0; i_228503 < q_s_203493; i_228503++) {\n                    bool cond_213754 = sle64(x_213723, i_228503);\n                    int64_t defunc_0_f_res_213755;\n                    \n                    if (cond_213754) {\n                        defunc_0_f_res_213755 = (int64_t) 0;\n                    } else {\n                        int64_t i_213756 = add64(x_213729, i_228503);\n                        int64_t defunc_0_add_arg_213757;\n                        \n                        defunc_0_add_arg_213757 = ((__global\n                                                    int64_t *) mem_229862)[i_213756 *\n                                                                           (n_p_203492 *\n                                                                            partition_sizze_203577) +\n                                                                           gtid_213717 *\n                                                                           n_p_203492 +\n                                                                           gtid_213718];\n                        \n                        in",
                   "t64_t defunc_1_add_res_213758 = add64((int64_t) 1,\n                                                                defunc_0_add_arg_213757);\n                        \n                        defunc_0_f_res_213755 = defunc_1_add_res_213758;\n                    }\n                    \n                    double defunc_0_f_res_213759;\n                    \n                    if (cond_213754) {\n                        defunc_0_f_res_213759 = 0.0;\n                    } else {\n                        int64_t i_213760 = add64(x_213729, i_228503);\n                        double defunc_0_add_arg_213761;\n                        \n                        defunc_0_add_arg_213761 = ((__global\n                                                    double *) mem_229866)[i_213760 *\n                                                                          (n_p_203492 *\n                                                                           partition_sizze_203577) +\n                                                                          gtid_213717 *\n                                                                          n_p_203492 +\n                                                                          gtid_213718];\n                        defunc_0_f_res_213759 = defunc_0_add_arg_213761;\n                    }\n                    \n                    int64_t binop_p_213762 = sub64(defunc_0_f_res_213755,\n                                                   defunc_0_m_fun_res_213732);\n                    double defunc_0_f_res_213763 =\n                           sitofp_i64_f64(binop_p_213762);\n                    double abs_res_213764 = fabs(defunc_0_f_res_213763);\n                    double tmp1_213765 = abs_res_213764 / x_213730;\n                    double x_213766 = tmp1_213765 * tmp1_213765;\n                    double y_213767 = tmp1_213765 * x_213766;\n                    double tmp2_213768 = 1.0 - y_213767;\n                    double x_213769 = tmp2_213768 * tmp2_213768;\n        ",
                   "            double tmp3_213770 = tmp2_213768 * x_213769;\n                    double w_j_213771 = defunc_0_f_res_213759 * tmp3_213770;\n                    double xw_j_213772 = defunc_0_f_res_213763 * w_j_213771;\n                    double x2w_j_213773 = defunc_0_f_res_213763 * xw_j_213772;\n                    double defunc_1_op_res_213746 = w_j_213771 + redout_228500;\n                    double defunc_1_op_res_213749 = xw_j_213772 + redout_228501;\n                    double defunc_1_op_res_213752 = x2w_j_213773 +\n                           redout_228502;\n                    double redout_tmp_233230 = defunc_1_op_res_213746;\n                    double redout_tmp_233231 = defunc_1_op_res_213749;\n                    double redout_tmp_233232 = defunc_1_op_res_213752;\n                    \n                    redout_228500 = redout_tmp_233230;\n                    redout_228501 = redout_tmp_233231;\n                    redout_228502 = redout_tmp_233232;\n                }\n                defunc_2_reduce_res_213741 = redout_228500;\n                defunc_2_reduce_res_213742 = redout_228501;\n                defunc_2_reduce_res_213743 = redout_228502;\n                \n                double x_213774 = defunc_2_reduce_res_213741 *\n                       defunc_2_reduce_res_213743;\n                double y_213775 = defunc_2_reduce_res_213742 *\n                       defunc_2_reduce_res_213742;\n                double y_213776 = x_213774 - y_213775;\n                double det1_213777 = 1.0 / y_213776;\n                double a11_213778 = defunc_2_reduce_res_213743 * det1_213777;\n                double x_213779 = 0.0 - defunc_2_reduce_res_213742;\n                double b11_213780 = det1_213777 * x_213779;\n                double c11_213781 = defunc_2_reduce_res_213741 * det1_213777;\n                int64_t defunc_0_m_fun_res_213782;\n                \n                if (cond_213731) {\n                    defunc_0_m_fun_res_213782 = (int64_t) 0;\n                } else {\n                 ",
                   "   int64_t y_213783 = sub64(s_n_m_203636, (int64_t) 1);\n                    bool cond_213784 = i_228955 == y_213783;\n                    int64_t defunc_0_m_fun_res_f_res_213785;\n                    \n                    if (cond_213784) {\n                        int64_t defunc_0_m_fun_res_f_res_t_res_213786 =\n                                sub64(pad_css_len_203632, (int64_t) 1);\n                        \n                        defunc_0_m_fun_res_f_res_213785 =\n                            defunc_0_m_fun_res_f_res_t_res_213786;\n                    } else {\n                        int64_t x_213787 = sub64(i_228955, (int64_t) 1);\n                        int64_t x_213788 = mul64(jump_s_203499, x_213787);\n                        int64_t min_arg_213789 = add64((int64_t) 1, x_213788);\n                        int64_t min_res_213790 = smin64(defunc_0_f_res_203631,\n                                                        min_arg_213789);\n                        \n                        defunc_0_m_fun_res_f_res_213785 = min_res_213790;\n                    }\n                    defunc_0_m_fun_res_213782 = defunc_0_m_fun_res_f_res_213785;\n                }\n                \n                double defunc_2_reduce_res_213791;\n                double defunc_2_reduce_res_213792;\n                double redout_228504;\n                double redout_228505;\n                \n                redout_228504 = 0.0;\n                redout_228505 = 0.0;\n                for (int64_t i_228506 = 0; i_228506 < q_s_203493; i_228506++) {\n                    bool cond_213800 = sle64(x_213723, i_228506);\n                    int64_t defunc_0_f_res_213801;\n                    \n                    if (cond_213800) {\n                        defunc_0_f_res_213801 = (int64_t) 0;\n                    } else {\n                        int64_t i_213802 = add64(x_213729, i_228506);\n                        int64_t defunc_0_add_arg_213803;\n                        \n                        defunc_0_add_arg_213803 = ((__g",
                   "lobal\n                                                    int64_t *) mem_229862)[i_213802 *\n                                                                           (n_p_203492 *\n                                                                            partition_sizze_203577) +\n                                                                           gtid_213717 *\n                                                                           n_p_203492 +\n                                                                           gtid_213718];\n                        \n                        int64_t defunc_1_add_res_213804 = add64((int64_t) 1,\n                                                                defunc_0_add_arg_213803);\n                        \n                        defunc_0_f_res_213801 = defunc_1_add_res_213804;\n                    }\n                    \n                    double defunc_0_f_res_213805;\n                    \n                    if (cond_213800) {\n                        defunc_0_f_res_213805 = 0.0;\n                    } else {\n                        int64_t i_213806 = add64(x_213729, i_228506);\n                        double defunc_0_add_arg_213807;\n                        \n                        defunc_0_add_arg_213807 = ((__global\n                                                    double *) mem_229866)[i_213806 *\n                                                                          (n_p_203492 *\n                                                                           partition_sizze_203577) +\n                                                                          gtid_213717 *\n                                                                          n_p_203492 +\n                                                                          gtid_213718];\n                        defunc_0_f_res_213805 = defunc_0_add_arg_213807;\n                    }\n                    \n                    int64_t binop_p_213808 = sub64(defunc_0_f",
                   "_res_213801,\n                                                   defunc_0_m_fun_res_213782);\n                    double defunc_0_f_res_213809 =\n                           sitofp_i64_f64(binop_p_213808);\n                    double abs_res_213810 = fabs(defunc_0_f_res_213809);\n                    double tmp1_213811 = abs_res_213810 / x_213730;\n                    double x_213812 = tmp1_213811 * tmp1_213811;\n                    double y_213813 = tmp1_213811 * x_213812;\n                    double tmp2_213814 = 1.0 - y_213813;\n                    double x_213815 = tmp2_213814 * tmp2_213814;\n                    double tmp3_213816 = tmp2_213814 * x_213815;\n                    double tmp4_213817 = defunc_0_f_res_213805 * tmp3_213816;\n                    double defunc_1_f_res_213818 = defunc_0_f_res_213809 *\n                           tmp4_213817;\n                    double defunc_0_f_res_213819;\n                    \n                    if (cond_213800) {\n                        defunc_0_f_res_213819 = 0.0;\n                    } else {\n                        int64_t i_213820 = add64(x_213729, i_228506);\n                        double defunc_0_add_arg_213821;\n                        \n                        defunc_0_add_arg_213821 = ((__global\n                                                    double *) mem_229870)[i_213820 *\n                                                                          (n_p_203492 *\n                                                                           partition_sizze_203577) +\n                                                                          gtid_213717 *\n                                                                          n_p_203492 +\n                                                                          gtid_213718];\n                        defunc_0_f_res_213819 = defunc_0_add_arg_213821;\n                    }\n                    \n                    double x_213822 = a11_213778 * tmp4_213817;\n                    double y_",
                   "213823 = b11_213780 * defunc_1_f_res_213818;\n                    double x_213824 = x_213822 + y_213823;\n                    double defunc_9_fit_fun_res_213825 = defunc_0_f_res_213819 *\n                           x_213824;\n                    double x_213826 = b11_213780 * tmp4_213817;\n                    double y_213827 = c11_213781 * defunc_1_f_res_213818;\n                    double x_213828 = x_213826 + y_213827;\n                    double defunc_9_slope_fun_res_213829 =\n                           defunc_0_f_res_213819 * x_213828;\n                    double defunc_1_op_res_213795 =\n                           defunc_9_fit_fun_res_213825 + redout_228504;\n                    double defunc_1_op_res_213798 =\n                           defunc_9_slope_fun_res_213829 + redout_228505;\n                    double redout_tmp_233233 = defunc_1_op_res_213795;\n                    double redout_tmp_233234 = defunc_1_op_res_213798;\n                    \n                    redout_228504 = redout_tmp_233233;\n                    redout_228505 = redout_tmp_233234;\n                }\n                defunc_2_reduce_res_213791 = redout_228504;\n                defunc_2_reduce_res_213792 = redout_228505;\n                ((__global double *) color_231995)[phys_tid_213719 + i_228955 *\n                                                   num_threads_232122] =\n                    defunc_2_reduce_res_213791;\n                ((__global double *) color_231994)[phys_tid_213719 + i_228955 *\n                                                   num_threads_232122] =\n                    defunc_2_reduce_res_213792;\n            }\n            for (int64_t i_233235 = 0; i_233235 < s_n_m_203636; i_233235++) {\n                double tmp_233236;\n                \n                tmp_233236 = ((__global\n                               double *) color_231995)[phys_tid_213719 +\n                                                       i_233235 *\n                                                       num_threads_232122];",
                   "\n                ((__global double *) mem_229905)[gtid_213717 * n_p_203492 +\n                                                 gtid_213718 + i_233235 *\n                                                 (n_p_203492 *\n                                                  partition_sizze_203577)] =\n                    tmp_233236;\n            }\n            for (int64_t i_233237 = 0; i_233237 < s_n_m_203636; i_233237++) {\n                double tmp_233238;\n                \n                tmp_233238 = ((__global\n                               double *) color_231994)[phys_tid_213719 +\n                                                       i_233237 *\n                                                       num_threads_232122];\n                ((__global double *) mem_229909)[gtid_213717 * n_p_203492 +\n                                                 gtid_213718 + i_233237 *\n                                                 (n_p_203492 *\n                                                  partition_sizze_203577)] =\n                    tmp_233238;\n            }\n        }\n        barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_213696\n}\n__kernel void mainzisegmap_213994(__global int *global_failure,\n                                  int64_t n_p_203492, int64_t q_s_203493,\n                                  int64_t jump_s_203499,\n                                  int64_t partition_sizze_203577,\n                                  int64_t defunc_0_f_res_203631,\n                                  int64_t pad_css_len_203632,\n                                  int64_t s_n_m_203636, __global\n                                  unsigned char *ext_mem_229264, __global\n                                  unsigned char *ext_mem_229265, __global\n                                  unsigned char *ext_mem_229362, __global\n                                  unsigned char *ext_mem_229363, __global\n                                  unsigned char *",
                   "mem_229526, __global\n                                  unsigned char *mem_229531, __global\n                                  unsigned char *mem_229962, __global\n                                  unsigned char *mem_229967)\n{\n    #define segmap_group_sizze_213981 (mainzisegmap_group_sizze_212822)\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_233321;\n    int32_t local_tid_233322;\n    int64_t group_sizze_233325;\n    int32_t wave_sizze_233324;\n    int32_t group_tid_233323;\n    \n    global_tid_233321 = get_global_id(0);\n    local_tid_233322 = get_local_id(0);\n    group_sizze_233325 = get_local_size(0);\n    wave_sizze_233324 = LOCKSTEP_WIDTH;\n    group_tid_233323 = get_group_id(0);\n    \n    int32_t phys_tid_213994 = global_tid_233321;\n    int64_t global_tid_233326 = sext_i32_i64(group_tid_233323) *\n            segmap_group_sizze_213981 + sext_i32_i64(local_tid_233322);\n    int64_t slice_233327 = s_n_m_203636;\n    int64_t slice_233328 = n_p_203492 * slice_233327;\n    int64_t slice_233329 = partition_sizze_203577 * slice_233328;\n    int64_t gtid_213991 = squot64(global_tid_233326, slice_233328);\n    int64_t remnant_233330 = global_tid_233326 - gtid_213991 * slice_233328;\n    int64_t gtid_213992 = squot64(remnant_233330, slice_233327);\n    int64_t remnant_233331 = remnant_233330 - gtid_213992 * slice_233327;\n    int64_t gtid_213993 = remnant_233331;\n    int64_t remnant_233332 = remnant_233331 - gtid_213993;\n    \n    if ((slt64(gtid_213991, partition_sizze_203577) && slt64(gtid_213992,\n                                                             n_p_203492)) &&\n        slt64(gtid_213993, s_n_m_203636)) {\n        int64_t x_213998;\n        \n        x_213998 = ((__global int64_t *) ext_mem_229264)[gtid_213991 *\n                                                         n_p_203492 +\n                                                         gtid_213992];\n    ",
                   "    \n        int64_t x_214000;\n        \n        x_214000 = ((__global int64_t *) ext_mem_229363)[gtid_213991 *\n                                                         (s_n_m_203636 *\n                                                          n_p_203492) +\n                                                         gtid_213992 *\n                                                         s_n_m_203636 +\n                                                         gtid_213993];\n        \n        double x_214001;\n        \n        x_214001 = ((__global double *) ext_mem_229362)[gtid_213991 *\n                                                        (s_n_m_203636 *\n                                                         n_p_203492) +\n                                                        gtid_213992 *\n                                                        s_n_m_203636 +\n                                                        gtid_213993];\n        \n        bool cond_214002 = gtid_213993 == (int64_t) 0;\n        int64_t defunc_0_m_fun_res_214003;\n        \n        if (cond_214002) {\n            defunc_0_m_fun_res_214003 = (int64_t) 0;\n        } else {\n            int64_t y_214004 = sub64(s_n_m_203636, (int64_t) 1);\n            bool cond_214005 = gtid_213993 == y_214004;\n            int64_t defunc_0_m_fun_res_f_res_214006;\n            \n            if (cond_214005) {\n                int64_t defunc_0_m_fun_res_f_res_t_res_214007 =\n                        sub64(pad_css_len_203632, (int64_t) 1);\n                \n                defunc_0_m_fun_res_f_res_214006 =\n                    defunc_0_m_fun_res_f_res_t_res_214007;\n            } else {\n                int64_t x_214008 = sub64(gtid_213993, (int64_t) 1);\n                int64_t x_214009 = mul64(jump_s_203499, x_214008);\n                int64_t min_arg_214010 = add64((int64_t) 1, x_214009);\n                int64_t min_res_214011 = smin64(defunc_0_f_res_203631,\n                                                min_arg_214010);\n               ",
                   " \n                defunc_0_m_fun_res_f_res_214006 = min_res_214011;\n            }\n            defunc_0_m_fun_res_214003 = defunc_0_m_fun_res_f_res_214006;\n        }\n        \n        double defunc_2_reduce_res_214012;\n        double defunc_2_reduce_res_214013;\n        double defunc_2_reduce_res_214014;\n        double redout_228519;\n        double redout_228520;\n        double redout_228521;\n        \n        redout_228519 = 0.0;\n        redout_228520 = 0.0;\n        redout_228521 = 0.0;\n        for (int64_t i_228522 = 0; i_228522 < q_s_203493; i_228522++) {\n            bool cond_214025 = sle64(x_213998, i_228522);\n            int64_t defunc_0_f_res_214026;\n            \n            if (cond_214025) {\n                defunc_0_f_res_214026 = (int64_t) 0;\n            } else {\n                int64_t i_214027 = add64(x_214000, i_228522);\n                int64_t defunc_0_add_arg_214028;\n                \n                defunc_0_add_arg_214028 = ((__global\n                                            int64_t *) ext_mem_229265)[gtid_213991 *\n                                                                       (defunc_0_f_res_203631 *\n                                                                        n_p_203492) +\n                                                                       gtid_213992 *\n                                                                       defunc_0_f_res_203631 +\n                                                                       i_214027];\n                \n                int64_t defunc_1_add_res_214029 = add64((int64_t) 1,\n                                                        defunc_0_add_arg_214028);\n                \n                defunc_0_f_res_214026 = defunc_1_add_res_214029;\n            }\n            \n            double defunc_0_f_res_214030;\n            \n            if (cond_214025) {\n                defunc_0_f_res_214030 = 0.0;\n            } else {\n                int64_t i_214031 = add64(x_214000, i_228522);\n                dou",
                   "ble defunc_0_add_arg_214032;\n                \n                defunc_0_add_arg_214032 = ((__global\n                                            double *) mem_229531)[gtid_213991 *\n                                                                  (defunc_0_f_res_203631 *\n                                                                   n_p_203492) +\n                                                                  gtid_213992 *\n                                                                  defunc_0_f_res_203631 +\n                                                                  i_214031];\n                defunc_0_f_res_214030 = defunc_0_add_arg_214032;\n            }\n            \n            int64_t binop_p_214033 = sub64(defunc_0_f_res_214026,\n                                           defunc_0_m_fun_res_214003);\n            double defunc_0_f_res_214034 = sitofp_i64_f64(binop_p_214033);\n            double abs_res_214035 = fabs(defunc_0_f_res_214034);\n            double tmp1_214036 = abs_res_214035 / x_214001;\n            double x_214037 = tmp1_214036 * tmp1_214036;\n            double y_214038 = tmp1_214036 * x_214037;\n            double tmp2_214039 = 1.0 - y_214038;\n            double x_214040 = tmp2_214039 * tmp2_214039;\n            double tmp3_214041 = tmp2_214039 * x_214040;\n            double w_j_214042 = defunc_0_f_res_214030 * tmp3_214041;\n            double xw_j_214043 = defunc_0_f_res_214034 * w_j_214042;\n            double x2w_j_214044 = defunc_0_f_res_214034 * xw_j_214043;\n            double defunc_1_op_res_214017 = w_j_214042 + redout_228519;\n            double defunc_1_op_res_214020 = xw_j_214043 + redout_228520;\n            double defunc_1_op_res_214023 = x2w_j_214044 + redout_228521;\n            double redout_tmp_233333 = defunc_1_op_res_214017;\n            double redout_tmp_233334 = defunc_1_op_res_214020;\n            double redout_tmp_233335 = defunc_1_op_res_214023;\n            \n            redout_228519 = redout_tmp_233333;\n            redout_228",
                   "520 = redout_tmp_233334;\n            redout_228521 = redout_tmp_233335;\n        }\n        defunc_2_reduce_res_214012 = redout_228519;\n        defunc_2_reduce_res_214013 = redout_228520;\n        defunc_2_reduce_res_214014 = redout_228521;\n        \n        double x_214045 = defunc_2_reduce_res_214012 *\n               defunc_2_reduce_res_214014;\n        double y_214046 = defunc_2_reduce_res_214013 *\n               defunc_2_reduce_res_214013;\n        double y_214047 = x_214045 - y_214046;\n        double det1_214048 = 1.0 / y_214047;\n        double a11_214049 = defunc_2_reduce_res_214014 * det1_214048;\n        double x_214050 = 0.0 - defunc_2_reduce_res_214013;\n        double b11_214051 = det1_214048 * x_214050;\n        double c11_214052 = defunc_2_reduce_res_214012 * det1_214048;\n        int64_t defunc_0_m_fun_res_214053;\n        \n        if (cond_214002) {\n            defunc_0_m_fun_res_214053 = (int64_t) 0;\n        } else {\n            int64_t y_214054 = sub64(s_n_m_203636, (int64_t) 1);\n            bool cond_214055 = gtid_213993 == y_214054;\n            int64_t defunc_0_m_fun_res_f_res_214056;\n            \n            if (cond_214055) {\n                int64_t defunc_0_m_fun_res_f_res_t_res_214057 =\n                        sub64(pad_css_len_203632, (int64_t) 1);\n                \n                defunc_0_m_fun_res_f_res_214056 =\n                    defunc_0_m_fun_res_f_res_t_res_214057;\n            } else {\n                int64_t x_214058 = sub64(gtid_213993, (int64_t) 1);\n                int64_t x_214059 = mul64(jump_s_203499, x_214058);\n                int64_t min_arg_214060 = add64((int64_t) 1, x_214059);\n                int64_t min_res_214061 = smin64(defunc_0_f_res_203631,\n                                                min_arg_214060);\n                \n                defunc_0_m_fun_res_f_res_214056 = min_res_214061;\n            }\n            defunc_0_m_fun_res_214053 = defunc_0_m_fun_res_f_res_214056;\n        }\n        \n        double defunc_2_reduce_res_21406",
                   "2;\n        double defunc_2_reduce_res_214063;\n        double redout_228523;\n        double redout_228524;\n        \n        redout_228523 = 0.0;\n        redout_228524 = 0.0;\n        for (int64_t i_228525 = 0; i_228525 < q_s_203493; i_228525++) {\n            bool cond_214071 = sle64(x_213998, i_228525);\n            int64_t defunc_0_f_res_214072;\n            \n            if (cond_214071) {\n                defunc_0_f_res_214072 = (int64_t) 0;\n            } else {\n                int64_t i_214073 = add64(x_214000, i_228525);\n                int64_t defunc_0_add_arg_214074;\n                \n                defunc_0_add_arg_214074 = ((__global\n                                            int64_t *) ext_mem_229265)[gtid_213991 *\n                                                                       (defunc_0_f_res_203631 *\n                                                                        n_p_203492) +\n                                                                       gtid_213992 *\n                                                                       defunc_0_f_res_203631 +\n                                                                       i_214073];\n                \n                int64_t defunc_1_add_res_214075 = add64((int64_t) 1,\n                                                        defunc_0_add_arg_214074);\n                \n                defunc_0_f_res_214072 = defunc_1_add_res_214075;\n            }\n            \n            double defunc_0_f_res_214076;\n            \n            if (cond_214071) {\n                defunc_0_f_res_214076 = 0.0;\n            } else {\n                int64_t i_214077 = add64(x_214000, i_228525);\n                double defunc_0_add_arg_214078;\n                \n                defunc_0_add_arg_214078 = ((__global\n                                            double *) mem_229531)[gtid_213991 *\n                                                                  (defunc_0_f_res_203631 *\n                                              ",
                   "                     n_p_203492) +\n                                                                  gtid_213992 *\n                                                                  defunc_0_f_res_203631 +\n                                                                  i_214077];\n                defunc_0_f_res_214076 = defunc_0_add_arg_214078;\n            }\n            \n            int64_t binop_p_214079 = sub64(defunc_0_f_res_214072,\n                                           defunc_0_m_fun_res_214053);\n            double defunc_0_f_res_214080 = sitofp_i64_f64(binop_p_214079);\n            double abs_res_214081 = fabs(defunc_0_f_res_214080);\n            double tmp1_214082 = abs_res_214081 / x_214001;\n            double x_214083 = tmp1_214082 * tmp1_214082;\n            double y_214084 = tmp1_214082 * x_214083;\n            double tmp2_214085 = 1.0 - y_214084;\n            double x_214086 = tmp2_214085 * tmp2_214085;\n            double tmp3_214087 = tmp2_214085 * x_214086;\n            double tmp4_214088 = defunc_0_f_res_214076 * tmp3_214087;\n            double defunc_1_f_res_214089 = defunc_0_f_res_214080 * tmp4_214088;\n            double defunc_0_f_res_214090;\n            \n            if (cond_214071) {\n                defunc_0_f_res_214090 = 0.0;\n            } else {\n                int64_t i_214091 = add64(x_214000, i_228525);\n                double defunc_0_add_arg_214092;\n                \n                defunc_0_add_arg_214092 = ((__global\n                                            double *) mem_229526)[gtid_213991 *\n                                                                  (defunc_0_f_res_203631 *\n                                                                   n_p_203492) +\n                                                                  gtid_213992 *\n                                                                  defunc_0_f_res_203631 +\n                                                                  i_214091];\n                defunc_0_f_res_214",
                   "090 = defunc_0_add_arg_214092;\n            }\n            \n            double x_214093 = a11_214049 * tmp4_214088;\n            double y_214094 = b11_214051 * defunc_1_f_res_214089;\n            double x_214095 = x_214093 + y_214094;\n            double defunc_9_fit_fun_res_214096 = defunc_0_f_res_214090 *\n                   x_214095;\n            double x_214097 = b11_214051 * tmp4_214088;\n            double y_214098 = c11_214052 * defunc_1_f_res_214089;\n            double x_214099 = x_214097 + y_214098;\n            double defunc_9_slope_fun_res_214100 = defunc_0_f_res_214090 *\n                   x_214099;\n            double defunc_1_op_res_214066 = defunc_9_fit_fun_res_214096 +\n                   redout_228523;\n            double defunc_1_op_res_214069 = defunc_9_slope_fun_res_214100 +\n                   redout_228524;\n            double redout_tmp_233336 = defunc_1_op_res_214066;\n            double redout_tmp_233337 = defunc_1_op_res_214069;\n            \n            redout_228523 = redout_tmp_233336;\n            redout_228524 = redout_tmp_233337;\n        }\n        defunc_2_reduce_res_214062 = redout_228523;\n        defunc_2_reduce_res_214063 = redout_228524;\n        ((__global double *) mem_229962)[gtid_213991 * (s_n_m_203636 *\n                                                        n_p_203492) +\n                                         gtid_213992 * s_n_m_203636 +\n                                         gtid_213993] =\n            defunc_2_reduce_res_214062;\n        ((__global double *) mem_229967)[gtid_213991 * (s_n_m_203636 *\n                                                        n_p_203492) +\n                                         gtid_213992 * s_n_m_203636 +\n                                         gtid_213993] =\n            defunc_2_reduce_res_214063;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_213981\n}\n__kernel void mainzisegmap_214111(__global int *global_failure,\n                                  int64_t n_p_203492, int64_t jump_s_20349",
                   "9,\n                                  int64_t partition_sizze_203577,\n                                  int64_t defunc_0_f_res_203631,\n                                  int64_t pad_css_len_203632,\n                                  int64_t s_n_m_203636, __global\n                                  unsigned char *mem_229973, __global\n                                  unsigned char *mem_229977)\n{\n    #define segmap_group_sizze_214104 (mainzisegmap_group_sizze_213157)\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_233338;\n    int32_t local_tid_233339;\n    int64_t group_sizze_233342;\n    int32_t wave_sizze_233341;\n    int32_t group_tid_233340;\n    \n    global_tid_233338 = get_global_id(0);\n    local_tid_233339 = get_local_id(0);\n    group_sizze_233342 = get_local_size(0);\n    wave_sizze_233341 = LOCKSTEP_WIDTH;\n    group_tid_233340 = get_group_id(0);\n    \n    int32_t phys_tid_214111 = global_tid_233338;\n    int64_t global_tid_233343 = sext_i32_i64(group_tid_233340) *\n            segmap_group_sizze_214104 + sext_i32_i64(local_tid_233339);\n    int64_t slice_233344 = s_n_m_203636;\n    int64_t slice_233345 = n_p_203492 * slice_233344;\n    int64_t slice_233346 = partition_sizze_203577 * slice_233345;\n    int64_t gtid_214108 = squot64(global_tid_233343, slice_233345);\n    int64_t remnant_233347 = global_tid_233343 - gtid_214108 * slice_233345;\n    int64_t gtid_214109 = squot64(remnant_233347, slice_233344);\n    int64_t remnant_233348 = remnant_233347 - gtid_214109 * slice_233344;\n    int64_t gtid_214110 = remnant_233348;\n    int64_t remnant_233349 = remnant_233348 - gtid_214110;\n    \n    if ((slt64(gtid_214108, partition_sizze_203577) && slt64(gtid_214109,\n                                                             n_p_203492)) &&\n        slt64(gtid_214110, s_n_m_203636)) {\n        bool cond_214113 = gtid_214110 == (int64_t) 0;\n        int64_t defunc_0_m",
                   "_fun_res_214114;\n        \n        if (cond_214113) {\n            defunc_0_m_fun_res_214114 = (int64_t) 0;\n        } else {\n            int64_t y_214115 = sub64(s_n_m_203636, (int64_t) 1);\n            bool cond_214116 = gtid_214110 == y_214115;\n            int64_t defunc_0_m_fun_res_f_res_214117;\n            \n            if (cond_214116) {\n                int64_t defunc_0_m_fun_res_f_res_t_res_214118 =\n                        sub64(pad_css_len_203632, (int64_t) 1);\n                \n                defunc_0_m_fun_res_f_res_214117 =\n                    defunc_0_m_fun_res_f_res_t_res_214118;\n            } else {\n                int64_t x_214119 = sub64(gtid_214110, (int64_t) 1);\n                int64_t x_214120 = mul64(jump_s_203499, x_214119);\n                int64_t min_arg_214121 = add64((int64_t) 1, x_214120);\n                int64_t min_res_214122 = smin64(defunc_0_f_res_203631,\n                                                min_arg_214121);\n                \n                defunc_0_m_fun_res_f_res_214117 = min_res_214122;\n            }\n            defunc_0_m_fun_res_214114 = defunc_0_m_fun_res_f_res_214117;\n        }\n        ((__global int64_t *) mem_229973)[gtid_214108 * (s_n_m_203636 *\n                                                         n_p_203492) +\n                                          gtid_214109 * s_n_m_203636 +\n                                          gtid_214110] =\n            defunc_0_m_fun_res_214114;\n        ((__global bool *) mem_229977)[gtid_214108 * (s_n_m_203636 *\n                                                      n_p_203492) +\n                                       gtid_214109 * s_n_m_203636 +\n                                       gtid_214110] = cond_214113;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_214104\n}\n__kernel void mainzisegmap_214195(__global int *global_failure,\n                                  int64_t n_p_203492, int64_t jump_s_203499,\n                                  int64_t partition_sizze_203577,\n",
                   "                                  int64_t defunc_0_f_res_203631,\n                                  int64_t pad_css_len_203632,\n                                  int64_t s_n_m_203636, __global\n                                  unsigned char *mem_229983, __global\n                                  unsigned char *mem_229988, __global\n                                  unsigned char *mem_229993, __global\n                                  unsigned char *mem_229999, __global\n                                  unsigned char *mem_230004, __global\n                                  unsigned char *mem_230009, __global\n                                  unsigned char *mem_230014)\n{\n    #define segmap_group_sizze_214186 (mainzisegmap_group_sizze_213054)\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_233454;\n    int32_t local_tid_233455;\n    int64_t group_sizze_233458;\n    int32_t wave_sizze_233457;\n    int32_t group_tid_233456;\n    \n    global_tid_233454 = get_global_id(0);\n    local_tid_233455 = get_local_id(0);\n    group_sizze_233458 = get_local_size(0);\n    wave_sizze_233457 = LOCKSTEP_WIDTH;\n    group_tid_233456 = get_group_id(0);\n    \n    int32_t phys_tid_214195 = global_tid_233454;\n    int64_t global_tid_233459 = sext_i32_i64(group_tid_233456) *\n            segmap_group_sizze_214186 + sext_i32_i64(local_tid_233455);\n    int64_t slice_233460 = s_n_m_203636;\n    int64_t slice_233461 = n_p_203492 * slice_233460;\n    int64_t slice_233462 = partition_sizze_203577 * slice_233461;\n    int64_t gtid_214192 = squot64(global_tid_233459, slice_233461);\n    int64_t remnant_233463 = global_tid_233459 - gtid_214192 * slice_233461;\n    int64_t gtid_214193 = squot64(remnant_233463, slice_233460);\n    int64_t remnant_233464 = remnant_233463 - gtid_214193 * slice_233460;\n    int64_t gtid_214194 = remnant_233464;\n    int64_t remnant_233465 = remnant_233464 - gtid_214194;\n",
                   "    \n    if ((slt64(gtid_214192, partition_sizze_203577) && slt64(gtid_214193,\n                                                             n_p_203492)) &&\n        slt64(gtid_214194, s_n_m_203636)) {\n        bool index_primexp_228728 = gtid_214194 == (int64_t) 0;\n        double defunc_2_reduce_res_214198;\n        \n        defunc_2_reduce_res_214198 = ((__global\n                                       double *) mem_229983)[gtid_214192 *\n                                                             (s_n_m_203636 *\n                                                              n_p_203492) +\n                                                             gtid_214193 *\n                                                             s_n_m_203636 +\n                                                             gtid_214194];\n        \n        double defunc_2_reduce_res_214199;\n        \n        defunc_2_reduce_res_214199 = ((__global\n                                       double *) mem_229988)[gtid_214192 *\n                                                             (s_n_m_203636 *\n                                                              n_p_203492) +\n                                                             gtid_214193 *\n                                                             s_n_m_203636 +\n                                                             gtid_214194];\n        \n        double defunc_2_reduce_res_214200;\n        \n        defunc_2_reduce_res_214200 = ((__global\n                                       double *) mem_229993)[gtid_214192 *\n                                                             (s_n_m_203636 *\n                                                              n_p_203492) +\n                                                             gtid_214193 *\n                                                             s_n_m_203636 +\n                                                             gtid_214194];\n        \n        double x_214201 = defunc_2_reduce_res_2",
                   "14198 *\n               defunc_2_reduce_res_214200;\n        double y_214202 = defunc_2_reduce_res_214199 *\n               defunc_2_reduce_res_214199;\n        double y_214203 = x_214201 - y_214202;\n        double det1_214204 = 1.0 / y_214203;\n        double a11_214205 = defunc_2_reduce_res_214200 * det1_214204;\n        double x_214206 = 0.0 - defunc_2_reduce_res_214199;\n        double b11_214207 = det1_214204 * x_214206;\n        double c11_214208 = defunc_2_reduce_res_214198 * det1_214204;\n        int64_t defunc_0_m_fun_res_214209;\n        \n        if (index_primexp_228728) {\n            defunc_0_m_fun_res_214209 = (int64_t) 0;\n        } else {\n            int64_t y_214210 = sub64(s_n_m_203636, (int64_t) 1);\n            bool cond_214211 = gtid_214194 == y_214210;\n            int64_t defunc_0_m_fun_res_f_res_214212;\n            \n            if (cond_214211) {\n                int64_t defunc_0_m_fun_res_f_res_t_res_214213 =\n                        sub64(pad_css_len_203632, (int64_t) 1);\n                \n                defunc_0_m_fun_res_f_res_214212 =\n                    defunc_0_m_fun_res_f_res_t_res_214213;\n            } else {\n                int64_t x_214214 = sub64(gtid_214194, (int64_t) 1);\n                int64_t x_214215 = mul64(jump_s_203499, x_214214);\n                int64_t min_arg_214216 = add64((int64_t) 1, x_214215);\n                int64_t min_res_214217 = smin64(defunc_0_f_res_203631,\n                                                min_arg_214216);\n                \n                defunc_0_m_fun_res_f_res_214212 = min_res_214217;\n            }\n            defunc_0_m_fun_res_214209 = defunc_0_m_fun_res_f_res_214212;\n        }\n        ((__global double *) mem_229999)[gtid_214192 * (s_n_m_203636 *\n                                                        n_p_203492) +\n                                         gtid_214193 * s_n_m_203636 +\n                                         gtid_214194] = a11_214205;\n        ((__global double *) mem_230004)[gtid_214192 * ",
                   "(s_n_m_203636 *\n                                                        n_p_203492) +\n                                         gtid_214193 * s_n_m_203636 +\n                                         gtid_214194] = b11_214207;\n        ((__global double *) mem_230009)[gtid_214192 * (s_n_m_203636 *\n                                                        n_p_203492) +\n                                         gtid_214193 * s_n_m_203636 +\n                                         gtid_214194] = c11_214208;\n        ((__global int64_t *) mem_230014)[gtid_214192 * (s_n_m_203636 *\n                                                         n_p_203492) +\n                                          gtid_214193 * s_n_m_203636 +\n                                          gtid_214194] =\n            defunc_0_m_fun_res_214209;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_214186\n}\n__kernel void mainzisegmap_214470(__global int *global_failure,\n                                  int64_t n_p_203492, int64_t q_s_203493,\n                                  int64_t jump_s_203499,\n                                  int64_t partition_sizze_203577,\n                                  int64_t defunc_0_f_res_203631,\n                                  int64_t pad_css_len_203632,\n                                  int64_t s_n_m_203636,\n                                  int64_t num_groups_214465,\n                                  int64_t num_threads_232131, __global\n                                  unsigned char *mem_230061, __global\n                                  unsigned char *mem_230064, __global\n                                  unsigned char *mem_230068, __global\n                                  unsigned char *mem_230072, __global\n                                  unsigned char *mem_230076, __global\n                                  unsigned char *mem_230080, __global\n                                  unsigned char *mem_230173, __global\n                                  unsigned char ",
                   "*mem_230177, __global\n                                  unsigned char *color_232004, __global\n                                  unsigned char *color_232005)\n{\n    #define segmap_group_sizze_214464 (mainzisegmap_group_sizze_214306)\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_233564;\n    int32_t local_tid_233565;\n    int64_t group_sizze_233568;\n    int32_t wave_sizze_233567;\n    int32_t group_tid_233566;\n    \n    global_tid_233564 = get_global_id(0);\n    local_tid_233565 = get_local_id(0);\n    group_sizze_233568 = get_local_size(0);\n    wave_sizze_233567 = LOCKSTEP_WIDTH;\n    group_tid_233566 = get_group_id(0);\n    \n    int32_t phys_tid_214470 = global_tid_233564;\n    int32_t phys_group_id_233569;\n    \n    phys_group_id_233569 = get_group_id(0);\n    for (int32_t i_233570 = 0; i_233570 <\n         sdiv_up32(sext_i64_i32(sdiv_up64(partition_sizze_203577,\n                                          segmap_group_sizze_214464)) -\n                   phys_group_id_233569, sext_i64_i32(num_groups_214465));\n         i_233570++) {\n        int32_t virt_group_id_233571 = phys_group_id_233569 + i_233570 *\n                sext_i64_i32(num_groups_214465);\n        int64_t global_tid_233572 = sext_i32_i64(virt_group_id_233571) *\n                segmap_group_sizze_214464 + sext_i32_i64(local_tid_233565);\n        int64_t slice_233573 = partition_sizze_203577;\n        int64_t gtid_214469 = global_tid_233572;\n        int64_t remnant_233574 = global_tid_233572 - gtid_214469;\n        \n        if (slt64(gtid_214469, partition_sizze_203577)) {\n            for (int64_t i_228962 = 0; i_228962 < n_p_203492; i_228962++) {\n                int64_t x_214482;\n                \n                x_214482 = ((__global int64_t *) mem_230064)[i_228962 *\n                                                             partition_sizze_203577 +\n                                             ",
                   "                gtid_214469];\n                for (int64_t i_228969 = 0; i_228969 < s_n_m_203636;\n                     i_228969++) {\n                    int64_t x_214488;\n                    \n                    x_214488 = ((__global int64_t *) mem_230072)[i_228962 *\n                                                                 (partition_sizze_203577 *\n                                                                  s_n_m_203636) +\n                                                                 i_228969 *\n                                                                 partition_sizze_203577 +\n                                                                 gtid_214469];\n                    \n                    double x_214489;\n                    \n                    x_214489 = ((__global double *) mem_230061)[i_228962 *\n                                                                (partition_sizze_203577 *\n                                                                 s_n_m_203636) +\n                                                                i_228969 *\n                                                                partition_sizze_203577 +\n                                                                gtid_214469];\n                    \n                    bool cond_214490 = i_228969 == (int64_t) 0;\n                    int64_t defunc_0_m_fun_res_214491;\n                    \n                    if (cond_214490) {\n                        defunc_0_m_fun_res_214491 = (int64_t) 0;\n                    } else {\n                        int64_t y_214492 = sub64(s_n_m_203636, (int64_t) 1);\n                        bool cond_214493 = i_228969 == y_214492;\n                        int64_t defunc_0_m_fun_res_f_res_214494;\n                        \n                        if (cond_214493) {\n                            int64_t defunc_0_m_fun_res_f_res_t_res_214495 =\n                                    sub64(pad_css_len_203632, (int64_t) 1);\n                          ",
                   "  \n                            defunc_0_m_fun_res_f_res_214494 =\n                                defunc_0_m_fun_res_f_res_t_res_214495;\n                        } else {\n                            int64_t x_214496 = sub64(i_228969, (int64_t) 1);\n                            int64_t x_214497 = mul64(jump_s_203499, x_214496);\n                            int64_t min_arg_214498 = add64((int64_t) 1,\n                                                           x_214497);\n                            int64_t min_res_214499 =\n                                    smin64(defunc_0_f_res_203631,\n                                           min_arg_214498);\n                            \n                            defunc_0_m_fun_res_f_res_214494 = min_res_214499;\n                        }\n                        defunc_0_m_fun_res_214491 =\n                            defunc_0_m_fun_res_f_res_214494;\n                    }\n                    \n                    double defunc_2_reduce_res_214500;\n                    double defunc_2_reduce_res_214501;\n                    double defunc_2_reduce_res_214502;\n                    double defunc_2_reduce_res_214503;\n                    double defunc_2_reduce_res_214504;\n                    double redout_228540;\n                    double redout_228541;\n                    double redout_228542;\n                    double redout_228543;\n                    double redout_228544;\n                    \n                    redout_228540 = 0.0;\n                    redout_228541 = 0.0;\n                    redout_228542 = 0.0;\n                    redout_228543 = 0.0;\n                    redout_228544 = 0.0;\n                    for (int64_t i_228545 = 0; i_228545 < q_s_203493;\n                         i_228545++) {\n                        bool cond_214521 = sle64(x_214482, i_228545);\n                        int64_t defunc_0_f_res_214522;\n                        \n                        if (cond_214521) {\n                            defunc_0_f_res_214522 = ",
                   "(int64_t) 0;\n                        } else {\n                            int64_t i_214523 = add64(x_214488, i_228545);\n                            int64_t defunc_0_add_arg_214524;\n                            \n                            defunc_0_add_arg_214524 = ((__global\n                                                        int64_t *) mem_230080)[i_228962 *\n                                                                               (partition_sizze_203577 *\n                                                                                defunc_0_f_res_203631) +\n                                                                               i_214523 *\n                                                                               partition_sizze_203577 +\n                                                                               gtid_214469];\n                            \n                            int64_t defunc_1_add_res_214525 = add64((int64_t) 1,\n                                                                    defunc_0_add_arg_214524);\n                            \n                            defunc_0_f_res_214522 = defunc_1_add_res_214525;\n                        }\n                        \n                        double defunc_0_f_res_214526;\n                        \n                        if (cond_214521) {\n                            defunc_0_f_res_214526 = 0.0;\n                        } else {\n                            int64_t i_214527 = add64(x_214488, i_228545);\n                            double defunc_0_add_arg_214528;\n                            \n                            defunc_0_add_arg_214528 = ((__global\n                                                        double *) mem_230068)[i_228962 *\n                                                                              (partition_sizze_203577 *\n                                                                               defunc_0_f_res_203631) +\n                                        ",
                   "                                      i_214527 *\n                                                                              partition_sizze_203577 +\n                                                                              gtid_214469];\n                            defunc_0_f_res_214526 = defunc_0_add_arg_214528;\n                        }\n                        \n                        int64_t binop_p_214529 = sub64(defunc_0_f_res_214522,\n                                                       defunc_0_m_fun_res_214491);\n                        double defunc_0_f_res_214530 =\n                               sitofp_i64_f64(binop_p_214529);\n                        double abs_res_214531 = fabs(defunc_0_f_res_214530);\n                        double tmp1_214532 = abs_res_214531 / x_214489;\n                        double x_214533 = tmp1_214532 * tmp1_214532;\n                        double y_214534 = tmp1_214532 * x_214533;\n                        double tmp2_214535 = 1.0 - y_214534;\n                        double x_214536 = tmp2_214535 * tmp2_214535;\n                        double tmp3_214537 = tmp2_214535 * x_214536;\n                        double w_j_214538 = defunc_0_f_res_214526 * tmp3_214537;\n                        double xw_j_214539 = defunc_0_f_res_214530 * w_j_214538;\n                        double x2w_j_214540 = defunc_0_f_res_214530 *\n                               xw_j_214539;\n                        double x3w_j_214541 = defunc_0_f_res_214530 *\n                               x2w_j_214540;\n                        double x4w_j_214542 = defunc_0_f_res_214530 *\n                               x3w_j_214541;\n                        double defunc_1_op_res_214507 = w_j_214538 +\n                               redout_228540;\n                        double defunc_1_op_res_214510 = xw_j_214539 +\n                               redout_228541;\n                        double defunc_1_op_res_214513 = x2w_j_214540 +\n                               redout_228542;\n            ",
                   "            double defunc_1_op_res_214516 = x3w_j_214541 +\n                               redout_228543;\n                        double defunc_1_op_res_214519 = x4w_j_214542 +\n                               redout_228544;\n                        double redout_tmp_233579 = defunc_1_op_res_214507;\n                        double redout_tmp_233580 = defunc_1_op_res_214510;\n                        double redout_tmp_233581 = defunc_1_op_res_214513;\n                        double redout_tmp_233582 = defunc_1_op_res_214516;\n                        double redout_tmp_233583 = defunc_1_op_res_214519;\n                        \n                        redout_228540 = redout_tmp_233579;\n                        redout_228541 = redout_tmp_233580;\n                        redout_228542 = redout_tmp_233581;\n                        redout_228543 = redout_tmp_233582;\n                        redout_228544 = redout_tmp_233583;\n                    }\n                    defunc_2_reduce_res_214500 = redout_228540;\n                    defunc_2_reduce_res_214501 = redout_228541;\n                    defunc_2_reduce_res_214502 = redout_228542;\n                    defunc_2_reduce_res_214503 = redout_228543;\n                    defunc_2_reduce_res_214504 = redout_228544;\n                    \n                    double x_214543 = defunc_2_reduce_res_214502 *\n                           defunc_2_reduce_res_214504;\n                    double y_214544 = defunc_2_reduce_res_214503 *\n                           defunc_2_reduce_res_214503;\n                    double a12_214545 = x_214543 - y_214544;\n                    double x_214546 = defunc_2_reduce_res_214502 *\n                           defunc_2_reduce_res_214503;\n                    double y_214547 = defunc_2_reduce_res_214501 *\n                           defunc_2_reduce_res_214504;\n                    double b12_214548 = x_214546 - y_214547;\n                    double x_214549 = defunc_2_reduce_res_214501 *\n                           defunc_2_reduce_",
                   "res_214503;\n                    double y_214550 = defunc_2_reduce_res_214502 *\n                           defunc_2_reduce_res_214502;\n                    double c12_214551 = x_214549 - y_214550;\n                    double x_214552 = defunc_2_reduce_res_214500 *\n                           defunc_2_reduce_res_214504;\n                    double b2_214553 = x_214552 - y_214550;\n                    double x_214554 = defunc_2_reduce_res_214501 *\n                           defunc_2_reduce_res_214502;\n                    double y_214555 = defunc_2_reduce_res_214500 *\n                           defunc_2_reduce_res_214503;\n                    double c2_214556 = x_214554 - y_214555;\n                    double x_214557 = defunc_2_reduce_res_214500 * a12_214545;\n                    double y_214558 = defunc_2_reduce_res_214501 * b12_214548;\n                    double x_214559 = x_214557 + y_214558;\n                    double y_214560 = defunc_2_reduce_res_214502 * c12_214551;\n                    double y_214561 = x_214559 + y_214560;\n                    double det_214562 = 1.0 / y_214561;\n                    double a12_214563 = a12_214545 * det_214562;\n                    double b12_214564 = b12_214548 * det_214562;\n                    double c12_214565 = c12_214551 * det_214562;\n                    double b2_214566 = b2_214553 * det_214562;\n                    double c2_214567 = c2_214556 * det_214562;\n                    int64_t defunc_0_m_fun_res_214568;\n                    \n                    if (cond_214490) {\n                        defunc_0_m_fun_res_214568 = (int64_t) 0;\n                    } else {\n                        int64_t y_214569 = sub64(s_n_m_203636, (int64_t) 1);\n                        bool cond_214570 = i_228969 == y_214569;\n                        int64_t defunc_0_m_fun_res_f_res_214571;\n                        \n                        if (cond_214570) {\n                            int64_t defunc_0_m_fun_res_f_res_t_res_214572 =\n                           ",
                   "         sub64(pad_css_len_203632, (int64_t) 1);\n                            \n                            defunc_0_m_fun_res_f_res_214571 =\n                                defunc_0_m_fun_res_f_res_t_res_214572;\n                        } else {\n                            int64_t x_214573 = sub64(i_228969, (int64_t) 1);\n                            int64_t x_214574 = mul64(jump_s_203499, x_214573);\n                            int64_t min_arg_214575 = add64((int64_t) 1,\n                                                           x_214574);\n                            int64_t min_res_214576 =\n                                    smin64(defunc_0_f_res_203631,\n                                           min_arg_214575);\n                            \n                            defunc_0_m_fun_res_f_res_214571 = min_res_214576;\n                        }\n                        defunc_0_m_fun_res_214568 =\n                            defunc_0_m_fun_res_f_res_214571;\n                    }\n                    \n                    double defunc_2_reduce_res_214577;\n                    double defunc_2_reduce_res_214578;\n                    double redout_228546;\n                    double redout_228547;\n                    \n                    redout_228546 = 0.0;\n                    redout_228547 = 0.0;\n                    for (int64_t i_228548 = 0; i_228548 < q_s_203493;\n                         i_228548++) {\n                        bool cond_214586 = sle64(x_214482, i_228548);\n                        int64_t defunc_0_f_res_214587;\n                        \n                        if (cond_214586) {\n                            defunc_0_f_res_214587 = (int64_t) 0;\n                        } else {\n                            int64_t i_214588 = add64(x_214488, i_228548);\n                            int64_t defunc_0_add_arg_214589;\n                            \n                            defunc_0_add_arg_214589 = ((__global\n                                                        int64_t ",
                   "*) mem_230080)[i_228962 *\n                                                                               (partition_sizze_203577 *\n                                                                                defunc_0_f_res_203631) +\n                                                                               i_214588 *\n                                                                               partition_sizze_203577 +\n                                                                               gtid_214469];\n                            \n                            int64_t defunc_1_add_res_214590 = add64((int64_t) 1,\n                                                                    defunc_0_add_arg_214589);\n                            \n                            defunc_0_f_res_214587 = defunc_1_add_res_214590;\n                        }\n                        \n                        double defunc_0_f_res_214591;\n                        \n                        if (cond_214586) {\n                            defunc_0_f_res_214591 = 0.0;\n                        } else {\n                            int64_t i_214592 = add64(x_214488, i_228548);\n                            double defunc_0_add_arg_214593;\n                            \n                            defunc_0_add_arg_214593 = ((__global\n                                                        double *) mem_230068)[i_228962 *\n                                                                              (partition_sizze_203577 *\n                                                                               defunc_0_f_res_203631) +\n                                                                              i_214592 *\n                                                                              partition_sizze_203577 +\n                                                                              gtid_214469];\n                            defunc_0_f_res_214591 = defunc_0_add_arg_214593;\n                  ",
                   "      }\n                        \n                        int64_t binop_p_214594 = sub64(defunc_0_f_res_214587,\n                                                       defunc_0_m_fun_res_214568);\n                        double defunc_0_f_res_214595 =\n                               sitofp_i64_f64(binop_p_214594);\n                        double abs_res_214596 = fabs(defunc_0_f_res_214595);\n                        double tmp1_214597 = abs_res_214596 / x_214489;\n                        double x_214598 = tmp1_214597 * tmp1_214597;\n                        double y_214599 = tmp1_214597 * x_214598;\n                        double tmp2_214600 = 1.0 - y_214599;\n                        double x_214601 = tmp2_214600 * tmp2_214600;\n                        double tmp3_214602 = tmp2_214600 * x_214601;\n                        double tmp4_214603 = defunc_0_f_res_214591 *\n                               tmp3_214602;\n                        double defunc_1_f_res_214604 = defunc_0_f_res_214595 *\n                               tmp4_214603;\n                        double defunc_1_f_res_214605 = defunc_0_f_res_214595 *\n                               defunc_1_f_res_214604;\n                        double defunc_0_f_res_214606;\n                        \n                        if (cond_214586) {\n                            defunc_0_f_res_214606 = 0.0;\n                        } else {\n                            int64_t i_214607 = add64(x_214488, i_228548);\n                            double defunc_0_add_arg_214608;\n                            \n                            defunc_0_add_arg_214608 = ((__global\n                                                        double *) mem_230076)[i_228962 *\n                                                                              (partition_sizze_203577 *\n                                                                               defunc_0_f_res_203631) +\n                                                                              i_214607 *\n          ",
                   "                                                                    partition_sizze_203577 +\n                                                                              gtid_214469];\n                            defunc_0_f_res_214606 = defunc_0_add_arg_214608;\n                        }\n                        \n                        double x_214609 = a12_214563 * tmp4_214603;\n                        double y_214610 = b12_214564 * defunc_1_f_res_214604;\n                        double x_214611 = x_214609 + y_214610;\n                        double y_214612 = c12_214565 * defunc_1_f_res_214605;\n                        double x_214613 = x_214611 + y_214612;\n                        double defunc_9_fit_fun_res_214614 =\n                               defunc_0_f_res_214606 * x_214613;\n                        double x_214615 = b12_214564 * tmp4_214603;\n                        double y_214616 = b2_214566 * defunc_1_f_res_214604;\n                        double x_214617 = x_214615 + y_214616;\n                        double y_214618 = c2_214567 * defunc_1_f_res_214605;\n                        double x_214619 = x_214617 + y_214618;\n                        double defunc_9_slope_fun_res_214620 =\n                               defunc_0_f_res_214606 * x_214619;\n                        double defunc_1_op_res_214581 =\n                               defunc_9_fit_fun_res_214614 + redout_228546;\n                        double defunc_1_op_res_214584 =\n                               defunc_9_slope_fun_res_214620 + redout_228547;\n                        double redout_tmp_233584 = defunc_1_op_res_214581;\n                        double redout_tmp_233585 = defunc_1_op_res_214584;\n                        \n                        redout_228546 = redout_tmp_233584;\n                        redout_228547 = redout_tmp_233585;\n                    }\n                    defunc_2_reduce_res_214577 = redout_228546;\n                    defunc_2_reduce_res_214578 = redout_228547;\n                    ((__gl",
                   "obal double *) color_232005)[phys_tid_214470 +\n                                                       (i_228962 *\n                                                        (num_threads_232131 *\n                                                         s_n_m_203636) +\n                                                        i_228969 *\n                                                        num_threads_232131)] =\n                        defunc_2_reduce_res_214577;\n                    ((__global double *) color_232004)[phys_tid_214470 +\n                                                       (i_228962 *\n                                                        (num_threads_232131 *\n                                                         s_n_m_203636) +\n                                                        i_228969 *\n                                                        num_threads_232131)] =\n                        defunc_2_reduce_res_214578;\n                }\n            }\n            for (int64_t i_233586 = 0; i_233586 < n_p_203492; i_233586++) {\n                for (int64_t i_233587 = 0; i_233587 < s_n_m_203636;\n                     i_233587++) {\n                    double tmp_233588;\n                    \n                    tmp_233588 = ((__global\n                                   double *) color_232005)[phys_tid_214470 +\n                                                           (i_233586 *\n                                                            (num_threads_232131 *\n                                                             s_n_m_203636) +\n                                                            i_233587 *\n                                                            num_threads_232131)];\n                    ((__global double *) mem_230173)[gtid_214469 + (i_233586 *\n                                                                    (partition_sizze_203577 *\n                                                                     s_n_m_203636) +\n               ",
                   "                                                     i_233587 *\n                                                                    partition_sizze_203577)] =\n                        tmp_233588;\n                }\n            }\n            for (int64_t i_233589 = 0; i_233589 < n_p_203492; i_233589++) {\n                for (int64_t i_233590 = 0; i_233590 < s_n_m_203636;\n                     i_233590++) {\n                    double tmp_233591;\n                    \n                    tmp_233591 = ((__global\n                                   double *) color_232004)[phys_tid_214470 +\n                                                           (i_233589 *\n                                                            (num_threads_232131 *\n                                                             s_n_m_203636) +\n                                                            i_233590 *\n                                                            num_threads_232131)];\n                    ((__global double *) mem_230177)[gtid_214469 + (i_233589 *\n                                                                    (partition_sizze_203577 *\n                                                                     s_n_m_203636) +\n                                                                    i_233590 *\n                                                                    partition_sizze_203577)] =\n                        tmp_233591;\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_214464\n}\n__kernel void mainzisegmap_216262(__global int *global_failure,\n                                  int64_t n_p_203492, int64_t q_s_203493,\n                                  int64_t jump_s_203499,\n                                  int64_t partition_sizze_203577,\n                                  int64_t defunc_0_f_res_203631,\n                                  int64_t pad_css_len_203632",
                   ",\n                                  int64_t s_n_m_203636,\n                                  int64_t num_groups_216240,\n                                  int64_t num_threads_232134, __global\n                                  unsigned char *ext_mem_229264, __global\n                                  unsigned char *mem_230181, __global\n                                  unsigned char *mem_230185, __global\n                                  unsigned char *mem_230189, __global\n                                  unsigned char *mem_230193, __global\n                                  unsigned char *mem_230197, __global\n                                  unsigned char *mem_230232, __global\n                                  unsigned char *mem_230236, __global\n                                  unsigned char *color_232006, __global\n                                  unsigned char *color_232007)\n{\n    #define segmap_group_sizze_216239 (mainzisegmap_group_sizze_214626)\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_233592;\n    int32_t local_tid_233593;\n    int64_t group_sizze_233596;\n    int32_t wave_sizze_233595;\n    int32_t group_tid_233594;\n    \n    global_tid_233592 = get_global_id(0);\n    local_tid_233593 = get_local_id(0);\n    group_sizze_233596 = get_local_size(0);\n    wave_sizze_233595 = LOCKSTEP_WIDTH;\n    group_tid_233594 = get_group_id(0);\n    \n    int32_t phys_tid_216262 = global_tid_233592;\n    int32_t phys_group_id_233597;\n    \n    phys_group_id_233597 = get_group_id(0);\n    for (int32_t i_233598 = 0; i_233598 <\n         sdiv_up32(sext_i64_i32(sdiv_up64(partition_sizze_203577 * n_p_203492,\n                                          segmap_group_sizze_216239)) -\n                   phys_group_id_233597, sext_i64_i32(num_groups_216240));\n         i_233598++) {\n        int32_t virt_group_id_233599 = phys_group_id_233597 + i_233598 *\n                sext",
                   "_i64_i32(num_groups_216240);\n        int64_t global_tid_233600 = sext_i32_i64(virt_group_id_233599) *\n                segmap_group_sizze_216239 + sext_i32_i64(local_tid_233593);\n        int64_t slice_233601 = n_p_203492;\n        int64_t slice_233602 = partition_sizze_203577 * slice_233601;\n        int64_t gtid_216260 = squot64(global_tid_233600, slice_233601);\n        int64_t remnant_233603 = global_tid_233600 - gtid_216260 * slice_233601;\n        int64_t gtid_216261 = remnant_233603;\n        int64_t remnant_233604 = remnant_233603 - gtid_216261;\n        \n        if (slt64(gtid_216260, partition_sizze_203577) && slt64(gtid_216261,\n                                                                n_p_203492)) {\n            int64_t x_216266;\n            \n            x_216266 = ((__global int64_t *) ext_mem_229264)[gtid_216260 *\n                                                             n_p_203492 +\n                                                             gtid_216261];\n            for (int64_t i_228976 = 0; i_228976 < s_n_m_203636; i_228976++) {\n                int64_t x_216272;\n                \n                x_216272 = ((__global int64_t *) mem_230181)[i_228976 *\n                                                             (n_p_203492 *\n                                                              partition_sizze_203577) +\n                                                             gtid_216260 *\n                                                             n_p_203492 +\n                                                             gtid_216261];\n                \n                double x_216273;\n                \n                x_216273 = ((__global double *) mem_230185)[i_228976 *\n                                                            (n_p_203492 *\n                                                             partition_sizze_203577) +\n                                                            gtid_216260 *\n                                                      ",
                   "      n_p_203492 +\n                                                            gtid_216261];\n                \n                bool cond_216274 = i_228976 == (int64_t) 0;\n                int64_t defunc_0_m_fun_res_216275;\n                \n                if (cond_216274) {\n                    defunc_0_m_fun_res_216275 = (int64_t) 0;\n                } else {\n                    int64_t y_216276 = sub64(s_n_m_203636, (int64_t) 1);\n                    bool cond_216277 = i_228976 == y_216276;\n                    int64_t defunc_0_m_fun_res_f_res_216278;\n                    \n                    if (cond_216277) {\n                        int64_t defunc_0_m_fun_res_f_res_t_res_216279 =\n                                sub64(pad_css_len_203632, (int64_t) 1);\n                        \n                        defunc_0_m_fun_res_f_res_216278 =\n                            defunc_0_m_fun_res_f_res_t_res_216279;\n                    } else {\n                        int64_t x_216280 = sub64(i_228976, (int64_t) 1);\n                        int64_t x_216281 = mul64(jump_s_203499, x_216280);\n                        int64_t min_arg_216282 = add64((int64_t) 1, x_216281);\n                        int64_t min_res_216283 = smin64(defunc_0_f_res_203631,\n                                                        min_arg_216282);\n                        \n                        defunc_0_m_fun_res_f_res_216278 = min_res_216283;\n                    }\n                    defunc_0_m_fun_res_216275 = defunc_0_m_fun_res_f_res_216278;\n                }\n                \n                double defunc_2_reduce_res_216284;\n                double defunc_2_reduce_res_216285;\n                double defunc_2_reduce_res_216286;\n                double defunc_2_reduce_res_216287;\n                double defunc_2_reduce_res_216288;\n                double redout_228553;\n                double redout_228554;\n                double redout_228555;\n                double redout_228556;\n                double redout_228557;\n  ",
                   "              \n                redout_228553 = 0.0;\n                redout_228554 = 0.0;\n                redout_228555 = 0.0;\n                redout_228556 = 0.0;\n                redout_228557 = 0.0;\n                for (int64_t i_228558 = 0; i_228558 < q_s_203493; i_228558++) {\n                    bool cond_216305 = sle64(x_216266, i_228558);\n                    int64_t defunc_0_f_res_216306;\n                    \n                    if (cond_216305) {\n                        defunc_0_f_res_216306 = (int64_t) 0;\n                    } else {\n                        int64_t i_216307 = add64(x_216272, i_228558);\n                        int64_t defunc_0_add_arg_216308;\n                        \n                        defunc_0_add_arg_216308 = ((__global\n                                                    int64_t *) mem_230189)[i_216307 *\n                                                                           (n_p_203492 *\n                                                                            partition_sizze_203577) +\n                                                                           gtid_216260 *\n                                                                           n_p_203492 +\n                                                                           gtid_216261];\n                        \n                        int64_t defunc_1_add_res_216309 = add64((int64_t) 1,\n                                                                defunc_0_add_arg_216308);\n                        \n                        defunc_0_f_res_216306 = defunc_1_add_res_216309;\n                    }\n                    \n                    double defunc_0_f_res_216310;\n                    \n                    if (cond_216305) {\n                        defunc_0_f_res_216310 = 0.0;\n                    } else {\n                        int64_t i_216311 = add64(x_216272, i_228558);\n                        double defunc_0_add_arg_216312;\n                        \n                     ",
                   "   defunc_0_add_arg_216312 = ((__global\n                                                    double *) mem_230193)[i_216311 *\n                                                                          (n_p_203492 *\n                                                                           partition_sizze_203577) +\n                                                                          gtid_216260 *\n                                                                          n_p_203492 +\n                                                                          gtid_216261];\n                        defunc_0_f_res_216310 = defunc_0_add_arg_216312;\n                    }\n                    \n                    int64_t binop_p_216313 = sub64(defunc_0_f_res_216306,\n                                                   defunc_0_m_fun_res_216275);\n                    double defunc_0_f_res_216314 =\n                           sitofp_i64_f64(binop_p_216313);\n                    double abs_res_216315 = fabs(defunc_0_f_res_216314);\n                    double tmp1_216316 = abs_res_216315 / x_216273;\n                    double x_216317 = tmp1_216316 * tmp1_216316;\n                    double y_216318 = tmp1_216316 * x_216317;\n                    double tmp2_216319 = 1.0 - y_216318;\n                    double x_216320 = tmp2_216319 * tmp2_216319;\n                    double tmp3_216321 = tmp2_216319 * x_216320;\n                    double w_j_216322 = defunc_0_f_res_216310 * tmp3_216321;\n                    double xw_j_216323 = defunc_0_f_res_216314 * w_j_216322;\n                    double x2w_j_216324 = defunc_0_f_res_216314 * xw_j_216323;\n                    double x3w_j_216325 = defunc_0_f_res_216314 * x2w_j_216324;\n                    double x4w_j_216326 = defunc_0_f_res_216314 * x3w_j_216325;\n                    double defunc_1_op_res_216291 = w_j_216322 + redout_228553;\n                    double defunc_1_op_res_216294 = xw_j_216323 + redout_228554;\n                    double defunc_1",
                   "_op_res_216297 = x2w_j_216324 +\n                           redout_228555;\n                    double defunc_1_op_res_216300 = x3w_j_216325 +\n                           redout_228556;\n                    double defunc_1_op_res_216303 = x4w_j_216326 +\n                           redout_228557;\n                    double redout_tmp_233607 = defunc_1_op_res_216291;\n                    double redout_tmp_233608 = defunc_1_op_res_216294;\n                    double redout_tmp_233609 = defunc_1_op_res_216297;\n                    double redout_tmp_233610 = defunc_1_op_res_216300;\n                    double redout_tmp_233611 = defunc_1_op_res_216303;\n                    \n                    redout_228553 = redout_tmp_233607;\n                    redout_228554 = redout_tmp_233608;\n                    redout_228555 = redout_tmp_233609;\n                    redout_228556 = redout_tmp_233610;\n                    redout_228557 = redout_tmp_233611;\n                }\n                defunc_2_reduce_res_216284 = redout_228553;\n                defunc_2_reduce_res_216285 = redout_228554;\n                defunc_2_reduce_res_216286 = redout_228555;\n                defunc_2_reduce_res_216287 = redout_228556;\n                defunc_2_reduce_res_216288 = redout_228557;\n                \n                double x_216327 = defunc_2_reduce_res_216286 *\n                       defunc_2_reduce_res_216288;\n                double y_216328 = defunc_2_reduce_res_216287 *\n                       defunc_2_reduce_res_216287;\n                double a12_216329 = x_216327 - y_216328;\n                double x_216330 = defunc_2_reduce_res_216286 *\n                       defunc_2_reduce_res_216287;\n                double y_216331 = defunc_2_reduce_res_216285 *\n                       defunc_2_reduce_res_216288;\n                double b12_216332 = x_216330 - y_216331;\n                double x_216333 = defunc_2_reduce_res_216285 *\n                       defunc_2_reduce_res_216287;\n                double y_216334 = defu",
                   "nc_2_reduce_res_216286 *\n                       defunc_2_reduce_res_216286;\n                double c12_216335 = x_216333 - y_216334;\n                double x_216336 = defunc_2_reduce_res_216284 *\n                       defunc_2_reduce_res_216288;\n                double b2_216337 = x_216336 - y_216334;\n                double x_216338 = defunc_2_reduce_res_216285 *\n                       defunc_2_reduce_res_216286;\n                double y_216339 = defunc_2_reduce_res_216284 *\n                       defunc_2_reduce_res_216287;\n                double c2_216340 = x_216338 - y_216339;\n                double x_216341 = defunc_2_reduce_res_216284 * a12_216329;\n                double y_216342 = defunc_2_reduce_res_216285 * b12_216332;\n                double x_216343 = x_216341 + y_216342;\n                double y_216344 = defunc_2_reduce_res_216286 * c12_216335;\n                double y_216345 = x_216343 + y_216344;\n                double det_216346 = 1.0 / y_216345;\n                double a12_216347 = a12_216329 * det_216346;\n                double b12_216348 = b12_216332 * det_216346;\n                double c12_216349 = c12_216335 * det_216346;\n                double b2_216350 = b2_216337 * det_216346;\n                double c2_216351 = c2_216340 * det_216346;\n                int64_t defunc_0_m_fun_res_216352;\n                \n                if (cond_216274) {\n                    defunc_0_m_fun_res_216352 = (int64_t) 0;\n                } else {\n                    int64_t y_216353 = sub64(s_n_m_203636, (int64_t) 1);\n                    bool cond_216354 = i_228976 == y_216353;\n                    int64_t defunc_0_m_fun_res_f_res_216355;\n                    \n                    if (cond_216354) {\n                        int64_t defunc_0_m_fun_res_f_res_t_res_216356 =\n                                sub64(pad_css_len_203632, (int64_t) 1);\n                        \n                        defunc_0_m_fun_res_f_res_216355 =\n                            defunc_0_m_fun_res_f_res_t",
                   "_res_216356;\n                    } else {\n                        int64_t x_216357 = sub64(i_228976, (int64_t) 1);\n                        int64_t x_216358 = mul64(jump_s_203499, x_216357);\n                        int64_t min_arg_216359 = add64((int64_t) 1, x_216358);\n                        int64_t min_res_216360 = smin64(defunc_0_f_res_203631,\n                                                        min_arg_216359);\n                        \n                        defunc_0_m_fun_res_f_res_216355 = min_res_216360;\n                    }\n                    defunc_0_m_fun_res_216352 = defunc_0_m_fun_res_f_res_216355;\n                }\n                \n                double defunc_2_reduce_res_216361;\n                double defunc_2_reduce_res_216362;\n                double redout_228559;\n                double redout_228560;\n                \n                redout_228559 = 0.0;\n                redout_228560 = 0.0;\n                for (int64_t i_228561 = 0; i_228561 < q_s_203493; i_228561++) {\n                    bool cond_216370 = sle64(x_216266, i_228561);\n                    int64_t defunc_0_f_res_216371;\n                    \n                    if (cond_216370) {\n                        defunc_0_f_res_216371 = (int64_t) 0;\n                    } else {\n                        int64_t i_216372 = add64(x_216272, i_228561);\n                        int64_t defunc_0_add_arg_216373;\n                        \n                        defunc_0_add_arg_216373 = ((__global\n                                                    int64_t *) mem_230189)[i_216372 *\n                                                                           (n_p_203492 *\n                                                                            partition_sizze_203577) +\n                                                                           gtid_216260 *\n                                                                           n_p_203492 +\n                                                           ",
                   "                gtid_216261];\n                        \n                        int64_t defunc_1_add_res_216374 = add64((int64_t) 1,\n                                                                defunc_0_add_arg_216373);\n                        \n                        defunc_0_f_res_216371 = defunc_1_add_res_216374;\n                    }\n                    \n                    double defunc_0_f_res_216375;\n                    \n                    if (cond_216370) {\n                        defunc_0_f_res_216375 = 0.0;\n                    } else {\n                        int64_t i_216376 = add64(x_216272, i_228561);\n                        double defunc_0_add_arg_216377;\n                        \n                        defunc_0_add_arg_216377 = ((__global\n                                                    double *) mem_230193)[i_216376 *\n                                                                          (n_p_203492 *\n                                                                           partition_sizze_203577) +\n                                                                          gtid_216260 *\n                                                                          n_p_203492 +\n                                                                          gtid_216261];\n                        defunc_0_f_res_216375 = defunc_0_add_arg_216377;\n                    }\n                    \n                    int64_t binop_p_216378 = sub64(defunc_0_f_res_216371,\n                                                   defunc_0_m_fun_res_216352);\n                    double defunc_0_f_res_216379 =\n                           sitofp_i64_f64(binop_p_216378);\n                    double abs_res_216380 = fabs(defunc_0_f_res_216379);\n                    double tmp1_216381 = abs_res_216380 / x_216273;\n                    double x_216382 = tmp1_216381 * tmp1_216381;\n                    double y_216383 = tmp1_216381 * x_216382;\n                    double tmp2_216384 = 1.0 - y_",
                   "216383;\n                    double x_216385 = tmp2_216384 * tmp2_216384;\n                    double tmp3_216386 = tmp2_216384 * x_216385;\n                    double tmp4_216387 = defunc_0_f_res_216375 * tmp3_216386;\n                    double defunc_1_f_res_216388 = defunc_0_f_res_216379 *\n                           tmp4_216387;\n                    double defunc_1_f_res_216389 = defunc_0_f_res_216379 *\n                           defunc_1_f_res_216388;\n                    double defunc_0_f_res_216390;\n                    \n                    if (cond_216370) {\n                        defunc_0_f_res_216390 = 0.0;\n                    } else {\n                        int64_t i_216391 = add64(x_216272, i_228561);\n                        double defunc_0_add_arg_216392;\n                        \n                        defunc_0_add_arg_216392 = ((__global\n                                                    double *) mem_230197)[i_216391 *\n                                                                          (n_p_203492 *\n                                                                           partition_sizze_203577) +\n                                                                          gtid_216260 *\n                                                                          n_p_203492 +\n                                                                          gtid_216261];\n                        defunc_0_f_res_216390 = defunc_0_add_arg_216392;\n                    }\n                    \n                    double x_216393 = a12_216347 * tmp4_216387;\n                    double y_216394 = b12_216348 * defunc_1_f_res_216388;\n                    double x_216395 = x_216393 + y_216394;\n                    double y_216396 = c12_216349 * defunc_1_f_res_216389;\n                    double x_216397 = x_216395 + y_216396;\n                    double defunc_9_fit_fun_res_216398 = defunc_0_f_res_216390 *\n                           x_216397;\n                    double x_216399 = b",
                   "12_216348 * tmp4_216387;\n                    double y_216400 = b2_216350 * defunc_1_f_res_216388;\n                    double x_216401 = x_216399 + y_216400;\n                    double y_216402 = c2_216351 * defunc_1_f_res_216389;\n                    double x_216403 = x_216401 + y_216402;\n                    double defunc_9_slope_fun_res_216404 =\n                           defunc_0_f_res_216390 * x_216403;\n                    double defunc_1_op_res_216365 =\n                           defunc_9_fit_fun_res_216398 + redout_228559;\n                    double defunc_1_op_res_216368 =\n                           defunc_9_slope_fun_res_216404 + redout_228560;\n                    double redout_tmp_233612 = defunc_1_op_res_216365;\n                    double redout_tmp_233613 = defunc_1_op_res_216368;\n                    \n                    redout_228559 = redout_tmp_233612;\n                    redout_228560 = redout_tmp_233613;\n                }\n                defunc_2_reduce_res_216361 = redout_228559;\n                defunc_2_reduce_res_216362 = redout_228560;\n                ((__global double *) color_232007)[phys_tid_216262 + i_228976 *\n                                                   num_threads_232134] =\n                    defunc_2_reduce_res_216361;\n                ((__global double *) color_232006)[phys_tid_216262 + i_228976 *\n                                                   num_threads_232134] =\n                    defunc_2_reduce_res_216362;\n            }\n            for (int64_t i_233614 = 0; i_233614 < s_n_m_203636; i_233614++) {\n                double tmp_233615;\n                \n                tmp_233615 = ((__global\n                               double *) color_232007)[phys_tid_216262 +\n                                                       i_233614 *\n                                                       num_threads_232134];\n                ((__global double *) mem_230232)[gtid_216260 * n_p_203492 +\n                                                 gtid",
                   "_216261 + i_233614 *\n                                                 (n_p_203492 *\n                                                  partition_sizze_203577)] =\n                    tmp_233615;\n            }\n            for (int64_t i_233616 = 0; i_233616 < s_n_m_203636; i_233616++) {\n                double tmp_233617;\n                \n                tmp_233617 = ((__global\n                               double *) color_232006)[phys_tid_216262 +\n                                                       i_233616 *\n                                                       num_threads_232134];\n                ((__global double *) mem_230236)[gtid_216260 * n_p_203492 +\n                                                 gtid_216261 + i_233616 *\n                                                 (n_p_203492 *\n                                                  partition_sizze_203577)] =\n                    tmp_233617;\n            }\n        }\n        barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_216239\n}\n__kernel void mainzisegmap_216607(__global int *global_failure,\n                                  int64_t n_p_203492, int64_t q_s_203493,\n                                  int64_t jump_s_203499,\n                                  int64_t partition_sizze_203577,\n                                  int64_t defunc_0_f_res_203631,\n                                  int64_t pad_css_len_203632,\n                                  int64_t s_n_m_203636, __global\n                                  unsigned char *ext_mem_229264, __global\n                                  unsigned char *ext_mem_229265, __global\n                                  unsigned char *ext_mem_229362, __global\n                                  unsigned char *ext_mem_229363, __global\n                                  unsigned char *mem_229526, __global\n                                  unsigned char *mem_229531, __global\n                                  unsig",
                   "ned char *mem_230301, __global\n                                  unsigned char *mem_230306)\n{\n    #define segmap_group_sizze_216594 (mainzisegmap_group_sizze_215167)\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_233716;\n    int32_t local_tid_233717;\n    int64_t group_sizze_233720;\n    int32_t wave_sizze_233719;\n    int32_t group_tid_233718;\n    \n    global_tid_233716 = get_global_id(0);\n    local_tid_233717 = get_local_id(0);\n    group_sizze_233720 = get_local_size(0);\n    wave_sizze_233719 = LOCKSTEP_WIDTH;\n    group_tid_233718 = get_group_id(0);\n    \n    int32_t phys_tid_216607 = global_tid_233716;\n    int64_t global_tid_233721 = sext_i32_i64(group_tid_233718) *\n            segmap_group_sizze_216594 + sext_i32_i64(local_tid_233717);\n    int64_t slice_233722 = s_n_m_203636;\n    int64_t slice_233723 = n_p_203492 * slice_233722;\n    int64_t slice_233724 = partition_sizze_203577 * slice_233723;\n    int64_t gtid_216604 = squot64(global_tid_233721, slice_233723);\n    int64_t remnant_233725 = global_tid_233721 - gtid_216604 * slice_233723;\n    int64_t gtid_216605 = squot64(remnant_233725, slice_233722);\n    int64_t remnant_233726 = remnant_233725 - gtid_216605 * slice_233722;\n    int64_t gtid_216606 = remnant_233726;\n    int64_t remnant_233727 = remnant_233726 - gtid_216606;\n    \n    if ((slt64(gtid_216604, partition_sizze_203577) && slt64(gtid_216605,\n                                                             n_p_203492)) &&\n        slt64(gtid_216606, s_n_m_203636)) {\n        int64_t x_216611;\n        \n        x_216611 = ((__global int64_t *) ext_mem_229264)[gtid_216604 *\n                                                         n_p_203492 +\n                                                         gtid_216605];\n        \n        int64_t x_216613;\n        \n        x_216613 = ((__global int64_t *) ext_mem_229363)[gtid_216604 *\n                   ",
                   "                                      (s_n_m_203636 *\n                                                          n_p_203492) +\n                                                         gtid_216605 *\n                                                         s_n_m_203636 +\n                                                         gtid_216606];\n        \n        double x_216614;\n        \n        x_216614 = ((__global double *) ext_mem_229362)[gtid_216604 *\n                                                        (s_n_m_203636 *\n                                                         n_p_203492) +\n                                                        gtid_216605 *\n                                                        s_n_m_203636 +\n                                                        gtid_216606];\n        \n        bool cond_216615 = gtid_216606 == (int64_t) 0;\n        int64_t defunc_0_m_fun_res_216616;\n        \n        if (cond_216615) {\n            defunc_0_m_fun_res_216616 = (int64_t) 0;\n        } else {\n            int64_t y_216617 = sub64(s_n_m_203636, (int64_t) 1);\n            bool cond_216618 = gtid_216606 == y_216617;\n            int64_t defunc_0_m_fun_res_f_res_216619;\n            \n            if (cond_216618) {\n                int64_t defunc_0_m_fun_res_f_res_t_res_216620 =\n                        sub64(pad_css_len_203632, (int64_t) 1);\n                \n                defunc_0_m_fun_res_f_res_216619 =\n                    defunc_0_m_fun_res_f_res_t_res_216620;\n            } else {\n                int64_t x_216621 = sub64(gtid_216606, (int64_t) 1);\n                int64_t x_216622 = mul64(jump_s_203499, x_216621);\n                int64_t min_arg_216623 = add64((int64_t) 1, x_216622);\n                int64_t min_res_216624 = smin64(defunc_0_f_res_203631,\n                                                min_arg_216623);\n                \n                defunc_0_m_fun_res_f_res_216619 = min_res_216624;\n            }\n            defunc_0_m_fun_res_216616 = defunc_0",
                   "_m_fun_res_f_res_216619;\n        }\n        \n        double defunc_2_reduce_res_216625;\n        double defunc_2_reduce_res_216626;\n        double defunc_2_reduce_res_216627;\n        double defunc_2_reduce_res_216628;\n        double defunc_2_reduce_res_216629;\n        double redout_228574;\n        double redout_228575;\n        double redout_228576;\n        double redout_228577;\n        double redout_228578;\n        \n        redout_228574 = 0.0;\n        redout_228575 = 0.0;\n        redout_228576 = 0.0;\n        redout_228577 = 0.0;\n        redout_228578 = 0.0;\n        for (int64_t i_228579 = 0; i_228579 < q_s_203493; i_228579++) {\n            bool cond_216646 = sle64(x_216611, i_228579);\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(x_216613, i_228579);\n                int64_t defunc_0_add_arg_216649;\n                \n                defunc_0_add_arg_216649 = ((__global\n                                            int64_t *) ext_mem_229265)[gtid_216604 *\n                                                                       (defunc_0_f_res_203631 *\n                                                                        n_p_203492) +\n                                                                       gtid_216605 *\n                                                                       defunc_0_f_res_203631 +\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(x_216613, i_228579);\n                double defunc_0_add_arg_216653;\n                \n                defunc_0_add_arg_216653 = ((__global\n                                            double *) mem_229531)[gtid_216604 *\n                                                                  (defunc_0_f_res_203631 *\n                                                                   n_p_203492) +\n                                                                  gtid_216605 *\n                                                                  defunc_0_f_res_203631 +\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_216616);\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_216614;\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 w_j_216663 = defunc_0_f_res_216651 * tmp3_216662;\n            double xw_j_216664 = defunc_0_f_res_216655 * w_j_216663;\n            double x2w_j_216665 = defunc_0_f_res_216655 * xw_j_216664;\n            double x3w_j_216666 = defunc_0_f_res_216655 * x2w_j_216665;\n            double x4w_j_216667 = defunc_0_f_res_216655 * x3w_j_216666;\n            double defunc_1_op_res_216632 = w_j_216663 + redout_228574;\n            double defunc_1_op_res_216635 = xw_j_216664 + redout_228575;\n            double defunc_1_op_res_216638 = x2w_j_216665 + redout_228576;\n            double defunc_1_op_res_216641 = x3w_j_216",
                   "666 + redout_228577;\n            double defunc_1_op_res_216644 = x4w_j_216667 + redout_228578;\n            double redout_tmp_233728 = defunc_1_op_res_216632;\n            double redout_tmp_233729 = defunc_1_op_res_216635;\n            double redout_tmp_233730 = defunc_1_op_res_216638;\n            double redout_tmp_233731 = defunc_1_op_res_216641;\n            double redout_tmp_233732 = defunc_1_op_res_216644;\n            \n            redout_228574 = redout_tmp_233728;\n            redout_228575 = redout_tmp_233729;\n            redout_228576 = redout_tmp_233730;\n            redout_228577 = redout_tmp_233731;\n            redout_228578 = redout_tmp_233732;\n        }\n        defunc_2_reduce_res_216625 = redout_228574;\n        defunc_2_reduce_res_216626 = redout_228575;\n        defunc_2_reduce_res_216627 = redout_228576;\n        defunc_2_reduce_res_216628 = redout_228577;\n        defunc_2_reduce_res_216629 = redout_228578;\n        \n        double x_216668 = defunc_2_reduce_res_216627 *\n               defunc_2_reduce_res_216629;\n        double y_216669 = defunc_2_reduce_res_216628 *\n               defunc_2_reduce_res_216628;\n        double a12_216670 = x_216668 - y_216669;\n        double x_216671 = defunc_2_reduce_res_216627 *\n               defunc_2_reduce_res_216628;\n        double y_216672 = defunc_2_reduce_res_216626 *\n               defunc_2_reduce_res_216629;\n        double b12_216673 = x_216671 - y_216672;\n        double x_216674 = defunc_2_reduce_res_216626 *\n               defunc_2_reduce_res_216628;\n        double y_216675 = defunc_2_reduce_res_216627 *\n               defunc_2_reduce_res_216627;\n        double c12_216676 = x_216674 - y_216675;\n        double x_216677 = defunc_2_reduce_res_216625 *\n               defunc_2_reduce_res_216629;\n        double b2_216678 = x_216677 - y_216675;\n        double x_216679 = defunc_2_reduce_res_216626 *\n               defunc_2_reduce_res_216627;\n        double y_216680 = defunc_2_reduce_res_216625 *\n               defunc_2_reduc",
                   "e_res_216628;\n        double c2_216681 = x_216679 - y_216680;\n        double x_216682 = defunc_2_reduce_res_216625 * a12_216670;\n        double y_216683 = defunc_2_reduce_res_216626 * b12_216673;\n        double x_216684 = x_216682 + y_216683;\n        double y_216685 = defunc_2_reduce_res_216627 * c12_216676;\n        double y_216686 = x_216684 + y_216685;\n        double det_216687 = 1.0 / y_216686;\n        double a12_216688 = a12_216670 * det_216687;\n        double b12_216689 = b12_216673 * det_216687;\n        double c12_216690 = c12_216676 * det_216687;\n        double b2_216691 = b2_216678 * det_216687;\n        double c2_216692 = c2_216681 * det_216687;\n        int64_t defunc_0_m_fun_res_216693;\n        \n        if (cond_216615) {\n            defunc_0_m_fun_res_216693 = (int64_t) 0;\n        } else {\n            int64_t y_216694 = sub64(s_n_m_203636, (int64_t) 1);\n            bool cond_216695 = gtid_216606 == y_216694;\n            int64_t defunc_0_m_fun_res_f_res_216696;\n            \n            if (cond_216695) {\n                int64_t defunc_0_m_fun_res_f_res_t_res_216697 =\n                        sub64(pad_css_len_203632, (int64_t) 1);\n                \n                defunc_0_m_fun_res_f_res_216696 =\n                    defunc_0_m_fun_res_f_res_t_res_216697;\n            } else {\n                int64_t x_216698 = sub64(gtid_216606, (int64_t) 1);\n                int64_t x_216699 = mul64(jump_s_203499, x_216698);\n                int64_t min_arg_216700 = add64((int64_t) 1, x_216699);\n                int64_t min_res_216701 = smin64(defunc_0_f_res_203631,\n                                                min_arg_216700);\n                \n                defunc_0_m_fun_res_f_res_216696 = min_res_216701;\n            }\n            defunc_0_m_fun_res_216693 = defunc_0_m_fun_res_f_res_216696;\n        }\n        \n        double defunc_2_reduce_res_216702;\n        double defunc_2_reduce_res_216703;\n        double redout_228580;\n        double redout_228581;\n        \n        re",
                   "dout_228580 = 0.0;\n        redout_228581 = 0.0;\n        for (int64_t i_228582 = 0; i_228582 < q_s_203493; i_228582++) {\n            bool cond_216711 = sle64(x_216611, i_228582);\n            int64_t defunc_0_f_res_216712;\n            \n            if (cond_216711) {\n                defunc_0_f_res_216712 = (int64_t) 0;\n            } else {\n                int64_t i_216713 = add64(x_216613, i_228582);\n                int64_t defunc_0_add_arg_216714;\n                \n                defunc_0_add_arg_216714 = ((__global\n                                            int64_t *) ext_mem_229265)[gtid_216604 *\n                                                                       (defunc_0_f_res_203631 *\n                                                                        n_p_203492) +\n                                                                       gtid_216605 *\n                                                                       defunc_0_f_res_203631 +\n                                                                       i_216713];\n                \n                int64_t defunc_1_add_res_216715 = add64((int64_t) 1,\n                                                        defunc_0_add_arg_216714);\n                \n                defunc_0_f_res_216712 = defunc_1_add_res_216715;\n            }\n            \n            double defunc_0_f_res_216716;\n            \n            if (cond_216711) {\n                defunc_0_f_res_216716 = 0.0;\n            } else {\n                int64_t i_216717 = add64(x_216613, i_228582);\n                double defunc_0_add_arg_216718;\n                \n                defunc_0_add_arg_216718 = ((__global\n                                            double *) mem_229531)[gtid_216604 *\n                                                                  (defunc_0_f_res_203631 *\n                                                                   n_p_203492) +\n                                                                  gtid_216605 *\n          ",
                   "                                                        defunc_0_f_res_203631 +\n                                                                  i_216717];\n                defunc_0_f_res_216716 = defunc_0_add_arg_216718;\n            }\n            \n            int64_t binop_p_216719 = sub64(defunc_0_f_res_216712,\n                                           defunc_0_m_fun_res_216693);\n            double defunc_0_f_res_216720 = sitofp_i64_f64(binop_p_216719);\n            double abs_res_216721 = fabs(defunc_0_f_res_216720);\n            double tmp1_216722 = abs_res_216721 / x_216614;\n            double x_216723 = tmp1_216722 * tmp1_216722;\n            double y_216724 = tmp1_216722 * x_216723;\n            double tmp2_216725 = 1.0 - y_216724;\n            double x_216726 = tmp2_216725 * tmp2_216725;\n            double tmp3_216727 = tmp2_216725 * x_216726;\n            double tmp4_216728 = defunc_0_f_res_216716 * tmp3_216727;\n            double defunc_1_f_res_216729 = defunc_0_f_res_216720 * tmp4_216728;\n            double defunc_1_f_res_216730 = defunc_0_f_res_216720 *\n                   defunc_1_f_res_216729;\n            double defunc_0_f_res_216731;\n            \n            if (cond_216711) {\n                defunc_0_f_res_216731 = 0.0;\n            } else {\n                int64_t i_216732 = add64(x_216613, i_228582);\n                double defunc_0_add_arg_216733;\n                \n                defunc_0_add_arg_216733 = ((__global\n                                            double *) mem_229526)[gtid_216604 *\n                                                                  (defunc_0_f_res_203631 *\n                                                                   n_p_203492) +\n                                                                  gtid_216605 *\n                                                                  defunc_0_f_res_203631 +\n                                                                  i_216732];\n                defunc_0_f_res_216731 = defunc_0_a",
                   "dd_arg_216733;\n            }\n            \n            double x_216734 = a12_216688 * tmp4_216728;\n            double y_216735 = b12_216689 * defunc_1_f_res_216729;\n            double x_216736 = x_216734 + y_216735;\n            double y_216737 = c12_216690 * defunc_1_f_res_216730;\n            double x_216738 = x_216736 + y_216737;\n            double defunc_9_fit_fun_res_216739 = defunc_0_f_res_216731 *\n                   x_216738;\n            double x_216740 = b12_216689 * tmp4_216728;\n            double y_216741 = b2_216691 * defunc_1_f_res_216729;\n            double x_216742 = x_216740 + y_216741;\n            double y_216743 = c2_216692 * defunc_1_f_res_216730;\n            double x_216744 = x_216742 + y_216743;\n            double defunc_9_slope_fun_res_216745 = defunc_0_f_res_216731 *\n                   x_216744;\n            double defunc_1_op_res_216706 = defunc_9_fit_fun_res_216739 +\n                   redout_228580;\n            double defunc_1_op_res_216709 = defunc_9_slope_fun_res_216745 +\n                   redout_228581;\n            double redout_tmp_233733 = defunc_1_op_res_216706;\n            double redout_tmp_233734 = defunc_1_op_res_216709;\n            \n            redout_228580 = redout_tmp_233733;\n            redout_228581 = redout_tmp_233734;\n        }\n        defunc_2_reduce_res_216702 = redout_228580;\n        defunc_2_reduce_res_216703 = redout_228581;\n        ((__global double *) mem_230301)[gtid_216604 * (s_n_m_203636 *\n                                                        n_p_203492) +\n                                         gtid_216605 * s_n_m_203636 +\n                                         gtid_216606] =\n            defunc_2_reduce_res_216702;\n        ((__global double *) mem_230306)[gtid_216604 * (s_n_m_203636 *\n                                                        n_p_203492) +\n                                         gtid_216605 * s_n_m_203636 +\n                                         gtid_216606] =\n            defunc_2_reduce_res_216",
                   "703;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_216594\n}\n__kernel void mainzisegmap_216756(__global int *global_failure,\n                                  int64_t n_p_203492, int64_t jump_s_203499,\n                                  int64_t partition_sizze_203577,\n                                  int64_t defunc_0_f_res_203631,\n                                  int64_t pad_css_len_203632,\n                                  int64_t s_n_m_203636, __global\n                                  unsigned char *mem_230312, __global\n                                  unsigned char *mem_230316)\n{\n    #define segmap_group_sizze_216749 (mainzisegmap_group_sizze_215584)\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_233735;\n    int32_t local_tid_233736;\n    int64_t group_sizze_233739;\n    int32_t wave_sizze_233738;\n    int32_t group_tid_233737;\n    \n    global_tid_233735 = get_global_id(0);\n    local_tid_233736 = get_local_id(0);\n    group_sizze_233739 = get_local_size(0);\n    wave_sizze_233738 = LOCKSTEP_WIDTH;\n    group_tid_233737 = get_group_id(0);\n    \n    int32_t phys_tid_216756 = global_tid_233735;\n    int64_t global_tid_233740 = sext_i32_i64(group_tid_233737) *\n            segmap_group_sizze_216749 + sext_i32_i64(local_tid_233736);\n    int64_t slice_233741 = s_n_m_203636;\n    int64_t slice_233742 = n_p_203492 * slice_233741;\n    int64_t slice_233743 = partition_sizze_203577 * slice_233742;\n    int64_t gtid_216753 = squot64(global_tid_233740, slice_233742);\n    int64_t remnant_233744 = global_tid_233740 - gtid_216753 * slice_233742;\n    int64_t gtid_216754 = squot64(remnant_233744, slice_233741);\n    int64_t remnant_233745 = remnant_233744 - gtid_216754 * slice_233741;\n    int64_t gtid_216755 = remnant_233745;\n    int64_t remnant_233746 = remnant_233745 - gtid_216755;\n    \n    if ((slt64(gtid_216753, partition_sizze_203577) && slt64",
                   "(gtid_216754,\n                                                             n_p_203492)) &&\n        slt64(gtid_216755, s_n_m_203636)) {\n        bool cond_216758 = gtid_216755 == (int64_t) 0;\n        int64_t defunc_0_m_fun_res_216759;\n        \n        if (cond_216758) {\n            defunc_0_m_fun_res_216759 = (int64_t) 0;\n        } else {\n            int64_t y_216760 = sub64(s_n_m_203636, (int64_t) 1);\n            bool cond_216761 = gtid_216755 == y_216760;\n            int64_t defunc_0_m_fun_res_f_res_216762;\n            \n            if (cond_216761) {\n                int64_t defunc_0_m_fun_res_f_res_t_res_216763 =\n                        sub64(pad_css_len_203632, (int64_t) 1);\n                \n                defunc_0_m_fun_res_f_res_216762 =\n                    defunc_0_m_fun_res_f_res_t_res_216763;\n            } else {\n                int64_t x_216764 = sub64(gtid_216755, (int64_t) 1);\n                int64_t x_216765 = mul64(jump_s_203499, x_216764);\n                int64_t min_arg_216766 = add64((int64_t) 1, x_216765);\n                int64_t min_res_216767 = smin64(defunc_0_f_res_203631,\n                                                min_arg_216766);\n                \n                defunc_0_m_fun_res_f_res_216762 = min_res_216767;\n            }\n            defunc_0_m_fun_res_216759 = defunc_0_m_fun_res_f_res_216762;\n        }\n        ((__global int64_t *) mem_230312)[gtid_216753 * (s_n_m_203636 *\n                                                         n_p_203492) +\n                                          gtid_216754 * s_n_m_203636 +\n                                          gtid_216755] =\n            defunc_0_m_fun_res_216759;\n        ((__global bool *) mem_230316)[gtid_216753 * (s_n_m_203636 *\n                                                      n_p_203492) +\n                                       gtid_216754 * s_n_m_203636 +\n                                       gtid_216755] = cond_216758;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_",
                   "216749\n}\n__kernel void mainzisegmap_216852(__global int *global_failure,\n                                  int64_t n_p_203492, int64_t jump_s_203499,\n                                  int64_t partition_sizze_203577,\n                                  int64_t defunc_0_f_res_203631,\n                                  int64_t pad_css_len_203632,\n                                  int64_t s_n_m_203636, __global\n                                  unsigned char *mem_230322, __global\n                                  unsigned char *mem_230327, __global\n                                  unsigned char *mem_230332, __global\n                                  unsigned char *mem_230337, __global\n                                  unsigned char *mem_230342, __global\n                                  unsigned char *mem_230348, __global\n                                  unsigned char *mem_230353, __global\n                                  unsigned char *mem_230358, __global\n                                  unsigned char *mem_230363, __global\n                                  unsigned char *mem_230368, __global\n                                  unsigned char *mem_230373)\n{\n    #define segmap_group_sizze_216841 (mainzisegmap_group_sizze_215454)\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_233879;\n    int32_t local_tid_233880;\n    int64_t group_sizze_233883;\n    int32_t wave_sizze_233882;\n    int32_t group_tid_233881;\n    \n    global_tid_233879 = get_global_id(0);\n    local_tid_233880 = get_local_id(0);\n    group_sizze_233883 = get_local_size(0);\n    wave_sizze_233882 = LOCKSTEP_WIDTH;\n    group_tid_233881 = get_group_id(0);\n    \n    int32_t phys_tid_216852 = global_tid_233879;\n    int64_t global_tid_233884 = sext_i32_i64(group_tid_233881) *\n            segmap_group_sizze_216841 + sext_i32_i64(local_tid_233880);\n    int64_t slice_233885 = s_n_m_203636;\n    int64",
                   "_t slice_233886 = n_p_203492 * slice_233885;\n    int64_t slice_233887 = partition_sizze_203577 * slice_233886;\n    int64_t gtid_216849 = squot64(global_tid_233884, slice_233886);\n    int64_t remnant_233888 = global_tid_233884 - gtid_216849 * slice_233886;\n    int64_t gtid_216850 = squot64(remnant_233888, slice_233885);\n    int64_t remnant_233889 = remnant_233888 - gtid_216850 * slice_233885;\n    int64_t gtid_216851 = remnant_233889;\n    int64_t remnant_233890 = remnant_233889 - gtid_216851;\n    \n    if ((slt64(gtid_216849, partition_sizze_203577) && slt64(gtid_216850,\n                                                             n_p_203492)) &&\n        slt64(gtid_216851, s_n_m_203636)) {\n        bool index_primexp_228734 = gtid_216851 == (int64_t) 0;\n        double defunc_2_reduce_res_216855;\n        \n        defunc_2_reduce_res_216855 = ((__global\n                                       double *) mem_230322)[gtid_216849 *\n                                                             (s_n_m_203636 *\n                                                              n_p_203492) +\n                                                             gtid_216850 *\n                                                             s_n_m_203636 +\n                                                             gtid_216851];\n        \n        double defunc_2_reduce_res_216856;\n        \n        defunc_2_reduce_res_216856 = ((__global\n                                       double *) mem_230327)[gtid_216849 *\n                                                             (s_n_m_203636 *\n                                                              n_p_203492) +\n                                                             gtid_216850 *\n                                                             s_n_m_203636 +\n                                                             gtid_216851];\n        \n        double defunc_2_reduce_res_216857;\n        \n        defunc_2_reduce_res_216857 = ((__global\n              ",
                   "                         double *) mem_230332)[gtid_216849 *\n                                                             (s_n_m_203636 *\n                                                              n_p_203492) +\n                                                             gtid_216850 *\n                                                             s_n_m_203636 +\n                                                             gtid_216851];\n        \n        double defunc_2_reduce_res_216858;\n        \n        defunc_2_reduce_res_216858 = ((__global\n                                       double *) mem_230337)[gtid_216849 *\n                                                             (s_n_m_203636 *\n                                                              n_p_203492) +\n                                                             gtid_216850 *\n                                                             s_n_m_203636 +\n                                                             gtid_216851];\n        \n        double defunc_2_reduce_res_216859;\n        \n        defunc_2_reduce_res_216859 = ((__global\n                                       double *) mem_230342)[gtid_216849 *\n                                                             (s_n_m_203636 *\n                                                              n_p_203492) +\n                                                             gtid_216850 *\n                                                             s_n_m_203636 +\n                                                             gtid_216851];\n        \n        double x_216860 = defunc_2_reduce_res_216857 *\n               defunc_2_reduce_res_216859;\n        double y_216861 = defunc_2_reduce_res_216858 *\n               defunc_2_reduce_res_216858;\n        double a12_216862 = x_216860 - y_216861;\n        double x_216863 = defunc_2_reduce_res_216857 *\n               defunc_2_reduce_res_216858;\n        double y_216864 = defunc_2_reduce_res_216856 *\n               defunc_2_red",
                   "uce_res_216859;\n        double b12_216865 = x_216863 - y_216864;\n        double x_216866 = defunc_2_reduce_res_216856 *\n               defunc_2_reduce_res_216858;\n        double y_216867 = defunc_2_reduce_res_216857 *\n               defunc_2_reduce_res_216857;\n        double c12_216868 = x_216866 - y_216867;\n        double x_216869 = defunc_2_reduce_res_216855 *\n               defunc_2_reduce_res_216859;\n        double b2_216870 = x_216869 - y_216867;\n        double x_216871 = defunc_2_reduce_res_216856 *\n               defunc_2_reduce_res_216857;\n        double y_216872 = defunc_2_reduce_res_216855 *\n               defunc_2_reduce_res_216858;\n        double c2_216873 = x_216871 - y_216872;\n        double x_216874 = defunc_2_reduce_res_216855 * a12_216862;\n        double y_216875 = defunc_2_reduce_res_216856 * b12_216865;\n        double x_216876 = x_216874 + y_216875;\n        double y_216877 = defunc_2_reduce_res_216857 * c12_216868;\n        double y_216878 = x_216876 + y_216877;\n        double det_216879 = 1.0 / y_216878;\n        double a12_216880 = a12_216862 * det_216879;\n        double b12_216881 = b12_216865 * det_216879;\n        double c12_216882 = c12_216868 * det_216879;\n        double b2_216883 = b2_216870 * det_216879;\n        double c2_216884 = c2_216873 * det_216879;\n        int64_t defunc_0_m_fun_res_216885;\n        \n        if (index_primexp_228734) {\n            defunc_0_m_fun_res_216885 = (int64_t) 0;\n        } else {\n            int64_t y_216886 = sub64(s_n_m_203636, (int64_t) 1);\n            bool cond_216887 = gtid_216851 == y_216886;\n            int64_t defunc_0_m_fun_res_f_res_216888;\n            \n            if (cond_216887) {\n                int64_t defunc_0_m_fun_res_f_res_t_res_216889 =\n                        sub64(pad_css_len_203632, (int64_t) 1);\n                \n                defunc_0_m_fun_res_f_res_216888 =\n                    defunc_0_m_fun_res_f_res_t_res_216889;\n            } else {\n                int64_t x_216890 = sub64(gtid_216",
                   "851, (int64_t) 1);\n                int64_t x_216891 = mul64(jump_s_203499, x_216890);\n                int64_t min_arg_216892 = add64((int64_t) 1, x_216891);\n                int64_t min_res_216893 = smin64(defunc_0_f_res_203631,\n                                                min_arg_216892);\n                \n                defunc_0_m_fun_res_f_res_216888 = min_res_216893;\n            }\n            defunc_0_m_fun_res_216885 = defunc_0_m_fun_res_f_res_216888;\n        }\n        ((__global double *) mem_230348)[gtid_216849 * (s_n_m_203636 *\n                                                        n_p_203492) +\n                                         gtid_216850 * s_n_m_203636 +\n                                         gtid_216851] = a12_216880;\n        ((__global double *) mem_230353)[gtid_216849 * (s_n_m_203636 *\n                                                        n_p_203492) +\n                                         gtid_216850 * s_n_m_203636 +\n                                         gtid_216851] = b12_216881;\n        ((__global double *) mem_230358)[gtid_216849 * (s_n_m_203636 *\n                                                        n_p_203492) +\n                                         gtid_216850 * s_n_m_203636 +\n                                         gtid_216851] = c12_216882;\n        ((__global double *) mem_230363)[gtid_216849 * (s_n_m_203636 *\n                                                        n_p_203492) +\n                                         gtid_216850 * s_n_m_203636 +\n                                         gtid_216851] = b2_216883;\n        ((__global double *) mem_230368)[gtid_216849 * (s_n_m_203636 *\n                                                        n_p_203492) +\n                                         gtid_216850 * s_n_m_203636 +\n                                         gtid_216851] = c2_216884;\n        ((__global int64_t *) mem_230373)[gtid_216849 * (s_n_m_203636 *\n                                                         n_p_2",
                   "03492) +\n                                          gtid_216850 * s_n_m_203636 +\n                                          gtid_216851] =\n            defunc_0_m_fun_res_216885;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_216841\n}\n__kernel void mainzisegmap_218413(__global int *global_failure,\n                                  int failure_is_an_option, __global\n                                  int64_t *global_failure_args,\n                                  int64_t n_p_203492, int64_t jump_s_203499,\n                                  int64_t partition_sizze_203577,\n                                  int64_t defunc_0_f_res_203631,\n                                  int64_t pad_css_len_203632,\n                                  int64_t s_n_m_203636, __global\n                                  unsigned char *ext_mem_230486, __global\n                                  unsigned char *ext_mem_230487, __global\n                                  unsigned char *mem_230493)\n{\n    #define segmap_group_sizze_218407 (mainzisegmap_group_sizze_218115)\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_234067;\n    int32_t local_tid_234068;\n    int64_t group_sizze_234071;\n    int32_t wave_sizze_234070;\n    int32_t group_tid_234069;\n    \n    global_tid_234067 = get_global_id(0);\n    local_tid_234068 = get_local_id(0);\n    group_sizze_234071 = get_local_size(0);\n    wave_sizze_234070 = LOCKSTEP_WIDTH;\n    group_tid_234069 = get_group_id(0);\n    \n    int32_t phys_tid_218413 = global_tid_234067;\n    int64_t global_tid_234072 = sext_i32_i64(group_tid_234069) *\n            segmap_group_sizze_218407 + sext_i32_i64(local_tid_234068);\n    int64_t slice_234073 = pad_css_len_203632;\n    int64_t slice_234074 = n_p_203492 * slice_234073;\n    int64_t slice_234075 = partition_sizze_203577 * slice_234074;\n    int64_t gtid_218410 = squot64(global_tid_234072, slice_234",
                   "074);\n    int64_t remnant_234076 = global_tid_234072 - gtid_218410 * slice_234074;\n    int64_t gtid_218411 = squot64(remnant_234076, slice_234073);\n    int64_t remnant_234077 = remnant_234076 - gtid_218411 * slice_234073;\n    int64_t gtid_218412 = remnant_234077;\n    int64_t remnant_234078 = remnant_234077 - gtid_218412;\n    \n    if ((slt64(gtid_218410, partition_sizze_203577) && slt64(gtid_218411,\n                                                             n_p_203492)) &&\n        slt64(gtid_218412, pad_css_len_203632)) {\n        bool cond_218417 = gtid_218412 == (int64_t) 0;\n        double defunc_0_f_res_218418;\n        \n        if (cond_218417) {\n            bool y_218419 = slt64((int64_t) 0, s_n_m_203636);\n            bool index_certs_218420;\n            \n            if (!y_218419) {\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_203636;\n                        ;\n                    }\n                    return;\n                }\n            }\n            \n            double head_res_218421;\n            \n            head_res_218421 = ((__global double *) ext_mem_230487)[gtid_218410 *\n                                                                   (s_n_m_203636 *\n                                                                    n_p_203492) +\n                                                                   gtid_218411 *\n                                                                   s_n_m_203636];\n            defunc_0_f_res_218418 = head_res_218421;\n        } else {\n            int64_t y_218422 = sub64(pad_css_len_203632, (int64_t) 1);\n            bool cond_218423 = gtid_218412 == y_218422;\n            double defunc_0_f_res_f_res_218424;\n            \n            if (cond_218423) {\n                int64_t i_218425 = sub64(s_n_m_203636, (int64_t",
                   ") 1);\n                bool x_218426 = sle64((int64_t) 0, i_218425);\n                bool y_218427 = slt64(i_218425, s_n_m_203636);\n                bool bounds_check_218428 = x_218426 && y_218427;\n                bool index_certs_218429;\n                \n                if (!bounds_check_218428) {\n                    {\n                        if (atomic_cmpxchg_i32_global(global_failure, -1, 39) ==\n                            -1) {\n                            global_failure_args[0] = (int64_t) i_218425;\n                            global_failure_args[1] = (int64_t) s_n_m_203636;\n                            ;\n                        }\n                        return;\n                    }\n                }\n                \n                double last_res_218430;\n                \n                last_res_218430 = ((__global\n                                    double *) ext_mem_230487)[gtid_218410 *\n                                                              (s_n_m_203636 *\n                                                               n_p_203492) +\n                                                              gtid_218411 *\n                                                              s_n_m_203636 +\n                                                              i_218425];\n                defunc_0_f_res_f_res_218424 = last_res_218430;\n            } else {\n                int64_t x_218431 = sub64(gtid_218412, (int64_t) 1);\n                bool zzero_218432 = jump_s_203499 == (int64_t) 0;\n                bool nonzzero_218433 = !zzero_218432;\n                bool nonzzero_cert_218434;\n                \n                if (!nonzzero_218433) {\n                    {\n                        if (atomic_cmpxchg_i32_global(global_failure, -1, 40) ==\n                            -1) {\n                            ;\n                        }\n                        return;\n                    }\n                }\n                \n                int64_t x_218435 = sdiv64(x_218431, jump_",
                   "s_203499);\n                int64_t m_v_218436 = add64((int64_t) 1, x_218435);\n                int64_t j_218437;\n                \n                if (cond_218417) {\n                    j_218437 = (int64_t) 0;\n                } else {\n                    int64_t y_218438 = sub64(s_n_m_203636, (int64_t) 1);\n                    bool cond_218439 = m_v_218436 == y_218438;\n                    int64_t j_f_res_218440;\n                    \n                    if (cond_218439) {\n                        j_f_res_218440 = x_218435;\n                    } else {\n                        j_f_res_218440 = m_v_218436;\n                    }\n                    j_218437 = j_f_res_218440;\n                }\n                \n                bool cond_218441 = j_218437 == (int64_t) 0;\n                int64_t defunc_0_m_fun_res_218442;\n                \n                if (cond_218441) {\n                    defunc_0_m_fun_res_218442 = (int64_t) 0;\n                } else {\n                    int64_t y_218443 = sub64(s_n_m_203636, (int64_t) 1);\n                    bool cond_218444 = j_218437 == y_218443;\n                    int64_t defunc_0_m_fun_res_f_res_218445;\n                    \n                    if (cond_218444) {\n                        defunc_0_m_fun_res_f_res_218445 = y_218422;\n                    } else {\n                        int64_t x_218446 = sub64(j_218437, (int64_t) 1);\n                        int64_t x_218447 = mul64(jump_s_203499, x_218446);\n                        int64_t min_arg_218448 = add64((int64_t) 1, x_218447);\n                        int64_t min_res_218449 = smin64(defunc_0_f_res_203631,\n                                                        min_arg_218448);\n                        \n                        defunc_0_m_fun_res_f_res_218445 = min_res_218449;\n                    }\n                    defunc_0_m_fun_res_218442 = defunc_0_m_fun_res_f_res_218445;\n                }\n                \n                int64_t defunc_0_m_fun_arg_218450 = add64((int64_t) 1,\n  ",
                   "                                                        j_218437);\n                bool cond_218451 = defunc_0_m_fun_arg_218450 == (int64_t) 0;\n                int64_t defunc_0_m_fun_res_218452;\n                \n                if (cond_218451) {\n                    defunc_0_m_fun_res_218452 = (int64_t) 0;\n                } else {\n                    int64_t y_218453 = sub64(s_n_m_203636, (int64_t) 1);\n                    bool cond_218454 = defunc_0_m_fun_arg_218450 == y_218453;\n                    int64_t defunc_0_m_fun_res_f_res_218455;\n                    \n                    if (cond_218454) {\n                        defunc_0_m_fun_res_f_res_218455 = y_218422;\n                    } else {\n                        int64_t x_218456 = mul64(jump_s_203499, j_218437);\n                        int64_t min_arg_218457 = add64((int64_t) 1, x_218456);\n                        int64_t min_res_218458 = smin64(defunc_0_f_res_203631,\n                                                        min_arg_218457);\n                        \n                        defunc_0_m_fun_res_f_res_218455 = min_res_218458;\n                    }\n                    defunc_0_m_fun_res_218452 = defunc_0_m_fun_res_f_res_218455;\n                }\n                \n                int64_t i64_arg_218459 = sub64(defunc_0_m_fun_res_218452,\n                                               defunc_0_m_fun_res_218442);\n                double i64_res_218460 = sitofp_i64_f64(i64_arg_218459);\n                int64_t i64_arg_218461 = sub64(gtid_218412,\n                                               defunc_0_m_fun_res_218442);\n                double i64_res_218462 = sitofp_i64_f64(i64_arg_218461);\n                double u_218463 = i64_res_218462 / i64_res_218460;\n                double u2_218464 = u_218463 * u_218463;\n                double u3_218465 = u_218463 * u2_218464;\n                double x_218466 = 2.0 * u3_218465;\n                double y_218467 = 3.0 * u2_218464;\n                double x_218468 = x_218466 - ",
                   "y_218467;\n                double x_218469 = 1.0 + x_218468;\n                bool x_218470 = sle64((int64_t) 0, j_218437);\n                bool y_218471 = slt64(j_218437, s_n_m_203636);\n                bool bounds_check_218472 = x_218470 && y_218471;\n                bool index_certs_218473;\n                \n                if (!bounds_check_218472) {\n                    {\n                        if (atomic_cmpxchg_i32_global(global_failure, -1, 41) ==\n                            -1) {\n                            global_failure_args[0] = (int64_t) j_218437;\n                            global_failure_args[1] = (int64_t) s_n_m_203636;\n                            ;\n                        }\n                        return;\n                    }\n                }\n                \n                double y_218474;\n                \n                y_218474 = ((__global double *) ext_mem_230487)[gtid_218410 *\n                                                                (s_n_m_203636 *\n                                                                 n_p_203492) +\n                                                                gtid_218411 *\n                                                                s_n_m_203636 +\n                                                                j_218437];\n                \n                double x_218475 = x_218469 * y_218474;\n                double x_218476 = y_218467 - x_218466;\n                bool x_218477 = sle64((int64_t) 0, defunc_0_m_fun_arg_218450);\n                bool y_218478 = slt64(defunc_0_m_fun_arg_218450, s_n_m_203636);\n                bool bounds_check_218479 = x_218477 && y_218478;\n                bool index_certs_218480;\n                \n                if (!bounds_check_218479) {\n                    {\n                        if (atomic_cmpxchg_i32_global(global_failure, -1, 42) ==\n                            -1) {\n                            global_failure_args[0] =\n                                (int64_t) defunc_0_m_f",
                   "un_arg_218450;\n                            global_failure_args[1] = (int64_t) s_n_m_203636;\n                            ;\n                        }\n                        return;\n                    }\n                }\n                \n                double y_218481;\n                \n                y_218481 = ((__global double *) ext_mem_230487)[gtid_218410 *\n                                                                (s_n_m_203636 *\n                                                                 n_p_203492) +\n                                                                gtid_218411 *\n                                                                s_n_m_203636 +\n                                                                defunc_0_m_fun_arg_218450];\n                \n                double y_218482 = x_218476 * y_218481;\n                double x_218483 = x_218475 + y_218482;\n                double y_218484 = 2.0 * u2_218464;\n                double x_218485 = u3_218465 - y_218484;\n                double x_218486 = u_218463 + x_218485;\n                double y_218487;\n                \n                y_218487 = ((__global double *) ext_mem_230486)[gtid_218410 *\n                                                                (s_n_m_203636 *\n                                                                 n_p_203492) +\n                                                                gtid_218411 *\n                                                                s_n_m_203636 +\n                                                                j_218437];\n                \n                double x_218488 = x_218486 * y_218487;\n                double y_218489 = i64_res_218460 * x_218488;\n                double x_218490 = x_218483 + y_218489;\n                double x_218491 = u3_218465 - u2_218464;\n                double y_218492;\n                \n                y_218492 = ((__global double *) ext_mem_230486)[gtid_218410 *\n                                              ",
                   "                  (s_n_m_203636 *\n                                                                 n_p_203492) +\n                                                                gtid_218411 *\n                                                                s_n_m_203636 +\n                                                                defunc_0_m_fun_arg_218450];\n                \n                double x_218493 = x_218491 * y_218492;\n                double y_218494 = i64_res_218460 * x_218493;\n                double defunc_4_interpolate_proc_res_218495 = x_218490 +\n                       y_218494;\n                \n                defunc_0_f_res_f_res_218424 =\n                    defunc_4_interpolate_proc_res_218495;\n            }\n            defunc_0_f_res_218418 = defunc_0_f_res_f_res_218424;\n        }\n        ((__global double *) mem_230493)[gtid_218410 * (pad_css_len_203632 *\n                                                        n_p_203492) +\n                                         gtid_218411 * pad_css_len_203632 +\n                                         gtid_218412] = defunc_0_f_res_218418;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_218407\n}\n__kernel void mainzisegmap_218562(__global int *global_failure,\n                                  int failure_is_an_option, __global\n                                  int64_t *global_failure_args,\n                                  int64_t n_p_203492,\n                                  int64_t partition_sizze_203577,\n                                  int64_t C_len_203634,\n                                  int64_t css_results_l_204110, __global\n                                  unsigned char *ext_mem_230494, __global\n                                  unsigned char *mem_230500)\n{\n    #define segmap_group_sizze_218557 (mainzisegmap_group_sizze_218511)\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    int3",
                   "2_t global_tid_234079;\n    int32_t local_tid_234080;\n    int64_t group_sizze_234083;\n    int32_t wave_sizze_234082;\n    int32_t group_tid_234081;\n    \n    global_tid_234079 = get_global_id(0);\n    local_tid_234080 = get_local_id(0);\n    group_sizze_234083 = get_local_size(0);\n    wave_sizze_234082 = LOCKSTEP_WIDTH;\n    group_tid_234081 = get_group_id(0);\n    \n    int32_t phys_tid_218562 = global_tid_234079;\n    int64_t global_tid_234084 = sext_i32_i64(group_tid_234081) *\n            segmap_group_sizze_218557 + sext_i32_i64(local_tid_234080);\n    int64_t slice_234085 = C_len_203634;\n    int64_t slice_234086 = partition_sizze_203577 * slice_234085;\n    int64_t gtid_218560 = squot64(global_tid_234084, slice_234085);\n    int64_t remnant_234087 = global_tid_234084 - gtid_218560 * slice_234085;\n    int64_t gtid_218561 = remnant_234087;\n    int64_t remnant_234088 = remnant_234087 - gtid_218561;\n    \n    if (slt64(gtid_218560, partition_sizze_203577) && slt64(gtid_218561,\n                                                            C_len_203634)) {\n        int64_t i_218565 = smod64(gtid_218561, n_p_203492);\n        bool x_218566 = sle64((int64_t) 0, i_218565);\n        bool y_218567 = slt64(i_218565, n_p_203492);\n        bool bounds_check_218568 = x_218566 && y_218567;\n        int64_t i_218569 = sdiv64(gtid_218561, n_p_203492);\n        bool x_218570 = sle64((int64_t) 0, i_218569);\n        bool y_218571 = slt64(i_218569, css_results_l_204110);\n        bool bounds_check_218572 = x_218570 && y_218571;\n        bool index_ok_218573 = bounds_check_218568 && bounds_check_218572;\n        bool index_certs_218574;\n        \n        if (!index_ok_218573) {\n            {\n                if (atomic_cmpxchg_i32_global(global_failure, -1, 43) == -1) {\n                    global_failure_args[0] = (int64_t) i_218565;\n                    global_failure_args[1] = (int64_t) i_218569;\n                    global_failure_args[2] = (int64_t) n_p_203492;\n                    global_failure_args[3] = (i",
                   "nt64_t) css_results_l_204110;\n                    ;\n                }\n                return;\n            }\n        }\n        \n        double defunc_0_f_res_218575;\n        \n        defunc_0_f_res_218575 = ((__global\n                                  double *) ext_mem_230494)[gtid_218560 *\n                                                            (css_results_l_204110 *\n                                                             n_p_203492) +\n                                                            i_218565 *\n                                                            css_results_l_204110 +\n                                                            i_218569];\n        ((__global double *) mem_230500)[gtid_218560 * C_len_203634 +\n                                         gtid_218561] = defunc_0_f_res_218575;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_218557\n}\n__kernel void mainzisegmap_218598(__global int *global_failure,\n                                  int64_t n_p_203492,\n                                  int64_t partition_sizze_203577, __global\n                                  unsigned char *mem_230503, __global\n                                  unsigned char *mem_230507)\n{\n    #define segmap_group_sizze_218594 (mainzisegmap_group_sizze_218582)\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_234089;\n    int32_t local_tid_234090;\n    int64_t group_sizze_234093;\n    int32_t wave_sizze_234092;\n    int32_t group_tid_234091;\n    \n    global_tid_234089 = get_global_id(0);\n    local_tid_234090 = get_local_id(0);\n    group_sizze_234093 = get_local_size(0);\n    wave_sizze_234092 = LOCKSTEP_WIDTH;\n    group_tid_234091 = get_group_id(0);\n    \n    int32_t phys_tid_218598 = global_tid_234089;\n    int64_t global_tid_234094 = sext_i32_i64(group_tid_234091) *\n            segmap_group_sizze_218594 + sext_i32_i64(local_tid_234090)",
                   ";\n    int64_t slice_234095 = partition_sizze_203577;\n    int64_t gtid_218597 = global_tid_234094;\n    int64_t remnant_234096 = global_tid_234094 - gtid_218597;\n    \n    if (slt64(gtid_218597, partition_sizze_203577)) {\n        double defunc_2_reduce_res_218600;\n        double redout_228979 = 0.0;\n        \n        for (int64_t i_228980 = 0; i_228980 < n_p_203492; i_228980++) {\n            double x_218604;\n            \n            x_218604 = ((__global double *) mem_230503)[i_228980 *\n                                                        partition_sizze_203577 +\n                                                        gtid_218597];\n            \n            double defunc_1_op_res_218603 = x_218604 + redout_228979;\n            double redout_tmp_234097 = defunc_1_op_res_218603;\n            \n            redout_228979 = redout_tmp_234097;\n        }\n        defunc_2_reduce_res_218600 = redout_228979;\n        ((__global double *) mem_230507)[gtid_218597] =\n            defunc_2_reduce_res_218600;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_218594\n}\n__kernel void mainzisegmap_218729(__global int *global_failure,\n                                  int64_t n_p_203492,\n                                  int64_t partition_sizze_203577, __global\n                                  unsigned char *mem_230520, __global\n                                  unsigned char *mem_230524)\n{\n    #define segmap_group_sizze_218725 (mainzisegmap_group_sizze_218713)\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_234232;\n    int32_t local_tid_234233;\n    int64_t group_sizze_234236;\n    int32_t wave_sizze_234235;\n    int32_t group_tid_234234;\n    \n    global_tid_234232 = get_global_id(0);\n    local_tid_234233 = get_local_id(0);\n    group_sizze_234236 = get_local_size(0);\n    wave_sizze_234235 = LOCKSTEP_WIDTH;\n    group_tid_234234 = get_group_id(0);\n    \n    i",
                   "nt32_t phys_tid_218729 = global_tid_234232;\n    int64_t global_tid_234237 = sext_i32_i64(group_tid_234234) *\n            segmap_group_sizze_218725 + sext_i32_i64(local_tid_234233);\n    int64_t slice_234238 = partition_sizze_203577;\n    int64_t gtid_218728 = global_tid_234237;\n    int64_t remnant_234239 = global_tid_234237 - gtid_218728;\n    \n    if (slt64(gtid_218728, partition_sizze_203577)) {\n        double defunc_2_reduce_res_218731;\n        double redout_228981 = 0.0;\n        \n        for (int64_t i_228982 = 0; i_228982 < n_p_203492; i_228982++) {\n            double x_218735;\n            \n            x_218735 = ((__global double *) mem_230520)[i_228982 *\n                                                        partition_sizze_203577 +\n                                                        gtid_218728];\n            \n            double defunc_1_op_res_218734 = x_218735 + redout_228981;\n            double redout_tmp_234240 = defunc_1_op_res_218734;\n            \n            redout_228981 = redout_tmp_234240;\n        }\n        defunc_2_reduce_res_218731 = redout_228981;\n        ((__global double *) mem_230524)[gtid_218728] =\n            defunc_2_reduce_res_218731;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_218725\n}\n__kernel void mainzisegmap_218860(__global int *global_failure,\n                                  int64_t partition_sizze_203577, __global\n                                  unsigned char *mem_230537, __global\n                                  unsigned char *mem_230541)\n{\n    #define segmap_group_sizze_218856 (mainzisegmap_group_sizze_218844)\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_234375;\n    int32_t local_tid_234376;\n    int64_t group_sizze_234379;\n    int32_t wave_sizze_234378;\n    int32_t group_tid_234377;\n    \n    global_tid_234375 = get_global_id(0);\n    local_tid_234376 = get_local_id(0);\n    group",
                   "_sizze_234379 = get_local_size(0);\n    wave_sizze_234378 = LOCKSTEP_WIDTH;\n    group_tid_234377 = get_group_id(0);\n    \n    int32_t phys_tid_218860 = global_tid_234375;\n    int64_t global_tid_234380 = sext_i32_i64(group_tid_234377) *\n            segmap_group_sizze_218856 + sext_i32_i64(local_tid_234376);\n    int64_t slice_234381 = partition_sizze_203577;\n    int64_t gtid_218859 = global_tid_234380;\n    int64_t remnant_234382 = global_tid_234380 - gtid_218859;\n    \n    if (slt64(gtid_218859, partition_sizze_203577)) {\n        double defunc_2_reduce_res_218862;\n        double redout_228983 = 0.0;\n        \n        for (int32_t i_229107 = 0; i_229107 < 3; i_229107++) {\n            int64_t i_228984 = sext_i32_i64(i_229107);\n            double x_218866;\n            \n            x_218866 = ((__global double *) mem_230537)[i_228984 *\n                                                        partition_sizze_203577 +\n                                                        gtid_218859];\n            \n            double defunc_1_op_res_218865 = x_218866 + redout_228983;\n            double redout_tmp_234383 = defunc_1_op_res_218865;\n            \n            redout_228983 = redout_tmp_234383;\n        }\n        defunc_2_reduce_res_218862 = redout_228983;\n        ((__global double *) mem_230541)[gtid_218859] =\n            defunc_2_reduce_res_218862;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_218856\n}\n__kernel void mainzisegmap_219049(__global int *global_failure,\n                                  int64_t n_203490, int64_t q_l_203495,\n                                  int64_t jump_t_203500,\n                                  int64_t partition_sizze_203577,\n                                  int64_t l_n_m_203643, int64_t i_203670,\n                                  int64_t num_groups_219045,\n                                  int64_t num_threads_232157, __global\n                                  unsigned char *mem_230558, __global\n                                  unsig",
                   "ned char *mem_230561, __global\n                                  unsigned char *mem_230564, __global\n                                  unsigned char *mem_230567, __global\n                                  unsigned char *mem_230586, __global\n                                  unsigned char *color_232027)\n{\n    #define segmap_group_sizze_219044 (mainzisegmap_group_sizze_218975)\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_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_219049 = global_tid_234533;\n    int32_t phys_group_id_234538;\n    \n    phys_group_id_234538 = get_group_id(0);\n    for (int32_t i_234539 = 0; i_234539 <\n         sdiv_up32(sext_i64_i32(sdiv_up64(partition_sizze_203577,\n                                          segmap_group_sizze_219044)) -\n                   phys_group_id_234538, sext_i64_i32(num_groups_219045));\n         i_234539++) {\n        int32_t virt_group_id_234540 = phys_group_id_234538 + i_234539 *\n                sext_i64_i32(num_groups_219045);\n        int64_t global_tid_234541 = sext_i32_i64(virt_group_id_234540) *\n                segmap_group_sizze_219044 + sext_i32_i64(local_tid_234534);\n        int64_t slice_234542 = partition_sizze_203577;\n        int64_t gtid_219048 = global_tid_234541;\n        int64_t remnant_234543 = global_tid_234541 - gtid_219048;\n        \n        if (slt64(gtid_219048, partition_sizze_203577)) {\n            for (int64_t i_228987 = 0; i_228987 < l_n_m_203643; i_228987++) {\n                int64_t x_219056;\n                \n                x_219056 = ((__global int64_t *) mem_2",
                   "30558)[i_228987 *\n                                                             partition_sizze_203577 +\n                                                             gtid_219048];\n                \n                double x_219057;\n                \n                x_219057 = ((__global double *) mem_230561)[i_228987 *\n                                                            partition_sizze_203577 +\n                                                            gtid_219048];\n                \n                int64_t min_arg_219058 = mul64(jump_t_203500, i_228987);\n                int64_t min_res_219059 = smin64(i_203670, min_arg_219058);\n                int64_t defunc_0_g_res_219060 = add64((int64_t) 1,\n                                                      min_res_219059);\n                double defunc_2_reduce_res_219061;\n                double redout_228331 = 0.0;\n                \n                for (int64_t i_228332 = 0; i_228332 < q_l_203495; i_228332++) {\n                    bool cond_219066 = sle64(n_203490, i_228332);\n                    int64_t defunc_0_f_res_219067;\n                    \n                    if (cond_219066) {\n                        defunc_0_f_res_219067 = (int64_t) 0;\n                    } else {\n                        int64_t i_219068 = add64(x_219056, i_228332);\n                        int64_t defunc_1_add_res_219069 = add64((int64_t) 1,\n                                                                i_219068);\n                        \n                        defunc_0_f_res_219067 = defunc_1_add_res_219069;\n                    }\n                    \n                    double defunc_0_f_res_219070;\n                    \n                    if (cond_219066) {\n                        defunc_0_f_res_219070 = 0.0;\n                    } else {\n                        int64_t i_219071 = add64(x_219056, i_228332);\n                        double defunc_0_add_arg_219072;\n                        \n                        defunc_0_add_arg_219072 = ((__gl",
                   "obal\n                                                    double *) mem_230564)[i_219071 *\n                                                                          partition_sizze_203577 +\n                                                                          gtid_219048];\n                        defunc_0_f_res_219070 = defunc_0_add_arg_219072;\n                    }\n                    \n                    int64_t binop_p_219073 = sub64(defunc_0_f_res_219067,\n                                                   defunc_0_g_res_219060);\n                    double defunc_0_f_res_219074 =\n                           sitofp_i64_f64(binop_p_219073);\n                    double abs_res_219075 = fabs(defunc_0_f_res_219074);\n                    double tmp1_219076 = abs_res_219075 / x_219057;\n                    double x_219077 = tmp1_219076 * tmp1_219076;\n                    double y_219078 = tmp1_219076 * x_219077;\n                    double tmp2_219079 = 1.0 - y_219078;\n                    double x_219080 = tmp2_219079 * tmp2_219079;\n                    double tmp3_219081 = tmp2_219079 * x_219080;\n                    double w_j_219082 = defunc_0_f_res_219070 * tmp3_219081;\n                    double defunc_1_op_res_219064 = w_j_219082 + redout_228331;\n                    double redout_tmp_234545 = defunc_1_op_res_219064;\n                    \n                    redout_228331 = redout_tmp_234545;\n                }\n                defunc_2_reduce_res_219061 = redout_228331;\n                \n                double a0_219083 = 1.0 / defunc_2_reduce_res_219061;\n                double defunc_2_reduce_res_219084;\n                double redout_228333 = 0.0;\n                \n                for (int64_t i_228334 = 0; i_228334 < q_l_203495; i_228334++) {\n                    bool cond_219089 = sle64(n_203490, i_228334);\n                    int64_t defunc_0_f_res_219090;\n                    \n                    if (cond_219089) {\n                        defunc_0_f_res_219090 = (int64_t",
                   ") 0;\n                    } else {\n                        int64_t i_219091 = add64(x_219056, i_228334);\n                        int64_t defunc_1_add_res_219092 = add64((int64_t) 1,\n                                                                i_219091);\n                        \n                        defunc_0_f_res_219090 = defunc_1_add_res_219092;\n                    }\n                    \n                    double defunc_0_f_res_219093;\n                    \n                    if (cond_219089) {\n                        defunc_0_f_res_219093 = 0.0;\n                    } else {\n                        int64_t i_219094 = add64(x_219056, i_228334);\n                        double defunc_0_add_arg_219095;\n                        \n                        defunc_0_add_arg_219095 = ((__global\n                                                    double *) mem_230564)[i_219094 *\n                                                                          partition_sizze_203577 +\n                                                                          gtid_219048];\n                        defunc_0_f_res_219093 = defunc_0_add_arg_219095;\n                    }\n                    \n                    int64_t binop_p_219096 = sub64(defunc_0_f_res_219090,\n                                                   defunc_0_g_res_219060);\n                    double defunc_0_f_res_219097 =\n                           sitofp_i64_f64(binop_p_219096);\n                    double abs_res_219098 = fabs(defunc_0_f_res_219097);\n                    double tmp1_219099 = abs_res_219098 / x_219057;\n                    double x_219100 = tmp1_219099 * tmp1_219099;\n                    double y_219101 = tmp1_219099 * x_219100;\n                    double tmp2_219102 = 1.0 - y_219101;\n                    double x_219103 = tmp2_219102 * tmp2_219102;\n                    double tmp3_219104 = tmp2_219102 * x_219103;\n                    double tmp4_219105 = defunc_0_f_res_219093 * tmp3_219104;\n                   ",
                   " double defunc_0_f_res_219106;\n                    \n                    if (cond_219089) {\n                        defunc_0_f_res_219106 = 0.0;\n                    } else {\n                        int64_t i_219107 = add64(x_219056, i_228334);\n                        double defunc_0_add_arg_219108;\n                        \n                        defunc_0_add_arg_219108 = ((__global\n                                                    double *) mem_230567)[i_219107 *\n                                                                          partition_sizze_203577 +\n                                                                          gtid_219048];\n                        defunc_0_f_res_219106 = defunc_0_add_arg_219108;\n                    }\n                    \n                    double x_219109 = a0_219083 * tmp4_219105;\n                    double defunc_9_fit_fun_res_219110 = defunc_0_f_res_219106 *\n                           x_219109;\n                    double defunc_1_op_res_219087 =\n                           defunc_9_fit_fun_res_219110 + redout_228333;\n                    double redout_tmp_234546 = defunc_1_op_res_219087;\n                    \n                    redout_228333 = redout_tmp_234546;\n                }\n                defunc_2_reduce_res_219084 = redout_228333;\n                ((__global double *) color_232027)[phys_tid_219049 + i_228987 *\n                                                   num_threads_232157] =\n                    defunc_2_reduce_res_219084;\n            }\n            for (int64_t i_234547 = 0; i_234547 < l_n_m_203643; i_234547++) {\n                double tmp_234548;\n                \n                tmp_234548 = ((__global\n                               double *) color_232027)[phys_tid_219049 +\n                                                       i_234547 *\n                                                       num_threads_232157];\n                ((__global double *) mem_230586)[gtid_219048 + i_234547 *\n                       ",
                   "                          partition_sizze_203577] =\n                    tmp_234548;\n            }\n        }\n        barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_219044\n}\n__kernel void mainzisegmap_219434(__global int *global_failure,\n                                  int64_t n_203490, int64_t q_l_203495,\n                                  int64_t jump_t_203500,\n                                  int64_t partition_sizze_203577,\n                                  int64_t l_n_m_203643, int64_t i_203670,\n                                  int64_t ctx_param_ext_229488,\n                                  int64_t ctx_param_ext_229489,\n                                  int64_t ctx_param_ext_229491, __global\n                                  unsigned char *ext_mem_229411, __global\n                                  unsigned char *ext_mem_229412, __global\n                                  unsigned char *mem_param_229493, __global\n                                  unsigned char *mem_230551, __global\n                                  unsigned char *mem_230591)\n{\n    #define segmap_group_sizze_219425 (mainzisegmap_group_sizze_219116)\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_234549;\n    int32_t local_tid_234550;\n    int64_t group_sizze_234553;\n    int32_t wave_sizze_234552;\n    int32_t group_tid_234551;\n    \n    global_tid_234549 = get_global_id(0);\n    local_tid_234550 = get_local_id(0);\n    group_sizze_234553 = get_local_size(0);\n    wave_sizze_234552 = LOCKSTEP_WIDTH;\n    group_tid_234551 = get_group_id(0);\n    \n    int32_t phys_tid_219434 = global_tid_234549;\n    int64_t global_tid_234554 = sext_i32_i64(group_tid_234551) *\n            segmap_group_sizze_219425 + sext_i32_i64(local_tid_234550);\n    int64_t slice_234555 = l_n_m_203643;\n    int64_t slice_234556 = partition_sizze_2035",
                   "77 * slice_234555;\n    int64_t gtid_219432 = squot64(global_tid_234554, slice_234555);\n    int64_t remnant_234557 = global_tid_234554 - gtid_219432 * slice_234555;\n    int64_t gtid_219433 = remnant_234557;\n    int64_t remnant_234558 = remnant_234557 - gtid_219433;\n    \n    if (slt64(gtid_219432, partition_sizze_203577) && slt64(gtid_219433,\n                                                            l_n_m_203643)) {\n        int64_t x_219438;\n        \n        x_219438 = ((__global int64_t *) ext_mem_229412)[gtid_219432 *\n                                                         l_n_m_203643 +\n                                                         gtid_219433];\n        \n        double x_219439;\n        \n        x_219439 = ((__global double *) ext_mem_229411)[gtid_219432 *\n                                                        l_n_m_203643 +\n                                                        gtid_219433];\n        \n        int64_t min_arg_219440 = mul64(jump_t_203500, gtid_219433);\n        int64_t min_res_219441 = smin64(i_203670, min_arg_219440);\n        int64_t defunc_0_g_res_219442 = add64((int64_t) 1, min_res_219441);\n        double defunc_2_reduce_res_219443;\n        double redout_228339 = 0.0;\n        \n        for (int64_t i_228340 = 0; i_228340 < q_l_203495; i_228340++) {\n            bool cond_219448 = sle64(n_203490, i_228340);\n            int64_t defunc_0_f_res_219449;\n            \n            if (cond_219448) {\n                defunc_0_f_res_219449 = (int64_t) 0;\n            } else {\n                int64_t i_219450 = add64(x_219438, i_228340);\n                int64_t defunc_1_add_res_219451 = add64((int64_t) 1, i_219450);\n                \n                defunc_0_f_res_219449 = defunc_1_add_res_219451;\n            }\n            \n            double defunc_0_f_res_219452;\n            \n            if (cond_219448) {\n                defunc_0_f_res_219452 = 0.0;\n            } else {\n                int64_t i_219453 = add64(x_219438, i_228340);\n             ",
                   "   double defunc_0_add_arg_219454;\n                \n                defunc_0_add_arg_219454 = ((__global\n                                            double *) mem_param_229493)[ctx_param_ext_229488 +\n                                                                        (gtid_219432 *\n                                                                         ctx_param_ext_229489 +\n                                                                         i_219453 *\n                                                                         ctx_param_ext_229491)];\n                defunc_0_f_res_219452 = defunc_0_add_arg_219454;\n            }\n            \n            int64_t binop_p_219455 = sub64(defunc_0_f_res_219449,\n                                           defunc_0_g_res_219442);\n            double defunc_0_f_res_219456 = sitofp_i64_f64(binop_p_219455);\n            double abs_res_219457 = fabs(defunc_0_f_res_219456);\n            double tmp1_219458 = abs_res_219457 / x_219439;\n            double x_219459 = tmp1_219458 * tmp1_219458;\n            double y_219460 = tmp1_219458 * x_219459;\n            double tmp2_219461 = 1.0 - y_219460;\n            double x_219462 = tmp2_219461 * tmp2_219461;\n            double tmp3_219463 = tmp2_219461 * x_219462;\n            double w_j_219464 = defunc_0_f_res_219452 * tmp3_219463;\n            double defunc_1_op_res_219446 = w_j_219464 + redout_228339;\n            double redout_tmp_234559 = defunc_1_op_res_219446;\n            \n            redout_228339 = redout_tmp_234559;\n        }\n        defunc_2_reduce_res_219443 = redout_228339;\n        \n        double a0_219465 = 1.0 / defunc_2_reduce_res_219443;\n        double defunc_2_reduce_res_219466;\n        double redout_228341 = 0.0;\n        \n        for (int64_t i_228342 = 0; i_228342 < q_l_203495; i_228342++) {\n            bool cond_219471 = sle64(n_203490, i_228342);\n            int64_t defunc_0_f_res_219472;\n            \n            if (cond_219471) {\n                defunc_0_f_res_21947",
                   "2 = (int64_t) 0;\n            } else {\n                int64_t i_219473 = add64(x_219438, i_228342);\n                int64_t defunc_1_add_res_219474 = add64((int64_t) 1, i_219473);\n                \n                defunc_0_f_res_219472 = defunc_1_add_res_219474;\n            }\n            \n            double defunc_0_f_res_219475;\n            \n            if (cond_219471) {\n                defunc_0_f_res_219475 = 0.0;\n            } else {\n                int64_t i_219476 = add64(x_219438, i_228342);\n                double defunc_0_add_arg_219477;\n                \n                defunc_0_add_arg_219477 = ((__global\n                                            double *) mem_param_229493)[ctx_param_ext_229488 +\n                                                                        (gtid_219432 *\n                                                                         ctx_param_ext_229489 +\n                                                                         i_219476 *\n                                                                         ctx_param_ext_229491)];\n                defunc_0_f_res_219475 = defunc_0_add_arg_219477;\n            }\n            \n            int64_t binop_p_219478 = sub64(defunc_0_f_res_219472,\n                                           defunc_0_g_res_219442);\n            double defunc_0_f_res_219479 = sitofp_i64_f64(binop_p_219478);\n            double abs_res_219480 = fabs(defunc_0_f_res_219479);\n            double tmp1_219481 = abs_res_219480 / x_219439;\n            double x_219482 = tmp1_219481 * tmp1_219481;\n            double y_219483 = tmp1_219481 * x_219482;\n            double tmp2_219484 = 1.0 - y_219483;\n            double x_219485 = tmp2_219484 * tmp2_219484;\n            double tmp3_219486 = tmp2_219484 * x_219485;\n            double tmp4_219487 = defunc_0_f_res_219475 * tmp3_219486;\n            double defunc_0_f_res_219488;\n            \n            if (cond_219471) {\n                defunc_0_f_res_219488 = 0.0;\n            } else {",
                   "\n                int64_t i_219489 = add64(x_219438, i_228342);\n                double defunc_0_add_arg_219490;\n                \n                defunc_0_add_arg_219490 = ((__global\n                                            double *) mem_230551)[gtid_219432 *\n                                                                  n_203490 +\n                                                                  i_219489];\n                defunc_0_f_res_219488 = defunc_0_add_arg_219490;\n            }\n            \n            double x_219491 = a0_219465 * tmp4_219487;\n            double defunc_9_fit_fun_res_219492 = defunc_0_f_res_219488 *\n                   x_219491;\n            double defunc_1_op_res_219469 = defunc_9_fit_fun_res_219492 +\n                   redout_228341;\n            double redout_tmp_234560 = defunc_1_op_res_219469;\n            \n            redout_228341 = redout_tmp_234560;\n        }\n        defunc_2_reduce_res_219466 = redout_228341;\n        ((__global double *) mem_230591)[gtid_219432 * l_n_m_203643 +\n                                         gtid_219433] =\n            defunc_2_reduce_res_219466;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_219425\n}\n__kernel void mainzisegmap_219551(__global int *global_failure,\n                                  int64_t partition_sizze_203577,\n                                  int64_t l_n_m_203643, __global\n                                  unsigned char *mem_230596, __global\n                                  unsigned char *mem_230601)\n{\n    #define segmap_group_sizze_219546 (mainzisegmap_group_sizze_219247)\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_234633;\n    int32_t local_tid_234634;\n    int64_t group_sizze_234637;\n    int32_t wave_sizze_234636;\n    int32_t group_tid_234635;\n    \n    global_tid_234633 = get_global_id(0);\n    local_tid_234634 = get_local_id(0);\n    group_si",
                   "zze_234637 = get_local_size(0);\n    wave_sizze_234636 = LOCKSTEP_WIDTH;\n    group_tid_234635 = get_group_id(0);\n    \n    int32_t phys_tid_219551 = global_tid_234633;\n    int64_t global_tid_234638 = sext_i32_i64(group_tid_234635) *\n            segmap_group_sizze_219546 + sext_i32_i64(local_tid_234634);\n    int64_t slice_234639 = l_n_m_203643;\n    int64_t slice_234640 = partition_sizze_203577 * slice_234639;\n    int64_t gtid_219549 = squot64(global_tid_234638, slice_234639);\n    int64_t remnant_234641 = global_tid_234638 - gtid_219549 * slice_234639;\n    int64_t gtid_219550 = remnant_234641;\n    int64_t remnant_234642 = remnant_234641 - gtid_219550;\n    \n    if (slt64(gtid_219549, partition_sizze_203577) && slt64(gtid_219550,\n                                                            l_n_m_203643)) {\n        double defunc_2_reduce_res_219552;\n        \n        defunc_2_reduce_res_219552 = ((__global\n                                       double *) mem_230596)[gtid_219549 *\n                                                             l_n_m_203643 +\n                                                             gtid_219550];\n        \n        double a0_219553 = 1.0 / defunc_2_reduce_res_219552;\n        \n        ((__global double *) mem_230601)[gtid_219549 * l_n_m_203643 +\n                                         gtid_219550] = a0_219553;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_219546\n}\n__kernel void mainzisegmap_219712(__global int *global_failure,\n                                  int64_t n_203490, int64_t q_l_203495,\n                                  int64_t jump_t_203500,\n                                  int64_t partition_sizze_203577,\n                                  int64_t l_n_m_203643, int64_t i_203670,\n                                  int64_t num_groups_219707,\n                                  int64_t num_threads_232163, __global\n                                  unsigned char *mem_230616, __global\n                                  unsig",
                   "ned char *mem_230619, __global\n                                  unsigned char *mem_230622, __global\n                                  unsigned char *mem_230625, __global\n                                  unsigned char *mem_230659, __global\n                                  unsigned char *mem_230662, __global\n                                  unsigned char *color_232028, __global\n                                  unsigned char *color_232029)\n{\n    #define segmap_group_sizze_219706 (mainzisegmap_group_sizze_219608)\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_234732;\n    int32_t local_tid_234733;\n    int64_t group_sizze_234736;\n    int32_t wave_sizze_234735;\n    int32_t group_tid_234734;\n    \n    global_tid_234732 = get_global_id(0);\n    local_tid_234733 = get_local_id(0);\n    group_sizze_234736 = get_local_size(0);\n    wave_sizze_234735 = LOCKSTEP_WIDTH;\n    group_tid_234734 = get_group_id(0);\n    \n    int32_t phys_tid_219712 = global_tid_234732;\n    int32_t phys_group_id_234737;\n    \n    phys_group_id_234737 = get_group_id(0);\n    for (int32_t i_234738 = 0; i_234738 <\n         sdiv_up32(sext_i64_i32(sdiv_up64(partition_sizze_203577,\n                                          segmap_group_sizze_219706)) -\n                   phys_group_id_234737, sext_i64_i32(num_groups_219707));\n         i_234738++) {\n        int32_t virt_group_id_234739 = phys_group_id_234737 + i_234738 *\n                sext_i64_i32(num_groups_219707);\n        int64_t global_tid_234740 = sext_i32_i64(virt_group_id_234739) *\n                segmap_group_sizze_219706 + sext_i32_i64(local_tid_234733);\n        int64_t slice_234741 = partition_sizze_203577;\n        int64_t gtid_219711 = global_tid_234740;\n        int64_t remnant_234742 = global_tid_234740 - gtid_219711;\n        \n        if (slt64(gtid_219711, partition_sizze_203577)) {\n            for (int64_t i_228993 = 0; i_",
                   "228993 < l_n_m_203643; i_228993++) {\n                int64_t x_219720;\n                \n                x_219720 = ((__global int64_t *) mem_230616)[i_228993 *\n                                                             partition_sizze_203577 +\n                                                             gtid_219711];\n                \n                double x_219721;\n                \n                x_219721 = ((__global double *) mem_230619)[i_228993 *\n                                                            partition_sizze_203577 +\n                                                            gtid_219711];\n                \n                int64_t min_arg_219722 = mul64(jump_t_203500, i_228993);\n                int64_t min_res_219723 = smin64(i_203670, min_arg_219722);\n                int64_t defunc_0_g_res_219724 = add64((int64_t) 1,\n                                                      min_res_219723);\n                double defunc_2_reduce_res_219725;\n                double defunc_2_reduce_res_219726;\n                double defunc_2_reduce_res_219727;\n                double redout_228355;\n                double redout_228356;\n                double redout_228357;\n                \n                redout_228355 = 0.0;\n                redout_228356 = 0.0;\n                redout_228357 = 0.0;\n                for (int64_t i_228358 = 0; i_228358 < q_l_203495; i_228358++) {\n                    bool cond_219738 = sle64(n_203490, i_228358);\n                    int64_t defunc_0_f_res_219739;\n                    \n                    if (cond_219738) {\n                        defunc_0_f_res_219739 = (int64_t) 0;\n                    } else {\n                        int64_t i_219740 = add64(x_219720, i_228358);\n                        int64_t defunc_1_add_res_219741 = add64((int64_t) 1,\n                                                                i_219740);\n                        \n                        defunc_0_f_res_219739 = defunc_1_add_res_219741;\n                 ",
                   "   }\n                    \n                    double defunc_0_f_res_219742;\n                    \n                    if (cond_219738) {\n                        defunc_0_f_res_219742 = 0.0;\n                    } else {\n                        int64_t i_219743 = add64(x_219720, i_228358);\n                        double defunc_0_add_arg_219744;\n                        \n                        defunc_0_add_arg_219744 = ((__global\n                                                    double *) mem_230622)[i_219743 *\n                                                                          partition_sizze_203577 +\n                                                                          gtid_219711];\n                        defunc_0_f_res_219742 = defunc_0_add_arg_219744;\n                    }\n                    \n                    int64_t binop_p_219745 = sub64(defunc_0_f_res_219739,\n                                                   defunc_0_g_res_219724);\n                    double defunc_0_f_res_219746 =\n                           sitofp_i64_f64(binop_p_219745);\n                    double abs_res_219747 = fabs(defunc_0_f_res_219746);\n                    double tmp1_219748 = abs_res_219747 / x_219721;\n                    double x_219749 = tmp1_219748 * tmp1_219748;\n                    double y_219750 = tmp1_219748 * x_219749;\n                    double tmp2_219751 = 1.0 - y_219750;\n                    double x_219752 = tmp2_219751 * tmp2_219751;\n                    double tmp3_219753 = tmp2_219751 * x_219752;\n                    double w_j_219754 = defunc_0_f_res_219742 * tmp3_219753;\n                    double xw_j_219755 = defunc_0_f_res_219746 * w_j_219754;\n                    double x2w_j_219756 = defunc_0_f_res_219746 * xw_j_219755;\n                    double defunc_1_op_res_219730 = w_j_219754 + redout_228355;\n                    double defunc_1_op_res_219733 = xw_j_219755 + redout_228356;\n                    double defunc_1_op_res_219736 = x2w_j_219756 +\n       ",
                   "                    redout_228357;\n                    double redout_tmp_234745 = defunc_1_op_res_219730;\n                    double redout_tmp_234746 = defunc_1_op_res_219733;\n                    double redout_tmp_234747 = defunc_1_op_res_219736;\n                    \n                    redout_228355 = redout_tmp_234745;\n                    redout_228356 = redout_tmp_234746;\n                    redout_228357 = redout_tmp_234747;\n                }\n                defunc_2_reduce_res_219725 = redout_228355;\n                defunc_2_reduce_res_219726 = redout_228356;\n                defunc_2_reduce_res_219727 = redout_228357;\n                \n                double x_219757 = defunc_2_reduce_res_219725 *\n                       defunc_2_reduce_res_219727;\n                double y_219758 = defunc_2_reduce_res_219726 *\n                       defunc_2_reduce_res_219726;\n                double y_219759 = x_219757 - y_219758;\n                double det1_219760 = 1.0 / y_219759;\n                double a11_219761 = defunc_2_reduce_res_219727 * det1_219760;\n                double x_219762 = 0.0 - defunc_2_reduce_res_219726;\n                double b11_219763 = det1_219760 * x_219762;\n                double c11_219764 = defunc_2_reduce_res_219725 * det1_219760;\n                double defunc_2_reduce_res_219765;\n                double defunc_2_reduce_res_219766;\n                double redout_228359;\n                double redout_228360;\n                \n                redout_228359 = 0.0;\n                redout_228360 = 0.0;\n                for (int64_t i_228361 = 0; i_228361 < q_l_203495; i_228361++) {\n                    bool cond_219774 = sle64(n_203490, i_228361);\n                    int64_t defunc_0_f_res_219775;\n                    \n                    if (cond_219774) {\n                        defunc_0_f_res_219775 = (int64_t) 0;\n                    } else {\n                        int64_t i_219776 = add64(x_219720, i_228361);\n                        int64_t defunc_1_add_",
                   "res_219777 = add64((int64_t) 1,\n                                                                i_219776);\n                        \n                        defunc_0_f_res_219775 = defunc_1_add_res_219777;\n                    }\n                    \n                    double defunc_0_f_res_219778;\n                    \n                    if (cond_219774) {\n                        defunc_0_f_res_219778 = 0.0;\n                    } else {\n                        int64_t i_219779 = add64(x_219720, i_228361);\n                        double defunc_0_add_arg_219780;\n                        \n                        defunc_0_add_arg_219780 = ((__global\n                                                    double *) mem_230622)[i_219779 *\n                                                                          partition_sizze_203577 +\n                                                                          gtid_219711];\n                        defunc_0_f_res_219778 = defunc_0_add_arg_219780;\n                    }\n                    \n                    int64_t binop_p_219781 = sub64(defunc_0_f_res_219775,\n                                                   defunc_0_g_res_219724);\n                    double defunc_0_f_res_219782 =\n                           sitofp_i64_f64(binop_p_219781);\n                    double abs_res_219783 = fabs(defunc_0_f_res_219782);\n                    double tmp1_219784 = abs_res_219783 / x_219721;\n                    double x_219785 = tmp1_219784 * tmp1_219784;\n                    double y_219786 = tmp1_219784 * x_219785;\n                    double tmp2_219787 = 1.0 - y_219786;\n                    double x_219788 = tmp2_219787 * tmp2_219787;\n                    double tmp3_219789 = tmp2_219787 * x_219788;\n                    double tmp4_219790 = defunc_0_f_res_219778 * tmp3_219789;\n                    double defunc_1_f_res_219791 = defunc_0_f_res_219782 *\n                           tmp4_219790;\n                    double defunc_0_f_res_219792;\n   ",
                   "                 \n                    if (cond_219774) {\n                        defunc_0_f_res_219792 = 0.0;\n                    } else {\n                        int64_t i_219793 = add64(x_219720, i_228361);\n                        double defunc_0_add_arg_219794;\n                        \n                        defunc_0_add_arg_219794 = ((__global\n                                                    double *) mem_230625)[i_219793 *\n                                                                          partition_sizze_203577 +\n                                                                          gtid_219711];\n                        defunc_0_f_res_219792 = defunc_0_add_arg_219794;\n                    }\n                    \n                    double x_219795 = a11_219761 * tmp4_219790;\n                    double y_219796 = b11_219763 * defunc_1_f_res_219791;\n                    double x_219797 = x_219795 + y_219796;\n                    double defunc_9_fit_fun_res_219798 = defunc_0_f_res_219792 *\n                           x_219797;\n                    double x_219799 = b11_219763 * tmp4_219790;\n                    double y_219800 = c11_219764 * defunc_1_f_res_219791;\n                    double x_219801 = x_219799 + y_219800;\n                    double defunc_9_slope_fun_res_219802 =\n                           defunc_0_f_res_219792 * x_219801;\n                    double defunc_1_op_res_219769 =\n                           defunc_9_fit_fun_res_219798 + redout_228359;\n                    double defunc_1_op_res_219772 =\n                           defunc_9_slope_fun_res_219802 + redout_228360;\n                    double redout_tmp_234748 = defunc_1_op_res_219769;\n                    double redout_tmp_234749 = defunc_1_op_res_219772;\n                    \n                    redout_228359 = redout_tmp_234748;\n                    redout_228360 = redout_tmp_234749;\n                }\n                defunc_2_reduce_res_219765 = redout_228359;\n                defunc_2_red",
                   "uce_res_219766 = redout_228360;\n                ((__global double *) color_232029)[phys_tid_219712 + i_228993 *\n                                                   num_threads_232163] =\n                    defunc_2_reduce_res_219765;\n                ((__global double *) color_232028)[phys_tid_219712 + i_228993 *\n                                                   num_threads_232163] =\n                    defunc_2_reduce_res_219766;\n            }\n            for (int64_t i_234750 = 0; i_234750 < l_n_m_203643; i_234750++) {\n                double tmp_234751;\n                \n                tmp_234751 = ((__global\n                               double *) color_232029)[phys_tid_219712 +\n                                                       i_234750 *\n                                                       num_threads_232163];\n                ((__global double *) mem_230659)[gtid_219711 + i_234750 *\n                                                 partition_sizze_203577] =\n                    tmp_234751;\n            }\n            for (int64_t i_234752 = 0; i_234752 < l_n_m_203643; i_234752++) {\n                double tmp_234753;\n                \n                tmp_234753 = ((__global\n                               double *) color_232028)[phys_tid_219712 +\n                                                       i_234752 *\n                                                       num_threads_232163];\n                ((__global double *) mem_230662)[gtid_219711 + i_234752 *\n                                                 partition_sizze_203577] =\n                    tmp_234753;\n            }\n        }\n        barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_219706\n}\n__kernel void mainzisegmap_220233(__global int *global_failure,\n                                  int64_t n_203490, int64_t q_l_203495,\n                                  int64_t jump_t_203500,\n                                  int64_t partition_siz",
                   "ze_203577,\n                                  int64_t l_n_m_203643, int64_t i_203670,\n                                  int64_t ctx_param_ext_229488,\n                                  int64_t ctx_param_ext_229489,\n                                  int64_t ctx_param_ext_229491, __global\n                                  unsigned char *ext_mem_229411, __global\n                                  unsigned char *ext_mem_229412, __global\n                                  unsigned char *mem_param_229493, __global\n                                  unsigned char *mem_230551, __global\n                                  unsigned char *mem_230667, __global\n                                  unsigned char *mem_230671)\n{\n    #define segmap_group_sizze_220222 (mainzisegmap_group_sizze_219808)\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_234754;\n    int32_t local_tid_234755;\n    int64_t group_sizze_234758;\n    int32_t wave_sizze_234757;\n    int32_t group_tid_234756;\n    \n    global_tid_234754 = get_global_id(0);\n    local_tid_234755 = get_local_id(0);\n    group_sizze_234758 = get_local_size(0);\n    wave_sizze_234757 = LOCKSTEP_WIDTH;\n    group_tid_234756 = get_group_id(0);\n    \n    int32_t phys_tid_220233 = global_tid_234754;\n    int64_t global_tid_234759 = sext_i32_i64(group_tid_234756) *\n            segmap_group_sizze_220222 + sext_i32_i64(local_tid_234755);\n    int64_t slice_234760 = l_n_m_203643;\n    int64_t slice_234761 = partition_sizze_203577 * slice_234760;\n    int64_t gtid_220231 = squot64(global_tid_234759, slice_234760);\n    int64_t remnant_234762 = global_tid_234759 - gtid_220231 * slice_234760;\n    int64_t gtid_220232 = remnant_234762;\n    int64_t remnant_234763 = remnant_234762 - gtid_220232;\n    \n    if (slt64(gtid_220231, partition_sizze_203577) && slt64(gtid_220232,\n                                                            l_n_m_203643)) {\n",
                   "        int64_t x_220237;\n        \n        x_220237 = ((__global int64_t *) ext_mem_229412)[gtid_220231 *\n                                                         l_n_m_203643 +\n                                                         gtid_220232];\n        \n        double x_220238;\n        \n        x_220238 = ((__global double *) ext_mem_229411)[gtid_220231 *\n                                                        l_n_m_203643 +\n                                                        gtid_220232];\n        \n        int64_t min_arg_220239 = mul64(jump_t_203500, gtid_220232);\n        int64_t min_res_220240 = smin64(i_203670, min_arg_220239);\n        int64_t defunc_0_g_res_220241 = add64((int64_t) 1, min_res_220240);\n        double defunc_2_reduce_res_220242;\n        double defunc_2_reduce_res_220243;\n        double defunc_2_reduce_res_220244;\n        double redout_228366;\n        double redout_228367;\n        double redout_228368;\n        \n        redout_228366 = 0.0;\n        redout_228367 = 0.0;\n        redout_228368 = 0.0;\n        for (int64_t i_228369 = 0; i_228369 < q_l_203495; i_228369++) {\n            bool cond_220255 = sle64(n_203490, i_228369);\n            int64_t defunc_0_f_res_220256;\n            \n            if (cond_220255) {\n                defunc_0_f_res_220256 = (int64_t) 0;\n            } else {\n                int64_t i_220257 = add64(x_220237, i_228369);\n                int64_t defunc_1_add_res_220258 = add64((int64_t) 1, i_220257);\n                \n                defunc_0_f_res_220256 = defunc_1_add_res_220258;\n            }\n            \n            double defunc_0_f_res_220259;\n            \n            if (cond_220255) {\n                defunc_0_f_res_220259 = 0.0;\n            } else {\n                int64_t i_220260 = add64(x_220237, i_228369);\n                double defunc_0_add_arg_220261;\n                \n                defunc_0_add_arg_220261 = ((__global\n                                            double *) mem_param_229493)[ctx_param_ext_22",
                   "9488 +\n                                                                        (gtid_220231 *\n                                                                         ctx_param_ext_229489 +\n                                                                         i_220260 *\n                                                                         ctx_param_ext_229491)];\n                defunc_0_f_res_220259 = defunc_0_add_arg_220261;\n            }\n            \n            int64_t binop_p_220262 = sub64(defunc_0_f_res_220256,\n                                           defunc_0_g_res_220241);\n            double defunc_0_f_res_220263 = sitofp_i64_f64(binop_p_220262);\n            double abs_res_220264 = fabs(defunc_0_f_res_220263);\n            double tmp1_220265 = abs_res_220264 / x_220238;\n            double x_220266 = tmp1_220265 * tmp1_220265;\n            double y_220267 = tmp1_220265 * x_220266;\n            double tmp2_220268 = 1.0 - y_220267;\n            double x_220269 = tmp2_220268 * tmp2_220268;\n            double tmp3_220270 = tmp2_220268 * x_220269;\n            double w_j_220271 = defunc_0_f_res_220259 * tmp3_220270;\n            double xw_j_220272 = defunc_0_f_res_220263 * w_j_220271;\n            double x2w_j_220273 = defunc_0_f_res_220263 * xw_j_220272;\n            double defunc_1_op_res_220247 = w_j_220271 + redout_228366;\n            double defunc_1_op_res_220250 = xw_j_220272 + redout_228367;\n            double defunc_1_op_res_220253 = x2w_j_220273 + redout_228368;\n            double redout_tmp_234764 = defunc_1_op_res_220247;\n            double redout_tmp_234765 = defunc_1_op_res_220250;\n            double redout_tmp_234766 = defunc_1_op_res_220253;\n            \n            redout_228366 = redout_tmp_234764;\n            redout_228367 = redout_tmp_234765;\n            redout_228368 = redout_tmp_234766;\n        }\n        defunc_2_reduce_res_220242 = redout_228366;\n        defunc_2_reduce_res_220243 = redout_228367;\n        defunc_2_reduce_res_220244 = redout_2",
                   "28368;\n        \n        double x_220274 = defunc_2_reduce_res_220242 *\n               defunc_2_reduce_res_220244;\n        double y_220275 = defunc_2_reduce_res_220243 *\n               defunc_2_reduce_res_220243;\n        double y_220276 = x_220274 - y_220275;\n        double det1_220277 = 1.0 / y_220276;\n        double a11_220278 = defunc_2_reduce_res_220244 * det1_220277;\n        double x_220279 = 0.0 - defunc_2_reduce_res_220243;\n        double b11_220280 = det1_220277 * x_220279;\n        double c11_220281 = defunc_2_reduce_res_220242 * det1_220277;\n        double defunc_2_reduce_res_220282;\n        double defunc_2_reduce_res_220283;\n        double redout_228370;\n        double redout_228371;\n        \n        redout_228370 = 0.0;\n        redout_228371 = 0.0;\n        for (int64_t i_228372 = 0; i_228372 < q_l_203495; i_228372++) {\n            bool cond_220291 = sle64(n_203490, i_228372);\n            int64_t defunc_0_f_res_220292;\n            \n            if (cond_220291) {\n                defunc_0_f_res_220292 = (int64_t) 0;\n            } else {\n                int64_t i_220293 = add64(x_220237, i_228372);\n                int64_t defunc_1_add_res_220294 = add64((int64_t) 1, i_220293);\n                \n                defunc_0_f_res_220292 = defunc_1_add_res_220294;\n            }\n            \n            double defunc_0_f_res_220295;\n            \n            if (cond_220291) {\n                defunc_0_f_res_220295 = 0.0;\n            } else {\n                int64_t i_220296 = add64(x_220237, i_228372);\n                double defunc_0_add_arg_220297;\n                \n                defunc_0_add_arg_220297 = ((__global\n                                            double *) mem_param_229493)[ctx_param_ext_229488 +\n                                                                        (gtid_220231 *\n                                                                         ctx_param_ext_229489 +\n                                                                         i_2202",
                   "96 *\n                                                                         ctx_param_ext_229491)];\n                defunc_0_f_res_220295 = defunc_0_add_arg_220297;\n            }\n            \n            int64_t binop_p_220298 = sub64(defunc_0_f_res_220292,\n                                           defunc_0_g_res_220241);\n            double defunc_0_f_res_220299 = sitofp_i64_f64(binop_p_220298);\n            double abs_res_220300 = fabs(defunc_0_f_res_220299);\n            double tmp1_220301 = abs_res_220300 / x_220238;\n            double x_220302 = tmp1_220301 * tmp1_220301;\n            double y_220303 = tmp1_220301 * x_220302;\n            double tmp2_220304 = 1.0 - y_220303;\n            double x_220305 = tmp2_220304 * tmp2_220304;\n            double tmp3_220306 = tmp2_220304 * x_220305;\n            double tmp4_220307 = defunc_0_f_res_220295 * tmp3_220306;\n            double defunc_1_f_res_220308 = defunc_0_f_res_220299 * tmp4_220307;\n            double defunc_0_f_res_220309;\n            \n            if (cond_220291) {\n                defunc_0_f_res_220309 = 0.0;\n            } else {\n                int64_t i_220310 = add64(x_220237, i_228372);\n                double defunc_0_add_arg_220311;\n                \n                defunc_0_add_arg_220311 = ((__global\n                                            double *) mem_230551)[gtid_220231 *\n                                                                  n_203490 +\n                                                                  i_220310];\n                defunc_0_f_res_220309 = defunc_0_add_arg_220311;\n            }\n            \n            double x_220312 = a11_220278 * tmp4_220307;\n            double y_220313 = b11_220280 * defunc_1_f_res_220308;\n            double x_220314 = x_220312 + y_220313;\n            double defunc_9_fit_fun_res_220315 = defunc_0_f_res_220309 *\n                   x_220314;\n            double x_220316 = b11_220280 * tmp4_220307;\n            double y_220317 = c11_220281 * defunc_1_f_res_22",
                   "0308;\n            double x_220318 = x_220316 + y_220317;\n            double defunc_9_slope_fun_res_220319 = defunc_0_f_res_220309 *\n                   x_220318;\n            double defunc_1_op_res_220286 = defunc_9_fit_fun_res_220315 +\n                   redout_228370;\n            double defunc_1_op_res_220289 = defunc_9_slope_fun_res_220319 +\n                   redout_228371;\n            double redout_tmp_234767 = defunc_1_op_res_220286;\n            double redout_tmp_234768 = defunc_1_op_res_220289;\n            \n            redout_228370 = redout_tmp_234767;\n            redout_228371 = redout_tmp_234768;\n        }\n        defunc_2_reduce_res_220282 = redout_228370;\n        defunc_2_reduce_res_220283 = redout_228371;\n        ((__global double *) mem_230667)[gtid_220231 * l_n_m_203643 +\n                                         gtid_220232] =\n            defunc_2_reduce_res_220282;\n        ((__global double *) mem_230671)[gtid_220231 * l_n_m_203643 +\n                                         gtid_220232] =\n            defunc_2_reduce_res_220283;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_220222\n}\n__kernel void mainzisegmap_220390(__global int *global_failure,\n                                  int64_t partition_sizze_203577,\n                                  int64_t l_n_m_203643, __global\n                                  unsigned char *mem_230676, __global\n                                  unsigned char *mem_230680, __global\n                                  unsigned char *mem_230684, __global\n                                  unsigned char *mem_230689, __global\n                                  unsigned char *mem_230693, __global\n                                  unsigned char *mem_230697)\n{\n    #define segmap_group_sizze_220383 (mainzisegmap_group_sizze_219990)\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_234869;\n    int",
                   "32_t local_tid_234870;\n    int64_t group_sizze_234873;\n    int32_t wave_sizze_234872;\n    int32_t group_tid_234871;\n    \n    global_tid_234869 = get_global_id(0);\n    local_tid_234870 = get_local_id(0);\n    group_sizze_234873 = get_local_size(0);\n    wave_sizze_234872 = LOCKSTEP_WIDTH;\n    group_tid_234871 = get_group_id(0);\n    \n    int32_t phys_tid_220390 = global_tid_234869;\n    int64_t global_tid_234874 = sext_i32_i64(group_tid_234871) *\n            segmap_group_sizze_220383 + sext_i32_i64(local_tid_234870);\n    int64_t slice_234875 = l_n_m_203643;\n    int64_t slice_234876 = partition_sizze_203577 * slice_234875;\n    int64_t gtid_220388 = squot64(global_tid_234874, slice_234875);\n    int64_t remnant_234877 = global_tid_234874 - gtid_220388 * slice_234875;\n    int64_t gtid_220389 = remnant_234877;\n    int64_t remnant_234878 = remnant_234877 - gtid_220389;\n    \n    if (slt64(gtid_220388, partition_sizze_203577) && slt64(gtid_220389,\n                                                            l_n_m_203643)) {\n        double defunc_2_reduce_res_220391;\n        \n        defunc_2_reduce_res_220391 = ((__global\n                                       double *) mem_230676)[gtid_220388 *\n                                                             l_n_m_203643 +\n                                                             gtid_220389];\n        \n        double defunc_2_reduce_res_220392;\n        \n        defunc_2_reduce_res_220392 = ((__global\n                                       double *) mem_230680)[gtid_220388 *\n                                                             l_n_m_203643 +\n                                                             gtid_220389];\n        \n        double defunc_2_reduce_res_220393;\n        \n        defunc_2_reduce_res_220393 = ((__global\n                                       double *) mem_230684)[gtid_220388 *\n                                                             l_n_m_203643 +\n                                                     ",
                   "        gtid_220389];\n        \n        double x_220394 = defunc_2_reduce_res_220391 *\n               defunc_2_reduce_res_220393;\n        double y_220395 = defunc_2_reduce_res_220392 *\n               defunc_2_reduce_res_220392;\n        double y_220396 = x_220394 - y_220395;\n        double det1_220397 = 1.0 / y_220396;\n        double a11_220398 = defunc_2_reduce_res_220393 * det1_220397;\n        double x_220399 = 0.0 - defunc_2_reduce_res_220392;\n        double b11_220400 = det1_220397 * x_220399;\n        double c11_220401 = defunc_2_reduce_res_220391 * det1_220397;\n        \n        ((__global double *) mem_230689)[gtid_220388 * l_n_m_203643 +\n                                         gtid_220389] = a11_220398;\n        ((__global double *) mem_230693)[gtid_220388 * l_n_m_203643 +\n                                         gtid_220389] = b11_220400;\n        ((__global double *) mem_230697)[gtid_220388 * l_n_m_203643 +\n                                         gtid_220389] = c11_220401;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_220383\n}\n__kernel void mainzisegmap_220609(__global int *global_failure,\n                                  int64_t n_203490, int64_t q_l_203495,\n                                  int64_t jump_t_203500,\n                                  int64_t partition_sizze_203577,\n                                  int64_t l_n_m_203643, int64_t i_203670,\n                                  int64_t num_groups_220604,\n                                  int64_t num_threads_232170, __global\n                                  unsigned char *mem_230723, __global\n                                  unsigned char *mem_230726, __global\n                                  unsigned char *mem_230729, __global\n                                  unsigned char *mem_230732, __global\n                                  unsigned char *mem_230766, __global\n                                  unsigned char *mem_230769, __global\n                                  unsigned char ",
                   "*color_232030, __global\n                                  unsigned char *color_232031)\n{\n    #define segmap_group_sizze_220603 (mainzisegmap_group_sizze_220473)\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_220609 = global_tid_234982;\n    int32_t phys_group_id_234987;\n    \n    phys_group_id_234987 = get_group_id(0);\n    for (int32_t i_234988 = 0; i_234988 <\n         sdiv_up32(sext_i64_i32(sdiv_up64(partition_sizze_203577,\n                                          segmap_group_sizze_220603)) -\n                   phys_group_id_234987, sext_i64_i32(num_groups_220604));\n         i_234988++) {\n        int32_t virt_group_id_234989 = phys_group_id_234987 + i_234988 *\n                sext_i64_i32(num_groups_220604);\n        int64_t global_tid_234990 = sext_i32_i64(virt_group_id_234989) *\n                segmap_group_sizze_220603 + sext_i32_i64(local_tid_234983);\n        int64_t slice_234991 = partition_sizze_203577;\n        int64_t gtid_220608 = global_tid_234990;\n        int64_t remnant_234992 = global_tid_234990 - gtid_220608;\n        \n        if (slt64(gtid_220608, partition_sizze_203577)) {\n            for (int64_t i_229000 = 0; i_229000 < l_n_m_203643; i_229000++) {\n                int64_t x_220617;\n                \n                x_220617 = ((__global int64_t *) mem_230723)[i_229000 *\n                                                             partition_sizze_203577 +\n                                                             gtid_220608];\n                \n                doubl",
                   "e x_220618;\n                \n                x_220618 = ((__global double *) mem_230726)[i_229000 *\n                                                            partition_sizze_203577 +\n                                                            gtid_220608];\n                \n                int64_t min_arg_220619 = mul64(jump_t_203500, i_229000);\n                int64_t min_res_220620 = smin64(i_203670, min_arg_220619);\n                int64_t defunc_0_g_res_220621 = add64((int64_t) 1,\n                                                      min_res_220620);\n                double defunc_2_reduce_res_220622;\n                double defunc_2_reduce_res_220623;\n                double defunc_2_reduce_res_220624;\n                double defunc_2_reduce_res_220625;\n                double defunc_2_reduce_res_220626;\n                double redout_228385;\n                double redout_228386;\n                double redout_228387;\n                double redout_228388;\n                double redout_228389;\n                \n                redout_228385 = 0.0;\n                redout_228386 = 0.0;\n                redout_228387 = 0.0;\n                redout_228388 = 0.0;\n                redout_228389 = 0.0;\n                for (int64_t i_228390 = 0; i_228390 < q_l_203495; i_228390++) {\n                    bool cond_220643 = sle64(n_203490, i_228390);\n                    int64_t defunc_0_f_res_220644;\n                    \n                    if (cond_220643) {\n                        defunc_0_f_res_220644 = (int64_t) 0;\n                    } else {\n                        int64_t i_220645 = add64(x_220617, i_228390);\n                        int64_t defunc_1_add_res_220646 = add64((int64_t) 1,\n                                                                i_220645);\n                        \n                        defunc_0_f_res_220644 = defunc_1_add_res_220646;\n                    }\n                    \n                    double defunc_0_f_res_220647;\n                    \n          ",
                   "          if (cond_220643) {\n                        defunc_0_f_res_220647 = 0.0;\n                    } else {\n                        int64_t i_220648 = add64(x_220617, i_228390);\n                        double defunc_0_add_arg_220649;\n                        \n                        defunc_0_add_arg_220649 = ((__global\n                                                    double *) mem_230729)[i_220648 *\n                                                                          partition_sizze_203577 +\n                                                                          gtid_220608];\n                        defunc_0_f_res_220647 = defunc_0_add_arg_220649;\n                    }\n                    \n                    int64_t binop_p_220650 = sub64(defunc_0_f_res_220644,\n                                                   defunc_0_g_res_220621);\n                    double defunc_0_f_res_220651 =\n                           sitofp_i64_f64(binop_p_220650);\n                    double abs_res_220652 = fabs(defunc_0_f_res_220651);\n                    double tmp1_220653 = abs_res_220652 / x_220618;\n                    double x_220654 = tmp1_220653 * tmp1_220653;\n                    double y_220655 = tmp1_220653 * x_220654;\n                    double tmp2_220656 = 1.0 - y_220655;\n                    double x_220657 = tmp2_220656 * tmp2_220656;\n                    double tmp3_220658 = tmp2_220656 * x_220657;\n                    double w_j_220659 = defunc_0_f_res_220647 * tmp3_220658;\n                    double xw_j_220660 = defunc_0_f_res_220651 * w_j_220659;\n                    double x2w_j_220661 = defunc_0_f_res_220651 * xw_j_220660;\n                    double x3w_j_220662 = defunc_0_f_res_220651 * x2w_j_220661;\n                    double x4w_j_220663 = defunc_0_f_res_220651 * x3w_j_220662;\n                    double defunc_1_op_res_220629 = w_j_220659 + redout_228385;\n                    double defunc_1_op_res_220632 = xw_j_220660 + redout_228386;\n                    d",
                   "ouble defunc_1_op_res_220635 = x2w_j_220661 +\n                           redout_228387;\n                    double defunc_1_op_res_220638 = x3w_j_220662 +\n                           redout_228388;\n                    double defunc_1_op_res_220641 = x4w_j_220663 +\n                           redout_228389;\n                    double redout_tmp_234995 = defunc_1_op_res_220629;\n                    double redout_tmp_234996 = defunc_1_op_res_220632;\n                    double redout_tmp_234997 = defunc_1_op_res_220635;\n                    double redout_tmp_234998 = defunc_1_op_res_220638;\n                    double redout_tmp_234999 = defunc_1_op_res_220641;\n                    \n                    redout_228385 = redout_tmp_234995;\n                    redout_228386 = redout_tmp_234996;\n                    redout_228387 = redout_tmp_234997;\n                    redout_228388 = redout_tmp_234998;\n                    redout_228389 = redout_tmp_234999;\n                }\n                defunc_2_reduce_res_220622 = redout_228385;\n                defunc_2_reduce_res_220623 = redout_228386;\n                defunc_2_reduce_res_220624 = redout_228387;\n                defunc_2_reduce_res_220625 = redout_228388;\n                defunc_2_reduce_res_220626 = redout_228389;\n                \n                double x_220664 = defunc_2_reduce_res_220624 *\n                       defunc_2_reduce_res_220626;\n                double y_220665 = defunc_2_reduce_res_220625 *\n                       defunc_2_reduce_res_220625;\n                double a12_220666 = x_220664 - y_220665;\n                double x_220667 = defunc_2_reduce_res_220624 *\n                       defunc_2_reduce_res_220625;\n                double y_220668 = defunc_2_reduce_res_220623 *\n                       defunc_2_reduce_res_220626;\n                double b12_220669 = x_220667 - y_220668;\n                double x_220670 = defunc_2_reduce_res_220623 *\n                       defunc_2_reduce_res_220625;\n                double y",
                   "_220671 = defunc_2_reduce_res_220624 *\n                       defunc_2_reduce_res_220624;\n                double c12_220672 = x_220670 - y_220671;\n                double x_220673 = defunc_2_reduce_res_220622 *\n                       defunc_2_reduce_res_220626;\n                double b2_220674 = x_220673 - y_220671;\n                double x_220675 = defunc_2_reduce_res_220623 *\n                       defunc_2_reduce_res_220624;\n                double y_220676 = defunc_2_reduce_res_220622 *\n                       defunc_2_reduce_res_220625;\n                double c2_220677 = x_220675 - y_220676;\n                double x_220678 = defunc_2_reduce_res_220622 * a12_220666;\n                double y_220679 = defunc_2_reduce_res_220623 * b12_220669;\n                double x_220680 = x_220678 + y_220679;\n                double y_220681 = defunc_2_reduce_res_220624 * c12_220672;\n                double y_220682 = x_220680 + y_220681;\n                double det_220683 = 1.0 / y_220682;\n                double a12_220684 = a12_220666 * det_220683;\n                double b12_220685 = b12_220669 * det_220683;\n                double c12_220686 = c12_220672 * det_220683;\n                double b2_220687 = b2_220674 * det_220683;\n                double c2_220688 = c2_220677 * det_220683;\n                double defunc_2_reduce_res_220689;\n                double defunc_2_reduce_res_220690;\n                double redout_228391;\n                double redout_228392;\n                \n                redout_228391 = 0.0;\n                redout_228392 = 0.0;\n                for (int64_t i_228393 = 0; i_228393 < q_l_203495; i_228393++) {\n                    bool cond_220698 = sle64(n_203490, i_228393);\n                    int64_t defunc_0_f_res_220699;\n                    \n                    if (cond_220698) {\n                        defunc_0_f_res_220699 = (int64_t) 0;\n                    } else {\n                        int64_t i_220700 = add64(x_220617, i_228393);\n                        i",
                   "nt64_t defunc_1_add_res_220701 = add64((int64_t) 1,\n                                                                i_220700);\n                        \n                        defunc_0_f_res_220699 = defunc_1_add_res_220701;\n                    }\n                    \n                    double defunc_0_f_res_220702;\n                    \n                    if (cond_220698) {\n                        defunc_0_f_res_220702 = 0.0;\n                    } else {\n                        int64_t i_220703 = add64(x_220617, i_228393);\n                        double defunc_0_add_arg_220704;\n                        \n                        defunc_0_add_arg_220704 = ((__global\n                                                    double *) mem_230729)[i_220703 *\n                                                                          partition_sizze_203577 +\n                                                                          gtid_220608];\n                        defunc_0_f_res_220702 = defunc_0_add_arg_220704;\n                    }\n                    \n                    int64_t binop_p_220705 = sub64(defunc_0_f_res_220699,\n                                                   defunc_0_g_res_220621);\n                    double defunc_0_f_res_220706 =\n                           sitofp_i64_f64(binop_p_220705);\n                    double abs_res_220707 = fabs(defunc_0_f_res_220706);\n                    double tmp1_220708 = abs_res_220707 / x_220618;\n                    double x_220709 = tmp1_220708 * tmp1_220708;\n                    double y_220710 = tmp1_220708 * x_220709;\n                    double tmp2_220711 = 1.0 - y_220710;\n                    double x_220712 = tmp2_220711 * tmp2_220711;\n                    double tmp3_220713 = tmp2_220711 * x_220712;\n                    double tmp4_220714 = defunc_0_f_res_220702 * tmp3_220713;\n                    double defunc_1_f_res_220715 = defunc_0_f_res_220706 *\n                           tmp4_220714;\n                    double defunc",
                   "_1_f_res_220716 = defunc_0_f_res_220706 *\n                           defunc_1_f_res_220715;\n                    double defunc_0_f_res_220717;\n                    \n                    if (cond_220698) {\n                        defunc_0_f_res_220717 = 0.0;\n                    } else {\n                        int64_t i_220718 = add64(x_220617, i_228393);\n                        double defunc_0_add_arg_220719;\n                        \n                        defunc_0_add_arg_220719 = ((__global\n                                                    double *) mem_230732)[i_220718 *\n                                                                          partition_sizze_203577 +\n                                                                          gtid_220608];\n                        defunc_0_f_res_220717 = defunc_0_add_arg_220719;\n                    }\n                    \n                    double x_220720 = a12_220684 * tmp4_220714;\n                    double y_220721 = b12_220685 * defunc_1_f_res_220715;\n                    double x_220722 = x_220720 + y_220721;\n                    double y_220723 = c12_220686 * defunc_1_f_res_220716;\n                    double x_220724 = x_220722 + y_220723;\n                    double defunc_9_fit_fun_res_220725 = defunc_0_f_res_220717 *\n                           x_220724;\n                    double x_220726 = b12_220685 * tmp4_220714;\n                    double y_220727 = b2_220687 * defunc_1_f_res_220715;\n                    double x_220728 = x_220726 + y_220727;\n                    double y_220729 = c2_220688 * defunc_1_f_res_220716;\n                    double x_220730 = x_220728 + y_220729;\n                    double defunc_9_slope_fun_res_220731 =\n                           defunc_0_f_res_220717 * x_220730;\n                    double defunc_1_op_res_220693 =\n                           defunc_9_fit_fun_res_220725 + redout_228391;\n                    double defunc_1_op_res_220696 =\n                           defunc_9_slope_fu",
                   "n_res_220731 + redout_228392;\n                    double redout_tmp_235000 = defunc_1_op_res_220693;\n                    double redout_tmp_235001 = defunc_1_op_res_220696;\n                    \n                    redout_228391 = redout_tmp_235000;\n                    redout_228392 = redout_tmp_235001;\n                }\n                defunc_2_reduce_res_220689 = redout_228391;\n                defunc_2_reduce_res_220690 = redout_228392;\n                ((__global double *) color_232031)[phys_tid_220609 + i_229000 *\n                                                   num_threads_232170] =\n                    defunc_2_reduce_res_220689;\n                ((__global double *) color_232030)[phys_tid_220609 + i_229000 *\n                                                   num_threads_232170] =\n                    defunc_2_reduce_res_220690;\n            }\n            for (int64_t i_235002 = 0; i_235002 < l_n_m_203643; i_235002++) {\n                double tmp_235003;\n                \n                tmp_235003 = ((__global\n                               double *) color_232031)[phys_tid_220609 +\n                                                       i_235002 *\n                                                       num_threads_232170];\n                ((__global double *) mem_230766)[gtid_220608 + i_235002 *\n                                                 partition_sizze_203577] =\n                    tmp_235003;\n            }\n            for (int64_t i_235004 = 0; i_235004 < l_n_m_203643; i_235004++) {\n                double tmp_235005;\n                \n                tmp_235005 = ((__global\n                               double *) color_232030)[phys_tid_220609 +\n                                                       i_235004 *\n                                                       num_threads_232170];\n                ((__global double *) mem_230769)[gtid_220608 + i_235004 *\n                                                 partition_sizze_203577] =\n                    tmp_23500",
                   "5;\n            }\n        }\n        barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_220603\n}\n__kernel void mainzisegmap_221278(__global int *global_failure,\n                                  int64_t n_203490, int64_t q_l_203495,\n                                  int64_t jump_t_203500,\n                                  int64_t partition_sizze_203577,\n                                  int64_t l_n_m_203643, int64_t i_203670,\n                                  int64_t ctx_param_ext_229488,\n                                  int64_t ctx_param_ext_229489,\n                                  int64_t ctx_param_ext_229491, __global\n                                  unsigned char *ext_mem_229411, __global\n                                  unsigned char *ext_mem_229412, __global\n                                  unsigned char *mem_param_229493, __global\n                                  unsigned char *mem_230551, __global\n                                  unsigned char *mem_230774, __global\n                                  unsigned char *mem_230778)\n{\n    #define segmap_group_sizze_221267 (mainzisegmap_group_sizze_220737)\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_235006;\n    int32_t local_tid_235007;\n    int64_t group_sizze_235010;\n    int32_t wave_sizze_235009;\n    int32_t group_tid_235008;\n    \n    global_tid_235006 = get_global_id(0);\n    local_tid_235007 = get_local_id(0);\n    group_sizze_235010 = get_local_size(0);\n    wave_sizze_235009 = LOCKSTEP_WIDTH;\n    group_tid_235008 = get_group_id(0);\n    \n    int32_t phys_tid_221278 = global_tid_235006;\n    int64_t global_tid_235011 = sext_i32_i64(group_tid_235008) *\n            segmap_group_sizze_221267 + sext_i32_i64(local_tid_235007);\n    int64_t slice_235012 = l_n_m_203643;\n    int64_t slice_235013 = partition_sizze_203577 * slice_",
                   "235012;\n    int64_t gtid_221276 = squot64(global_tid_235011, slice_235012);\n    int64_t remnant_235014 = global_tid_235011 - gtid_221276 * slice_235012;\n    int64_t gtid_221277 = remnant_235014;\n    int64_t remnant_235015 = remnant_235014 - gtid_221277;\n    \n    if (slt64(gtid_221276, partition_sizze_203577) && slt64(gtid_221277,\n                                                            l_n_m_203643)) {\n        int64_t x_221282;\n        \n        x_221282 = ((__global int64_t *) ext_mem_229412)[gtid_221276 *\n                                                         l_n_m_203643 +\n                                                         gtid_221277];\n        \n        double x_221283;\n        \n        x_221283 = ((__global double *) ext_mem_229411)[gtid_221276 *\n                                                        l_n_m_203643 +\n                                                        gtid_221277];\n        \n        int64_t min_arg_221284 = mul64(jump_t_203500, gtid_221277);\n        int64_t min_res_221285 = smin64(i_203670, min_arg_221284);\n        int64_t defunc_0_g_res_221286 = add64((int64_t) 1, min_res_221285);\n        double defunc_2_reduce_res_221287;\n        double defunc_2_reduce_res_221288;\n        double defunc_2_reduce_res_221289;\n        double defunc_2_reduce_res_221290;\n        double defunc_2_reduce_res_221291;\n        double redout_228398;\n        double redout_228399;\n        double redout_228400;\n        double redout_228401;\n        double redout_228402;\n        \n        redout_228398 = 0.0;\n        redout_228399 = 0.0;\n        redout_228400 = 0.0;\n        redout_228401 = 0.0;\n        redout_228402 = 0.0;\n        for (int64_t i_228403 = 0; i_228403 < q_l_203495; i_228403++) {\n            bool cond_221308 = sle64(n_203490, i_228403);\n            int64_t defunc_0_f_res_221309;\n            \n            if (cond_221308) {\n                defunc_0_f_res_221309 = (int64_t) 0;\n            } else {\n                int64_t i_221310 = add64(x_221282, i_22840",
                   "3);\n                int64_t defunc_1_add_res_221311 = add64((int64_t) 1, i_221310);\n                \n                defunc_0_f_res_221309 = defunc_1_add_res_221311;\n            }\n            \n            double defunc_0_f_res_221312;\n            \n            if (cond_221308) {\n                defunc_0_f_res_221312 = 0.0;\n            } else {\n                int64_t i_221313 = add64(x_221282, i_228403);\n                double defunc_0_add_arg_221314;\n                \n                defunc_0_add_arg_221314 = ((__global\n                                            double *) mem_param_229493)[ctx_param_ext_229488 +\n                                                                        (gtid_221276 *\n                                                                         ctx_param_ext_229489 +\n                                                                         i_221313 *\n                                                                         ctx_param_ext_229491)];\n                defunc_0_f_res_221312 = defunc_0_add_arg_221314;\n            }\n            \n            int64_t binop_p_221315 = sub64(defunc_0_f_res_221309,\n                                           defunc_0_g_res_221286);\n            double defunc_0_f_res_221316 = sitofp_i64_f64(binop_p_221315);\n            double abs_res_221317 = fabs(defunc_0_f_res_221316);\n            double tmp1_221318 = abs_res_221317 / x_221283;\n            double x_221319 = tmp1_221318 * tmp1_221318;\n            double y_221320 = tmp1_221318 * x_221319;\n            double tmp2_221321 = 1.0 - y_221320;\n            double x_221322 = tmp2_221321 * tmp2_221321;\n            double tmp3_221323 = tmp2_221321 * x_221322;\n            double w_j_221324 = defunc_0_f_res_221312 * tmp3_221323;\n            double xw_j_221325 = defunc_0_f_res_221316 * w_j_221324;\n            double x2w_j_221326 = defunc_0_f_res_221316 * xw_j_221325;\n            double x3w_j_221327 = defunc_0_f_res_221316 * x2w_j_221326;\n            double x4w_j_221328 = de",
                   "func_0_f_res_221316 * x3w_j_221327;\n            double defunc_1_op_res_221294 = w_j_221324 + redout_228398;\n            double defunc_1_op_res_221297 = xw_j_221325 + redout_228399;\n            double defunc_1_op_res_221300 = x2w_j_221326 + redout_228400;\n            double defunc_1_op_res_221303 = x3w_j_221327 + redout_228401;\n            double defunc_1_op_res_221306 = x4w_j_221328 + redout_228402;\n            double redout_tmp_235016 = defunc_1_op_res_221294;\n            double redout_tmp_235017 = defunc_1_op_res_221297;\n            double redout_tmp_235018 = defunc_1_op_res_221300;\n            double redout_tmp_235019 = defunc_1_op_res_221303;\n            double redout_tmp_235020 = defunc_1_op_res_221306;\n            \n            redout_228398 = redout_tmp_235016;\n            redout_228399 = redout_tmp_235017;\n            redout_228400 = redout_tmp_235018;\n            redout_228401 = redout_tmp_235019;\n            redout_228402 = redout_tmp_235020;\n        }\n        defunc_2_reduce_res_221287 = redout_228398;\n        defunc_2_reduce_res_221288 = redout_228399;\n        defunc_2_reduce_res_221289 = redout_228400;\n        defunc_2_reduce_res_221290 = redout_228401;\n        defunc_2_reduce_res_221291 = redout_228402;\n        \n        double x_221329 = defunc_2_reduce_res_221289 *\n               defunc_2_reduce_res_221291;\n        double y_221330 = defunc_2_reduce_res_221290 *\n               defunc_2_reduce_res_221290;\n        double a12_221331 = x_221329 - y_221330;\n        double x_221332 = defunc_2_reduce_res_221289 *\n               defunc_2_reduce_res_221290;\n        double y_221333 = defunc_2_reduce_res_221288 *\n               defunc_2_reduce_res_221291;\n        double b12_221334 = x_221332 - y_221333;\n        double x_221335 = defunc_2_reduce_res_221288 *\n               defunc_2_reduce_res_221290;\n        double y_221336 = defunc_2_reduce_res_221289 *\n               defunc_2_reduce_res_221289;\n        double c12_221337 = x_221335 - y_221336;\n        double x_221",
                   "338 = defunc_2_reduce_res_221287 *\n               defunc_2_reduce_res_221291;\n        double b2_221339 = x_221338 - y_221336;\n        double x_221340 = defunc_2_reduce_res_221288 *\n               defunc_2_reduce_res_221289;\n        double y_221341 = defunc_2_reduce_res_221287 *\n               defunc_2_reduce_res_221290;\n        double c2_221342 = x_221340 - y_221341;\n        double x_221343 = defunc_2_reduce_res_221287 * a12_221331;\n        double y_221344 = defunc_2_reduce_res_221288 * b12_221334;\n        double x_221345 = x_221343 + y_221344;\n        double y_221346 = defunc_2_reduce_res_221289 * c12_221337;\n        double y_221347 = x_221345 + y_221346;\n        double det_221348 = 1.0 / y_221347;\n        double a12_221349 = a12_221331 * det_221348;\n        double b12_221350 = b12_221334 * det_221348;\n        double c12_221351 = c12_221337 * det_221348;\n        double b2_221352 = b2_221339 * det_221348;\n        double c2_221353 = c2_221342 * det_221348;\n        double defunc_2_reduce_res_221354;\n        double defunc_2_reduce_res_221355;\n        double redout_228404;\n        double redout_228405;\n        \n        redout_228404 = 0.0;\n        redout_228405 = 0.0;\n        for (int64_t i_228406 = 0; i_228406 < q_l_203495; i_228406++) {\n            bool cond_221363 = sle64(n_203490, i_228406);\n            int64_t defunc_0_f_res_221364;\n            \n            if (cond_221363) {\n                defunc_0_f_res_221364 = (int64_t) 0;\n            } else {\n                int64_t i_221365 = add64(x_221282, i_228406);\n                int64_t defunc_1_add_res_221366 = add64((int64_t) 1, i_221365);\n                \n                defunc_0_f_res_221364 = defunc_1_add_res_221366;\n            }\n            \n            double defunc_0_f_res_221367;\n            \n            if (cond_221363) {\n                defunc_0_f_res_221367 = 0.0;\n            } else {\n                int64_t i_221368 = add64(x_221282, i_228406);\n                double defunc_0_add_arg_221369;\n             ",
                   "   \n                defunc_0_add_arg_221369 = ((__global\n                                            double *) mem_param_229493)[ctx_param_ext_229488 +\n                                                                        (gtid_221276 *\n                                                                         ctx_param_ext_229489 +\n                                                                         i_221368 *\n                                                                         ctx_param_ext_229491)];\n                defunc_0_f_res_221367 = defunc_0_add_arg_221369;\n            }\n            \n            int64_t binop_p_221370 = sub64(defunc_0_f_res_221364,\n                                           defunc_0_g_res_221286);\n            double defunc_0_f_res_221371 = sitofp_i64_f64(binop_p_221370);\n            double abs_res_221372 = fabs(defunc_0_f_res_221371);\n            double tmp1_221373 = abs_res_221372 / x_221283;\n            double x_221374 = tmp1_221373 * tmp1_221373;\n            double y_221375 = tmp1_221373 * x_221374;\n            double tmp2_221376 = 1.0 - y_221375;\n            double x_221377 = tmp2_221376 * tmp2_221376;\n            double tmp3_221378 = tmp2_221376 * x_221377;\n            double tmp4_221379 = defunc_0_f_res_221367 * tmp3_221378;\n            double defunc_1_f_res_221380 = defunc_0_f_res_221371 * tmp4_221379;\n            double defunc_1_f_res_221381 = defunc_0_f_res_221371 *\n                   defunc_1_f_res_221380;\n            double defunc_0_f_res_221382;\n            \n            if (cond_221363) {\n                defunc_0_f_res_221382 = 0.0;\n            } else {\n                int64_t i_221383 = add64(x_221282, i_228406);\n                double defunc_0_add_arg_221384;\n                \n                defunc_0_add_arg_221384 = ((__global\n                                            double *) mem_230551)[gtid_221276 *\n                                                                  n_203490 +\n                                     ",
                   "                             i_221383];\n                defunc_0_f_res_221382 = defunc_0_add_arg_221384;\n            }\n            \n            double x_221385 = a12_221349 * tmp4_221379;\n            double y_221386 = b12_221350 * defunc_1_f_res_221380;\n            double x_221387 = x_221385 + y_221386;\n            double y_221388 = c12_221351 * defunc_1_f_res_221381;\n            double x_221389 = x_221387 + y_221388;\n            double defunc_9_fit_fun_res_221390 = defunc_0_f_res_221382 *\n                   x_221389;\n            double x_221391 = b12_221350 * tmp4_221379;\n            double y_221392 = b2_221352 * defunc_1_f_res_221380;\n            double x_221393 = x_221391 + y_221392;\n            double y_221394 = c2_221353 * defunc_1_f_res_221381;\n            double x_221395 = x_221393 + y_221394;\n            double defunc_9_slope_fun_res_221396 = defunc_0_f_res_221382 *\n                   x_221395;\n            double defunc_1_op_res_221358 = defunc_9_fit_fun_res_221390 +\n                   redout_228404;\n            double defunc_1_op_res_221361 = defunc_9_slope_fun_res_221396 +\n                   redout_228405;\n            double redout_tmp_235021 = defunc_1_op_res_221358;\n            double redout_tmp_235022 = defunc_1_op_res_221361;\n            \n            redout_228404 = redout_tmp_235021;\n            redout_228405 = redout_tmp_235022;\n        }\n        defunc_2_reduce_res_221354 = redout_228404;\n        defunc_2_reduce_res_221355 = redout_228405;\n        ((__global double *) mem_230774)[gtid_221276 * l_n_m_203643 +\n                                         gtid_221277] =\n            defunc_2_reduce_res_221354;\n        ((__global double *) mem_230778)[gtid_221276 * l_n_m_203643 +\n                                         gtid_221277] =\n            defunc_2_reduce_res_221355;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_221267\n}\n__kernel void mainzisegmap_221479(__global int *global_failure,\n                                  int64_t partitio",
                   "n_sizze_203577,\n                                  int64_t l_n_m_203643, __global\n                                  unsigned char *mem_230783, __global\n                                  unsigned char *mem_230787, __global\n                                  unsigned char *mem_230791, __global\n                                  unsigned char *mem_230795, __global\n                                  unsigned char *mem_230799, __global\n                                  unsigned char *mem_230804, __global\n                                  unsigned char *mem_230808, __global\n                                  unsigned char *mem_230812, __global\n                                  unsigned char *mem_230816, __global\n                                  unsigned char *mem_230820)\n{\n    #define segmap_group_sizze_221470 (mainzisegmap_group_sizze_220968)\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_235151;\n    int32_t local_tid_235152;\n    int64_t group_sizze_235155;\n    int32_t wave_sizze_235154;\n    int32_t group_tid_235153;\n    \n    global_tid_235151 = get_global_id(0);\n    local_tid_235152 = get_local_id(0);\n    group_sizze_235155 = get_local_size(0);\n    wave_sizze_235154 = LOCKSTEP_WIDTH;\n    group_tid_235153 = get_group_id(0);\n    \n    int32_t phys_tid_221479 = global_tid_235151;\n    int64_t global_tid_235156 = sext_i32_i64(group_tid_235153) *\n            segmap_group_sizze_221470 + sext_i32_i64(local_tid_235152);\n    int64_t slice_235157 = l_n_m_203643;\n    int64_t slice_235158 = partition_sizze_203577 * slice_235157;\n    int64_t gtid_221477 = squot64(global_tid_235156, slice_235157);\n    int64_t remnant_235159 = global_tid_235156 - gtid_221477 * slice_235157;\n    int64_t gtid_221478 = remnant_235159;\n    int64_t remnant_235160 = remnant_235159 - gtid_221478;\n    \n    if (slt64(gtid_221477, partition_sizze_203577) && slt64(gtid_221478,\n                ",
                   "                                            l_n_m_203643)) {\n        double defunc_2_reduce_res_221480;\n        \n        defunc_2_reduce_res_221480 = ((__global\n                                       double *) mem_230783)[gtid_221477 *\n                                                             l_n_m_203643 +\n                                                             gtid_221478];\n        \n        double defunc_2_reduce_res_221481;\n        \n        defunc_2_reduce_res_221481 = ((__global\n                                       double *) mem_230787)[gtid_221477 *\n                                                             l_n_m_203643 +\n                                                             gtid_221478];\n        \n        double defunc_2_reduce_res_221482;\n        \n        defunc_2_reduce_res_221482 = ((__global\n                                       double *) mem_230791)[gtid_221477 *\n                                                             l_n_m_203643 +\n                                                             gtid_221478];\n        \n        double defunc_2_reduce_res_221483;\n        \n        defunc_2_reduce_res_221483 = ((__global\n                                       double *) mem_230795)[gtid_221477 *\n                                                             l_n_m_203643 +\n                                                             gtid_221478];\n        \n        double defunc_2_reduce_res_221484;\n        \n        defunc_2_reduce_res_221484 = ((__global\n                                       double *) mem_230799)[gtid_221477 *\n                                                             l_n_m_203643 +\n                                                             gtid_221478];\n        \n        double x_221485 = defunc_2_reduce_res_221482 *\n               defunc_2_reduce_res_221484;\n        double y_221486 = defunc_2_reduce_res_221483 *\n               defunc_2_reduce_res_221483;\n        double a12_221487 = x_221485 - y_221486;\n        double x_22",
                   "1488 = defunc_2_reduce_res_221482 *\n               defunc_2_reduce_res_221483;\n        double y_221489 = defunc_2_reduce_res_221481 *\n               defunc_2_reduce_res_221484;\n        double b12_221490 = x_221488 - y_221489;\n        double x_221491 = defunc_2_reduce_res_221481 *\n               defunc_2_reduce_res_221483;\n        double y_221492 = defunc_2_reduce_res_221482 *\n               defunc_2_reduce_res_221482;\n        double c12_221493 = x_221491 - y_221492;\n        double x_221494 = defunc_2_reduce_res_221480 *\n               defunc_2_reduce_res_221484;\n        double b2_221495 = x_221494 - y_221492;\n        double x_221496 = defunc_2_reduce_res_221481 *\n               defunc_2_reduce_res_221482;\n        double y_221497 = defunc_2_reduce_res_221480 *\n               defunc_2_reduce_res_221483;\n        double c2_221498 = x_221496 - y_221497;\n        double x_221499 = defunc_2_reduce_res_221480 * a12_221487;\n        double y_221500 = defunc_2_reduce_res_221481 * b12_221490;\n        double x_221501 = x_221499 + y_221500;\n        double y_221502 = defunc_2_reduce_res_221482 * c12_221493;\n        double y_221503 = x_221501 + y_221502;\n        double det_221504 = 1.0 / y_221503;\n        double a12_221505 = a12_221487 * det_221504;\n        double b12_221506 = b12_221490 * det_221504;\n        double c12_221507 = c12_221493 * det_221504;\n        double b2_221508 = b2_221495 * det_221504;\n        double c2_221509 = c2_221498 * det_221504;\n        \n        ((__global double *) mem_230804)[gtid_221477 * l_n_m_203643 +\n                                         gtid_221478] = a12_221505;\n        ((__global double *) mem_230808)[gtid_221477 * l_n_m_203643 +\n                                         gtid_221478] = b12_221506;\n        ((__global double *) mem_230812)[gtid_221477 * l_n_m_203643 +\n                                         gtid_221478] = c12_221507;\n        ((__global double *) mem_230816)[gtid_221477 * l_n_m_203643 +\n                                         gtid_",
                   "221478] = b2_221508;\n        ((__global double *) mem_230820)[gtid_221477 * l_n_m_203643 +\n                                         gtid_221478] = c2_221509;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_221470\n}\n__kernel void mainzisegmap_222349(__global int *global_failure,\n                                  int failure_is_an_option, __global\n                                  int64_t *global_failure_args,\n                                  int64_t n_203490, int64_t jump_l_203501,\n                                  int64_t partition_sizze_203577,\n                                  int64_t l_n_m_203643, int64_t i_203670,\n                                  int64_t y_205786, __global\n                                  unsigned char *ext_mem_230907, __global\n                                  unsigned char *ext_mem_230908, __global\n                                  unsigned char *mem_230913)\n{\n    #define segmap_group_sizze_222344 (mainzisegmap_group_sizze_222226)\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_235325;\n    int32_t local_tid_235326;\n    int64_t group_sizze_235329;\n    int32_t wave_sizze_235328;\n    int32_t group_tid_235327;\n    \n    global_tid_235325 = get_global_id(0);\n    local_tid_235326 = get_local_id(0);\n    group_sizze_235329 = get_local_size(0);\n    wave_sizze_235328 = LOCKSTEP_WIDTH;\n    group_tid_235327 = get_group_id(0);\n    \n    int32_t phys_tid_222349 = global_tid_235325;\n    int64_t global_tid_235330 = sext_i32_i64(group_tid_235327) *\n            segmap_group_sizze_222344 + sext_i32_i64(local_tid_235326);\n    int64_t slice_235331 = n_203490;\n    int64_t slice_235332 = partition_sizze_203577 * slice_235331;\n    int64_t gtid_222347 = squot64(global_tid_235330, slice_235331);\n    int64_t remnant_235333 = global_tid_235330 - gtid_222347 * slice_235331;\n    int64_t gtid_222348 = remnant_235333;\n    int64_t remn",
                   "ant_235334 = remnant_235333 - gtid_222348;\n    \n    if (slt64(gtid_222347, partition_sizze_203577) && slt64(gtid_222348,\n                                                            n_203490)) {\n        int64_t m_v_222353 = sdiv64(gtid_222348, jump_l_203501);\n        bool cond_222354 = m_v_222353 == y_205786;\n        int64_t j_222355;\n        \n        if (cond_222354) {\n            int64_t j_t_res_222356 = sub64(m_v_222353, (int64_t) 1);\n            \n            j_222355 = j_t_res_222356;\n        } else {\n            j_222355 = m_v_222353;\n        }\n        \n        int64_t min_arg_222357 = mul64(jump_l_203501, j_222355);\n        int64_t min_res_222358 = smin64(i_203670, min_arg_222357);\n        int64_t defunc_0_m_fun_arg_222359 = add64((int64_t) 1, j_222355);\n        int64_t min_arg_222360 = mul64(jump_l_203501,\n                                       defunc_0_m_fun_arg_222359);\n        int64_t min_res_222361 = smin64(i_203670, min_arg_222360);\n        int64_t i64_arg_222362 = sub64(min_res_222361, min_res_222358);\n        double i64_res_222363 = sitofp_i64_f64(i64_arg_222362);\n        int64_t i64_arg_222364 = sub64(gtid_222348, min_res_222358);\n        double i64_res_222365 = sitofp_i64_f64(i64_arg_222364);\n        double u_222366 = i64_res_222365 / i64_res_222363;\n        double u2_222367 = u_222366 * u_222366;\n        double u3_222368 = u_222366 * u2_222367;\n        double x_222369 = 2.0 * u3_222368;\n        double y_222370 = 3.0 * u2_222367;\n        double x_222371 = x_222369 - y_222370;\n        double x_222372 = 1.0 + x_222371;\n        bool x_222373 = sle64((int64_t) 0, j_222355);\n        bool y_222374 = slt64(j_222355, l_n_m_203643);\n        bool bounds_check_222375 = x_222373 && y_222374;\n        bool index_certs_222376;\n        \n        if (!bounds_check_222375) {\n            {\n                if (atomic_cmpxchg_i32_global(global_failure, -1, 50) == -1) {\n                    global_failure_args[0] = (int64_t) j_222355;\n                    global_failure_args[",
                   "1] = (int64_t) l_n_m_203643;\n                    ;\n                }\n                return;\n            }\n        }\n        \n        double y_222377;\n        \n        y_222377 = ((__global double *) ext_mem_230908)[gtid_222347 *\n                                                        l_n_m_203643 +\n                                                        j_222355];\n        \n        double x_222378 = x_222372 * y_222377;\n        double x_222379 = y_222370 - x_222369;\n        bool x_222380 = sle64((int64_t) 0, defunc_0_m_fun_arg_222359);\n        bool y_222381 = slt64(defunc_0_m_fun_arg_222359, l_n_m_203643);\n        bool bounds_check_222382 = x_222380 && y_222381;\n        bool index_certs_222383;\n        \n        if (!bounds_check_222382) {\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_222359;\n                    global_failure_args[1] = (int64_t) l_n_m_203643;\n                    ;\n                }\n                return;\n            }\n        }\n        \n        double y_222384;\n        \n        y_222384 = ((__global double *) ext_mem_230908)[gtid_222347 *\n                                                        l_n_m_203643 +\n                                                        defunc_0_m_fun_arg_222359];\n        \n        double y_222385 = x_222379 * y_222384;\n        double x_222386 = x_222378 + y_222385;\n        double y_222387 = 2.0 * u2_222367;\n        double x_222388 = u3_222368 - y_222387;\n        double x_222389 = u_222366 + x_222388;\n        double y_222390;\n        \n        y_222390 = ((__global double *) ext_mem_230907)[gtid_222347 *\n                                                        l_n_m_203643 +\n                                                        j_222355];\n        \n        double x_222391 = x_222389 * y_222390;\n        double y_222392 = i64_res_222363 * x_222391;\n        double x_222393 = x_222386 ",
                   "+ y_222392;\n        double x_222394 = u3_222368 - u2_222367;\n        double y_222395;\n        \n        y_222395 = ((__global double *) ext_mem_230907)[gtid_222347 *\n                                                        l_n_m_203643 +\n                                                        defunc_0_m_fun_arg_222359];\n        \n        double x_222396 = x_222394 * y_222395;\n        double y_222397 = i64_res_222363 * x_222396;\n        double defunc_4_interpolate_proc_res_222398 = x_222393 + y_222397;\n        \n        ((__global double *) mem_230913)[gtid_222347 * n_203490 + gtid_222348] =\n            defunc_4_interpolate_proc_res_222398;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_222344\n}\n__kernel void mainzisegmap_222444(__global int *global_failure,\n                                  int64_t n_203490, int64_t n_p_203492,\n                                  int64_t partition_sizze_203577,\n                                  int64_t C_len_203634, int64_t ext_230915,\n                                  __global unsigned char *mem_230500, __global\n                                  unsigned char *ext_mem_230914, __global\n                                  unsigned char *mem_230920)\n{\n    #define segmap_group_sizze_222439 (mainzisegmap_group_sizze_222413)\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_235335;\n    int32_t local_tid_235336;\n    int64_t group_sizze_235339;\n    int32_t wave_sizze_235338;\n    int32_t group_tid_235337;\n    \n    global_tid_235335 = get_global_id(0);\n    local_tid_235336 = get_local_id(0);\n    group_sizze_235339 = get_local_size(0);\n    wave_sizze_235338 = LOCKSTEP_WIDTH;\n    group_tid_235337 = get_group_id(0);\n    \n    int32_t phys_tid_222444 = global_tid_235335;\n    int64_t global_tid_235340 = sext_i32_i64(group_tid_235337) *\n            segmap_group_sizze_222439 + sext_i32_i64(local_tid_235336);\n    int64_",
                   "t slice_235341 = n_203490;\n    int64_t slice_235342 = partition_sizze_203577 * slice_235341;\n    int64_t gtid_222442 = squot64(global_tid_235340, slice_235341);\n    int64_t remnant_235343 = global_tid_235340 - gtid_222442 * slice_235341;\n    int64_t gtid_222443 = remnant_235343;\n    int64_t remnant_235344 = remnant_235343 - gtid_222443;\n    \n    if (slt64(gtid_222442, partition_sizze_203577) && slt64(gtid_222443,\n                                                            n_203490)) {\n        int64_t slice_228328 = n_p_203492 + gtid_222443;\n        double x_222445;\n        \n        x_222445 = ((__global double *) mem_230500)[gtid_222442 * C_len_203634 +\n                                                    slice_228328];\n        \n        double x_222446;\n        \n        x_222446 = ((__global double *) ext_mem_230914)[gtid_222442 *\n                                                        ext_230915 +\n                                                        gtid_222443];\n        \n        double defunc_1_f_res_222447 = x_222445 - x_222446;\n        \n        ((__global double *) mem_230920)[gtid_222442 * n_203490 + gtid_222443] =\n            defunc_1_f_res_222447;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_222439\n}\n__kernel void mainzisegmap_222551(__global int *global_failure,\n                                  int failure_is_an_option, __global\n                                  int64_t *global_failure_args,\n                                  int64_t n_203490, int64_t q_t_203494,\n                                  int64_t jump_t_203500,\n                                  int64_t partition_sizze_203577,\n                                  int64_t t_n_m_203650, int64_t i_203670,\n                                  int64_t num_groups_222547,\n                                  int64_t num_threads_232182, __global\n                                  unsigned char *mem_229161, __global\n                                  unsigned char *ext_mem_229196, __global\n          ",
                   "                        unsigned char *mem_230927, __global\n                                  unsigned char *mem_230930, __global\n                                  unsigned char *mem_230933, __global\n                                  unsigned char *mem_230936, __global\n                                  unsigned char *mem_230939, __global\n                                  unsigned char *mem_231003, __global\n                                  unsigned char *color_232040, __global\n                                  unsigned char *color_232041, __global\n                                  unsigned char *color_232042)\n{\n    #define segmap_group_sizze_222546 (mainzisegmap_group_sizze_222454)\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_235360;\n    int32_t local_tid_235361;\n    int64_t group_sizze_235364;\n    int32_t wave_sizze_235363;\n    int32_t group_tid_235362;\n    \n    global_tid_235360 = get_global_id(0);\n    local_tid_235361 = get_local_id(0);\n    group_sizze_235364 = get_local_size(0);\n    wave_sizze_235363 = LOCKSTEP_WIDTH;\n    group_tid_235362 = get_group_id(0);\n    \n    int32_t phys_tid_222551 = global_tid_235360;\n    int32_t phys_group_id_235365;\n    \n    phys_group_id_235365 = get_group_id(0);\n    for (int32_t i_235366 = 0; i_235366 <\n         sdiv_up32(sext_i64_i32(sdiv_up64(partition_sizze_203577,\n                                          segmap_group_sizze_222546)) -\n                   phys_group_id_235365, sext_i64_i32(num_groups_222547));\n         i_235366++) {\n        int32_t virt_group_id_235367 = phys_group_id_235365 + i_235366 *\n                sext_i64_i32(num_groups_222547);\n        int64_t global_tid_235368 = sext_i32_i64(virt_group_id_235367)",
                   " *\n                segmap_group_sizze_222546 + sext_i32_i64(local_tid_235361);\n        int64_t slice_235369 = partition_sizze_203577;\n        int64_t gtid_222550 = global_tid_235368;\n        int64_t remnant_235370 = global_tid_235368 - gtid_222550;\n        \n        if (slt64(gtid_222550, partition_sizze_203577)) {\n            int64_t x_222556;\n            \n            x_222556 = ((__global int64_t *) ext_mem_229196)[gtid_222550];\n            for (int64_t i_229005 = 0; i_229005 < n_203490; i_229005++) {\n                double x_222560;\n                \n                x_222560 = ((__global double *) mem_229161)[gtid_222550 *\n                                                            n_203490 +\n                                                            i_229005];\n                \n                double x_222561;\n                \n                x_222561 = ((__global double *) mem_230927)[i_229005 *\n                                                            partition_sizze_203577 +\n                                                            gtid_222550];\n                \n                double defunc_1_f_res_222562 = x_222560 - x_222561;\n                \n                ((__global double *) color_232040)[phys_tid_222551 + i_229005 *\n                                                   num_threads_232182] =\n                    defunc_1_f_res_222562;\n            }\n            for (int64_t i_229011 = 0; i_229011 < n_203490; i_229011++) {\n                int64_t x_222565;\n                \n                x_222565 = ((__global int64_t *) mem_230930)[i_229011 *\n                                                             partition_sizze_203577 +\n                                                             gtid_222550];\n                \n                bool cond_222566 = sle64((int64_t) 0, x_222565);\n                double defunc_0_f_res_222567;\n                \n                if (cond_222566) {\n                    bool y_222568 = slt64(x_222565, n_203490);\n                ",
                   "    bool bounds_check_222569 = cond_222566 && y_222568;\n                    bool index_certs_222570;\n                    \n                    if (!bounds_check_222569) {\n                        {\n                            if (atomic_cmpxchg_i32_global(global_failure, -1,\n                                                          52) == -1) {\n                                global_failure_args[0] = (int64_t) x_222565;\n                                global_failure_args[1] = (int64_t) n_203490;\n                                ;\n                            }\n                            local_failure = true;\n                            goto error_0;\n                        }\n                    }\n                    \n                    double defunc_0_f_res_t_res_222571;\n                    \n                    defunc_0_f_res_t_res_222571 = ((__global\n                                                    double *) color_232040)[phys_tid_222551 +\n                                                                            x_222565 *\n                                                                            num_threads_232182];\n                    defunc_0_f_res_222567 = defunc_0_f_res_t_res_222571;\n                } else {\n                    defunc_0_f_res_222567 = 0.0;\n                }\n                \n                double defunc_0_f_res_222572;\n                \n                if (cond_222566) {\n                    bool y_222573 = slt64(x_222565, n_203490);\n                    bool bounds_check_222574 = cond_222566 && y_222573;\n                    bool index_certs_222575;\n                    \n                    if (!bounds_check_222574) {\n                        {\n                            if (atomic_cmpxchg_i32_global(global_failure, -1,\n                                                          53) == -1) {\n                                global_failure_args[0] = (int64_t) x_222565;\n                                global_failure_args[1] = (int64_t) n_203490;\n  ",
                   "                              ;\n                            }\n                            local_failure = true;\n                            goto error_0;\n                        }\n                    }\n                    \n                    double defunc_0_f_res_t_res_222576;\n                    \n                    defunc_0_f_res_t_res_222576 = ((__global\n                                                    double *) mem_230939)[x_222565 *\n                                                                          partition_sizze_203577 +\n                                                                          gtid_222550];\n                    defunc_0_f_res_222572 = defunc_0_f_res_t_res_222576;\n                } else {\n                    defunc_0_f_res_222572 = 0.0;\n                }\n                ((__global double *) color_232042)[phys_tid_222551 + i_229011 *\n                                                   num_threads_232182] =\n                    defunc_0_f_res_222572;\n                ((__global double *) color_232041)[phys_tid_222551 + i_229011 *\n                                                   num_threads_232182] =\n                    defunc_0_f_res_222567;\n            }\n            for (int64_t i_229016 = 0; i_229016 < t_n_m_203650; i_229016++) {\n                int64_t x_222579;\n                \n                x_222579 = ((__global int64_t *) mem_230933)[i_229016 *\n                                                             partition_sizze_203577 +\n                                                             gtid_222550];\n                \n                double x_222580;\n                \n                x_222580 = ((__global double *) mem_230936)[i_229016 *\n                                                            partition_sizze_203577 +\n                                                            gtid_222550];\n                \n                int64_t min_arg_222581 = mul64(jump_t_203500, i_229016);\n                int64_t min_res_222582 = smin64",
                   "(i_203670, min_arg_222581);\n                int64_t defunc_0_g_res_222583 = add64((int64_t) 1,\n                                                      min_res_222582);\n                double defunc_2_reduce_res_222584;\n                double redout_228222 = 0.0;\n                \n                for (int64_t i_228223 = 0; i_228223 < q_t_203494; i_228223++) {\n                    bool cond_222589 = sle64(x_222556, i_228223);\n                    int64_t defunc_0_f_res_222590;\n                    \n                    if (cond_222589) {\n                        defunc_0_f_res_222590 = (int64_t) 0;\n                    } else {\n                        int64_t i_222591 = add64(x_222579, i_228223);\n                        int64_t defunc_0_add_arg_222592;\n                        \n                        defunc_0_add_arg_222592 = ((__global\n                                                    int64_t *) mem_230930)[i_222591 *\n                                                                           partition_sizze_203577 +\n                                                                           gtid_222550];\n                        \n                        int64_t defunc_1_add_res_222593 = add64((int64_t) 1,\n                                                                defunc_0_add_arg_222592);\n                        \n                        defunc_0_f_res_222590 = defunc_1_add_res_222593;\n                    }\n                    \n                    double defunc_0_f_res_222594;\n                    \n                    if (cond_222589) {\n                        defunc_0_f_res_222594 = 0.0;\n                    } else {\n                        int64_t i_222595 = add64(x_222579, i_228223);\n                        double defunc_0_add_arg_222596;\n                        \n                        defunc_0_add_arg_222596 = ((__global\n                                                    double *) color_232042)[phys_tid_222551 +\n                                                        ",
                   "                    i_222595 *\n                                                                            num_threads_232182];\n                        defunc_0_f_res_222594 = defunc_0_add_arg_222596;\n                    }\n                    \n                    int64_t binop_p_222597 = sub64(defunc_0_f_res_222590,\n                                                   defunc_0_g_res_222583);\n                    double defunc_0_f_res_222598 =\n                           sitofp_i64_f64(binop_p_222597);\n                    double abs_res_222599 = fabs(defunc_0_f_res_222598);\n                    double tmp1_222600 = abs_res_222599 / x_222580;\n                    double x_222601 = tmp1_222600 * tmp1_222600;\n                    double y_222602 = tmp1_222600 * x_222601;\n                    double tmp2_222603 = 1.0 - y_222602;\n                    double x_222604 = tmp2_222603 * tmp2_222603;\n                    double tmp3_222605 = tmp2_222603 * x_222604;\n                    double w_j_222606 = defunc_0_f_res_222594 * tmp3_222605;\n                    double defunc_1_op_res_222587 = w_j_222606 + redout_228222;\n                    double redout_tmp_235375 = defunc_1_op_res_222587;\n                    \n                    redout_228222 = redout_tmp_235375;\n                }\n                defunc_2_reduce_res_222584 = redout_228222;\n                \n                double a0_222607 = 1.0 / defunc_2_reduce_res_222584;\n                double defunc_2_reduce_res_222608;\n                double redout_228224 = 0.0;\n                \n                for (int64_t i_228225 = 0; i_228225 < q_t_203494; i_228225++) {\n                    bool cond_222613 = sle64(x_222556, i_228225);\n                    int64_t defunc_0_f_res_222614;\n                    \n                    if (cond_222613) {\n                        defunc_0_f_res_222614 = (int64_t) 0;\n                    } else {\n                        int64_t i_222615 = add64(x_222579, i_228225);\n                        int64_t defunc_0_add_",
                   "arg_222616;\n                        \n                        defunc_0_add_arg_222616 = ((__global\n                                                    int64_t *) mem_230930)[i_222615 *\n                                                                           partition_sizze_203577 +\n                                                                           gtid_222550];\n                        \n                        int64_t defunc_1_add_res_222617 = add64((int64_t) 1,\n                                                                defunc_0_add_arg_222616);\n                        \n                        defunc_0_f_res_222614 = defunc_1_add_res_222617;\n                    }\n                    \n                    double defunc_0_f_res_222618;\n                    \n                    if (cond_222613) {\n                        defunc_0_f_res_222618 = 0.0;\n                    } else {\n                        int64_t i_222619 = add64(x_222579, i_228225);\n                        double defunc_0_add_arg_222620;\n                        \n                        defunc_0_add_arg_222620 = ((__global\n                                                    double *) color_232042)[phys_tid_222551 +\n                                                                            i_222619 *\n                                                                            num_threads_232182];\n                        defunc_0_f_res_222618 = defunc_0_add_arg_222620;\n                    }\n                    \n                    int64_t binop_p_222621 = sub64(defunc_0_f_res_222614,\n                                                   defunc_0_g_res_222583);\n                    double defunc_0_f_res_222622 =\n                           sitofp_i64_f64(binop_p_222621);\n                    double abs_res_222623 = fabs(defunc_0_f_res_222622);\n                    double tmp1_222624 = abs_res_222623 / x_222580;\n                    double x_222625 = tmp1_222624 * tmp1_222624;\n                    double y_22",
                   "2626 = tmp1_222624 * x_222625;\n                    double tmp2_222627 = 1.0 - y_222626;\n                    double x_222628 = tmp2_222627 * tmp2_222627;\n                    double tmp3_222629 = tmp2_222627 * x_222628;\n                    double tmp4_222630 = defunc_0_f_res_222618 * tmp3_222629;\n                    double defunc_0_f_res_222631;\n                    \n                    if (cond_222613) {\n                        defunc_0_f_res_222631 = 0.0;\n                    } else {\n                        int64_t i_222632 = add64(x_222579, i_228225);\n                        double defunc_0_add_arg_222633;\n                        \n                        defunc_0_add_arg_222633 = ((__global\n                                                    double *) color_232041)[phys_tid_222551 +\n                                                                            i_222632 *\n                                                                            num_threads_232182];\n                        defunc_0_f_res_222631 = defunc_0_add_arg_222633;\n                    }\n                    \n                    double x_222634 = a0_222607 * tmp4_222630;\n                    double defunc_9_fit_fun_res_222635 = defunc_0_f_res_222631 *\n                           x_222634;\n                    double defunc_1_op_res_222611 =\n                           defunc_9_fit_fun_res_222635 + redout_228224;\n                    double redout_tmp_235376 = defunc_1_op_res_222611;\n                    \n                    redout_228224 = redout_tmp_235376;\n                }\n                defunc_2_reduce_res_222608 = redout_228224;\n                ((__global double *) color_232040)[phys_tid_222551 + i_229016 *\n                                                   num_threads_232182] =\n                    defunc_2_reduce_res_222608;\n            }\n            for (int64_t i_235377 = 0; i_235377 < t_n_m_203650; i_235377++) {\n                double tmp_235378;\n                \n                tmp_235378 = ((",
                   "__global\n                               double *) color_232040)[phys_tid_222551 +\n                                                       i_235377 *\n                                                       num_threads_232182];\n                ((__global double *) mem_231003)[gtid_222550 + i_235377 *\n                                                 partition_sizze_203577] =\n                    tmp_235378;\n            }\n        }\n        barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_222546\n}\n__kernel void mainzisegmap_223067(__global int *global_failure,\n                                  int64_t n_203490,\n                                  int64_t partition_sizze_203577, __global\n                                  unsigned char *mem_229161, __global\n                                  unsigned char *mem_230920, __global\n                                  unsigned char *mem_231008)\n{\n    #define segmap_group_sizze_223062 (mainzisegmap_group_sizze_223036)\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_235379;\n    int32_t local_tid_235380;\n    int64_t group_sizze_235383;\n    int32_t wave_sizze_235382;\n    int32_t group_tid_235381;\n    \n    global_tid_235379 = get_global_id(0);\n    local_tid_235380 = get_local_id(0);\n    group_sizze_235383 = get_local_size(0);\n    wave_sizze_235382 = LOCKSTEP_WIDTH;\n    group_tid_235381 = get_group_id(0);\n    \n    int32_t phys_tid_223067 = global_tid_235379;\n    int64_t global_tid_235384 = sext_i32_i64(group_tid_235381) *\n            segmap_group_sizze_223062 + sext_i32_i64(local_tid_235380);\n    int64_t slice_235385 = n_203490;\n    int64_t slice_235386 = partition_sizze_203577 * slice_235385;\n    int64_t gtid_223065 = squot64(global_tid_235384, slice_235385);\n    int64_t remnant_235387 = global_tid_235384 - gtid_223065 * slice_235385;\n    int64_t gtid",
                   "_223066 = remnant_235387;\n    int64_t remnant_235388 = remnant_235387 - gtid_223066;\n    \n    if (slt64(gtid_223065, partition_sizze_203577) && slt64(gtid_223066,\n                                                            n_203490)) {\n        double x_223068;\n        \n        x_223068 = ((__global double *) mem_229161)[gtid_223065 * n_203490 +\n                                                    gtid_223066];\n        \n        double x_223069;\n        \n        x_223069 = ((__global double *) mem_230920)[gtid_223065 * n_203490 +\n                                                    gtid_223066];\n        \n        double defunc_1_f_res_223070 = x_223068 - x_223069;\n        \n        ((__global double *) mem_231008)[gtid_223065 * n_203490 + gtid_223066] =\n            defunc_1_f_res_223070;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_223062\n}\n__kernel void mainzisegmap_223084(__global int *global_failure,\n                                  int failure_is_an_option, __global\n                                  int64_t *global_failure_args,\n                                  int64_t n_203490,\n                                  int64_t partition_sizze_203577,\n                                  int64_t ctx_param_ext_229488,\n                                  int64_t ctx_param_ext_229489,\n                                  int64_t ctx_param_ext_229491, __global\n                                  unsigned char *ext_mem_229197, __global\n                                  unsigned char *mem_param_229493, __global\n                                  unsigned char *mem_231008, __global\n                                  unsigned char *mem_231013, __global\n                                  unsigned char *mem_231017)\n{\n    #define segmap_group_sizze_223078 (mainzisegmap_group_sizze_222980)\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_235389;\n    int32_t",
                   " local_tid_235390;\n    int64_t group_sizze_235393;\n    int32_t wave_sizze_235392;\n    int32_t group_tid_235391;\n    \n    global_tid_235389 = get_global_id(0);\n    local_tid_235390 = get_local_id(0);\n    group_sizze_235393 = get_local_size(0);\n    wave_sizze_235392 = LOCKSTEP_WIDTH;\n    group_tid_235391 = get_group_id(0);\n    \n    int32_t phys_tid_223084 = global_tid_235389;\n    int64_t global_tid_235394 = sext_i32_i64(group_tid_235391) *\n            segmap_group_sizze_223078 + sext_i32_i64(local_tid_235390);\n    int64_t slice_235395 = n_203490;\n    int64_t slice_235396 = partition_sizze_203577 * slice_235395;\n    int64_t gtid_223082 = squot64(global_tid_235394, slice_235395);\n    int64_t remnant_235397 = global_tid_235394 - gtid_223082 * slice_235395;\n    int64_t gtid_223083 = remnant_235397;\n    int64_t remnant_235398 = remnant_235397 - gtid_223083;\n    \n    if (slt64(gtid_223082, partition_sizze_203577) && slt64(gtid_223083,\n                                                            n_203490)) {\n        int64_t x_223087;\n        \n        x_223087 = ((__global int64_t *) ext_mem_229197)[gtid_223082 *\n                                                         n_203490 +\n                                                         gtid_223083];\n        \n        bool cond_223088 = sle64((int64_t) 0, x_223087);\n        double defunc_0_f_res_223089;\n        \n        if (cond_223088) {\n            bool y_223090 = slt64(x_223087, n_203490);\n            bool bounds_check_223091 = cond_223088 && y_223090;\n            bool index_certs_223092;\n            \n            if (!bounds_check_223091) {\n                {\n                    if (atomic_cmpxchg_i32_global(global_failure, -1, 54) ==\n                        -1) {\n                        global_failure_args[0] = (int64_t) x_223087;\n                        global_failure_args[1] = (int64_t) n_203490;\n                        ;\n                    }\n                    return;\n                }\n            }\n            \n        ",
                   "    double defunc_0_f_res_t_res_223093;\n            \n            defunc_0_f_res_t_res_223093 = ((__global\n                                            double *) mem_231008)[gtid_223082 *\n                                                                  n_203490 +\n                                                                  x_223087];\n            defunc_0_f_res_223089 = defunc_0_f_res_t_res_223093;\n        } else {\n            defunc_0_f_res_223089 = 0.0;\n        }\n        \n        double defunc_0_f_res_223094;\n        \n        if (cond_223088) {\n            bool y_223095 = slt64(x_223087, n_203490);\n            bool bounds_check_223096 = cond_223088 && y_223095;\n            bool index_certs_223097;\n            \n            if (!bounds_check_223096) {\n                {\n                    if (atomic_cmpxchg_i32_global(global_failure, -1, 55) ==\n                        -1) {\n                        global_failure_args[0] = (int64_t) x_223087;\n                        global_failure_args[1] = (int64_t) n_203490;\n                        ;\n                    }\n                    return;\n                }\n            }\n            \n            double defunc_0_f_res_t_res_223098;\n            \n            defunc_0_f_res_t_res_223098 = ((__global\n                                            double *) mem_param_229493)[ctx_param_ext_229488 +\n                                                                        (gtid_223082 *\n                                                                         ctx_param_ext_229489 +\n                                                                         x_223087 *\n                                                                         ctx_param_ext_229491)];\n            defunc_0_f_res_223094 = defunc_0_f_res_t_res_223098;\n        } else {\n            defunc_0_f_res_223094 = 0.0;\n        }\n        ((__global double *) mem_231013)[gtid_223082 * n_203490 + gtid_223083] =\n            defunc_0_f_res_223094;\n        ((__global double *) ",
                   "mem_231017)[gtid_223082 * n_203490 + gtid_223083] =\n            defunc_0_f_res_223089;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_223078\n}\n__kernel void mainzisegmap_223112(__global int *global_failure,\n                                  int64_t n_203490, int64_t q_t_203494,\n                                  int64_t jump_t_203500,\n                                  int64_t partition_sizze_203577,\n                                  int64_t t_n_m_203650, int64_t i_203670,\n                                  __global unsigned char *ext_mem_229196,\n                                  __global unsigned char *ext_mem_229197,\n                                  __global unsigned char *ext_mem_229460,\n                                  __global unsigned char *ext_mem_229461,\n                                  __global unsigned char *mem_231013, __global\n                                  unsigned char *mem_231017, __global\n                                  unsigned char *mem_231022)\n{\n    #define segmap_group_sizze_223103 (mainzisegmap_group_sizze_222643)\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_235399;\n    int32_t local_tid_235400;\n    int64_t group_sizze_235403;\n    int32_t wave_sizze_235402;\n    int32_t group_tid_235401;\n    \n    global_tid_235399 = get_global_id(0);\n    local_tid_235400 = get_local_id(0);\n    group_sizze_235403 = get_local_size(0);\n    wave_sizze_235402 = LOCKSTEP_WIDTH;\n    group_tid_235401 = get_group_id(0);\n    \n    int32_t phys_tid_223112 = global_tid_235399;\n    int64_t global_tid_235404 = sext_i32_i64(group_tid_235401) *\n            segmap_group_sizze_223103 + sext_i32_i64(local_tid_235400);\n    int64_t slice_235405 = t_n_m_203650;\n    int64_t slice_235406 = partition_sizze_203577 * slice_235405;\n    int64_t gtid_223110 = squot64(global_tid_235404, slice_235405);\n    int64_t remnant_235407 = global_tid_23540",
                   "4 - gtid_223110 * slice_235405;\n    int64_t gtid_223111 = remnant_235407;\n    int64_t remnant_235408 = remnant_235407 - gtid_223111;\n    \n    if (slt64(gtid_223110, partition_sizze_203577) && slt64(gtid_223111,\n                                                            t_n_m_203650)) {\n        int64_t x_223114;\n        \n        x_223114 = ((__global int64_t *) ext_mem_229196)[gtid_223110];\n        \n        int64_t x_223118;\n        \n        x_223118 = ((__global int64_t *) ext_mem_229461)[gtid_223110 *\n                                                         t_n_m_203650 +\n                                                         gtid_223111];\n        \n        double x_223119;\n        \n        x_223119 = ((__global double *) ext_mem_229460)[gtid_223110 *\n                                                        t_n_m_203650 +\n                                                        gtid_223111];\n        \n        int64_t min_arg_223120 = mul64(jump_t_203500, gtid_223111);\n        int64_t min_res_223121 = smin64(i_203670, min_arg_223120);\n        int64_t defunc_0_g_res_223122 = add64((int64_t) 1, min_res_223121);\n        double defunc_2_reduce_res_223123;\n        double redout_228230 = 0.0;\n        \n        for (int64_t i_228231 = 0; i_228231 < q_t_203494; i_228231++) {\n            bool cond_223128 = sle64(x_223114, i_228231);\n            int64_t defunc_0_f_res_223129;\n            \n            if (cond_223128) {\n                defunc_0_f_res_223129 = (int64_t) 0;\n            } else {\n                int64_t i_223130 = add64(x_223118, i_228231);\n                int64_t defunc_0_add_arg_223131;\n                \n                defunc_0_add_arg_223131 = ((__global\n                                            int64_t *) ext_mem_229197)[gtid_223110 *\n                                                                       n_203490 +\n                                                                       i_223130];\n                \n                int64_t defunc_1_add_res_223132 ",
                   "= add64((int64_t) 1,\n                                                        defunc_0_add_arg_223131);\n                \n                defunc_0_f_res_223129 = defunc_1_add_res_223132;\n            }\n            \n            double defunc_0_f_res_223133;\n            \n            if (cond_223128) {\n                defunc_0_f_res_223133 = 0.0;\n            } else {\n                int64_t i_223134 = add64(x_223118, i_228231);\n                double defunc_0_add_arg_223135;\n                \n                defunc_0_add_arg_223135 = ((__global\n                                            double *) mem_231013)[gtid_223110 *\n                                                                  n_203490 +\n                                                                  i_223134];\n                defunc_0_f_res_223133 = defunc_0_add_arg_223135;\n            }\n            \n            int64_t binop_p_223136 = sub64(defunc_0_f_res_223129,\n                                           defunc_0_g_res_223122);\n            double defunc_0_f_res_223137 = sitofp_i64_f64(binop_p_223136);\n            double abs_res_223138 = fabs(defunc_0_f_res_223137);\n            double tmp1_223139 = abs_res_223138 / x_223119;\n            double x_223140 = tmp1_223139 * tmp1_223139;\n            double y_223141 = tmp1_223139 * x_223140;\n            double tmp2_223142 = 1.0 - y_223141;\n            double x_223143 = tmp2_223142 * tmp2_223142;\n            double tmp3_223144 = tmp2_223142 * x_223143;\n            double w_j_223145 = defunc_0_f_res_223133 * tmp3_223144;\n            double defunc_1_op_res_223126 = w_j_223145 + redout_228230;\n            double redout_tmp_235409 = defunc_1_op_res_223126;\n            \n            redout_228230 = redout_tmp_235409;\n        }\n        defunc_2_reduce_res_223123 = redout_228230;\n        \n        double a0_223146 = 1.0 / defunc_2_reduce_res_223123;\n        double defunc_2_reduce_res_223147;\n        double redout_228232 = 0.0;\n        \n        for (int64_t i_228233 = 0; i_22",
                   "8233 < q_t_203494; i_228233++) {\n            bool cond_223152 = sle64(x_223114, i_228233);\n            int64_t defunc_0_f_res_223153;\n            \n            if (cond_223152) {\n                defunc_0_f_res_223153 = (int64_t) 0;\n            } else {\n                int64_t i_223154 = add64(x_223118, i_228233);\n                int64_t defunc_0_add_arg_223155;\n                \n                defunc_0_add_arg_223155 = ((__global\n                                            int64_t *) ext_mem_229197)[gtid_223110 *\n                                                                       n_203490 +\n                                                                       i_223154];\n                \n                int64_t defunc_1_add_res_223156 = add64((int64_t) 1,\n                                                        defunc_0_add_arg_223155);\n                \n                defunc_0_f_res_223153 = defunc_1_add_res_223156;\n            }\n            \n            double defunc_0_f_res_223157;\n            \n            if (cond_223152) {\n                defunc_0_f_res_223157 = 0.0;\n            } else {\n                int64_t i_223158 = add64(x_223118, i_228233);\n                double defunc_0_add_arg_223159;\n                \n                defunc_0_add_arg_223159 = ((__global\n                                            double *) mem_231013)[gtid_223110 *\n                                                                  n_203490 +\n                                                                  i_223158];\n                defunc_0_f_res_223157 = defunc_0_add_arg_223159;\n            }\n            \n            int64_t binop_p_223160 = sub64(defunc_0_f_res_223153,\n                                           defunc_0_g_res_223122);\n            double defunc_0_f_res_223161 = sitofp_i64_f64(binop_p_223160);\n            double abs_res_223162 = fabs(defunc_0_f_res_223161);\n            double tmp1_223163 = abs_res_223162 / x_223119;\n            double x_223164 = tmp1_223163 * tmp1_2",
                   "23163;\n            double y_223165 = tmp1_223163 * x_223164;\n            double tmp2_223166 = 1.0 - y_223165;\n            double x_223167 = tmp2_223166 * tmp2_223166;\n            double tmp3_223168 = tmp2_223166 * x_223167;\n            double tmp4_223169 = defunc_0_f_res_223157 * tmp3_223168;\n            double defunc_0_f_res_223170;\n            \n            if (cond_223152) {\n                defunc_0_f_res_223170 = 0.0;\n            } else {\n                int64_t i_223171 = add64(x_223118, i_228233);\n                double defunc_0_add_arg_223172;\n                \n                defunc_0_add_arg_223172 = ((__global\n                                            double *) mem_231017)[gtid_223110 *\n                                                                  n_203490 +\n                                                                  i_223171];\n                defunc_0_f_res_223170 = defunc_0_add_arg_223172;\n            }\n            \n            double x_223173 = a0_223146 * tmp4_223169;\n            double defunc_9_fit_fun_res_223174 = defunc_0_f_res_223170 *\n                   x_223173;\n            double defunc_1_op_res_223150 = defunc_9_fit_fun_res_223174 +\n                   redout_228232;\n            double redout_tmp_235410 = defunc_1_op_res_223150;\n            \n            redout_228232 = redout_tmp_235410;\n        }\n        defunc_2_reduce_res_223147 = redout_228232;\n        ((__global double *) mem_231022)[gtid_223110 * t_n_m_203650 +\n                                         gtid_223111] =\n            defunc_2_reduce_res_223147;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_223103\n}\n__kernel void mainzisegmap_223236(__global int *global_failure,\n                                  int64_t partition_sizze_203577,\n                                  int64_t t_n_m_203650, __global\n                                  unsigned char *mem_231027, __global\n                                  unsigned char *mem_231032)\n{\n    #define segmap_group_sizze_",
                   "223231 (mainzisegmap_group_sizze_222781)\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_235483;\n    int32_t local_tid_235484;\n    int64_t group_sizze_235487;\n    int32_t wave_sizze_235486;\n    int32_t group_tid_235485;\n    \n    global_tid_235483 = get_global_id(0);\n    local_tid_235484 = get_local_id(0);\n    group_sizze_235487 = get_local_size(0);\n    wave_sizze_235486 = LOCKSTEP_WIDTH;\n    group_tid_235485 = get_group_id(0);\n    \n    int32_t phys_tid_223236 = global_tid_235483;\n    int64_t global_tid_235488 = sext_i32_i64(group_tid_235485) *\n            segmap_group_sizze_223231 + sext_i32_i64(local_tid_235484);\n    int64_t slice_235489 = t_n_m_203650;\n    int64_t slice_235490 = partition_sizze_203577 * slice_235489;\n    int64_t gtid_223234 = squot64(global_tid_235488, slice_235489);\n    int64_t remnant_235491 = global_tid_235488 - gtid_223234 * slice_235489;\n    int64_t gtid_223235 = remnant_235491;\n    int64_t remnant_235492 = remnant_235491 - gtid_223235;\n    \n    if (slt64(gtid_223234, partition_sizze_203577) && slt64(gtid_223235,\n                                                            t_n_m_203650)) {\n        double defunc_2_reduce_res_223237;\n        \n        defunc_2_reduce_res_223237 = ((__global\n                                       double *) mem_231027)[gtid_223234 *\n                                                             t_n_m_203650 +\n                                                             gtid_223235];\n        \n        double a0_223238 = 1.0 / defunc_2_reduce_res_223237;\n        \n        ((__global double *) mem_231032)[gtid_223234 * t_n_m_203650 +\n                                         gtid_223235] = a0_223238;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_223231\n}\n__kernel void mainzisegmap_223423(__global int *global_failure,\n                                  int failure_is_an_option, __glo",
                   "bal\n                                  int64_t *global_failure_args,\n                                  int64_t n_203490, int64_t q_t_203494,\n                                  int64_t jump_t_203500,\n                                  int64_t partition_sizze_203577,\n                                  int64_t t_n_m_203650, int64_t i_203670,\n                                  int64_t num_groups_223418,\n                                  int64_t num_threads_232192, __global\n                                  unsigned char *mem_229161, __global\n                                  unsigned char *ext_mem_229196, __global\n                                  unsigned char *mem_231047, __global\n                                  unsigned char *mem_231050, __global\n                                  unsigned char *mem_231053, __global\n                                  unsigned char *mem_231056, __global\n                                  unsigned char *mem_231059, __global\n                                  unsigned char *mem_231138, __global\n                                  unsigned char *mem_231141, __global\n                                  unsigned char *color_232044, __global\n                                  unsigned char *color_232045, __global\n                                  unsigned char *color_232046, __global\n                                  unsigned char *color_232047)\n{\n    #define segmap_group_sizze_223417 (mainzisegmap_group_sizze_223296)\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_235582;\n    int32_t local_tid_235583;\n    int64_t group_sizze_235586;\n    int32_t wave_sizze_235585;\n    int32_t group_tid_235584;\n    \n    global_tid_235582 = get_global_id(0);\n    lo",
                   "cal_tid_235583 = get_local_id(0);\n    group_sizze_235586 = get_local_size(0);\n    wave_sizze_235585 = LOCKSTEP_WIDTH;\n    group_tid_235584 = get_group_id(0);\n    \n    int32_t phys_tid_223423 = global_tid_235582;\n    int32_t phys_group_id_235587;\n    \n    phys_group_id_235587 = get_group_id(0);\n    for (int32_t i_235588 = 0; i_235588 <\n         sdiv_up32(sext_i64_i32(sdiv_up64(partition_sizze_203577,\n                                          segmap_group_sizze_223417)) -\n                   phys_group_id_235587, sext_i64_i32(num_groups_223418));\n         i_235588++) {\n        int32_t virt_group_id_235589 = phys_group_id_235587 + i_235588 *\n                sext_i64_i32(num_groups_223418);\n        int64_t global_tid_235590 = sext_i32_i64(virt_group_id_235589) *\n                segmap_group_sizze_223417 + sext_i32_i64(local_tid_235583);\n        int64_t slice_235591 = partition_sizze_203577;\n        int64_t gtid_223422 = global_tid_235590;\n        int64_t remnant_235592 = global_tid_235590 - gtid_223422;\n        \n        if (slt64(gtid_223422, partition_sizze_203577)) {\n            int64_t x_223428;\n            \n            x_223428 = ((__global int64_t *) ext_mem_229196)[gtid_223422];\n            for (int64_t i_229020 = 0; i_229020 < n_203490; i_229020++) {\n                double x_223432;\n                \n                x_223432 = ((__global double *) mem_229161)[gtid_223422 *\n                                                            n_203490 +\n                                                            i_229020];\n                \n                double x_223433;\n                \n                x_223433 = ((__global double *) mem_231047)[i_229020 *\n                                                            partition_sizze_203577 +\n                                                            gtid_223422];\n                \n                double defunc_1_f_res_223434 = x_223432 - x_223433;\n                \n                ((__global double *) color_232044)[phys_tid_22",
                   "3423 + i_229020 *\n                                                   num_threads_232192] =\n                    defunc_1_f_res_223434;\n            }\n            for (int64_t i_229026 = 0; i_229026 < n_203490; i_229026++) {\n                int64_t x_223437;\n                \n                x_223437 = ((__global int64_t *) mem_231050)[i_229026 *\n                                                             partition_sizze_203577 +\n                                                             gtid_223422];\n                \n                bool cond_223438 = sle64((int64_t) 0, x_223437);\n                double defunc_0_f_res_223439;\n                \n                if (cond_223438) {\n                    bool y_223440 = slt64(x_223437, n_203490);\n                    bool bounds_check_223441 = cond_223438 && y_223440;\n                    bool index_certs_223442;\n                    \n                    if (!bounds_check_223441) {\n                        {\n                            if (atomic_cmpxchg_i32_global(global_failure, -1,\n                                                          56) == -1) {\n                                global_failure_args[0] = (int64_t) x_223437;\n                                global_failure_args[1] = (int64_t) n_203490;\n                                ;\n                            }\n                            local_failure = true;\n                            goto error_0;\n                        }\n                    }\n                    \n                    double defunc_0_f_res_t_res_223443;\n                    \n                    defunc_0_f_res_t_res_223443 = ((__global\n                                                    double *) color_232044)[phys_tid_223423 +\n                                                                            x_223437 *\n                                                                            num_threads_232192];\n                    defunc_0_f_res_223439 = defunc_0_f_res_t_res_223443;\n                } else",
                   " {\n                    defunc_0_f_res_223439 = 0.0;\n                }\n                \n                double defunc_0_f_res_223444;\n                \n                if (cond_223438) {\n                    bool y_223445 = slt64(x_223437, n_203490);\n                    bool bounds_check_223446 = cond_223438 && y_223445;\n                    bool index_certs_223447;\n                    \n                    if (!bounds_check_223446) {\n                        {\n                            if (atomic_cmpxchg_i32_global(global_failure, -1,\n                                                          57) == -1) {\n                                global_failure_args[0] = (int64_t) x_223437;\n                                global_failure_args[1] = (int64_t) n_203490;\n                                ;\n                            }\n                            local_failure = true;\n                            goto error_0;\n                        }\n                    }\n                    \n                    double defunc_0_f_res_t_res_223448;\n                    \n                    defunc_0_f_res_t_res_223448 = ((__global\n                                                    double *) mem_231059)[x_223437 *\n                                                                          partition_sizze_203577 +\n                                                                          gtid_223422];\n                    defunc_0_f_res_223444 = defunc_0_f_res_t_res_223448;\n                } else {\n                    defunc_0_f_res_223444 = 0.0;\n                }\n                ((__global double *) color_232047)[phys_tid_223423 + i_229026 *\n                                                   num_threads_232192] =\n                    defunc_0_f_res_223444;\n                ((__global double *) color_232046)[phys_tid_223423 + i_229026 *\n                                                   num_threads_232192] =\n                    defunc_0_f_res_223439;\n            }\n            for (int64_t i_2290",
                   "33 = 0; i_229033 < t_n_m_203650; i_229033++) {\n                int64_t x_223452;\n                \n                x_223452 = ((__global int64_t *) mem_231053)[i_229033 *\n                                                             partition_sizze_203577 +\n                                                             gtid_223422];\n                \n                double x_223453;\n                \n                x_223453 = ((__global double *) mem_231056)[i_229033 *\n                                                            partition_sizze_203577 +\n                                                            gtid_223422];\n                \n                int64_t min_arg_223454 = mul64(jump_t_203500, i_229033);\n                int64_t min_res_223455 = smin64(i_203670, min_arg_223454);\n                int64_t defunc_0_g_res_223456 = add64((int64_t) 1,\n                                                      min_res_223455);\n                double defunc_2_reduce_res_223457;\n                double defunc_2_reduce_res_223458;\n                double defunc_2_reduce_res_223459;\n                double redout_228246;\n                double redout_228247;\n                double redout_228248;\n                \n                redout_228246 = 0.0;\n                redout_228247 = 0.0;\n                redout_228248 = 0.0;\n                for (int64_t i_228249 = 0; i_228249 < q_t_203494; i_228249++) {\n                    bool cond_223470 = sle64(x_223428, i_228249);\n                    int64_t defunc_0_f_res_223471;\n                    \n                    if (cond_223470) {\n                        defunc_0_f_res_223471 = (int64_t) 0;\n                    } else {\n                        int64_t i_223472 = add64(x_223452, i_228249);\n                        int64_t defunc_0_add_arg_223473;\n                        \n                        defunc_0_add_arg_223473 = ((__global\n                                                    int64_t *) mem_231050)[i_223472 *\n                            ",
                   "                                               partition_sizze_203577 +\n                                                                           gtid_223422];\n                        \n                        int64_t defunc_1_add_res_223474 = add64((int64_t) 1,\n                                                                defunc_0_add_arg_223473);\n                        \n                        defunc_0_f_res_223471 = defunc_1_add_res_223474;\n                    }\n                    \n                    double defunc_0_f_res_223475;\n                    \n                    if (cond_223470) {\n                        defunc_0_f_res_223475 = 0.0;\n                    } else {\n                        int64_t i_223476 = add64(x_223452, i_228249);\n                        double defunc_0_add_arg_223477;\n                        \n                        defunc_0_add_arg_223477 = ((__global\n                                                    double *) color_232047)[phys_tid_223423 +\n                                                                            i_223476 *\n                                                                            num_threads_232192];\n                        defunc_0_f_res_223475 = defunc_0_add_arg_223477;\n                    }\n                    \n                    int64_t binop_p_223478 = sub64(defunc_0_f_res_223471,\n                                                   defunc_0_g_res_223456);\n                    double defunc_0_f_res_223479 =\n                           sitofp_i64_f64(binop_p_223478);\n                    double abs_res_223480 = fabs(defunc_0_f_res_223479);\n                    double tmp1_223481 = abs_res_223480 / x_223453;\n                    double x_223482 = tmp1_223481 * tmp1_223481;\n                    double y_223483 = tmp1_223481 * x_223482;\n                    double tmp2_223484 = 1.0 - y_223483;\n                    double x_223485 = tmp2_223484 * tmp2_223484;\n                    double tmp3_223486 = tmp2_223484 * x_22",
                   "3485;\n                    double w_j_223487 = defunc_0_f_res_223475 * tmp3_223486;\n                    double xw_j_223488 = defunc_0_f_res_223479 * w_j_223487;\n                    double x2w_j_223489 = defunc_0_f_res_223479 * xw_j_223488;\n                    double defunc_1_op_res_223462 = w_j_223487 + redout_228246;\n                    double defunc_1_op_res_223465 = xw_j_223488 + redout_228247;\n                    double defunc_1_op_res_223468 = x2w_j_223489 +\n                           redout_228248;\n                    double redout_tmp_235598 = defunc_1_op_res_223462;\n                    double redout_tmp_235599 = defunc_1_op_res_223465;\n                    double redout_tmp_235600 = defunc_1_op_res_223468;\n                    \n                    redout_228246 = redout_tmp_235598;\n                    redout_228247 = redout_tmp_235599;\n                    redout_228248 = redout_tmp_235600;\n                }\n                defunc_2_reduce_res_223457 = redout_228246;\n                defunc_2_reduce_res_223458 = redout_228247;\n                defunc_2_reduce_res_223459 = redout_228248;\n                \n                double x_223490 = defunc_2_reduce_res_223457 *\n                       defunc_2_reduce_res_223459;\n                double y_223491 = defunc_2_reduce_res_223458 *\n                       defunc_2_reduce_res_223458;\n                double y_223492 = x_223490 - y_223491;\n                double det1_223493 = 1.0 / y_223492;\n                double a11_223494 = defunc_2_reduce_res_223459 * det1_223493;\n                double x_223495 = 0.0 - defunc_2_reduce_res_223458;\n                double b11_223496 = det1_223493 * x_223495;\n                double c11_223497 = defunc_2_reduce_res_223457 * det1_223493;\n                double defunc_2_reduce_res_223498;\n                double defunc_2_reduce_res_223499;\n                double redout_228250;\n                double redout_228251;\n                \n                redout_228250 = 0.0;\n                redout_22",
                   "8251 = 0.0;\n                for (int64_t i_228252 = 0; i_228252 < q_t_203494; i_228252++) {\n                    bool cond_223507 = sle64(x_223428, i_228252);\n                    int64_t defunc_0_f_res_223508;\n                    \n                    if (cond_223507) {\n                        defunc_0_f_res_223508 = (int64_t) 0;\n                    } else {\n                        int64_t i_223509 = add64(x_223452, i_228252);\n                        int64_t defunc_0_add_arg_223510;\n                        \n                        defunc_0_add_arg_223510 = ((__global\n                                                    int64_t *) mem_231050)[i_223509 *\n                                                                           partition_sizze_203577 +\n                                                                           gtid_223422];\n                        \n                        int64_t defunc_1_add_res_223511 = add64((int64_t) 1,\n                                                                defunc_0_add_arg_223510);\n                        \n                        defunc_0_f_res_223508 = defunc_1_add_res_223511;\n                    }\n                    \n                    double defunc_0_f_res_223512;\n                    \n                    if (cond_223507) {\n                        defunc_0_f_res_223512 = 0.0;\n                    } else {\n                        int64_t i_223513 = add64(x_223452, i_228252);\n                        double defunc_0_add_arg_223514;\n                        \n                        defunc_0_add_arg_223514 = ((__global\n                                                    double *) color_232047)[phys_tid_223423 +\n                                                                            i_223513 *\n                                                                            num_threads_232192];\n                        defunc_0_f_res_223512 = defunc_0_add_arg_223514;\n                    }\n                    \n                    in",
                   "t64_t binop_p_223515 = sub64(defunc_0_f_res_223508,\n                                                   defunc_0_g_res_223456);\n                    double defunc_0_f_res_223516 =\n                           sitofp_i64_f64(binop_p_223515);\n                    double abs_res_223517 = fabs(defunc_0_f_res_223516);\n                    double tmp1_223518 = abs_res_223517 / x_223453;\n                    double x_223519 = tmp1_223518 * tmp1_223518;\n                    double y_223520 = tmp1_223518 * x_223519;\n                    double tmp2_223521 = 1.0 - y_223520;\n                    double x_223522 = tmp2_223521 * tmp2_223521;\n                    double tmp3_223523 = tmp2_223521 * x_223522;\n                    double tmp4_223524 = defunc_0_f_res_223512 * tmp3_223523;\n                    double defunc_1_f_res_223525 = defunc_0_f_res_223516 *\n                           tmp4_223524;\n                    double defunc_0_f_res_223526;\n                    \n                    if (cond_223507) {\n                        defunc_0_f_res_223526 = 0.0;\n                    } else {\n                        int64_t i_223527 = add64(x_223452, i_228252);\n                        double defunc_0_add_arg_223528;\n                        \n                        defunc_0_add_arg_223528 = ((__global\n                                                    double *) color_232046)[phys_tid_223423 +\n                                                                            i_223527 *\n                                                                            num_threads_232192];\n                        defunc_0_f_res_223526 = defunc_0_add_arg_223528;\n                    }\n                    \n                    double x_223529 = a11_223494 * tmp4_223524;\n                    double y_223530 = b11_223496 * defunc_1_f_res_223525;\n                    double x_223531 = x_223529 + y_223530;\n                    double defunc_9_fit_fun_res_223532 = defunc_0_f_res_223526 *\n                           x_223531;\n  ",
                   "                  double x_223533 = b11_223496 * tmp4_223524;\n                    double y_223534 = c11_223497 * defunc_1_f_res_223525;\n                    double x_223535 = x_223533 + y_223534;\n                    double defunc_9_slope_fun_res_223536 =\n                           defunc_0_f_res_223526 * x_223535;\n                    double defunc_1_op_res_223502 =\n                           defunc_9_fit_fun_res_223532 + redout_228250;\n                    double defunc_1_op_res_223505 =\n                           defunc_9_slope_fun_res_223536 + redout_228251;\n                    double redout_tmp_235601 = defunc_1_op_res_223502;\n                    double redout_tmp_235602 = defunc_1_op_res_223505;\n                    \n                    redout_228250 = redout_tmp_235601;\n                    redout_228251 = redout_tmp_235602;\n                }\n                defunc_2_reduce_res_223498 = redout_228250;\n                defunc_2_reduce_res_223499 = redout_228251;\n                ((__global double *) color_232045)[phys_tid_223423 + i_229033 *\n                                                   num_threads_232192] =\n                    defunc_2_reduce_res_223498;\n                ((__global double *) color_232044)[phys_tid_223423 + i_229033 *\n                                                   num_threads_232192] =\n                    defunc_2_reduce_res_223499;\n            }\n            for (int64_t i_235603 = 0; i_235603 < t_n_m_203650; i_235603++) {\n                double tmp_235604;\n                \n                tmp_235604 = ((__global\n                               double *) color_232045)[phys_tid_223423 +\n                                                       i_235603 *\n                                                       num_threads_232192];\n                ((__global double *) mem_231138)[gtid_223422 + i_235603 *\n                                                 partition_sizze_203577] =\n                    tmp_235604;\n            }\n            for (int64_t i_2",
                   "35605 = 0; i_235605 < t_n_m_203650; i_235605++) {\n                double tmp_235606;\n                \n                tmp_235606 = ((__global\n                               double *) color_232044)[phys_tid_223423 +\n                                                       i_235605 *\n                                                       num_threads_232192];\n                ((__global double *) mem_231141)[gtid_223422 + i_235605 *\n                                                 partition_sizze_203577] =\n                    tmp_235606;\n            }\n        }\n        barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_223417\n}\n__kernel void mainzisegmap_224073(__global int *global_failure,\n                                  int64_t n_203490,\n                                  int64_t partition_sizze_203577, __global\n                                  unsigned char *mem_229161, __global\n                                  unsigned char *mem_230920, __global\n                                  unsigned char *mem_231146)\n{\n    #define segmap_group_sizze_224068 (mainzisegmap_group_sizze_224042)\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_235607;\n    int32_t local_tid_235608;\n    int64_t group_sizze_235611;\n    int32_t wave_sizze_235610;\n    int32_t group_tid_235609;\n    \n    global_tid_235607 = get_global_id(0);\n    local_tid_235608 = get_local_id(0);\n    group_sizze_235611 = get_local_size(0);\n    wave_sizze_235610 = LOCKSTEP_WIDTH;\n    group_tid_235609 = get_group_id(0);\n    \n    int32_t phys_tid_224073 = global_tid_235607;\n    int64_t global_tid_235612 = sext_i32_i64(group_tid_235609) *\n            segmap_group_sizze_224068 + sext_i32_i64(local_tid_235608);\n    int64_t slice_235613 = n_203490;\n    int64_t slice_235614 = partition_sizze_203577 * slice_235613;\n    int64_t gtid_224071 = sq",
                   "uot64(global_tid_235612, slice_235613);\n    int64_t remnant_235615 = global_tid_235612 - gtid_224071 * slice_235613;\n    int64_t gtid_224072 = remnant_235615;\n    int64_t remnant_235616 = remnant_235615 - gtid_224072;\n    \n    if (slt64(gtid_224071, partition_sizze_203577) && slt64(gtid_224072,\n                                                            n_203490)) {\n        double x_224074;\n        \n        x_224074 = ((__global double *) mem_229161)[gtid_224071 * n_203490 +\n                                                    gtid_224072];\n        \n        double x_224075;\n        \n        x_224075 = ((__global double *) mem_230920)[gtid_224071 * n_203490 +\n                                                    gtid_224072];\n        \n        double defunc_1_f_res_224076 = x_224074 - x_224075;\n        \n        ((__global double *) mem_231146)[gtid_224071 * n_203490 + gtid_224072] =\n            defunc_1_f_res_224076;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_224068\n}\n__kernel void mainzisegmap_224090(__global int *global_failure,\n                                  int failure_is_an_option, __global\n                                  int64_t *global_failure_args,\n                                  int64_t n_203490,\n                                  int64_t partition_sizze_203577,\n                                  int64_t ctx_param_ext_229488,\n                                  int64_t ctx_param_ext_229489,\n                                  int64_t ctx_param_ext_229491, __global\n                                  unsigned char *ext_mem_229197, __global\n                                  unsigned char *mem_param_229493, __global\n                                  unsigned char *mem_231146, __global\n                                  unsigned char *mem_231151, __global\n                                  unsigned char *mem_231155)\n{\n    #define segmap_group_sizze_224084 (mainzisegmap_group_sizze_223986)\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_235617;\n    int32_t local_tid_235618;\n    int64_t group_sizze_235621;\n    int32_t wave_sizze_235620;\n    int32_t group_tid_235619;\n    \n    global_tid_235617 = get_global_id(0);\n    local_tid_235618 = get_local_id(0);\n    group_sizze_235621 = get_local_size(0);\n    wave_sizze_235620 = LOCKSTEP_WIDTH;\n    group_tid_235619 = get_group_id(0);\n    \n    int32_t phys_tid_224090 = global_tid_235617;\n    int64_t global_tid_235622 = sext_i32_i64(group_tid_235619) *\n            segmap_group_sizze_224084 + sext_i32_i64(local_tid_235618);\n    int64_t slice_235623 = n_203490;\n    int64_t slice_235624 = partition_sizze_203577 * slice_235623;\n    int64_t gtid_224088 = squot64(global_tid_235622, slice_235623);\n    int64_t remnant_235625 = global_tid_235622 - gtid_224088 * slice_235623;\n    int64_t gtid_224089 = remnant_235625;\n    int64_t remnant_235626 = remnant_235625 - gtid_224089;\n    \n    if (slt64(gtid_224088, partition_sizze_203577) && slt64(gtid_224089,\n                                                            n_203490)) {\n        int64_t x_224093;\n        \n        x_224093 = ((__global int64_t *) ext_mem_229197)[gtid_224088 *\n                                                         n_203490 +\n                                                         gtid_224089];\n        \n        bool cond_224094 = sle64((int64_t) 0, x_224093);\n        double defunc_0_f_res_224095;\n        \n        if (cond_224094) {\n            bool y_224096 = slt64(x_224093, n_203490);\n            bool bounds_check_224097 = cond_224094 && y_224096;\n            bool index_certs_224098;\n            \n            if (!bounds_check_224097) {\n                {\n                    if (atomic_cmpxchg_i32_global(global_failure, -1, 58) ==\n                        -1) {\n                        global_failure_args[0] = (int64_t) x_224093;\n                        global_failure_args[1] = (int64_t) n_2034",
                   "90;\n                        ;\n                    }\n                    return;\n                }\n            }\n            \n            double defunc_0_f_res_t_res_224099;\n            \n            defunc_0_f_res_t_res_224099 = ((__global\n                                            double *) mem_231146)[gtid_224088 *\n                                                                  n_203490 +\n                                                                  x_224093];\n            defunc_0_f_res_224095 = defunc_0_f_res_t_res_224099;\n        } else {\n            defunc_0_f_res_224095 = 0.0;\n        }\n        \n        double defunc_0_f_res_224100;\n        \n        if (cond_224094) {\n            bool y_224101 = slt64(x_224093, n_203490);\n            bool bounds_check_224102 = cond_224094 && y_224101;\n            bool index_certs_224103;\n            \n            if (!bounds_check_224102) {\n                {\n                    if (atomic_cmpxchg_i32_global(global_failure, -1, 59) ==\n                        -1) {\n                        global_failure_args[0] = (int64_t) x_224093;\n                        global_failure_args[1] = (int64_t) n_203490;\n                        ;\n                    }\n                    return;\n                }\n            }\n            \n            double defunc_0_f_res_t_res_224104;\n            \n            defunc_0_f_res_t_res_224104 = ((__global\n                                            double *) mem_param_229493)[ctx_param_ext_229488 +\n                                                                        (gtid_224088 *\n                                                                         ctx_param_ext_229489 +\n                                                                         x_224093 *\n                                                                         ctx_param_ext_229491)];\n            defunc_0_f_res_224100 = defunc_0_f_res_t_res_224104;\n        } else {\n            defunc_0_f_res_224100 = 0.0;\n        }\n        ((__",
                   "global double *) mem_231151)[gtid_224088 * n_203490 + gtid_224089] =\n            defunc_0_f_res_224100;\n        ((__global double *) mem_231155)[gtid_224088 * n_203490 + gtid_224089] =\n            defunc_0_f_res_224095;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_224084\n}\n__kernel void mainzisegmap_224120(__global int *global_failure,\n                                  int64_t n_203490, int64_t q_t_203494,\n                                  int64_t jump_t_203500,\n                                  int64_t partition_sizze_203577,\n                                  int64_t t_n_m_203650, int64_t i_203670,\n                                  __global unsigned char *ext_mem_229196,\n                                  __global unsigned char *ext_mem_229197,\n                                  __global unsigned char *ext_mem_229460,\n                                  __global unsigned char *ext_mem_229461,\n                                  __global unsigned char *mem_231151, __global\n                                  unsigned char *mem_231155, __global\n                                  unsigned char *mem_231160, __global\n                                  unsigned char *mem_231164)\n{\n    #define segmap_group_sizze_224109 (mainzisegmap_group_sizze_223544)\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_235627;\n    int32_t local_tid_235628;\n    int64_t group_sizze_235631;\n    int32_t wave_sizze_235630;\n    int32_t group_tid_235629;\n    \n    global_tid_235627 = get_global_id(0);\n    local_tid_235628 = get_local_id(0);\n    group_sizze_235631 = get_local_size(0);\n    wave_sizze_235630 = LOCKSTEP_WIDTH;\n    group_tid_235629 = get_group_id(0);\n    \n    int32_t phys_tid_224120 = global_tid_235627;\n    int64_t global_tid_235632 = sext_i32_i64(group_tid_235629) *\n            segmap_group_sizze_224109 + sext_i32_i64(local_tid_235628);\n    int64_t slice",
                   "_235633 = t_n_m_203650;\n    int64_t slice_235634 = partition_sizze_203577 * slice_235633;\n    int64_t gtid_224118 = squot64(global_tid_235632, slice_235633);\n    int64_t remnant_235635 = global_tid_235632 - gtid_224118 * slice_235633;\n    int64_t gtid_224119 = remnant_235635;\n    int64_t remnant_235636 = remnant_235635 - gtid_224119;\n    \n    if (slt64(gtid_224118, partition_sizze_203577) && slt64(gtid_224119,\n                                                            t_n_m_203650)) {\n        int64_t x_224122;\n        \n        x_224122 = ((__global int64_t *) ext_mem_229196)[gtid_224118];\n        \n        int64_t x_224126;\n        \n        x_224126 = ((__global int64_t *) ext_mem_229461)[gtid_224118 *\n                                                         t_n_m_203650 +\n                                                         gtid_224119];\n        \n        double x_224127;\n        \n        x_224127 = ((__global double *) ext_mem_229460)[gtid_224118 *\n                                                        t_n_m_203650 +\n                                                        gtid_224119];\n        \n        int64_t min_arg_224128 = mul64(jump_t_203500, gtid_224119);\n        int64_t min_res_224129 = smin64(i_203670, min_arg_224128);\n        int64_t defunc_0_g_res_224130 = add64((int64_t) 1, min_res_224129);\n        double defunc_2_reduce_res_224131;\n        double defunc_2_reduce_res_224132;\n        double defunc_2_reduce_res_224133;\n        double redout_228257;\n        double redout_228258;\n        double redout_228259;\n        \n        redout_228257 = 0.0;\n        redout_228258 = 0.0;\n        redout_228259 = 0.0;\n        for (int64_t i_228260 = 0; i_228260 < q_t_203494; i_228260++) {\n            bool cond_224144 = sle64(x_224122, i_228260);\n            int64_t defunc_0_f_res_224145;\n            \n            if (cond_224144) {\n                defunc_0_f_res_224145 = (int64_t) 0;\n            } else {\n                int64_t i_224146 = add64(x_224126, i_228260);\n   ",
                   "             int64_t defunc_0_add_arg_224147;\n                \n                defunc_0_add_arg_224147 = ((__global\n                                            int64_t *) ext_mem_229197)[gtid_224118 *\n                                                                       n_203490 +\n                                                                       i_224146];\n                \n                int64_t defunc_1_add_res_224148 = add64((int64_t) 1,\n                                                        defunc_0_add_arg_224147);\n                \n                defunc_0_f_res_224145 = defunc_1_add_res_224148;\n            }\n            \n            double defunc_0_f_res_224149;\n            \n            if (cond_224144) {\n                defunc_0_f_res_224149 = 0.0;\n            } else {\n                int64_t i_224150 = add64(x_224126, i_228260);\n                double defunc_0_add_arg_224151;\n                \n                defunc_0_add_arg_224151 = ((__global\n                                            double *) mem_231151)[gtid_224118 *\n                                                                  n_203490 +\n                                                                  i_224150];\n                defunc_0_f_res_224149 = defunc_0_add_arg_224151;\n            }\n            \n            int64_t binop_p_224152 = sub64(defunc_0_f_res_224145,\n                                           defunc_0_g_res_224130);\n            double defunc_0_f_res_224153 = sitofp_i64_f64(binop_p_224152);\n            double abs_res_224154 = fabs(defunc_0_f_res_224153);\n            double tmp1_224155 = abs_res_224154 / x_224127;\n            double x_224156 = tmp1_224155 * tmp1_224155;\n            double y_224157 = tmp1_224155 * x_224156;\n            double tmp2_224158 = 1.0 - y_224157;\n            double x_224159 = tmp2_224158 * tmp2_224158;\n            double tmp3_224160 = tmp2_224158 * x_224159;\n            double w_j_224161 = defunc_0_f_res_224149 * tmp3_224160;\n            double xw_j_",
                   "224162 = defunc_0_f_res_224153 * w_j_224161;\n            double x2w_j_224163 = defunc_0_f_res_224153 * xw_j_224162;\n            double defunc_1_op_res_224136 = w_j_224161 + redout_228257;\n            double defunc_1_op_res_224139 = xw_j_224162 + redout_228258;\n            double defunc_1_op_res_224142 = x2w_j_224163 + redout_228259;\n            double redout_tmp_235637 = defunc_1_op_res_224136;\n            double redout_tmp_235638 = defunc_1_op_res_224139;\n            double redout_tmp_235639 = defunc_1_op_res_224142;\n            \n            redout_228257 = redout_tmp_235637;\n            redout_228258 = redout_tmp_235638;\n            redout_228259 = redout_tmp_235639;\n        }\n        defunc_2_reduce_res_224131 = redout_228257;\n        defunc_2_reduce_res_224132 = redout_228258;\n        defunc_2_reduce_res_224133 = redout_228259;\n        \n        double x_224164 = defunc_2_reduce_res_224131 *\n               defunc_2_reduce_res_224133;\n        double y_224165 = defunc_2_reduce_res_224132 *\n               defunc_2_reduce_res_224132;\n        double y_224166 = x_224164 - y_224165;\n        double det1_224167 = 1.0 / y_224166;\n        double a11_224168 = defunc_2_reduce_res_224133 * det1_224167;\n        double x_224169 = 0.0 - defunc_2_reduce_res_224132;\n        double b11_224170 = det1_224167 * x_224169;\n        double c11_224171 = defunc_2_reduce_res_224131 * det1_224167;\n        double defunc_2_reduce_res_224172;\n        double defunc_2_reduce_res_224173;\n        double redout_228261;\n        double redout_228262;\n        \n        redout_228261 = 0.0;\n        redout_228262 = 0.0;\n        for (int64_t i_228263 = 0; i_228263 < q_t_203494; i_228263++) {\n            bool cond_224181 = sle64(x_224122, i_228263);\n            int64_t defunc_0_f_res_224182;\n            \n            if (cond_224181) {\n                defunc_0_f_res_224182 = (int64_t) 0;\n            } else {\n                int64_t i_224183 = add64(x_224126, i_228263);\n                int64_t defunc_0_add_arg_",
                   "224184;\n                \n                defunc_0_add_arg_224184 = ((__global\n                                            int64_t *) ext_mem_229197)[gtid_224118 *\n                                                                       n_203490 +\n                                                                       i_224183];\n                \n                int64_t defunc_1_add_res_224185 = add64((int64_t) 1,\n                                                        defunc_0_add_arg_224184);\n                \n                defunc_0_f_res_224182 = defunc_1_add_res_224185;\n            }\n            \n            double defunc_0_f_res_224186;\n            \n            if (cond_224181) {\n                defunc_0_f_res_224186 = 0.0;\n            } else {\n                int64_t i_224187 = add64(x_224126, i_228263);\n                double defunc_0_add_arg_224188;\n                \n                defunc_0_add_arg_224188 = ((__global\n                                            double *) mem_231151)[gtid_224118 *\n                                                                  n_203490 +\n                                                                  i_224187];\n                defunc_0_f_res_224186 = defunc_0_add_arg_224188;\n            }\n            \n            int64_t binop_p_224189 = sub64(defunc_0_f_res_224182,\n                                           defunc_0_g_res_224130);\n            double defunc_0_f_res_224190 = sitofp_i64_f64(binop_p_224189);\n            double abs_res_224191 = fabs(defunc_0_f_res_224190);\n            double tmp1_224192 = abs_res_224191 / x_224127;\n            double x_224193 = tmp1_224192 * tmp1_224192;\n            double y_224194 = tmp1_224192 * x_224193;\n            double tmp2_224195 = 1.0 - y_224194;\n            double x_224196 = tmp2_224195 * tmp2_224195;\n            double tmp3_224197 = tmp2_224195 * x_224196;\n            double tmp4_224198 = defunc_0_f_res_224186 * tmp3_224197;\n            double defunc_1_f_res_224199 = defunc_0_f_res_224",
                   "190 * tmp4_224198;\n            double defunc_0_f_res_224200;\n            \n            if (cond_224181) {\n                defunc_0_f_res_224200 = 0.0;\n            } else {\n                int64_t i_224201 = add64(x_224126, i_228263);\n                double defunc_0_add_arg_224202;\n                \n                defunc_0_add_arg_224202 = ((__global\n                                            double *) mem_231155)[gtid_224118 *\n                                                                  n_203490 +\n                                                                  i_224201];\n                defunc_0_f_res_224200 = defunc_0_add_arg_224202;\n            }\n            \n            double x_224203 = a11_224168 * tmp4_224198;\n            double y_224204 = b11_224170 * defunc_1_f_res_224199;\n            double x_224205 = x_224203 + y_224204;\n            double defunc_9_fit_fun_res_224206 = defunc_0_f_res_224200 *\n                   x_224205;\n            double x_224207 = b11_224170 * tmp4_224198;\n            double y_224208 = c11_224171 * defunc_1_f_res_224199;\n            double x_224209 = x_224207 + y_224208;\n            double defunc_9_slope_fun_res_224210 = defunc_0_f_res_224200 *\n                   x_224209;\n            double defunc_1_op_res_224176 = defunc_9_fit_fun_res_224206 +\n                   redout_228261;\n            double defunc_1_op_res_224179 = defunc_9_slope_fun_res_224210 +\n                   redout_228262;\n            double redout_tmp_235640 = defunc_1_op_res_224176;\n            double redout_tmp_235641 = defunc_1_op_res_224179;\n            \n            redout_228261 = redout_tmp_235640;\n            redout_228262 = redout_tmp_235641;\n        }\n        defunc_2_reduce_res_224172 = redout_228261;\n        defunc_2_reduce_res_224173 = redout_228262;\n        ((__global double *) mem_231160)[gtid_224118 * t_n_m_203650 +\n                                         gtid_224119] =\n            defunc_2_reduce_res_224172;\n        ((__global double *) mem_231164)",
                   "[gtid_224118 * t_n_m_203650 +\n                                         gtid_224119] =\n            defunc_2_reduce_res_224173;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_224109\n}\n__kernel void mainzisegmap_224284(__global int *global_failure,\n                                  int64_t partition_sizze_203577,\n                                  int64_t t_n_m_203650, __global\n                                  unsigned char *mem_231169, __global\n                                  unsigned char *mem_231173, __global\n                                  unsigned char *mem_231177, __global\n                                  unsigned char *mem_231182, __global\n                                  unsigned char *mem_231186, __global\n                                  unsigned char *mem_231190)\n{\n    #define segmap_group_sizze_224277 (mainzisegmap_group_sizze_223733)\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_235742;\n    int32_t local_tid_235743;\n    int64_t group_sizze_235746;\n    int32_t wave_sizze_235745;\n    int32_t group_tid_235744;\n    \n    global_tid_235742 = get_global_id(0);\n    local_tid_235743 = get_local_id(0);\n    group_sizze_235746 = get_local_size(0);\n    wave_sizze_235745 = LOCKSTEP_WIDTH;\n    group_tid_235744 = get_group_id(0);\n    \n    int32_t phys_tid_224284 = global_tid_235742;\n    int64_t global_tid_235747 = sext_i32_i64(group_tid_235744) *\n            segmap_group_sizze_224277 + sext_i32_i64(local_tid_235743);\n    int64_t slice_235748 = t_n_m_203650;\n    int64_t slice_235749 = partition_sizze_203577 * slice_235748;\n    int64_t gtid_224282 = squot64(global_tid_235747, slice_235748);\n    int64_t remnant_235750 = global_tid_235747 - gtid_224282 * slice_235748;\n    int64_t gtid_224283 = remnant_235750;\n    int64_t remnant_235751 = remnant_235750 - gtid_224283;\n    \n    if (slt64(gtid_224282, partition_sizze_203577) && sl",
                   "t64(gtid_224283,\n                                                            t_n_m_203650)) {\n        double defunc_2_reduce_res_224285;\n        \n        defunc_2_reduce_res_224285 = ((__global\n                                       double *) mem_231169)[gtid_224282 *\n                                                             t_n_m_203650 +\n                                                             gtid_224283];\n        \n        double defunc_2_reduce_res_224286;\n        \n        defunc_2_reduce_res_224286 = ((__global\n                                       double *) mem_231173)[gtid_224282 *\n                                                             t_n_m_203650 +\n                                                             gtid_224283];\n        \n        double defunc_2_reduce_res_224287;\n        \n        defunc_2_reduce_res_224287 = ((__global\n                                       double *) mem_231177)[gtid_224282 *\n                                                             t_n_m_203650 +\n                                                             gtid_224283];\n        \n        double x_224288 = defunc_2_reduce_res_224285 *\n               defunc_2_reduce_res_224287;\n        double y_224289 = defunc_2_reduce_res_224286 *\n               defunc_2_reduce_res_224286;\n        double y_224290 = x_224288 - y_224289;\n        double det1_224291 = 1.0 / y_224290;\n        double a11_224292 = defunc_2_reduce_res_224287 * det1_224291;\n        double x_224293 = 0.0 - defunc_2_reduce_res_224286;\n        double b11_224294 = det1_224291 * x_224293;\n        double c11_224295 = defunc_2_reduce_res_224285 * det1_224291;\n        \n        ((__global double *) mem_231182)[gtid_224282 * t_n_m_203650 +\n                                         gtid_224283] = a11_224292;\n        ((__global double *) mem_231186)[gtid_224282 * t_n_m_203650 +\n                                         gtid_224283] = b11_224294;\n        ((__global double *) mem_231190)[gtid_224282 * t_n_m_203650 +\n      ",
                   "                                   gtid_224283] = c11_224295;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_224277\n}\n__kernel void mainzisegmap_224529(__global int *global_failure,\n                                  int failure_is_an_option, __global\n                                  int64_t *global_failure_args,\n                                  int64_t n_203490, int64_t q_t_203494,\n                                  int64_t jump_t_203500,\n                                  int64_t partition_sizze_203577,\n                                  int64_t t_n_m_203650, int64_t i_203670,\n                                  int64_t num_groups_224524,\n                                  int64_t num_threads_232203, __global\n                                  unsigned char *mem_229161, __global\n                                  unsigned char *ext_mem_229196, __global\n                                  unsigned char *mem_231216, __global\n                                  unsigned char *mem_231219, __global\n                                  unsigned char *mem_231222, __global\n                                  unsigned char *mem_231225, __global\n                                  unsigned char *mem_231228, __global\n                                  unsigned char *mem_231307, __global\n                                  unsigned char *mem_231310, __global\n                                  unsigned char *color_232049, __global\n                                  unsigned char *color_232050, __global\n                                  unsigned char *color_232051, __global\n                                  unsigned char *color_232052)\n{\n    #define segmap_group_sizze_224523 (mainzisegmap_group_sizze_224370)\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_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_224529 = global_tid_235855;\n    int32_t phys_group_id_235860;\n    \n    phys_group_id_235860 = get_group_id(0);\n    for (int32_t i_235861 = 0; i_235861 <\n         sdiv_up32(sext_i64_i32(sdiv_up64(partition_sizze_203577,\n                                          segmap_group_sizze_224523)) -\n                   phys_group_id_235860, sext_i64_i32(num_groups_224524));\n         i_235861++) {\n        int32_t virt_group_id_235862 = phys_group_id_235860 + i_235861 *\n                sext_i64_i32(num_groups_224524);\n        int64_t global_tid_235863 = sext_i32_i64(virt_group_id_235862) *\n                segmap_group_sizze_224523 + sext_i32_i64(local_tid_235856);\n        int64_t slice_235864 = partition_sizze_203577;\n        int64_t gtid_224528 = global_tid_235863;\n        int64_t remnant_235865 = global_tid_235863 - gtid_224528;\n        \n        if (slt64(gtid_224528, partition_sizze_203577)) {\n            int64_t x_224534;\n            \n            x_224534 = ((__global int64_t *) ext_mem_229196)[gtid_224528];\n            for (int64_t i_229038 = 0; i_229038 < n_203490; i_229038++) {\n                double x_224538;\n                \n                x_224538 = ((__global double *) mem_229161)[gtid_224528 *\n                                                            n_203490 +\n                                                            i_229038];\n                \n                double x_224539;\n                \n                x_224539 = ((__global double *) mem_231216)[i_229038 *\n                                                           ",
                   " partition_sizze_203577 +\n                                                            gtid_224528];\n                \n                double defunc_1_f_res_224540 = x_224538 - x_224539;\n                \n                ((__global double *) color_232049)[phys_tid_224529 + i_229038 *\n                                                   num_threads_232203] =\n                    defunc_1_f_res_224540;\n            }\n            for (int64_t i_229044 = 0; i_229044 < n_203490; i_229044++) {\n                int64_t x_224543;\n                \n                x_224543 = ((__global int64_t *) mem_231219)[i_229044 *\n                                                             partition_sizze_203577 +\n                                                             gtid_224528];\n                \n                bool cond_224544 = sle64((int64_t) 0, x_224543);\n                double defunc_0_f_res_224545;\n                \n                if (cond_224544) {\n                    bool y_224546 = slt64(x_224543, n_203490);\n                    bool bounds_check_224547 = cond_224544 && y_224546;\n                    bool index_certs_224548;\n                    \n                    if (!bounds_check_224547) {\n                        {\n                            if (atomic_cmpxchg_i32_global(global_failure, -1,\n                                                          60) == -1) {\n                                global_failure_args[0] = (int64_t) x_224543;\n                                global_failure_args[1] = (int64_t) n_203490;\n                                ;\n                            }\n                            local_failure = true;\n                            goto error_0;\n                        }\n                    }\n                    \n                    double defunc_0_f_res_t_res_224549;\n                    \n                    defunc_0_f_res_t_res_224549 = ((__global\n                                                    double *) color_232049)[phys_tid_224529 +\n               ",
                   "                                                             x_224543 *\n                                                                            num_threads_232203];\n                    defunc_0_f_res_224545 = defunc_0_f_res_t_res_224549;\n                } else {\n                    defunc_0_f_res_224545 = 0.0;\n                }\n                \n                double defunc_0_f_res_224550;\n                \n                if (cond_224544) {\n                    bool y_224551 = slt64(x_224543, n_203490);\n                    bool bounds_check_224552 = cond_224544 && y_224551;\n                    bool index_certs_224553;\n                    \n                    if (!bounds_check_224552) {\n                        {\n                            if (atomic_cmpxchg_i32_global(global_failure, -1,\n                                                          61) == -1) {\n                                global_failure_args[0] = (int64_t) x_224543;\n                                global_failure_args[1] = (int64_t) n_203490;\n                                ;\n                            }\n                            local_failure = true;\n                            goto error_0;\n                        }\n                    }\n                    \n                    double defunc_0_f_res_t_res_224554;\n                    \n                    defunc_0_f_res_t_res_224554 = ((__global\n                                                    double *) mem_231228)[x_224543 *\n                                                                          partition_sizze_203577 +\n                                                                          gtid_224528];\n                    defunc_0_f_res_224550 = defunc_0_f_res_t_res_224554;\n                } else {\n                    defunc_0_f_res_224550 = 0.0;\n                }\n                ((__global double *) color_232052)[phys_tid_224529 + i_229044 *\n                                                   num_threads_232203] =\n                    ",
                   "defunc_0_f_res_224550;\n                ((__global double *) color_232051)[phys_tid_224529 + i_229044 *\n                                                   num_threads_232203] =\n                    defunc_0_f_res_224545;\n            }\n            for (int64_t i_229051 = 0; i_229051 < t_n_m_203650; i_229051++) {\n                int64_t x_224558;\n                \n                x_224558 = ((__global int64_t *) mem_231222)[i_229051 *\n                                                             partition_sizze_203577 +\n                                                             gtid_224528];\n                \n                double x_224559;\n                \n                x_224559 = ((__global double *) mem_231225)[i_229051 *\n                                                            partition_sizze_203577 +\n                                                            gtid_224528];\n                \n                int64_t min_arg_224560 = mul64(jump_t_203500, i_229051);\n                int64_t min_res_224561 = smin64(i_203670, min_arg_224560);\n                int64_t defunc_0_g_res_224562 = add64((int64_t) 1,\n                                                      min_res_224561);\n                double defunc_2_reduce_res_224563;\n                double defunc_2_reduce_res_224564;\n                double defunc_2_reduce_res_224565;\n                double defunc_2_reduce_res_224566;\n                double defunc_2_reduce_res_224567;\n                double redout_228276;\n                double redout_228277;\n                double redout_228278;\n                double redout_228279;\n                double redout_228280;\n                \n                redout_228276 = 0.0;\n                redout_228277 = 0.0;\n                redout_228278 = 0.0;\n                redout_228279 = 0.0;\n                redout_228280 = 0.0;\n                for (int64_t i_228281 = 0; i_228281 < q_t_203494; i_228281++) {\n                    bool cond_224584 = sle64(x_224534, i_228281);\n            ",
                   "        int64_t defunc_0_f_res_224585;\n                    \n                    if (cond_224584) {\n                        defunc_0_f_res_224585 = (int64_t) 0;\n                    } else {\n                        int64_t i_224586 = add64(x_224558, i_228281);\n                        int64_t defunc_0_add_arg_224587;\n                        \n                        defunc_0_add_arg_224587 = ((__global\n                                                    int64_t *) mem_231219)[i_224586 *\n                                                                           partition_sizze_203577 +\n                                                                           gtid_224528];\n                        \n                        int64_t defunc_1_add_res_224588 = add64((int64_t) 1,\n                                                                defunc_0_add_arg_224587);\n                        \n                        defunc_0_f_res_224585 = defunc_1_add_res_224588;\n                    }\n                    \n                    double defunc_0_f_res_224589;\n                    \n                    if (cond_224584) {\n                        defunc_0_f_res_224589 = 0.0;\n                    } else {\n                        int64_t i_224590 = add64(x_224558, i_228281);\n                        double defunc_0_add_arg_224591;\n                        \n                        defunc_0_add_arg_224591 = ((__global\n                                                    double *) color_232052)[phys_tid_224529 +\n                                                                            i_224590 *\n                                                                            num_threads_232203];\n                        defunc_0_f_res_224589 = defunc_0_add_arg_224591;\n                    }\n                    \n                    int64_t binop_p_224592 = sub64(defunc_0_f_res_224585,\n                                                   defunc_0_g_res_224562);\n                    double defunc_0_f_res_2",
                   "24593 =\n                           sitofp_i64_f64(binop_p_224592);\n                    double abs_res_224594 = fabs(defunc_0_f_res_224593);\n                    double tmp1_224595 = abs_res_224594 / x_224559;\n                    double x_224596 = tmp1_224595 * tmp1_224595;\n                    double y_224597 = tmp1_224595 * x_224596;\n                    double tmp2_224598 = 1.0 - y_224597;\n                    double x_224599 = tmp2_224598 * tmp2_224598;\n                    double tmp3_224600 = tmp2_224598 * x_224599;\n                    double w_j_224601 = defunc_0_f_res_224589 * tmp3_224600;\n                    double xw_j_224602 = defunc_0_f_res_224593 * w_j_224601;\n                    double x2w_j_224603 = defunc_0_f_res_224593 * xw_j_224602;\n                    double x3w_j_224604 = defunc_0_f_res_224593 * x2w_j_224603;\n                    double x4w_j_224605 = defunc_0_f_res_224593 * x3w_j_224604;\n                    double defunc_1_op_res_224570 = w_j_224601 + redout_228276;\n                    double defunc_1_op_res_224573 = xw_j_224602 + redout_228277;\n                    double defunc_1_op_res_224576 = x2w_j_224603 +\n                           redout_228278;\n                    double defunc_1_op_res_224579 = x3w_j_224604 +\n                           redout_228279;\n                    double defunc_1_op_res_224582 = x4w_j_224605 +\n                           redout_228280;\n                    double redout_tmp_235871 = defunc_1_op_res_224570;\n                    double redout_tmp_235872 = defunc_1_op_res_224573;\n                    double redout_tmp_235873 = defunc_1_op_res_224576;\n                    double redout_tmp_235874 = defunc_1_op_res_224579;\n                    double redout_tmp_235875 = defunc_1_op_res_224582;\n                    \n                    redout_228276 = redout_tmp_235871;\n                    redout_228277 = redout_tmp_235872;\n                    redout_228278 = redout_tmp_235873;\n                    redout_228279 = redout_tmp_235874;\n ",
                   "                   redout_228280 = redout_tmp_235875;\n                }\n                defunc_2_reduce_res_224563 = redout_228276;\n                defunc_2_reduce_res_224564 = redout_228277;\n                defunc_2_reduce_res_224565 = redout_228278;\n                defunc_2_reduce_res_224566 = redout_228279;\n                defunc_2_reduce_res_224567 = redout_228280;\n                \n                double x_224606 = defunc_2_reduce_res_224565 *\n                       defunc_2_reduce_res_224567;\n                double y_224607 = defunc_2_reduce_res_224566 *\n                       defunc_2_reduce_res_224566;\n                double a12_224608 = x_224606 - y_224607;\n                double x_224609 = defunc_2_reduce_res_224565 *\n                       defunc_2_reduce_res_224566;\n                double y_224610 = defunc_2_reduce_res_224564 *\n                       defunc_2_reduce_res_224567;\n                double b12_224611 = x_224609 - y_224610;\n                double x_224612 = defunc_2_reduce_res_224564 *\n                       defunc_2_reduce_res_224566;\n                double y_224613 = defunc_2_reduce_res_224565 *\n                       defunc_2_reduce_res_224565;\n                double c12_224614 = x_224612 - y_224613;\n                double x_224615 = defunc_2_reduce_res_224563 *\n                       defunc_2_reduce_res_224567;\n                double b2_224616 = x_224615 - y_224613;\n                double x_224617 = defunc_2_reduce_res_224564 *\n                       defunc_2_reduce_res_224565;\n                double y_224618 = defunc_2_reduce_res_224563 *\n                       defunc_2_reduce_res_224566;\n                double c2_224619 = x_224617 - y_224618;\n                double x_224620 = defunc_2_reduce_res_224563 * a12_224608;\n                double y_224621 = defunc_2_reduce_res_224564 * b12_224611;\n                double x_224622 = x_224620 + y_224621;\n                double y_224623 = defunc_2_reduce_res_224565 * c12_224614;\n                double",
                   " y_224624 = x_224622 + y_224623;\n                double det_224625 = 1.0 / y_224624;\n                double a12_224626 = a12_224608 * det_224625;\n                double b12_224627 = b12_224611 * det_224625;\n                double c12_224628 = c12_224614 * det_224625;\n                double b2_224629 = b2_224616 * det_224625;\n                double c2_224630 = c2_224619 * det_224625;\n                double defunc_2_reduce_res_224631;\n                double defunc_2_reduce_res_224632;\n                double redout_228282;\n                double redout_228283;\n                \n                redout_228282 = 0.0;\n                redout_228283 = 0.0;\n                for (int64_t i_228284 = 0; i_228284 < q_t_203494; i_228284++) {\n                    bool cond_224640 = sle64(x_224534, i_228284);\n                    int64_t defunc_0_f_res_224641;\n                    \n                    if (cond_224640) {\n                        defunc_0_f_res_224641 = (int64_t) 0;\n                    } else {\n                        int64_t i_224642 = add64(x_224558, i_228284);\n                        int64_t defunc_0_add_arg_224643;\n                        \n                        defunc_0_add_arg_224643 = ((__global\n                                                    int64_t *) mem_231219)[i_224642 *\n                                                                           partition_sizze_203577 +\n                                                                           gtid_224528];\n                        \n                        int64_t defunc_1_add_res_224644 = add64((int64_t) 1,\n                                                                defunc_0_add_arg_224643);\n                        \n                        defunc_0_f_res_224641 = defunc_1_add_res_224644;\n                    }\n                    \n                    double defunc_0_f_res_224645;\n                    \n                    if (cond_224640) {\n                        defunc_0_f_res_224645 = 0.0;\n              ",
                   "      } else {\n                        int64_t i_224646 = add64(x_224558, i_228284);\n                        double defunc_0_add_arg_224647;\n                        \n                        defunc_0_add_arg_224647 = ((__global\n                                                    double *) color_232052)[phys_tid_224529 +\n                                                                            i_224646 *\n                                                                            num_threads_232203];\n                        defunc_0_f_res_224645 = defunc_0_add_arg_224647;\n                    }\n                    \n                    int64_t binop_p_224648 = sub64(defunc_0_f_res_224641,\n                                                   defunc_0_g_res_224562);\n                    double defunc_0_f_res_224649 =\n                           sitofp_i64_f64(binop_p_224648);\n                    double abs_res_224650 = fabs(defunc_0_f_res_224649);\n                    double tmp1_224651 = abs_res_224650 / x_224559;\n                    double x_224652 = tmp1_224651 * tmp1_224651;\n                    double y_224653 = tmp1_224651 * x_224652;\n                    double tmp2_224654 = 1.0 - y_224653;\n                    double x_224655 = tmp2_224654 * tmp2_224654;\n                    double tmp3_224656 = tmp2_224654 * x_224655;\n                    double tmp4_224657 = defunc_0_f_res_224645 * tmp3_224656;\n                    double defunc_1_f_res_224658 = defunc_0_f_res_224649 *\n                           tmp4_224657;\n                    double defunc_1_f_res_224659 = defunc_0_f_res_224649 *\n                           defunc_1_f_res_224658;\n                    double defunc_0_f_res_224660;\n                    \n                    if (cond_224640) {\n                        defunc_0_f_res_224660 = 0.0;\n                    } else {\n                        int64_t i_224661 = add64(x_224558, i_228284);\n                        double defunc_0_add_arg_224662;\n                        \n    ",
                   "                    defunc_0_add_arg_224662 = ((__global\n                                                    double *) color_232051)[phys_tid_224529 +\n                                                                            i_224661 *\n                                                                            num_threads_232203];\n                        defunc_0_f_res_224660 = defunc_0_add_arg_224662;\n                    }\n                    \n                    double x_224663 = a12_224626 * tmp4_224657;\n                    double y_224664 = b12_224627 * defunc_1_f_res_224658;\n                    double x_224665 = x_224663 + y_224664;\n                    double y_224666 = c12_224628 * defunc_1_f_res_224659;\n                    double x_224667 = x_224665 + y_224666;\n                    double defunc_9_fit_fun_res_224668 = defunc_0_f_res_224660 *\n                           x_224667;\n                    double x_224669 = b12_224627 * tmp4_224657;\n                    double y_224670 = b2_224629 * defunc_1_f_res_224658;\n                    double x_224671 = x_224669 + y_224670;\n                    double y_224672 = c2_224630 * defunc_1_f_res_224659;\n                    double x_224673 = x_224671 + y_224672;\n                    double defunc_9_slope_fun_res_224674 =\n                           defunc_0_f_res_224660 * x_224673;\n                    double defunc_1_op_res_224635 =\n                           defunc_9_fit_fun_res_224668 + redout_228282;\n                    double defunc_1_op_res_224638 =\n                           defunc_9_slope_fun_res_224674 + redout_228283;\n                    double redout_tmp_235876 = defunc_1_op_res_224635;\n                    double redout_tmp_235877 = defunc_1_op_res_224638;\n                    \n                    redout_228282 = redout_tmp_235876;\n                    redout_228283 = redout_tmp_235877;\n                }\n                defunc_2_reduce_res_224631 = redout_228282;\n                defunc_2_reduce_res_224632 = redout_",
                   "228283;\n                ((__global double *) color_232050)[phys_tid_224529 + i_229051 *\n                                                   num_threads_232203] =\n                    defunc_2_reduce_res_224631;\n                ((__global double *) color_232049)[phys_tid_224529 + i_229051 *\n                                                   num_threads_232203] =\n                    defunc_2_reduce_res_224632;\n            }\n            for (int64_t i_235878 = 0; i_235878 < t_n_m_203650; i_235878++) {\n                double tmp_235879;\n                \n                tmp_235879 = ((__global\n                               double *) color_232050)[phys_tid_224529 +\n                                                       i_235878 *\n                                                       num_threads_232203];\n                ((__global double *) mem_231307)[gtid_224528 + i_235878 *\n                                                 partition_sizze_203577] =\n                    tmp_235879;\n            }\n            for (int64_t i_235880 = 0; i_235880 < t_n_m_203650; i_235880++) {\n                double tmp_235881;\n                \n                tmp_235881 = ((__global\n                               double *) color_232049)[phys_tid_224529 +\n                                                       i_235880 *\n                                                       num_threads_232203];\n                ((__global double *) mem_231310)[gtid_224528 + i_235880 *\n                                                 partition_sizze_203577] =\n                    tmp_235881;\n            }\n        }\n        barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_224523\n}\n__kernel void mainzisegmap_225327(__global int *global_failure,\n                                  int64_t n_203490,\n                                  int64_t partition_sizze_203577, __global\n                                  unsigned char *mem_229161, __global\n           ",
                   "                       unsigned char *mem_230920, __global\n                                  unsigned char *mem_231315)\n{\n    #define segmap_group_sizze_225322 (mainzisegmap_group_sizze_225296)\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_235882;\n    int32_t local_tid_235883;\n    int64_t group_sizze_235886;\n    int32_t wave_sizze_235885;\n    int32_t group_tid_235884;\n    \n    global_tid_235882 = get_global_id(0);\n    local_tid_235883 = get_local_id(0);\n    group_sizze_235886 = get_local_size(0);\n    wave_sizze_235885 = LOCKSTEP_WIDTH;\n    group_tid_235884 = get_group_id(0);\n    \n    int32_t phys_tid_225327 = global_tid_235882;\n    int64_t global_tid_235887 = sext_i32_i64(group_tid_235884) *\n            segmap_group_sizze_225322 + sext_i32_i64(local_tid_235883);\n    int64_t slice_235888 = n_203490;\n    int64_t slice_235889 = partition_sizze_203577 * slice_235888;\n    int64_t gtid_225325 = squot64(global_tid_235887, slice_235888);\n    int64_t remnant_235890 = global_tid_235887 - gtid_225325 * slice_235888;\n    int64_t gtid_225326 = remnant_235890;\n    int64_t remnant_235891 = remnant_235890 - gtid_225326;\n    \n    if (slt64(gtid_225325, partition_sizze_203577) && slt64(gtid_225326,\n                                                            n_203490)) {\n        double x_225328;\n        \n        x_225328 = ((__global double *) mem_229161)[gtid_225325 * n_203490 +\n                                                    gtid_225326];\n        \n        double x_225329;\n        \n        x_225329 = ((__global double *) mem_230920)[gtid_225325 * n_203490 +\n                                                    gtid_225326];\n        \n        double defunc_1_f_res_225330 = x_225328 - x_225329;\n        \n        ((__global double *) mem_231315)[gtid_225325 * n_203490 + gtid_225326] =\n            defunc_1_f_res_225330;\n    }\n    \n  error_0:\n    return;\n    #und",
                   "ef segmap_group_sizze_225322\n}\n__kernel void mainzisegmap_225344(__global int *global_failure,\n                                  int failure_is_an_option, __global\n                                  int64_t *global_failure_args,\n                                  int64_t n_203490,\n                                  int64_t partition_sizze_203577,\n                                  int64_t ctx_param_ext_229488,\n                                  int64_t ctx_param_ext_229489,\n                                  int64_t ctx_param_ext_229491, __global\n                                  unsigned char *ext_mem_229197, __global\n                                  unsigned char *mem_param_229493, __global\n                                  unsigned char *mem_231315, __global\n                                  unsigned char *mem_231320, __global\n                                  unsigned char *mem_231324)\n{\n    #define segmap_group_sizze_225338 (mainzisegmap_group_sizze_225240)\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_235892;\n    int32_t local_tid_235893;\n    int64_t group_sizze_235896;\n    int32_t wave_sizze_235895;\n    int32_t group_tid_235894;\n    \n    global_tid_235892 = get_global_id(0);\n    local_tid_235893 = get_local_id(0);\n    group_sizze_235896 = get_local_size(0);\n    wave_sizze_235895 = LOCKSTEP_WIDTH;\n    group_tid_235894 = get_group_id(0);\n    \n    int32_t phys_tid_225344 = global_tid_235892;\n    int64_t global_tid_235897 = sext_i32_i64(group_tid_235894) *\n            segmap_group_sizze_225338 + sext_i32_i64(local_tid_235893);\n    int64_t slice_235898 = n_203490;\n    int64_t slice_235899 = partition_sizze_203577 * slice_235898;\n    int64_t gtid_225342 = squot64(global_tid_235897, slice_235898);\n    int64_t remnant_235900 = global_tid_235897 - gtid_225342 * slice_235898;\n    int64_t gtid_225343 = remnant_235900;\n    int64_t remnant_235901 = re",
                   "mnant_235900 - gtid_225343;\n    \n    if (slt64(gtid_225342, partition_sizze_203577) && slt64(gtid_225343,\n                                                            n_203490)) {\n        int64_t x_225347;\n        \n        x_225347 = ((__global int64_t *) ext_mem_229197)[gtid_225342 *\n                                                         n_203490 +\n                                                         gtid_225343];\n        \n        bool cond_225348 = sle64((int64_t) 0, x_225347);\n        double defunc_0_f_res_225349;\n        \n        if (cond_225348) {\n            bool y_225350 = slt64(x_225347, n_203490);\n            bool bounds_check_225351 = cond_225348 && y_225350;\n            bool index_certs_225352;\n            \n            if (!bounds_check_225351) {\n                {\n                    if (atomic_cmpxchg_i32_global(global_failure, -1, 62) ==\n                        -1) {\n                        global_failure_args[0] = (int64_t) x_225347;\n                        global_failure_args[1] = (int64_t) n_203490;\n                        ;\n                    }\n                    return;\n                }\n            }\n            \n            double defunc_0_f_res_t_res_225353;\n            \n            defunc_0_f_res_t_res_225353 = ((__global\n                                            double *) mem_231315)[gtid_225342 *\n                                                                  n_203490 +\n                                                                  x_225347];\n            defunc_0_f_res_225349 = defunc_0_f_res_t_res_225353;\n        } else {\n            defunc_0_f_res_225349 = 0.0;\n        }\n        \n        double defunc_0_f_res_225354;\n        \n        if (cond_225348) {\n            bool y_225355 = slt64(x_225347, n_203490);\n            bool bounds_check_225356 = cond_225348 && y_225355;\n            bool index_certs_225357;\n            \n            if (!bounds_check_225356) {\n                {\n                    if (atomic_cmpxchg_i32_global(gl",
                   "obal_failure, -1, 63) ==\n                        -1) {\n                        global_failure_args[0] = (int64_t) x_225347;\n                        global_failure_args[1] = (int64_t) n_203490;\n                        ;\n                    }\n                    return;\n                }\n            }\n            \n            double defunc_0_f_res_t_res_225358;\n            \n            defunc_0_f_res_t_res_225358 = ((__global\n                                            double *) mem_param_229493)[ctx_param_ext_229488 +\n                                                                        (gtid_225342 *\n                                                                         ctx_param_ext_229489 +\n                                                                         x_225347 *\n                                                                         ctx_param_ext_229491)];\n            defunc_0_f_res_225354 = defunc_0_f_res_t_res_225358;\n        } else {\n            defunc_0_f_res_225354 = 0.0;\n        }\n        ((__global double *) mem_231320)[gtid_225342 * n_203490 + gtid_225343] =\n            defunc_0_f_res_225354;\n        ((__global double *) mem_231324)[gtid_225342 * n_203490 + gtid_225343] =\n            defunc_0_f_res_225349;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_225338\n}\n__kernel void mainzisegmap_225374(__global int *global_failure,\n                                  int64_t n_203490, int64_t q_t_203494,\n                                  int64_t jump_t_203500,\n                                  int64_t partition_sizze_203577,\n                                  int64_t t_n_m_203650, int64_t i_203670,\n                                  __global unsigned char *ext_mem_229196,\n                                  __global unsigned char *ext_mem_229197,\n                                  __global unsigned char *ext_mem_229460,\n                                  __global unsigned char *ext_mem_229461,\n                                  __global uns",
                   "igned char *mem_231320, __global\n                                  unsigned char *mem_231324, __global\n                                  unsigned char *mem_231329, __global\n                                  unsigned char *mem_231333)\n{\n    #define segmap_group_sizze_225363 (mainzisegmap_group_sizze_224682)\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_235902;\n    int32_t local_tid_235903;\n    int64_t group_sizze_235906;\n    int32_t wave_sizze_235905;\n    int32_t group_tid_235904;\n    \n    global_tid_235902 = get_global_id(0);\n    local_tid_235903 = get_local_id(0);\n    group_sizze_235906 = get_local_size(0);\n    wave_sizze_235905 = LOCKSTEP_WIDTH;\n    group_tid_235904 = get_group_id(0);\n    \n    int32_t phys_tid_225374 = global_tid_235902;\n    int64_t global_tid_235907 = sext_i32_i64(group_tid_235904) *\n            segmap_group_sizze_225363 + sext_i32_i64(local_tid_235903);\n    int64_t slice_235908 = t_n_m_203650;\n    int64_t slice_235909 = partition_sizze_203577 * slice_235908;\n    int64_t gtid_225372 = squot64(global_tid_235907, slice_235908);\n    int64_t remnant_235910 = global_tid_235907 - gtid_225372 * slice_235908;\n    int64_t gtid_225373 = remnant_235910;\n    int64_t remnant_235911 = remnant_235910 - gtid_225373;\n    \n    if (slt64(gtid_225372, partition_sizze_203577) && slt64(gtid_225373,\n                                                            t_n_m_203650)) {\n        int64_t x_225376;\n        \n        x_225376 = ((__global int64_t *) ext_mem_229196)[gtid_225372];\n        \n        int64_t x_225380;\n        \n        x_225380 = ((__global int64_t *) ext_mem_229461)[gtid_225372 *\n                                                         t_n_m_203650 +\n                                                         gtid_225373];\n        \n        double x_225381;\n        \n        x_225381 = ((__global double *) ext_mem_229460)[gtid_225372 *\n",
                   "                                                        t_n_m_203650 +\n                                                        gtid_225373];\n        \n        int64_t min_arg_225382 = mul64(jump_t_203500, gtid_225373);\n        int64_t min_res_225383 = smin64(i_203670, min_arg_225382);\n        int64_t defunc_0_g_res_225384 = add64((int64_t) 1, min_res_225383);\n        double defunc_2_reduce_res_225385;\n        double defunc_2_reduce_res_225386;\n        double defunc_2_reduce_res_225387;\n        double defunc_2_reduce_res_225388;\n        double defunc_2_reduce_res_225389;\n        double redout_228289;\n        double redout_228290;\n        double redout_228291;\n        double redout_228292;\n        double redout_228293;\n        \n        redout_228289 = 0.0;\n        redout_228290 = 0.0;\n        redout_228291 = 0.0;\n        redout_228292 = 0.0;\n        redout_228293 = 0.0;\n        for (int64_t i_228294 = 0; i_228294 < q_t_203494; i_228294++) {\n            bool cond_225406 = sle64(x_225376, i_228294);\n            int64_t defunc_0_f_res_225407;\n            \n            if (cond_225406) {\n                defunc_0_f_res_225407 = (int64_t) 0;\n            } else {\n                int64_t i_225408 = add64(x_225380, i_228294);\n                int64_t defunc_0_add_arg_225409;\n                \n                defunc_0_add_arg_225409 = ((__global\n                                            int64_t *) ext_mem_229197)[gtid_225372 *\n                                                                       n_203490 +\n                                                                       i_225408];\n                \n                int64_t defunc_1_add_res_225410 = add64((int64_t) 1,\n                                                        defunc_0_add_arg_225409);\n                \n                defunc_0_f_res_225407 = defunc_1_add_res_225410;\n            }\n            \n            double defunc_0_f_res_225411;\n            \n            if (cond_225406) {\n                defunc_0_f_res_22541",
                   "1 = 0.0;\n            } else {\n                int64_t i_225412 = add64(x_225380, i_228294);\n                double defunc_0_add_arg_225413;\n                \n                defunc_0_add_arg_225413 = ((__global\n                                            double *) mem_231320)[gtid_225372 *\n                                                                  n_203490 +\n                                                                  i_225412];\n                defunc_0_f_res_225411 = defunc_0_add_arg_225413;\n            }\n            \n            int64_t binop_p_225414 = sub64(defunc_0_f_res_225407,\n                                           defunc_0_g_res_225384);\n            double defunc_0_f_res_225415 = sitofp_i64_f64(binop_p_225414);\n            double abs_res_225416 = fabs(defunc_0_f_res_225415);\n            double tmp1_225417 = abs_res_225416 / x_225381;\n            double x_225418 = tmp1_225417 * tmp1_225417;\n            double y_225419 = tmp1_225417 * x_225418;\n            double tmp2_225420 = 1.0 - y_225419;\n            double x_225421 = tmp2_225420 * tmp2_225420;\n            double tmp3_225422 = tmp2_225420 * x_225421;\n            double w_j_225423 = defunc_0_f_res_225411 * tmp3_225422;\n            double xw_j_225424 = defunc_0_f_res_225415 * w_j_225423;\n            double x2w_j_225425 = defunc_0_f_res_225415 * xw_j_225424;\n            double x3w_j_225426 = defunc_0_f_res_225415 * x2w_j_225425;\n            double x4w_j_225427 = defunc_0_f_res_225415 * x3w_j_225426;\n            double defunc_1_op_res_225392 = w_j_225423 + redout_228289;\n            double defunc_1_op_res_225395 = xw_j_225424 + redout_228290;\n            double defunc_1_op_res_225398 = x2w_j_225425 + redout_228291;\n            double defunc_1_op_res_225401 = x3w_j_225426 + redout_228292;\n            double defunc_1_op_res_225404 = x4w_j_225427 + redout_228293;\n            double redout_tmp_235912 = defunc_1_op_res_225392;\n            double redout_tmp_235913 = defunc_1_op_res_225395;\n           ",
                   " double redout_tmp_235914 = defunc_1_op_res_225398;\n            double redout_tmp_235915 = defunc_1_op_res_225401;\n            double redout_tmp_235916 = defunc_1_op_res_225404;\n            \n            redout_228289 = redout_tmp_235912;\n            redout_228290 = redout_tmp_235913;\n            redout_228291 = redout_tmp_235914;\n            redout_228292 = redout_tmp_235915;\n            redout_228293 = redout_tmp_235916;\n        }\n        defunc_2_reduce_res_225385 = redout_228289;\n        defunc_2_reduce_res_225386 = redout_228290;\n        defunc_2_reduce_res_225387 = redout_228291;\n        defunc_2_reduce_res_225388 = redout_228292;\n        defunc_2_reduce_res_225389 = redout_228293;\n        \n        double x_225428 = defunc_2_reduce_res_225387 *\n               defunc_2_reduce_res_225389;\n        double y_225429 = defunc_2_reduce_res_225388 *\n               defunc_2_reduce_res_225388;\n        double a12_225430 = x_225428 - y_225429;\n        double x_225431 = defunc_2_reduce_res_225387 *\n               defunc_2_reduce_res_225388;\n        double y_225432 = defunc_2_reduce_res_225386 *\n               defunc_2_reduce_res_225389;\n        double b12_225433 = x_225431 - y_225432;\n        double x_225434 = defunc_2_reduce_res_225386 *\n               defunc_2_reduce_res_225388;\n        double y_225435 = defunc_2_reduce_res_225387 *\n               defunc_2_reduce_res_225387;\n        double c12_225436 = x_225434 - y_225435;\n        double x_225437 = defunc_2_reduce_res_225385 *\n               defunc_2_reduce_res_225389;\n        double b2_225438 = x_225437 - y_225435;\n        double x_225439 = defunc_2_reduce_res_225386 *\n               defunc_2_reduce_res_225387;\n        double y_225440 = defunc_2_reduce_res_225385 *\n               defunc_2_reduce_res_225388;\n        double c2_225441 = x_225439 - y_225440;\n        double x_225442 = defunc_2_reduce_res_225385 * a12_225430;\n        double y_225443 = defunc_2_reduce_res_225386 * b12_225433;\n        double x_225444 = x_225442 +",
                   " y_225443;\n        double y_225445 = defunc_2_reduce_res_225387 * c12_225436;\n        double y_225446 = x_225444 + y_225445;\n        double det_225447 = 1.0 / y_225446;\n        double a12_225448 = a12_225430 * det_225447;\n        double b12_225449 = b12_225433 * det_225447;\n        double c12_225450 = c12_225436 * det_225447;\n        double b2_225451 = b2_225438 * det_225447;\n        double c2_225452 = c2_225441 * det_225447;\n        double defunc_2_reduce_res_225453;\n        double defunc_2_reduce_res_225454;\n        double redout_228295;\n        double redout_228296;\n        \n        redout_228295 = 0.0;\n        redout_228296 = 0.0;\n        for (int64_t i_228297 = 0; i_228297 < q_t_203494; i_228297++) {\n            bool cond_225462 = sle64(x_225376, i_228297);\n            int64_t defunc_0_f_res_225463;\n            \n            if (cond_225462) {\n                defunc_0_f_res_225463 = (int64_t) 0;\n            } else {\n                int64_t i_225464 = add64(x_225380, i_228297);\n                int64_t defunc_0_add_arg_225465;\n                \n                defunc_0_add_arg_225465 = ((__global\n                                            int64_t *) ext_mem_229197)[gtid_225372 *\n                                                                       n_203490 +\n                                                                       i_225464];\n                \n                int64_t defunc_1_add_res_225466 = add64((int64_t) 1,\n                                                        defunc_0_add_arg_225465);\n                \n                defunc_0_f_res_225463 = defunc_1_add_res_225466;\n            }\n            \n            double defunc_0_f_res_225467;\n            \n            if (cond_225462) {\n                defunc_0_f_res_225467 = 0.0;\n            } else {\n                int64_t i_225468 = add64(x_225380, i_228297);\n                double defunc_0_add_arg_225469;\n                \n                defunc_0_add_arg_225469 = ((__global\n                           ",
                   "                 double *) mem_231320)[gtid_225372 *\n                                                                  n_203490 +\n                                                                  i_225468];\n                defunc_0_f_res_225467 = defunc_0_add_arg_225469;\n            }\n            \n            int64_t binop_p_225470 = sub64(defunc_0_f_res_225463,\n                                           defunc_0_g_res_225384);\n            double defunc_0_f_res_225471 = sitofp_i64_f64(binop_p_225470);\n            double abs_res_225472 = fabs(defunc_0_f_res_225471);\n            double tmp1_225473 = abs_res_225472 / x_225381;\n            double x_225474 = tmp1_225473 * tmp1_225473;\n            double y_225475 = tmp1_225473 * x_225474;\n            double tmp2_225476 = 1.0 - y_225475;\n            double x_225477 = tmp2_225476 * tmp2_225476;\n            double tmp3_225478 = tmp2_225476 * x_225477;\n            double tmp4_225479 = defunc_0_f_res_225467 * tmp3_225478;\n            double defunc_1_f_res_225480 = defunc_0_f_res_225471 * tmp4_225479;\n            double defunc_1_f_res_225481 = defunc_0_f_res_225471 *\n                   defunc_1_f_res_225480;\n            double defunc_0_f_res_225482;\n            \n            if (cond_225462) {\n                defunc_0_f_res_225482 = 0.0;\n            } else {\n                int64_t i_225483 = add64(x_225380, i_228297);\n                double defunc_0_add_arg_225484;\n                \n                defunc_0_add_arg_225484 = ((__global\n                                            double *) mem_231324)[gtid_225372 *\n                                                                  n_203490 +\n                                                                  i_225483];\n                defunc_0_f_res_225482 = defunc_0_add_arg_225484;\n            }\n            \n            double x_225485 = a12_225448 * tmp4_225479;\n            double y_225486 = b12_225449 * defunc_1_f_res_225480;\n            double x_225487 = x_225485 + y_225486;\n    ",
                   "        double y_225488 = c12_225450 * defunc_1_f_res_225481;\n            double x_225489 = x_225487 + y_225488;\n            double defunc_9_fit_fun_res_225490 = defunc_0_f_res_225482 *\n                   x_225489;\n            double x_225491 = b12_225449 * tmp4_225479;\n            double y_225492 = b2_225451 * defunc_1_f_res_225480;\n            double x_225493 = x_225491 + y_225492;\n            double y_225494 = c2_225452 * defunc_1_f_res_225481;\n            double x_225495 = x_225493 + y_225494;\n            double defunc_9_slope_fun_res_225496 = defunc_0_f_res_225482 *\n                   x_225495;\n            double defunc_1_op_res_225457 = defunc_9_fit_fun_res_225490 +\n                   redout_228295;\n            double defunc_1_op_res_225460 = defunc_9_slope_fun_res_225496 +\n                   redout_228296;\n            double redout_tmp_235917 = defunc_1_op_res_225457;\n            double redout_tmp_235918 = defunc_1_op_res_225460;\n            \n            redout_228295 = redout_tmp_235917;\n            redout_228296 = redout_tmp_235918;\n        }\n        defunc_2_reduce_res_225453 = redout_228295;\n        defunc_2_reduce_res_225454 = redout_228296;\n        ((__global double *) mem_231329)[gtid_225372 * t_n_m_203650 +\n                                         gtid_225373] =\n            defunc_2_reduce_res_225453;\n        ((__global double *) mem_231333)[gtid_225372 * t_n_m_203650 +\n                                         gtid_225373] =\n            defunc_2_reduce_res_225454;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_225363\n}\n__kernel void mainzisegmap_225582(__global int *global_failure,\n                                  int64_t partition_sizze_203577,\n                                  int64_t t_n_m_203650, __global\n                                  unsigned char *mem_231338, __global\n                                  unsigned char *mem_231342, __global\n                                  unsigned char *mem_231346, __global\n                  ",
                   "                unsigned char *mem_231350, __global\n                                  unsigned char *mem_231354, __global\n                                  unsigned char *mem_231359, __global\n                                  unsigned char *mem_231363, __global\n                                  unsigned char *mem_231367, __global\n                                  unsigned char *mem_231371, __global\n                                  unsigned char *mem_231375)\n{\n    #define segmap_group_sizze_225573 (mainzisegmap_group_sizze_224920)\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_236047;\n    int32_t local_tid_236048;\n    int64_t group_sizze_236051;\n    int32_t wave_sizze_236050;\n    int32_t group_tid_236049;\n    \n    global_tid_236047 = get_global_id(0);\n    local_tid_236048 = get_local_id(0);\n    group_sizze_236051 = get_local_size(0);\n    wave_sizze_236050 = LOCKSTEP_WIDTH;\n    group_tid_236049 = get_group_id(0);\n    \n    int32_t phys_tid_225582 = global_tid_236047;\n    int64_t global_tid_236052 = sext_i32_i64(group_tid_236049) *\n            segmap_group_sizze_225573 + sext_i32_i64(local_tid_236048);\n    int64_t slice_236053 = t_n_m_203650;\n    int64_t slice_236054 = partition_sizze_203577 * slice_236053;\n    int64_t gtid_225580 = squot64(global_tid_236052, slice_236053);\n    int64_t remnant_236055 = global_tid_236052 - gtid_225580 * slice_236053;\n    int64_t gtid_225581 = remnant_236055;\n    int64_t remnant_236056 = remnant_236055 - gtid_225581;\n    \n    if (slt64(gtid_225580, partition_sizze_203577) && slt64(gtid_225581,\n                                                            t_n_m_203650)) {\n        double defunc_2_reduce_res_225583;\n        \n        defunc_2_reduce_res_225583 = ((__global\n                                       double *) mem_231338)[gtid_225580 *\n                                                             t_n_m_203650",
                   " +\n                                                             gtid_225581];\n        \n        double defunc_2_reduce_res_225584;\n        \n        defunc_2_reduce_res_225584 = ((__global\n                                       double *) mem_231342)[gtid_225580 *\n                                                             t_n_m_203650 +\n                                                             gtid_225581];\n        \n        double defunc_2_reduce_res_225585;\n        \n        defunc_2_reduce_res_225585 = ((__global\n                                       double *) mem_231346)[gtid_225580 *\n                                                             t_n_m_203650 +\n                                                             gtid_225581];\n        \n        double defunc_2_reduce_res_225586;\n        \n        defunc_2_reduce_res_225586 = ((__global\n                                       double *) mem_231350)[gtid_225580 *\n                                                             t_n_m_203650 +\n                                                             gtid_225581];\n        \n        double defunc_2_reduce_res_225587;\n        \n        defunc_2_reduce_res_225587 = ((__global\n                                       double *) mem_231354)[gtid_225580 *\n                                                             t_n_m_203650 +\n                                                             gtid_225581];\n        \n        double x_225588 = defunc_2_reduce_res_225585 *\n               defunc_2_reduce_res_225587;\n        double y_225589 = defunc_2_reduce_res_225586 *\n               defunc_2_reduce_res_225586;\n        double a12_225590 = x_225588 - y_225589;\n        double x_225591 = defunc_2_reduce_res_225585 *\n               defunc_2_reduce_res_225586;\n        double y_225592 = defunc_2_reduce_res_225584 *\n               defunc_2_reduce_res_225587;\n        double b12_225593 = x_225591 - y_225592;\n        double x_225594 = defunc_2_reduce_res_225584 *\n               defunc_2_redu",
                   "ce_res_225586;\n        double y_225595 = defunc_2_reduce_res_225585 *\n               defunc_2_reduce_res_225585;\n        double c12_225596 = x_225594 - y_225595;\n        double x_225597 = defunc_2_reduce_res_225583 *\n               defunc_2_reduce_res_225587;\n        double b2_225598 = x_225597 - y_225595;\n        double x_225599 = defunc_2_reduce_res_225584 *\n               defunc_2_reduce_res_225585;\n        double y_225600 = defunc_2_reduce_res_225583 *\n               defunc_2_reduce_res_225586;\n        double c2_225601 = x_225599 - y_225600;\n        double x_225602 = defunc_2_reduce_res_225583 * a12_225590;\n        double y_225603 = defunc_2_reduce_res_225584 * b12_225593;\n        double x_225604 = x_225602 + y_225603;\n        double y_225605 = defunc_2_reduce_res_225585 * c12_225596;\n        double y_225606 = x_225604 + y_225605;\n        double det_225607 = 1.0 / y_225606;\n        double a12_225608 = a12_225590 * det_225607;\n        double b12_225609 = b12_225593 * det_225607;\n        double c12_225610 = c12_225596 * det_225607;\n        double b2_225611 = b2_225598 * det_225607;\n        double c2_225612 = c2_225601 * det_225607;\n        \n        ((__global double *) mem_231359)[gtid_225580 * t_n_m_203650 +\n                                         gtid_225581] = a12_225608;\n        ((__global double *) mem_231363)[gtid_225580 * t_n_m_203650 +\n                                         gtid_225581] = b12_225609;\n        ((__global double *) mem_231367)[gtid_225580 * t_n_m_203650 +\n                                         gtid_225581] = c12_225610;\n        ((__global double *) mem_231371)[gtid_225580 * t_n_m_203650 +\n                                         gtid_225581] = b2_225611;\n        ((__global double *) mem_231375)[gtid_225580 * t_n_m_203650 +\n                                         gtid_225581] = c2_225612;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_225573\n}\n__kernel void mainzisegmap_225873(__global int *global_failure,\n              ",
                   "                    int64_t n_203490,\n                                  int64_t partition_sizze_203577, __global\n                                  unsigned char *mem_229161, __global\n                                  unsigned char *mem_230920, __global\n                                  unsigned char *mem_231411)\n{\n    #define segmap_group_sizze_225868 (mainzisegmap_group_sizze_225842)\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_236145;\n    int32_t local_tid_236146;\n    int64_t group_sizze_236149;\n    int32_t wave_sizze_236148;\n    int32_t group_tid_236147;\n    \n    global_tid_236145 = get_global_id(0);\n    local_tid_236146 = get_local_id(0);\n    group_sizze_236149 = get_local_size(0);\n    wave_sizze_236148 = LOCKSTEP_WIDTH;\n    group_tid_236147 = get_group_id(0);\n    \n    int32_t phys_tid_225873 = global_tid_236145;\n    int64_t global_tid_236150 = sext_i32_i64(group_tid_236147) *\n            segmap_group_sizze_225868 + sext_i32_i64(local_tid_236146);\n    int64_t slice_236151 = n_203490;\n    int64_t slice_236152 = partition_sizze_203577 * slice_236151;\n    int64_t gtid_225871 = squot64(global_tid_236150, slice_236151);\n    int64_t remnant_236153 = global_tid_236150 - gtid_225871 * slice_236151;\n    int64_t gtid_225872 = remnant_236153;\n    int64_t remnant_236154 = remnant_236153 - gtid_225872;\n    \n    if (slt64(gtid_225871, partition_sizze_203577) && slt64(gtid_225872,\n                                                            n_203490)) {\n        double x_225874;\n        \n        x_225874 = ((__global double *) mem_229161)[gtid_225871 * n_203490 +\n                                                    gtid_225872];\n        \n        double x_225875;\n        \n        x_225875 = ((__global double *) mem_230920)[gtid_225871 * n_203490 +\n                                                    gtid_225872];\n        \n        double defunc_1_f_res_225",
                   "876 = x_225874 - x_225875;\n        \n        ((__global double *) mem_231411)[gtid_225871 * n_203490 + gtid_225872] =\n            defunc_1_f_res_225876;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_225868\n}\n__kernel void mainzisegmap_225890(__global int *global_failure,\n                                  int failure_is_an_option, __global\n                                  int64_t *global_failure_args,\n                                  int64_t n_203490,\n                                  int64_t partition_sizze_203577,\n                                  int64_t ctx_param_ext_229488,\n                                  int64_t ctx_param_ext_229489,\n                                  int64_t ctx_param_ext_229491, __global\n                                  unsigned char *ext_mem_229197, __global\n                                  unsigned char *mem_param_229493, __global\n                                  unsigned char *mem_231411, __global\n                                  unsigned char *mem_231416, __global\n                                  unsigned char *mem_231420)\n{\n    #define segmap_group_sizze_225884 (mainzisegmap_group_sizze_225786)\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_236155;\n    int32_t local_tid_236156;\n    int64_t group_sizze_236159;\n    int32_t wave_sizze_236158;\n    int32_t group_tid_236157;\n    \n    global_tid_236155 = get_global_id(0);\n    local_tid_236156 = get_local_id(0);\n    group_sizze_236159 = get_local_size(0);\n    wave_sizze_236158 = LOCKSTEP_WIDTH;\n    group_tid_236157 = get_group_id(0);\n    \n    int32_t phys_tid_225890 = global_tid_236155;\n    int64_t global_tid_236160 = sext_i32_i64(group_tid_236157) *\n            segmap_group_sizze_225884 + sext_i32_i64(local_tid_236156);\n    int64_t slice_236161 = n_203490;\n    int64_t slice_236162 = partition_sizze_203577 * slice_236161;\n    int64_t gtid_225888 ",
                   "= squot64(global_tid_236160, slice_236161);\n    int64_t remnant_236163 = global_tid_236160 - gtid_225888 * slice_236161;\n    int64_t gtid_225889 = remnant_236163;\n    int64_t remnant_236164 = remnant_236163 - gtid_225889;\n    \n    if (slt64(gtid_225888, partition_sizze_203577) && slt64(gtid_225889,\n                                                            n_203490)) {\n        int64_t x_225893;\n        \n        x_225893 = ((__global int64_t *) ext_mem_229197)[gtid_225888 *\n                                                         n_203490 +\n                                                         gtid_225889];\n        \n        bool cond_225894 = sle64((int64_t) 0, x_225893);\n        double defunc_0_f_res_225895;\n        \n        if (cond_225894) {\n            bool y_225896 = slt64(x_225893, n_203490);\n            bool bounds_check_225897 = cond_225894 && y_225896;\n            bool index_certs_225898;\n            \n            if (!bounds_check_225897) {\n                {\n                    if (atomic_cmpxchg_i32_global(global_failure, -1, 64) ==\n                        -1) {\n                        global_failure_args[0] = (int64_t) x_225893;\n                        global_failure_args[1] = (int64_t) n_203490;\n                        ;\n                    }\n                    return;\n                }\n            }\n            \n            double defunc_0_f_res_t_res_225899;\n            \n            defunc_0_f_res_t_res_225899 = ((__global\n                                            double *) mem_231411)[gtid_225888 *\n                                                                  n_203490 +\n                                                                  x_225893];\n            defunc_0_f_res_225895 = defunc_0_f_res_t_res_225899;\n        } else {\n            defunc_0_f_res_225895 = 0.0;\n        }\n        \n        double defunc_0_f_res_225900;\n        \n        if (cond_225894) {\n            bool y_225901 = slt64(x_225893, n_203490);\n            bool bounds_check_",
                   "225902 = cond_225894 && y_225901;\n            bool index_certs_225903;\n            \n            if (!bounds_check_225902) {\n                {\n                    if (atomic_cmpxchg_i32_global(global_failure, -1, 65) ==\n                        -1) {\n                        global_failure_args[0] = (int64_t) x_225893;\n                        global_failure_args[1] = (int64_t) n_203490;\n                        ;\n                    }\n                    return;\n                }\n            }\n            \n            double defunc_0_f_res_t_res_225904;\n            \n            defunc_0_f_res_t_res_225904 = ((__global\n                                            double *) mem_param_229493)[ctx_param_ext_229488 +\n                                                                        (gtid_225888 *\n                                                                         ctx_param_ext_229489 +\n                                                                         x_225893 *\n                                                                         ctx_param_ext_229491)];\n            defunc_0_f_res_225900 = defunc_0_f_res_t_res_225904;\n        } else {\n            defunc_0_f_res_225900 = 0.0;\n        }\n        ((__global double *) mem_231416)[gtid_225888 * n_203490 + gtid_225889] =\n            defunc_0_f_res_225900;\n        ((__global double *) mem_231420)[gtid_225888 * n_203490 + gtid_225889] =\n            defunc_0_f_res_225895;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_225884\n}\n__kernel void mainzisegmap_226185(__global int *global_failure,\n                                  int64_t n_203490,\n                                  int64_t partition_sizze_203577, __global\n                                  unsigned char *mem_229161, __global\n                                  unsigned char *mem_230920, __global\n                                  unsigned char *mem_231435)\n{\n    #define segmap_group_sizze_226180 (mainzisegmap_group_sizze_226154)\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_236185;\n    int32_t local_tid_236186;\n    int64_t group_sizze_236189;\n    int32_t wave_sizze_236188;\n    int32_t group_tid_236187;\n    \n    global_tid_236185 = get_global_id(0);\n    local_tid_236186 = get_local_id(0);\n    group_sizze_236189 = get_local_size(0);\n    wave_sizze_236188 = LOCKSTEP_WIDTH;\n    group_tid_236187 = get_group_id(0);\n    \n    int32_t phys_tid_226185 = global_tid_236185;\n    int64_t global_tid_236190 = sext_i32_i64(group_tid_236187) *\n            segmap_group_sizze_226180 + sext_i32_i64(local_tid_236186);\n    int64_t slice_236191 = n_203490;\n    int64_t slice_236192 = partition_sizze_203577 * slice_236191;\n    int64_t gtid_226183 = squot64(global_tid_236190, slice_236191);\n    int64_t remnant_236193 = global_tid_236190 - gtid_226183 * slice_236191;\n    int64_t gtid_226184 = remnant_236193;\n    int64_t remnant_236194 = remnant_236193 - gtid_226184;\n    \n    if (slt64(gtid_226183, partition_sizze_203577) && slt64(gtid_226184,\n                                                            n_203490)) {\n        double x_226186;\n        \n        x_226186 = ((__global double *) mem_229161)[gtid_226183 * n_203490 +\n                                                    gtid_226184];\n        \n        double x_226187;\n        \n        x_226187 = ((__global double *) mem_230920)[gtid_226183 * n_203490 +\n                                                    gtid_226184];\n        \n        double defunc_1_f_res_226188 = x_226186 - x_226187;\n        \n        ((__global double *) mem_231435)[gtid_226183 * n_203490 + gtid_226184] =\n            defunc_1_f_res_226188;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_226180\n}\n__kernel void mainzisegmap_226202(__global int *global_failure,\n                                  int failure_is_an_option, __global\n                                  int64_t *gl",
                   "obal_failure_args,\n                                  int64_t n_203490,\n                                  int64_t partition_sizze_203577,\n                                  int64_t ctx_param_ext_229488,\n                                  int64_t ctx_param_ext_229489,\n                                  int64_t ctx_param_ext_229491, __global\n                                  unsigned char *ext_mem_229197, __global\n                                  unsigned char *mem_param_229493, __global\n                                  unsigned char *mem_231435, __global\n                                  unsigned char *mem_231440, __global\n                                  unsigned char *mem_231444)\n{\n    #define segmap_group_sizze_226196 (mainzisegmap_group_sizze_226098)\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_236195;\n    int32_t local_tid_236196;\n    int64_t group_sizze_236199;\n    int32_t wave_sizze_236198;\n    int32_t group_tid_236197;\n    \n    global_tid_236195 = get_global_id(0);\n    local_tid_236196 = get_local_id(0);\n    group_sizze_236199 = get_local_size(0);\n    wave_sizze_236198 = LOCKSTEP_WIDTH;\n    group_tid_236197 = get_group_id(0);\n    \n    int32_t phys_tid_226202 = global_tid_236195;\n    int64_t global_tid_236200 = sext_i32_i64(group_tid_236197) *\n            segmap_group_sizze_226196 + sext_i32_i64(local_tid_236196);\n    int64_t slice_236201 = n_203490;\n    int64_t slice_236202 = partition_sizze_203577 * slice_236201;\n    int64_t gtid_226200 = squot64(global_tid_236200, slice_236201);\n    int64_t remnant_236203 = global_tid_236200 - gtid_226200 * slice_236201;\n    int64_t gtid_226201 = remnant_236203;\n    int64_t remnant_236204 = remnant_236203 - gtid_226201;\n    \n    if (slt64(gtid_226200, partition_sizze_203577) && slt64(gtid_226201,\n                                                            n_203490)) {\n        int64_t x_226205;\n    ",
                   "    \n        x_226205 = ((__global int64_t *) ext_mem_229197)[gtid_226200 *\n                                                         n_203490 +\n                                                         gtid_226201];\n        \n        bool cond_226206 = sle64((int64_t) 0, x_226205);\n        double defunc_0_f_res_226207;\n        \n        if (cond_226206) {\n            bool y_226208 = slt64(x_226205, n_203490);\n            bool bounds_check_226209 = cond_226206 && y_226208;\n            bool index_certs_226210;\n            \n            if (!bounds_check_226209) {\n                {\n                    if (atomic_cmpxchg_i32_global(global_failure, -1, 66) ==\n                        -1) {\n                        global_failure_args[0] = (int64_t) x_226205;\n                        global_failure_args[1] = (int64_t) n_203490;\n                        ;\n                    }\n                    return;\n                }\n            }\n            \n            double defunc_0_f_res_t_res_226211;\n            \n            defunc_0_f_res_t_res_226211 = ((__global\n                                            double *) mem_231435)[gtid_226200 *\n                                                                  n_203490 +\n                                                                  x_226205];\n            defunc_0_f_res_226207 = defunc_0_f_res_t_res_226211;\n        } else {\n            defunc_0_f_res_226207 = 0.0;\n        }\n        \n        double defunc_0_f_res_226212;\n        \n        if (cond_226206) {\n            bool y_226213 = slt64(x_226205, n_203490);\n            bool bounds_check_226214 = cond_226206 && y_226213;\n            bool index_certs_226215;\n            \n            if (!bounds_check_226214) {\n                {\n                    if (atomic_cmpxchg_i32_global(global_failure, -1, 67) ==\n                        -1) {\n                        global_failure_args[0] = (int64_t) x_226205;\n                        global_failure_args[1] = (int64_t) n_203490;\n                ",
                   "        ;\n                    }\n                    return;\n                }\n            }\n            \n            double defunc_0_f_res_t_res_226216;\n            \n            defunc_0_f_res_t_res_226216 = ((__global\n                                            double *) mem_param_229493)[ctx_param_ext_229488 +\n                                                                        (gtid_226200 *\n                                                                         ctx_param_ext_229489 +\n                                                                         x_226205 *\n                                                                         ctx_param_ext_229491)];\n            defunc_0_f_res_226212 = defunc_0_f_res_t_res_226216;\n        } else {\n            defunc_0_f_res_226212 = 0.0;\n        }\n        ((__global double *) mem_231440)[gtid_226200 * n_203490 + gtid_226201] =\n            defunc_0_f_res_226212;\n        ((__global double *) mem_231444)[gtid_226200 * n_203490 + gtid_226201] =\n            defunc_0_f_res_226207;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_226196\n}\n__kernel void mainzisegmap_226589(__global int *global_failure,\n                                  int64_t n_203490,\n                                  int64_t partition_sizze_203577, __global\n                                  unsigned char *mem_229161, __global\n                                  unsigned char *mem_230920, __global\n                                  unsigned char *mem_231466)\n{\n    #define segmap_group_sizze_226584 (mainzisegmap_group_sizze_226558)\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_236231;\n    int32_t local_tid_236232;\n    int64_t group_sizze_236235;\n    int32_t wave_sizze_236234;\n    int32_t group_tid_236233;\n    \n    global_tid_236231 = get_global_id(0);\n    local_tid_236232 = get_local_id(0);\n    group_sizze_236235 = g",
                   "et_local_size(0);\n    wave_sizze_236234 = LOCKSTEP_WIDTH;\n    group_tid_236233 = get_group_id(0);\n    \n    int32_t phys_tid_226589 = global_tid_236231;\n    int64_t global_tid_236236 = sext_i32_i64(group_tid_236233) *\n            segmap_group_sizze_226584 + sext_i32_i64(local_tid_236232);\n    int64_t slice_236237 = n_203490;\n    int64_t slice_236238 = partition_sizze_203577 * slice_236237;\n    int64_t gtid_226587 = squot64(global_tid_236236, slice_236237);\n    int64_t remnant_236239 = global_tid_236236 - gtid_226587 * slice_236237;\n    int64_t gtid_226588 = remnant_236239;\n    int64_t remnant_236240 = remnant_236239 - gtid_226588;\n    \n    if (slt64(gtid_226587, partition_sizze_203577) && slt64(gtid_226588,\n                                                            n_203490)) {\n        double x_226590;\n        \n        x_226590 = ((__global double *) mem_229161)[gtid_226587 * n_203490 +\n                                                    gtid_226588];\n        \n        double x_226591;\n        \n        x_226591 = ((__global double *) mem_230920)[gtid_226587 * n_203490 +\n                                                    gtid_226588];\n        \n        double defunc_1_f_res_226592 = x_226590 - x_226591;\n        \n        ((__global double *) mem_231466)[gtid_226587 * n_203490 + gtid_226588] =\n            defunc_1_f_res_226592;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_226584\n}\n__kernel void mainzisegmap_226606(__global int *global_failure,\n                                  int failure_is_an_option, __global\n                                  int64_t *global_failure_args,\n                                  int64_t n_203490,\n                                  int64_t partition_sizze_203577,\n                                  int64_t ctx_param_ext_229488,\n                                  int64_t ctx_param_ext_229489,\n                                  int64_t ctx_param_ext_229491, __global\n                                  unsigned char *ext_mem_229197, ",
                   "__global\n                                  unsigned char *mem_param_229493, __global\n                                  unsigned char *mem_231466, __global\n                                  unsigned char *mem_231471, __global\n                                  unsigned char *mem_231475)\n{\n    #define segmap_group_sizze_226600 (mainzisegmap_group_sizze_226502)\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_236241;\n    int32_t local_tid_236242;\n    int64_t group_sizze_236245;\n    int32_t wave_sizze_236244;\n    int32_t group_tid_236243;\n    \n    global_tid_236241 = get_global_id(0);\n    local_tid_236242 = get_local_id(0);\n    group_sizze_236245 = get_local_size(0);\n    wave_sizze_236244 = LOCKSTEP_WIDTH;\n    group_tid_236243 = get_group_id(0);\n    \n    int32_t phys_tid_226606 = global_tid_236241;\n    int64_t global_tid_236246 = sext_i32_i64(group_tid_236243) *\n            segmap_group_sizze_226600 + sext_i32_i64(local_tid_236242);\n    int64_t slice_236247 = n_203490;\n    int64_t slice_236248 = partition_sizze_203577 * slice_236247;\n    int64_t gtid_226604 = squot64(global_tid_236246, slice_236247);\n    int64_t remnant_236249 = global_tid_236246 - gtid_226604 * slice_236247;\n    int64_t gtid_226605 = remnant_236249;\n    int64_t remnant_236250 = remnant_236249 - gtid_226605;\n    \n    if (slt64(gtid_226604, partition_sizze_203577) && slt64(gtid_226605,\n                                                            n_203490)) {\n        int64_t x_226609;\n        \n        x_226609 = ((__global int64_t *) ext_mem_229197)[gtid_226604 *\n                                                         n_203490 +\n                                                         gtid_226605];\n        \n        bool cond_226610 = sle64((int64_t) 0, x_226609);\n        double defunc_0_f_res_226611;\n        \n        if (cond_226610) {\n            bool y_226612 = slt64(x_226609, n_20",
                   "3490);\n            bool bounds_check_226613 = cond_226610 && y_226612;\n            bool index_certs_226614;\n            \n            if (!bounds_check_226613) {\n                {\n                    if (atomic_cmpxchg_i32_global(global_failure, -1, 68) ==\n                        -1) {\n                        global_failure_args[0] = (int64_t) x_226609;\n                        global_failure_args[1] = (int64_t) n_203490;\n                        ;\n                    }\n                    return;\n                }\n            }\n            \n            double defunc_0_f_res_t_res_226615;\n            \n            defunc_0_f_res_t_res_226615 = ((__global\n                                            double *) mem_231466)[gtid_226604 *\n                                                                  n_203490 +\n                                                                  x_226609];\n            defunc_0_f_res_226611 = defunc_0_f_res_t_res_226615;\n        } else {\n            defunc_0_f_res_226611 = 0.0;\n        }\n        \n        double defunc_0_f_res_226616;\n        \n        if (cond_226610) {\n            bool y_226617 = slt64(x_226609, n_203490);\n            bool bounds_check_226618 = cond_226610 && y_226617;\n            bool index_certs_226619;\n            \n            if (!bounds_check_226618) {\n                {\n                    if (atomic_cmpxchg_i32_global(global_failure, -1, 69) ==\n                        -1) {\n                        global_failure_args[0] = (int64_t) x_226609;\n                        global_failure_args[1] = (int64_t) n_203490;\n                        ;\n                    }\n                    return;\n                }\n            }\n            \n            double defunc_0_f_res_t_res_226620;\n            \n            defunc_0_f_res_t_res_226620 = ((__global\n                                            double *) mem_param_229493)[ctx_param_ext_229488 +\n                                                                        (gtid_226604 *\n  ",
                   "                                                                       ctx_param_ext_229489 +\n                                                                         x_226609 *\n                                                                         ctx_param_ext_229491)];\n            defunc_0_f_res_226616 = defunc_0_f_res_t_res_226620;\n        } else {\n            defunc_0_f_res_226616 = 0.0;\n        }\n        ((__global double *) mem_231471)[gtid_226604 * n_203490 + gtid_226605] =\n            defunc_0_f_res_226616;\n        ((__global double *) mem_231475)[gtid_226604 * n_203490 + gtid_226605] =\n            defunc_0_f_res_226611;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_226600\n}\n__kernel void mainzisegmap_226894(__global int *global_failure,\n                                  int failure_is_an_option, __global\n                                  int64_t *global_failure_args,\n                                  int64_t n_203490, int64_t jump_t_203500,\n                                  int64_t partition_sizze_203577,\n                                  int64_t t_n_m_203650, int64_t i_203670,\n                                  int64_t y_206583, __global\n                                  unsigned char *ext_mem_231504, __global\n                                  unsigned char *ext_mem_231505, __global\n                                  unsigned char *mem_231510)\n{\n    #define segmap_group_sizze_226889 (mainzisegmap_group_sizze_226771)\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_236281;\n    int32_t local_tid_236282;\n    int64_t group_sizze_236285;\n    int32_t wave_sizze_236284;\n    int32_t group_tid_236283;\n    \n    global_tid_236281 = get_global_id(0);\n    local_tid_236282 = get_local_id(0);\n    group_sizze_236285 = get_local_size(0);\n    wave_sizze_236284 = LOCKSTEP_WIDTH;\n    group_tid_236283 = get_group_id(0);\n    \n    int32_",
                   "t phys_tid_226894 = global_tid_236281;\n    int64_t global_tid_236286 = sext_i32_i64(group_tid_236283) *\n            segmap_group_sizze_226889 + sext_i32_i64(local_tid_236282);\n    int64_t slice_236287 = n_203490;\n    int64_t slice_236288 = partition_sizze_203577 * slice_236287;\n    int64_t gtid_226892 = squot64(global_tid_236286, slice_236287);\n    int64_t remnant_236289 = global_tid_236286 - gtid_226892 * slice_236287;\n    int64_t gtid_226893 = remnant_236289;\n    int64_t remnant_236290 = remnant_236289 - gtid_226893;\n    \n    if (slt64(gtid_226892, partition_sizze_203577) && slt64(gtid_226893,\n                                                            n_203490)) {\n        int64_t m_v_226898 = sdiv64(gtid_226893, jump_t_203500);\n        bool cond_226899 = m_v_226898 == y_206583;\n        int64_t j_226900;\n        \n        if (cond_226899) {\n            int64_t j_t_res_226901 = sub64(m_v_226898, (int64_t) 1);\n            \n            j_226900 = j_t_res_226901;\n        } else {\n            j_226900 = m_v_226898;\n        }\n        \n        int64_t min_arg_226902 = mul64(jump_t_203500, j_226900);\n        int64_t min_res_226903 = smin64(i_203670, min_arg_226902);\n        int64_t defunc_0_m_fun_arg_226904 = add64((int64_t) 1, j_226900);\n        int64_t min_arg_226905 = mul64(jump_t_203500,\n                                       defunc_0_m_fun_arg_226904);\n        int64_t min_res_226906 = smin64(i_203670, min_arg_226905);\n        int64_t i64_arg_226907 = sub64(min_res_226906, min_res_226903);\n        double i64_res_226908 = sitofp_i64_f64(i64_arg_226907);\n        int64_t i64_arg_226909 = sub64(gtid_226893, min_res_226903);\n        double i64_res_226910 = sitofp_i64_f64(i64_arg_226909);\n        double u_226911 = i64_res_226910 / i64_res_226908;\n        double u2_226912 = u_226911 * u_226911;\n        double u3_226913 = u_226911 * u2_226912;\n        double x_226914 = 2.0 * u3_226913;\n        double y_226915 = 3.0 * u2_226912;\n        double x_226916 = x_226914 - y_226915;\n  ",
                   "      double x_226917 = 1.0 + x_226916;\n        bool x_226918 = sle64((int64_t) 0, j_226900);\n        bool y_226919 = slt64(j_226900, t_n_m_203650);\n        bool bounds_check_226920 = x_226918 && y_226919;\n        bool index_certs_226921;\n        \n        if (!bounds_check_226920) {\n            {\n                if (atomic_cmpxchg_i32_global(global_failure, -1, 70) == -1) {\n                    global_failure_args[0] = (int64_t) j_226900;\n                    global_failure_args[1] = (int64_t) t_n_m_203650;\n                    ;\n                }\n                return;\n            }\n        }\n        \n        double y_226922;\n        \n        y_226922 = ((__global double *) ext_mem_231505)[gtid_226892 *\n                                                        t_n_m_203650 +\n                                                        j_226900];\n        \n        double x_226923 = x_226917 * y_226922;\n        double x_226924 = y_226915 - x_226914;\n        bool x_226925 = sle64((int64_t) 0, defunc_0_m_fun_arg_226904);\n        bool y_226926 = slt64(defunc_0_m_fun_arg_226904, t_n_m_203650);\n        bool bounds_check_226927 = x_226925 && y_226926;\n        bool index_certs_226928;\n        \n        if (!bounds_check_226927) {\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_226904;\n                    global_failure_args[1] = (int64_t) t_n_m_203650;\n                    ;\n                }\n                return;\n            }\n        }\n        \n        double y_226929;\n        \n        y_226929 = ((__global double *) ext_mem_231505)[gtid_226892 *\n                                                        t_n_m_203650 +\n                                                        defunc_0_m_fun_arg_226904];\n        \n        double y_226930 = x_226924 * y_226929;\n        double x_226931 = x_226923 + y_226930;\n        double y_226932 = 2.0 * u2_226912;",
                   "\n        double x_226933 = u3_226913 - y_226932;\n        double x_226934 = u_226911 + x_226933;\n        double y_226935;\n        \n        y_226935 = ((__global double *) ext_mem_231504)[gtid_226892 *\n                                                        t_n_m_203650 +\n                                                        j_226900];\n        \n        double x_226936 = x_226934 * y_226935;\n        double y_226937 = i64_res_226908 * x_226936;\n        double x_226938 = x_226931 + y_226937;\n        double x_226939 = u3_226913 - u2_226912;\n        double y_226940;\n        \n        y_226940 = ((__global double *) ext_mem_231504)[gtid_226892 *\n                                                        t_n_m_203650 +\n                                                        defunc_0_m_fun_arg_226904];\n        \n        double x_226941 = x_226939 * y_226940;\n        double y_226942 = i64_res_226908 * x_226941;\n        double defunc_4_interpolate_proc_res_226943 = x_226938 + y_226942;\n        \n        ((__global double *) mem_231510)[gtid_226892 * n_203490 + gtid_226893] =\n            defunc_4_interpolate_proc_res_226943;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_226889\n}\n__kernel void mainzisegmap_227111(__global int *global_failure,\n                                  int64_t n_203490,\n                                  int64_t partition_sizze_203577,\n                                  int64_t ext_231522, __global\n                                  unsigned char *mem_229161, __global\n                                  unsigned char *ext_mem_231517, __global\n                                  unsigned char *ext_mem_231518, __global\n                                  unsigned char *mem_231554)\n{\n    #define segmap_group_sizze_227106 (mainzisegmap_group_sizze_227070)\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_236303;\n    int32_t local_tid",
                   "_236304;\n    int64_t group_sizze_236307;\n    int32_t wave_sizze_236306;\n    int32_t group_tid_236305;\n    \n    global_tid_236303 = get_global_id(0);\n    local_tid_236304 = get_local_id(0);\n    group_sizze_236307 = get_local_size(0);\n    wave_sizze_236306 = LOCKSTEP_WIDTH;\n    group_tid_236305 = get_group_id(0);\n    \n    int32_t phys_tid_227111 = global_tid_236303;\n    int64_t global_tid_236308 = sext_i32_i64(group_tid_236305) *\n            segmap_group_sizze_227106 + sext_i32_i64(local_tid_236304);\n    int64_t slice_236309 = n_203490;\n    int64_t slice_236310 = partition_sizze_203577 * slice_236309;\n    int64_t gtid_227109 = squot64(global_tid_236308, slice_236309);\n    int64_t remnant_236311 = global_tid_236308 - gtid_227109 * slice_236309;\n    int64_t gtid_227110 = remnant_236311;\n    int64_t remnant_236312 = remnant_236311 - gtid_227110;\n    \n    if (slt64(gtid_227109, partition_sizze_203577) && slt64(gtid_227110,\n                                                            n_203490)) {\n        double x_227112;\n        \n        x_227112 = ((__global double *) mem_229161)[gtid_227109 * n_203490 +\n                                                    gtid_227110];\n        \n        double x_227113;\n        \n        x_227113 = ((__global double *) ext_mem_231518)[gtid_227109 * n_203490 +\n                                                        gtid_227110];\n        \n        double x_227114;\n        \n        x_227114 = ((__global double *) ext_mem_231517)[gtid_227109 *\n                                                        ext_231522 +\n                                                        gtid_227110];\n        \n        double x_227115 = x_227112 - x_227113;\n        double defunc_2_f_res_227116 = x_227115 - x_227114;\n        bool isnan_res_227117;\n        \n        isnan_res_227117 = futrts_isnan64(defunc_2_f_res_227116);\n        \n        double defunc_0_f_res_227118;\n        \n        if (isnan_res_227117) {\n            defunc_0_f_res_227118 = defunc_2_f_res_227116;\n    ",
                   "    } else {\n            double abs_res_227119 = fabs(defunc_2_f_res_227116);\n            \n            defunc_0_f_res_227118 = abs_res_227119;\n        }\n        ((__global double *) mem_231554)[gtid_227109 * n_203490 + gtid_227110] =\n            defunc_0_f_res_227118;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_227106\n}\n__kernel void mainzisegmap_227132(__global int *global_failure,\n                                  int failure_is_an_option, __global\n                                  int64_t *global_failure_args,\n                                  int64_t n_203490,\n                                  int64_t partition_sizze_203577, __global\n                                  unsigned char *ext_mem_229197, __global\n                                  unsigned char *mem_231554, __global\n                                  unsigned char *mem_231559)\n{\n    #define segmap_group_sizze_227127 (mainzisegmap_group_sizze_227027)\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_236313;\n    int32_t local_tid_236314;\n    int64_t group_sizze_236317;\n    int32_t wave_sizze_236316;\n    int32_t group_tid_236315;\n    \n    global_tid_236313 = get_global_id(0);\n    local_tid_236314 = get_local_id(0);\n    group_sizze_236317 = get_local_size(0);\n    wave_sizze_236316 = LOCKSTEP_WIDTH;\n    group_tid_236315 = get_group_id(0);\n    \n    int32_t phys_tid_227132 = global_tid_236313;\n    int64_t global_tid_236318 = sext_i32_i64(group_tid_236315) *\n            segmap_group_sizze_227127 + sext_i32_i64(local_tid_236314);\n    int64_t slice_236319 = n_203490;\n    int64_t slice_236320 = partition_sizze_203577 * slice_236319;\n    int64_t gtid_227130 = squot64(global_tid_236318, slice_236319);\n    int64_t remnant_236321 = global_tid_236318 - gtid_227130 * slice_236319;\n    int64_t gtid_227131 = remnant_236321;\n    int64_t remnant_236322 = remnant_236321 - gtid_227131;",
                   "\n    \n    if (slt64(gtid_227130, partition_sizze_203577) && slt64(gtid_227131,\n                                                            n_203490)) {\n        int64_t x_227134;\n        \n        x_227134 = ((__global int64_t *) ext_mem_229197)[gtid_227130 *\n                                                         n_203490 +\n                                                         gtid_227131];\n        \n        bool cond_227135 = sle64((int64_t) 0, x_227134);\n        double defunc_0_f_res_227136;\n        \n        if (cond_227135) {\n            bool y_227137 = slt64(x_227134, n_203490);\n            bool bounds_check_227138 = cond_227135 && y_227137;\n            bool index_certs_227139;\n            \n            if (!bounds_check_227138) {\n                {\n                    if (atomic_cmpxchg_i32_global(global_failure, -1, 73) ==\n                        -1) {\n                        global_failure_args[0] = (int64_t) x_227134;\n                        global_failure_args[1] = (int64_t) n_203490;\n                        ;\n                    }\n                    return;\n                }\n            }\n            \n            double defunc_0_f_res_t_res_227140;\n            \n            defunc_0_f_res_t_res_227140 = ((__global\n                                            double *) mem_231554)[gtid_227130 *\n                                                                  n_203490 +\n                                                                  x_227134];\n            defunc_0_f_res_227136 = defunc_0_f_res_t_res_227140;\n        } else {\n            defunc_0_f_res_227136 = INFINITY;\n        }\n        ((__global double *) mem_231559)[gtid_227130 * n_203490 + gtid_227131] =\n            defunc_0_f_res_227136;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_227127\n}\n__kernel void mainzisegmap_227261(__global int *global_failure,\n                                  int64_t n_203490,\n                                  int64_t partition_sizze_203577,\n             ",
                   "                     int64_t i_203670, int32_t iters_206665,\n                                  int64_t num_groups_227257,\n                                  int64_t num_threads_232227, __global\n                                  unsigned char *mem_231564, __global\n                                  unsigned char *mem_231674, __global\n                                  unsigned char *color_232062, __global\n                                  unsigned char *color_232063, __global\n                                  unsigned char *color_232064, __global\n                                  unsigned char *color_232065, __global\n                                  unsigned char *color_232066, __global\n                                  unsigned char *color_232067, __global\n                                  unsigned char *color_232068)\n{\n    #define segmap_group_sizze_227256 (mainzisegmap_group_sizze_227158)\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_236326;\n    int32_t local_tid_236327;\n    int64_t group_sizze_236330;\n    int32_t wave_sizze_236329;\n    int32_t group_tid_236328;\n    \n    global_tid_236326 = get_global_id(0);\n    local_tid_236327 = get_local_id(0);\n    group_sizze_236330 = get_local_size(0);\n    wave_sizze_236329 = LOCKSTEP_WIDTH;\n    group_tid_236328 = get_group_id(0);\n    \n    int32_t phys_tid_227261 = global_tid_236326;\n    int32_t phys_group_id_236331;\n    \n    phys_group_id_236331 = get_group_id(0);\n    for (int32_t i_236332 = 0; i_236332 <\n         sdiv_up32(sext_i64_i32(sdiv_up64(partition_sizze_203577,\n                                          segmap_group_sizze_227256)) -\n                   phys_group_id_236331, sext_i64_i32(num_groups_227257));\n         i_236332++) {\n        int32_t virt_group_id_236333 = phys_group_id_236331 + i_236332 *\n                sext_i64_i32(num_groups_227257);\n        int64_t global_tid_236334 = sext_i32_",
                   "i64(virt_group_id_236333) *\n                segmap_group_sizze_227256 + sext_i32_i64(local_tid_236327);\n        int64_t slice_236335 = partition_sizze_203577;\n        int64_t gtid_227260 = global_tid_236334;\n        int64_t remnant_236336 = global_tid_236334 - gtid_227260;\n        \n        if (slt64(gtid_227260, partition_sizze_203577)) {\n            for (int64_t i_236337 = 0; i_236337 < n_203490; i_236337++) {\n                double tmp_236338;\n                \n                tmp_236338 = ((__global double *) mem_231564)[gtid_227260 +\n                                                              i_236337 *\n                                                              partition_sizze_203577];\n                ((__global double *) color_232062)[phys_tid_227261 + i_236337 *\n                                                   num_threads_232227] =\n                    tmp_236338;\n            }\n            \n            __global unsigned char *ext_mem_231667;\n            __global unsigned char *ext_mem_unused_231956;\n            __global unsigned char *mem_param_231574;\n            __global unsigned char *mem_param_out_231957;\n            \n            mem_param_231574 = color_232062;\n            mem_param_out_231957 = color_232063;\n            for (int32_t i_227264 = 0; i_227264 < iters_206665; i_227264++) {\n                int32_t defunc_2_radix_sort_step_arg_227266 = mul32(2,\n                                                                    i_227264);\n                int32_t defunc_0_get_bit_arg_227267 = add32(1,\n                                                            defunc_2_radix_sort_step_arg_227266);\n                bool cond_f_res_227268 = defunc_0_get_bit_arg_227267 == 63;\n                bool cond_f_res_227269 = defunc_2_radix_sort_step_arg_227266 ==\n                     63;\n                int64_t unsign_arg_227270 =\n                        zext_i32_i64(defunc_0_get_bit_arg_227267);\n                int64_t unsign_arg_227271 =\n                        zext_i",
                   "32_i64(defunc_2_radix_sort_step_arg_227266);\n                int64_t discard_229074;\n                int64_t discard_229075;\n                int64_t discard_229076;\n                int64_t discard_229077;\n                int64_t scanacc_229059;\n                int64_t scanacc_229060;\n                int64_t scanacc_229061;\n                int64_t scanacc_229062;\n                \n                scanacc_229059 = (int64_t) 0;\n                scanacc_229060 = (int64_t) 0;\n                scanacc_229061 = (int64_t) 0;\n                scanacc_229062 = (int64_t) 0;\n                for (int64_t i_229068 = 0; i_229068 < n_203490; i_229068++) {\n                    double x_227289;\n                    \n                    x_227289 = ((__global\n                                 double *) mem_param_231574)[phys_tid_227261 +\n                                                             i_229068 *\n                                                             num_threads_232227];\n                    \n                    int64_t i64_arg_227290;\n                    \n                    i64_arg_227290 = futrts_to_bits64(x_227289);\n                    \n                    int64_t unsign_arg_227291 = ashr64(i64_arg_227290,\n                                                       unsign_arg_227270);\n                    int64_t unsign_arg_227292 = (int64_t) 1 & unsign_arg_227291;\n                    int32_t to_i32_res_227293 = zext_i64_i32(unsign_arg_227292);\n                    int64_t unsign_arg_227294 = ashr64(i64_arg_227290,\n                                                       (int64_t) 63);\n                    int64_t unsign_arg_227295 = (int64_t) 1 & unsign_arg_227294;\n                    int32_t to_i32_res_227296 = zext_i64_i32(unsign_arg_227295);\n                    bool cond_227297 = to_i32_res_227296 == 1;\n                    bool x_227298 = !cond_227297;\n                    bool y_227299 = cond_f_res_227268 && x_227298;\n                    bool cond_227300 = cond_227297 || y_2272",
                   "99;\n                    int32_t defunc_1_get_bit_res_227301;\n                    \n                    if (cond_227300) {\n                        int32_t defunc_1_get_bit_res_t_res_227302 = 1 ^\n                                to_i32_res_227293;\n                        \n                        defunc_1_get_bit_res_227301 =\n                            defunc_1_get_bit_res_t_res_227302;\n                    } else {\n                        defunc_1_get_bit_res_227301 = to_i32_res_227293;\n                    }\n                    \n                    int32_t x_227303 = mul32(2, defunc_1_get_bit_res_227301);\n                    int64_t unsign_arg_227304 = ashr64(i64_arg_227290,\n                                                       unsign_arg_227271);\n                    int64_t unsign_arg_227305 = (int64_t) 1 & unsign_arg_227304;\n                    int32_t to_i32_res_227306 = zext_i64_i32(unsign_arg_227305);\n                    bool y_227307 = cond_f_res_227269 && x_227298;\n                    bool cond_227308 = cond_227297 || y_227307;\n                    int32_t defunc_1_get_bit_res_227309;\n                    \n                    if (cond_227308) {\n                        int32_t defunc_1_get_bit_res_t_res_227310 = 1 ^\n                                to_i32_res_227306;\n                        \n                        defunc_1_get_bit_res_227309 =\n                            defunc_1_get_bit_res_t_res_227310;\n                    } else {\n                        defunc_1_get_bit_res_227309 = to_i32_res_227306;\n                    }\n                    \n                    int32_t defunc_0_f_res_227311 = add32(x_227303,\n                                                          defunc_1_get_bit_res_227309);\n                    bool cond_227312 = defunc_0_f_res_227311 == 0;\n                    int64_t defunc_0_f_res_227313 = btoi_bool_i64(cond_227312);\n                    int64_t defunc_0_f_res_227314;\n                    int64_t defunc_0_f_res_227315;\n                    ",
                   "int64_t defunc_0_f_res_227316;\n                    \n                    if (cond_227312) {\n                        defunc_0_f_res_227314 = (int64_t) 0;\n                        defunc_0_f_res_227315 = (int64_t) 0;\n                        defunc_0_f_res_227316 = (int64_t) 0;\n                    } else {\n                        bool cond_227317 = defunc_0_f_res_227311 == 1;\n                        int64_t defunc_0_f_res_f_res_227318 =\n                                btoi_bool_i64(cond_227317);\n                        int64_t defunc_0_f_res_f_res_227319;\n                        int64_t defunc_0_f_res_f_res_227320;\n                        \n                        if (cond_227317) {\n                            defunc_0_f_res_f_res_227319 = (int64_t) 0;\n                            defunc_0_f_res_f_res_227320 = (int64_t) 0;\n                        } else {\n                            bool cond_227321 = defunc_0_f_res_227311 == 2;\n                            int64_t defunc_0_f_res_f_res_f_res_227322 =\n                                    btoi_bool_i64(cond_227321);\n                            bool cond_neg_227323 = !cond_227321;\n                            int64_t defunc_0_f_res_f_res_f_res_227324 =\n                                    btoi_bool_i64(cond_neg_227323);\n                            \n                            defunc_0_f_res_f_res_227319 =\n                                defunc_0_f_res_f_res_f_res_227322;\n                            defunc_0_f_res_f_res_227320 =\n                                defunc_0_f_res_f_res_f_res_227324;\n                        }\n                        defunc_0_f_res_227314 = defunc_0_f_res_f_res_227318;\n                        defunc_0_f_res_227315 = defunc_0_f_res_f_res_227319;\n                        defunc_0_f_res_227316 = defunc_0_f_res_f_res_227320;\n                    }\n                    \n                    int64_t defunc_1_op_res_227285 =\n                            add64(defunc_0_f_res_227313, scanacc_229059);\n                 ",
                   "   int64_t defunc_1_op_res_227286 =\n                            add64(defunc_0_f_res_227314, scanacc_229060);\n                    int64_t defunc_1_op_res_227287 =\n                            add64(defunc_0_f_res_227315, scanacc_229061);\n                    int64_t defunc_1_op_res_227288 =\n                            add64(defunc_0_f_res_227316, scanacc_229062);\n                    \n                    ((__global int64_t *) color_232068)[phys_tid_227261 +\n                                                        i_229068 *\n                                                        num_threads_232227] =\n                        defunc_1_op_res_227285;\n                    ((__global int64_t *) color_232067)[phys_tid_227261 +\n                                                        i_229068 *\n                                                        num_threads_232227] =\n                        defunc_1_op_res_227286;\n                    ((__global int64_t *) color_232066)[phys_tid_227261 +\n                                                        i_229068 *\n                                                        num_threads_232227] =\n                        defunc_1_op_res_227287;\n                    ((__global int64_t *) color_232065)[phys_tid_227261 +\n                                                        i_229068 *\n                                                        num_threads_232227] =\n                        defunc_1_op_res_227288;\n                    ((__global int32_t *) color_232064)[phys_tid_227261 +\n                                                        i_229068 *\n                                                        num_threads_232227] =\n                        defunc_0_f_res_227311;\n                    \n                    int64_t scanacc_tmp_236342 = defunc_1_op_res_227285;\n                    int64_t scanacc_tmp_236343 = defunc_1_op_res_227286;\n                    int64_t scanacc_tmp_236344 = defunc_1_op_res_227287;\n                    int64_t scanacc_tmp_2",
                   "36345 = defunc_1_op_res_227288;\n                    \n                    scanacc_229059 = scanacc_tmp_236342;\n                    scanacc_229060 = scanacc_tmp_236343;\n                    scanacc_229061 = scanacc_tmp_236344;\n                    scanacc_229062 = scanacc_tmp_236345;\n                }\n                discard_229074 = scanacc_229059;\n                discard_229075 = scanacc_229060;\n                discard_229076 = scanacc_229061;\n                discard_229077 = scanacc_229062;\n                \n                int64_t last_res_227325;\n                \n                last_res_227325 = ((__global\n                                    int64_t *) color_232068)[phys_tid_227261 +\n                                                             i_203670 *\n                                                             num_threads_232227];\n                \n                int64_t last_res_227326;\n                \n                last_res_227326 = ((__global\n                                    int64_t *) color_232067)[phys_tid_227261 +\n                                                             i_203670 *\n                                                             num_threads_232227];\n                \n                int64_t last_res_227327;\n                \n                last_res_227327 = ((__global\n                                    int64_t *) color_232066)[phys_tid_227261 +\n                                                             i_203670 *\n                                                             num_threads_232227];\n                for (int64_t i_236351 = 0; i_236351 < n_203490; i_236351++) {\n                    double tmp_236352;\n                    \n                    tmp_236352 = ((__global\n                                   double *) mem_param_231574)[phys_tid_227261 +\n                                                               i_236351 *\n                                                               num_threads_232227];\n                    ((__g",
                   "lobal double *) mem_param_out_231957)[phys_tid_227261 +\n                                                               i_236351 *\n                                                               num_threads_232227] =\n                        tmp_236352;\n                }\n                for (int64_t write_iter_229078 = 0; write_iter_229078 <\n                     n_203490; write_iter_229078++) {\n                    int32_t write_iv_229080;\n                    \n                    write_iv_229080 = ((__global\n                                        int32_t *) color_232064)[phys_tid_227261 +\n                                                                 write_iter_229078 *\n                                                                 num_threads_232227];\n                    \n                    bool match_lit_227336 = 0 == write_iv_229080;\n                    int64_t defunc_1_f_res_227337;\n                    \n                    if (match_lit_227336) {\n                        int64_t write_iv_229081;\n                        \n                        write_iv_229081 = ((__global\n                                            int64_t *) color_232068)[phys_tid_227261 +\n                                                                     write_iter_229078 *\n                                                                     num_threads_232227];\n                        \n                        int64_t case_res_227338 = sub64(write_iv_229081,\n                                                        (int64_t) 1);\n                        \n                        defunc_1_f_res_227337 = case_res_227338;\n                    } else {\n                        bool match_lit_227339 = 1 == write_iv_229080;\n                        int64_t x_227340;\n                        \n                        if (match_lit_227339) {\n                            int64_t write_iv_229082;\n                            \n                            write_iv_229082 = ((__global\n                             ",
                   "                   int64_t *) color_232067)[phys_tid_227261 +\n                                                                         write_iter_229078 *\n                                                                         num_threads_232227];\n                            \n                            int64_t x_227341 = add64(last_res_227325,\n                                                     write_iv_229082);\n                            int64_t case_res_227342 = sub64(x_227341,\n                                                            (int64_t) 1);\n                            \n                            x_227340 = case_res_227342;\n                        } else {\n                            bool match_lit_227343 = 2 == write_iv_229080;\n                            int64_t x_227344;\n                            \n                            if (match_lit_227343) {\n                                int64_t write_iv_229083;\n                                \n                                write_iv_229083 = ((__global\n                                                    int64_t *) color_232066)[phys_tid_227261 +\n                                                                             write_iter_229078 *\n                                                                             num_threads_232227];\n                                \n                                int64_t x_227345 = add64(last_res_227325,\n                                                         last_res_227326);\n                                int64_t x_227346 = add64(x_227345,\n                                                         write_iv_229083);\n                                int64_t case_res_227347 = sub64(x_227346,\n                                                                (int64_t) 1);\n                                \n                                x_227344 = case_res_227347;\n                            } else {\n                                int64_t write_iv_229084;\n              ",
                   "                  \n                                write_iv_229084 = ((__global\n                                                    int64_t *) color_232065)[phys_tid_227261 +\n                                                                             write_iter_229078 *\n                                                                             num_threads_232227];\n                                \n                                int64_t x_227348 = add64(last_res_227325,\n                                                         last_res_227326);\n                                int64_t x_227349 = add64(last_res_227327,\n                                                         x_227348);\n                                int64_t x_227350 = add64(x_227349,\n                                                         write_iv_229084);\n                                int64_t defunc_1_f_res_res_227351 =\n                                        sub64(x_227350, (int64_t) 1);\n                                \n                                x_227344 = defunc_1_f_res_res_227351;\n                            }\n                            x_227340 = x_227344;\n                        }\n                        defunc_1_f_res_227337 = x_227340;\n                    }\n                    if (sle64((int64_t) 0, defunc_1_f_res_227337) &&\n                        slt64(defunc_1_f_res_227337, n_203490)) {\n                        for (int64_t i_236354 = 0; i_236354 < (int64_t) 1;\n                             i_236354++) {\n                            double tmp_236355;\n                            \n                            tmp_236355 = ((__global\n                                           double *) mem_param_231574)[phys_tid_227261 +\n                                                                       num_threads_232227 *\n                                                                       write_iter_229078 +\n                                                                       i_236354 *\n   ",
                   "                                                                    num_threads_232227];\n                            ((__global\n                              double *) mem_param_out_231957)[phys_tid_227261 +\n                                                              num_threads_232227 *\n                                                              defunc_1_f_res_227337 +\n                                                              i_236354 *\n                                                              num_threads_232227] =\n                                tmp_236355;\n                        }\n                    }\n                }\n                \n                __global unsigned char *mem_param_tmp_236339;\n                \n                mem_param_tmp_236339 = mem_param_out_231957;\n                \n                __global unsigned char *mem_param_out_tmp_236340;\n                \n                mem_param_out_tmp_236340 = mem_param_231574;\n                mem_param_231574 = mem_param_tmp_236339;\n                mem_param_out_231957 = mem_param_out_tmp_236340;\n            }\n            ext_mem_231667 = mem_param_231574;\n            ext_mem_unused_231956 = mem_param_out_231957;\n            for (int64_t i_236356 = 0; i_236356 < n_203490; i_236356++) {\n                double tmp_236357;\n                \n                tmp_236357 = ((__global\n                               double *) ext_mem_231667)[phys_tid_227261 +\n                                                         i_236356 *\n                                                         num_threads_232227];\n                ((__global double *) mem_231674)[gtid_227260 + i_236356 *\n                                                 partition_sizze_203577] =\n                    tmp_236357;\n            }\n        }\n        barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_227256\n}\n__kernel void mainzisegmap_227986(__global int *global_failure,\n       ",
                   "                           int64_t n_203490,\n                                  int64_t partition_sizze_203577,\n                                  int64_t i_203670, __global\n                                  unsigned char *mem_param_231733, __global\n                                  unsigned char *mem_231739, __global\n                                  unsigned char *mem_231769, __global\n                                  unsigned char *mem_231773, __global\n                                  unsigned char *mem_231777, __global\n                                  unsigned char *mem_231781, __global\n                                  unsigned char *mem_231785)\n{\n    #define segmap_group_sizze_227981 (mainzisegmap_group_sizze_227577)\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_236555;\n    int32_t local_tid_236556;\n    int64_t group_sizze_236559;\n    int32_t wave_sizze_236558;\n    int32_t group_tid_236557;\n    \n    global_tid_236555 = get_global_id(0);\n    local_tid_236556 = get_local_id(0);\n    group_sizze_236559 = get_local_size(0);\n    wave_sizze_236558 = LOCKSTEP_WIDTH;\n    group_tid_236557 = get_group_id(0);\n    \n    int32_t phys_tid_227986 = global_tid_236555;\n    int64_t global_tid_236560 = sext_i32_i64(group_tid_236557) *\n            segmap_group_sizze_227981 + sext_i32_i64(local_tid_236556);\n    int64_t slice_236561 = n_203490;\n    int64_t slice_236562 = partition_sizze_203577 * slice_236561;\n    int64_t gtid_227984 = squot64(global_tid_236560, slice_236561);\n    int64_t remnant_236563 = global_tid_236560 - gtid_227984 * slice_236561;\n    int64_t gtid_227985 = remnant_236563;\n    int64_t remnant_236564 = remnant_236563 - gtid_227985;\n    \n    if (slt64(gtid_227984, partition_sizze_203577) && slt64(gtid_227985,\n                                                            n_203490)) {\n        int32_t x_227990;\n        \n        x_227990 = ((__gl",
                   "obal int32_t *) mem_231785)[gtid_227984 * n_203490 +\n                                                     gtid_227985];\n        \n        double write_value_227995;\n        \n        write_value_227995 = ((__global\n                               double *) mem_param_231733)[gtid_227984 *\n                                                           n_203490 +\n                                                           gtid_227985];\n        \n        bool match_lit_227996 = 0 == x_227990;\n        int64_t defunc_1_f_res_227997;\n        \n        if (match_lit_227996) {\n            int64_t x_227991;\n            \n            x_227991 = ((__global int64_t *) mem_231769)[gtid_227984 *\n                                                         n_203490 +\n                                                         gtid_227985];\n            \n            int64_t case_res_227998 = sub64(x_227991, (int64_t) 1);\n            \n            defunc_1_f_res_227997 = case_res_227998;\n        } else {\n            int64_t last_res_227987;\n            \n            last_res_227987 = ((__global int64_t *) mem_231769)[gtid_227984 *\n                                                                n_203490 +\n                                                                i_203670];\n            \n            bool match_lit_227999 = 1 == x_227990;\n            int64_t x_228000;\n            \n            if (match_lit_227999) {\n                int64_t x_227992;\n                \n                x_227992 = ((__global int64_t *) mem_231773)[gtid_227984 *\n                                                             n_203490 +\n                                                             gtid_227985];\n                \n                int64_t x_228001 = add64(last_res_227987, x_227992);\n                int64_t case_res_228002 = sub64(x_228001, (int64_t) 1);\n                \n                x_228000 = case_res_228002;\n            } else {\n                int64_t last_res_227988;\n                \n                last_res_2",
                   "27988 = ((__global\n                                    int64_t *) mem_231773)[gtid_227984 *\n                                                           n_203490 + i_203670];\n                \n                bool match_lit_228003 = 2 == x_227990;\n                int64_t x_228004;\n                \n                if (match_lit_228003) {\n                    int64_t x_227993;\n                    \n                    x_227993 = ((__global int64_t *) mem_231777)[gtid_227984 *\n                                                                 n_203490 +\n                                                                 gtid_227985];\n                    \n                    int64_t x_228005 = add64(last_res_227987, last_res_227988);\n                    int64_t x_228006 = add64(x_227993, x_228005);\n                    int64_t case_res_228007 = sub64(x_228006, (int64_t) 1);\n                    \n                    x_228004 = case_res_228007;\n                } else {\n                    int64_t last_res_227989;\n                    \n                    last_res_227989 = ((__global\n                                        int64_t *) mem_231777)[gtid_227984 *\n                                                               n_203490 +\n                                                               i_203670];\n                    \n                    int64_t x_227994;\n                    \n                    x_227994 = ((__global int64_t *) mem_231781)[gtid_227984 *\n                                                                 n_203490 +\n                                                                 gtid_227985];\n                    \n                    int64_t x_228008 = add64(last_res_227987, last_res_227988);\n                    int64_t x_228009 = add64(last_res_227989, x_228008);\n                    int64_t x_228010 = add64(x_227994, x_228009);\n                    int64_t defunc_1_f_res_res_228011 = sub64(x_228010,\n                                                              (int64",
                   "_t) 1);\n                    \n                    x_228004 = defunc_1_f_res_res_228011;\n                }\n                x_228000 = x_228004;\n            }\n            defunc_1_f_res_227997 = x_228000;\n        }\n        if ((sle64((int64_t) 0, gtid_227984) && slt64(gtid_227984,\n                                                      partition_sizze_203577)) &&\n            (sle64((int64_t) 0, defunc_1_f_res_227997) &&\n             slt64(defunc_1_f_res_227997, n_203490))) {\n            ((__global double *) mem_231739)[gtid_227984 * n_203490 +\n                                             defunc_1_f_res_227997] =\n                write_value_227995;\n        }\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_227981\n}\n__kernel void mainzisegmap_228041(__global int *global_failure,\n                                  int64_t partition_sizze_203577,\n                                  int64_t stl_res_203664, int64_t j_m_i_204133,\n                                  __global unsigned char *mem_231819, __global\n                                  unsigned char *mem_231823, __global\n                                  unsigned char *mem_231826, __global\n                                  unsigned char *mem_231829)\n{\n    #define segmap_group_sizze_228035 (mainzisegmap_group_sizze_228020)\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_236569;\n    int32_t local_tid_236570;\n    int64_t group_sizze_236573;\n    int32_t wave_sizze_236572;\n    int32_t group_tid_236571;\n    \n    global_tid_236569 = get_global_id(0);\n    local_tid_236570 = get_local_id(0);\n    group_sizze_236573 = get_local_size(0);\n    wave_sizze_236572 = LOCKSTEP_WIDTH;\n    group_tid_236571 = get_group_id(0);\n    \n    int32_t phys_tid_228041 = global_tid_236569;\n    int64_t global_tid_236574 = sext_i32_i64(group_tid_236571) *\n            segmap_group_sizze_228035 + sext_i32_i64(local_tid_2365",
                   "70);\n    int64_t slice_236575 = partition_sizze_203577;\n    int64_t gtid_228040 = global_tid_236574;\n    int64_t remnant_236576 = global_tid_236574 - gtid_228040;\n    \n    if (slt64(gtid_228040, partition_sizze_203577)) {\n        double defunc_2_reduce_res_228043;\n        double redout_229087 = 0.0;\n        \n        for (int64_t i_229088 = 0; i_229088 < j_m_i_204133; i_229088++) {\n            int64_t slice_229093 = stl_res_203664 + i_229088;\n            double x_228047;\n            \n            x_228047 = ((__global double *) mem_231819)[slice_229093 *\n                                                        partition_sizze_203577 +\n                                                        gtid_228040];\n            \n            double defunc_1_op_res_228046 = x_228047 + redout_229087;\n            double redout_tmp_236577 = defunc_1_op_res_228046;\n            \n            redout_229087 = redout_tmp_236577;\n        }\n        defunc_2_reduce_res_228043 = redout_229087;\n        \n        double h_228048 = 3.0 * defunc_2_reduce_res_228043;\n        double h9_228049 = 0.999 * h_228048;\n        double h1_228050 = 1.0e-3 * h_228048;\n        \n        ((__global double *) mem_231823)[gtid_228040] = h_228048;\n        ((__global double *) mem_231826)[gtid_228040] = h9_228049;\n        ((__global double *) mem_231829)[gtid_228040] = h1_228050;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_228035\n}\n__kernel void mainzisegmap_228103(__global int *global_failure,\n                                  int64_t partition_sizze_203577, __global\n                                  unsigned char *mem_231833, __global\n                                  unsigned char *mem_231837, __global\n                                  unsigned char *mem_231840, __global\n                                  unsigned char *mem_231843)\n{\n    #define segmap_group_sizze_228097 (mainzisegmap_group_sizze_228055)\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_236646;\n    int32_t local_tid_236647;\n    int64_t group_sizze_236650;\n    int32_t wave_sizze_236649;\n    int32_t group_tid_236648;\n    \n    global_tid_236646 = get_global_id(0);\n    local_tid_236647 = get_local_id(0);\n    group_sizze_236650 = get_local_size(0);\n    wave_sizze_236649 = LOCKSTEP_WIDTH;\n    group_tid_236648 = get_group_id(0);\n    \n    int32_t phys_tid_228103 = global_tid_236646;\n    int64_t global_tid_236651 = sext_i32_i64(group_tid_236648) *\n            segmap_group_sizze_228097 + sext_i32_i64(local_tid_236647);\n    int64_t slice_236652 = partition_sizze_203577;\n    int64_t gtid_228102 = global_tid_236651;\n    int64_t remnant_236653 = global_tid_236651 - gtid_228102;\n    \n    if (slt64(gtid_228102, partition_sizze_203577)) {\n        double defunc_2_reduce_res_228104;\n        \n        defunc_2_reduce_res_228104 = ((__global\n                                       double *) mem_231833)[gtid_228102];\n        \n        double h_228105 = 3.0 * defunc_2_reduce_res_228104;\n        double h9_228106 = 0.999 * h_228105;\n        double h1_228107 = 1.0e-3 * h_228105;\n        \n        ((__global double *) mem_231837)[gtid_228102] = h_228105;\n        ((__global double *) mem_231840)[gtid_228102] = h9_228106;\n        ((__global double *) mem_231843)[gtid_228102] = h1_228107;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_228097\n}\n__kernel void mainzisegmap_228189(__global int *global_failure,\n                                  int64_t n_203490,\n                                  int64_t partition_sizze_203577, __global\n                                  unsigned char *ext_mem_231560, __global\n                                  unsigned char *ext_mem_231844, __global\n                                  unsigned char *ext_mem_231845, __global\n                                  unsigned char *ext_mem_231846, __global\n                                  unsigned char *mem_231851)\n{\n    #",
                   "define segmap_group_sizze_228184 (mainzisegmap_group_sizze_228124)\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_236655;\n    int32_t local_tid_236656;\n    int64_t group_sizze_236659;\n    int32_t wave_sizze_236658;\n    int32_t group_tid_236657;\n    \n    global_tid_236655 = get_global_id(0);\n    local_tid_236656 = get_local_id(0);\n    group_sizze_236659 = get_local_size(0);\n    wave_sizze_236658 = LOCKSTEP_WIDTH;\n    group_tid_236657 = get_group_id(0);\n    \n    int32_t phys_tid_228189 = global_tid_236655;\n    int64_t global_tid_236660 = sext_i32_i64(group_tid_236657) *\n            segmap_group_sizze_228184 + sext_i32_i64(local_tid_236656);\n    int64_t slice_236661 = n_203490;\n    int64_t slice_236662 = partition_sizze_203577 * slice_236661;\n    int64_t gtid_228187 = squot64(global_tid_236660, slice_236661);\n    int64_t remnant_236663 = global_tid_236660 - gtid_228187 * slice_236661;\n    int64_t gtid_228188 = remnant_236663;\n    int64_t remnant_236664 = remnant_236663 - gtid_228188;\n    \n    if (slt64(gtid_228187, partition_sizze_203577) && slt64(gtid_228188,\n                                                            n_203490)) {\n        double x_228190;\n        \n        x_228190 = ((__global double *) ext_mem_231846)[gtid_228187];\n        \n        double x_228192;\n        \n        x_228192 = ((__global double *) ext_mem_231844)[gtid_228187];\n        \n        double x_228193;\n        \n        x_228193 = ((__global double *) ext_mem_231560)[gtid_228187 * n_203490 +\n                                                        gtid_228188];\n        \n        double x_228194 = x_228193 / x_228190;\n        double y_228195 = fpow64(x_228194, 2.0);\n        double x_228196 = 1.0 - y_228195;\n        double bicube_228197 = fpow64(x_228196, 2.0);\n        bool isnan_res_228198;\n        \n        isnan_res_228198 = futrts_isnan64(x_228193);\n        \n        bool",
                   " cond_f_res_228199 = x_228193 <= x_228192;\n        bool x_228200 = !isnan_res_228198;\n        bool y_228201 = cond_f_res_228199 && x_228200;\n        bool cond_228202 = isnan_res_228198 || y_228201;\n        double defunc_0_f_res_228203;\n        \n        if (cond_228202) {\n            defunc_0_f_res_228203 = 1.0;\n        } else {\n            double x_228191;\n            \n            x_228191 = ((__global double *) ext_mem_231845)[gtid_228187];\n            \n            bool cond_228204 = x_228191 <= x_228193;\n            bool cond_f_res_228205 = x_228193 <= 1.0e-6;\n            bool x_228206 = !cond_228204;\n            bool y_228207 = cond_f_res_228205 && x_228206;\n            bool cond_228208 = cond_228204 || y_228207;\n            double defunc_0_f_res_f_res_228209;\n            \n            if (cond_228208) {\n                defunc_0_f_res_f_res_228209 = 1.0e-6;\n            } else {\n                defunc_0_f_res_f_res_228209 = bicube_228197;\n            }\n            defunc_0_f_res_228203 = defunc_0_f_res_f_res_228209;\n        }\n        ((__global double *) mem_231851)[gtid_228187 * n_203490 + gtid_228188] =\n            defunc_0_f_res_228203;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_228184\n}\n__kernel void mainzisegmap_228212(__global int *global_failure,\n                                  int64_t m_203489, int64_t n_203490,\n                                  int64_t partition_sizze_203577,\n                                  int64_t num_groups_228217,\n                                  int64_t num_threads_232245, __global\n                                  unsigned char *mem_229161, __global\n                                  unsigned char *mem_229164, __global\n                                  unsigned char *mem_231887, __global\n                                  unsigned char *mem_231891, __global\n                                  unsigned char *mem_231895, __global\n                                  unsigned char *mem_231898, __global\n                ",
                   "                  unsigned char *mem_231901, __global\n                                  unsigned char *color_232083)\n{\n    #define segmap_group_sizze_228215 (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_236666;\n    int32_t local_tid_236667;\n    int64_t group_sizze_236670;\n    int32_t wave_sizze_236669;\n    int32_t group_tid_236668;\n    \n    global_tid_236666 = get_global_id(0);\n    local_tid_236667 = get_local_id(0);\n    group_sizze_236670 = get_local_size(0);\n    wave_sizze_236669 = LOCKSTEP_WIDTH;\n    group_tid_236668 = get_group_id(0);\n    \n    int32_t phys_tid_228212 = global_tid_236666;\n    int32_t phys_group_id_236671;\n    \n    phys_group_id_236671 = get_group_id(0);\n    for (int32_t i_236672 = 0; i_236672 <\n         sdiv_up32(sext_i64_i32(sdiv_up64(partition_sizze_203577,\n                                          segmap_group_sizze_228215)) -\n                   phys_group_id_236671, sext_i64_i32(num_groups_228217));\n         i_236672++) {\n        int32_t virt_group_id_236673 = phys_group_id_236671 + i_236672 *\n                sext_i64_i32(num_groups_228217);\n        int64_t global_tid_236674 = sext_i32_i64(virt_group_id_236673) *\n                segmap_group_sizze_228215 + sext_i32_i64(local_tid_236667);\n        int64_t slice_236675 = partition_sizze_203577;\n        int64_t write_i_228211 = global_tid_236674;\n        int64_t remnant_236676 = global_tid_236674 - write_i_228211;\n        \n        if (slt64(write_i_228211, partition_sizze_203577)) {\n            int64_t write_index_206853;\n            \n            write_index_206853 = ((__global\n                                   int64_t *) mem_229164)[write_i_228211];\n            for (int64_t i_229091 = 0; i_229091 < n_203490; i_229091++) {\n                double x_206855;\n                \n                x_206855 = ((__global double *) mem_229161)[write",
                   "_i_228211 *\n                                                            n_203490 +\n                                                            i_229091];\n                \n                double x_206856;\n                \n                x_206856 = ((__global double *) mem_231898)[i_229091 *\n                                                            partition_sizze_203577 +\n                                                            write_i_228211];\n                \n                double x_206857;\n                \n                x_206857 = ((__global double *) mem_231901)[i_229091 *\n                                                            partition_sizze_203577 +\n                                                            write_i_228211];\n                \n                double x_206858 = x_206855 - x_206856;\n                double defunc_2_f_res_206859 = x_206858 - x_206857;\n                \n                ((__global double *) color_232083)[phys_tid_228212 + i_229091 *\n                                                   num_threads_232245] =\n                    defunc_2_f_res_206859;\n            }\n            if (sle64((int64_t) 0, write_index_206853) &&\n                slt64(write_index_206853, m_203489)) {\n                for (int64_t i_236678 = 0; i_236678 < n_203490; i_236678++) {\n                    double tmp_236679;\n                    \n                    tmp_236679 = ((__global\n                                   double *) color_232083)[phys_tid_228212 +\n                                                           i_236678 *\n                                                           num_threads_232245];\n                    ((__global double *) mem_231895)[write_index_206853 *\n                                                     n_203490 + i_236678] =\n                        tmp_236679;\n                }\n            }\n            if (sle64((int64_t) 0, write_index_206853) &&\n                slt64(write_index_206853, m_203489)) {\n                for (int64",
                   "_t i_236680 = 0; i_236680 < n_203490; i_236680++) {\n                    double tmp_236681;\n                    \n                    tmp_236681 = ((__global\n                                   double *) mem_231901)[write_i_228211 +\n                                                         i_236680 *\n                                                         partition_sizze_203577];\n                    ((__global double *) mem_231891)[write_index_206853 *\n                                                     n_203490 + i_236680] =\n                        tmp_236681;\n                }\n            }\n            if (sle64((int64_t) 0, write_index_206853) &&\n                slt64(write_index_206853, m_203489)) {\n                for (int64_t i_236682 = 0; i_236682 < n_203490; i_236682++) {\n                    double tmp_236683;\n                    \n                    tmp_236683 = ((__global\n                                   double *) mem_231898)[write_i_228211 +\n                                                         i_236682 *\n                                                         partition_sizze_203577];\n                    ((__global double *) mem_231887)[write_index_206853 *\n                                                     n_203490 + i_236682] =\n                        tmp_236683;\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_228215\n}\n__kernel void mainzisegmap_intragroup_206893(__global int *global_failure,\n                                             __local volatile\n                                             int64_t *color_231965_backing_aligned_0,\n                                             __local volatile\n                                             int64_t *color_231964_backing_aligned_1,\n                                             int64_t n_203490,\n                                             int64_t partition_sizze_203577,\n          ",
                   "                                   int64_t i_203670, __global\n                                             unsigned char *mem_229161, __global\n                                             unsigned char *mem_229178, __global\n                                             unsigned char *mem_229181)\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_231965_backing_1 =\n                                   (__local volatile\n                                    unsigned char *) color_231965_backing_aligned_0;\n    __local volatile unsigned char *restrict color_231964_backing_0 =\n                                   (__local volatile\n                                    unsigned char *) color_231964_backing_aligned_1;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_232327;\n    int32_t local_tid_232328;\n    int64_t group_sizze_232331;\n    int32_t wave_sizze_232330;\n    int32_t group_tid_232329;\n    \n    global_tid_232327 = get_global_id(0);\n    local_tid_232328 = get_local_id(0);\n    group_sizze_232331 = get_local_size(0);\n    wave_sizze_232330 = LOCKSTEP_WIDTH;\n    group_tid_232329 = get_group_id(0);\n    \n    int32_t phys_tid_206893 = group_tid_232329;\n    int64_t slice_232333 = n_203490;\n    int64_t ltid_pre_232332 = sext_i32_i64(local_tid_232328);\n    int64_t remnant_232334 = sext_i32_i64(local_tid_232328) - ltid_pre_232332;\n    int64_t slice_232335 = partition_sizze_203577;\n    int64_t gtid_206892 = sext_i32_i64(group_tid_232329);\n    int64_t remnant_232336 = sext_i32_i64(group_tid_232329) - gtid_206892;\n    __local unsigned char *color_231964;\n    \n    color_231964 = (__local unsigned char *) color_231964_backing_0;\n    \n    __local unsigned char *color_231965;\n    \n    color_231965 = (__local unsigned char *) color_231965_backing_1;\n    \n    int64_t gtid_206897 = sext_i32_i64(sext_i64_i32(ltid_pre_232332));\n    int32_t phys_tid_206898 = local_tid_232328;\n ",
                   "   double x_206902;\n    \n    x_206902 = ((__global double *) mem_229161)[gtid_206892 * n_203490 +\n                                                gtid_206897];\n    \n    bool isnan_res_206903;\n    \n    isnan_res_206903 = futrts_isnan64(x_206902);\n    \n    bool defunc_0_p_res_206904 = !isnan_res_206903;\n    int64_t defunc_0_f_res_206905 = btoi_bool_i64(defunc_0_p_res_206904);\n    \n    ((__local int64_t *) color_231965)[gtid_206897] = defunc_0_f_res_206905;\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int64_t dims_flat_232337 = n_203490;\n    int64_t x_206899;\n    int64_t x_206900;\n    int64_t x_232339;\n    int64_t x_232340;\n    bool ltid_in_bounds_232342 = slt64(sext_i32_i64(local_tid_232328),\n                                       n_203490);\n    int32_t skip_threads_232343;\n    \n    // read input for in-block scan\n    {\n        if (ltid_in_bounds_232342) {\n            x_206900 = ((volatile __local\n                         int64_t *) color_231965)[sext_i32_i64(local_tid_232328)];\n            if ((local_tid_232328 - squot32(local_tid_232328, 32) * 32) == 0) {\n                x_206899 = x_206900;\n            }\n        }\n    }\n    // in-block scan (hopefully no barriers needed)\n    {\n        skip_threads_232343 = 1;\n        while (slt32(skip_threads_232343, 32)) {\n            bool thread_active_232344 = sle32(skip_threads_232343,\n                                              local_tid_232328 -\n                                              squot32(local_tid_232328, 32) *\n                                              32) && ltid_in_bounds_232342;\n            \n            if (thread_active_232344) {\n                // read operands\n                {\n                    x_206899 = ((volatile __local\n                                 int64_t *) color_231965)[sext_i32_i64(local_tid_232328) -\n                                                          sext_i32_i64(skip_threads_232343)];\n                }\n            }\n            // perform operation\n            {\n                boo",
                   "l inactive_232345 =\n                     slt64(srem64(sext_i32_i64(local_tid_232328), n_203490),\n                           sext_i32_i64(local_tid_232328) -\n                           sext_i32_i64(local_tid_232328 -\n                           skip_threads_232343));\n                \n                if (thread_active_232344 && inactive_232345) {\n                    x_206899 = x_206900;\n                }\n                if (thread_active_232344) {\n                    if (!inactive_232345) {\n                        int64_t defunc_1_op_res_206901 = add64(x_206899,\n                                                               x_206900);\n                        \n                        x_206899 = defunc_1_op_res_206901;\n                    }\n                }\n            }\n            if (sle32(wave_sizze_232330, skip_threads_232343)) {\n                barrier(CLK_LOCAL_MEM_FENCE);\n            }\n            if (thread_active_232344) {\n                // write result\n                {\n                    ((volatile __local\n                      int64_t *) color_231965)[sext_i32_i64(local_tid_232328)] =\n                        x_206899;\n                    x_206900 = x_206899;\n                }\n            }\n            if (sle32(wave_sizze_232330, skip_threads_232343)) {\n                barrier(CLK_LOCAL_MEM_FENCE);\n            }\n            skip_threads_232343 *= 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_232328 - squot32(local_tid_232328, 32) * 32) == 31 &&\n            ltid_in_bounds_232342) {\n            ((volatile __local\n              int64_t *) color_231965)[sext_i32_i64(squot32(local_tid_232328,\n                                                            32))] = x_206899;\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_232346;\n        \n        ",
                   "// read input for in-block scan\n        {\n            if (squot32(local_tid_232328, 32) == 0 && ltid_in_bounds_232342) {\n                x_232340 = ((volatile __local\n                             int64_t *) color_231965)[sext_i32_i64(local_tid_232328)];\n                if ((local_tid_232328 - squot32(local_tid_232328, 32) * 32) ==\n                    0) {\n                    x_232339 = x_232340;\n                }\n            }\n        }\n        // in-block scan (hopefully no barriers needed)\n        {\n            skip_threads_232346 = 1;\n            while (slt32(skip_threads_232346, 32)) {\n                bool thread_active_232347 = sle32(skip_threads_232346,\n                                                  local_tid_232328 -\n                                                  squot32(local_tid_232328,\n                                                          32) * 32) &&\n                     (squot32(local_tid_232328, 32) == 0 &&\n                      ltid_in_bounds_232342);\n                \n                if (thread_active_232347) {\n                    // read operands\n                    {\n                        x_232339 = ((volatile __local\n                                     int64_t *) color_231965)[sext_i32_i64(local_tid_232328) -\n                                                              sext_i32_i64(skip_threads_232346)];\n                    }\n                }\n                // perform operation\n                {\n                    bool inactive_232348 =\n                         slt64(srem64(sext_i32_i64(local_tid_232328 * 32 + 32 -\n                                      1), n_203490),\n                               sext_i32_i64(local_tid_232328 * 32 + 32 - 1) -\n                               sext_i32_i64((local_tid_232328 -\n                                             skip_threads_232346) * 32 + 32 -\n                               1));\n                    \n                    if (thread_active_232347 && inactive_232348) {\n                        x_23",
                   "2339 = x_232340;\n                    }\n                    if (thread_active_232347) {\n                        if (!inactive_232348) {\n                            int64_t defunc_1_op_res_232341 = add64(x_232339,\n                                                                   x_232340);\n                            \n                            x_232339 = defunc_1_op_res_232341;\n                        }\n                    }\n                }\n                if (sle32(wave_sizze_232330, skip_threads_232346)) {\n                    barrier(CLK_LOCAL_MEM_FENCE);\n                }\n                if (thread_active_232347) {\n                    // write result\n                    {\n                        ((volatile __local\n                          int64_t *) color_231965)[sext_i32_i64(local_tid_232328)] =\n                            x_232339;\n                        x_232340 = x_232339;\n                    }\n                }\n                if (sle32(wave_sizze_232330, skip_threads_232346)) {\n                    barrier(CLK_LOCAL_MEM_FENCE);\n                }\n                skip_threads_232346 *= 2;\n            }\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    bool no_carry_in_232349 = squot32(local_tid_232328, 32) == 0 ||\n         !ltid_in_bounds_232342;\n    \n    // carry-in for every block except the first\n    {\n        // read operands\n        {\n            if (!no_carry_in_232349) {\n                x_206900 = x_206899;\n                x_206899 = ((__local\n                             int64_t *) color_231965)[sext_i32_i64(squot32(local_tid_232328,\n                                                                           32)) -\n                                                      (int64_t) 1];\n            }\n        }\n        // perform operation\n        {\n            bool inactive_232350 = slt64(srem64(sext_i32_i64(local_tid_232328),\n                                                n_203490),\n                                         sext_i32_i64(local_",
                   "tid_232328) -\n                                         sext_i32_i64(squot32(local_tid_232328,\n                                                              32) * 32 - 1));\n            \n            if (!no_carry_in_232349) {\n                if (inactive_232350) {\n                    x_206899 = x_206900;\n                }\n            }\n            if (!no_carry_in_232349) {\n                if (!inactive_232350) {\n                    int64_t defunc_1_op_res_206901 = add64(x_206899, x_206900);\n                    \n                    x_206899 = defunc_1_op_res_206901;\n                }\n            }\n        }\n        // write final result\n        {\n            if (!no_carry_in_232349) {\n                ((__local\n                  int64_t *) color_231965)[sext_i32_i64(local_tid_232328)] =\n                    x_206899;\n            }\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    // restore correct values for first block\n    {\n        if (squot32(local_tid_232328, 32) == 0 && ltid_in_bounds_232342) {\n            ((__local int64_t *) color_231965)[sext_i32_i64(local_tid_232328)] =\n                x_206900;\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int64_t last_res_206906;\n    \n    last_res_206906 = ((__local int64_t *) color_231965)[i_203670];\n    ((__local int64_t *) color_231964)[sext_i32_i64(local_tid_232328)] =\n        (int64_t) -1;\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int64_t write_i_206909 = sext_i32_i64(sext_i64_i32(ltid_pre_232332));\n    int32_t phys_tid_206910 = local_tid_232328;\n    double x_206911;\n    \n    x_206911 = ((__global double *) mem_229161)[gtid_206892 * n_203490 +\n                                                write_i_206909];\n    \n    bool isnan_res_206914;\n    \n    isnan_res_206914 = futrts_isnan64(x_206911);\n    \n    bool defunc_0_p_res_206915 = !isnan_res_206914;\n    int64_t defunc_1_f_res_206916;\n    \n    if (defunc_0_p_res_206915) {\n        int64_t x_206912;\n        \n        x_206912 = ((__local int64_t *) color_231",
                   "965)[write_i_206909];\n        \n        int64_t defunc_1_f_res_t_res_206917 = sub64(x_206912, (int64_t) 1);\n        \n        defunc_1_f_res_206916 = defunc_1_f_res_t_res_206917;\n    } else {\n        defunc_1_f_res_206916 = (int64_t) -1;\n    }\n    if (sle64((int64_t) 0, defunc_1_f_res_206916) &&\n        slt64(defunc_1_f_res_206916, n_203490)) {\n        ((__local int64_t *) color_231964)[defunc_1_f_res_206916] =\n            write_i_206909;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int64_t tmp_232351;\n    \n    tmp_232351 = ((__local\n                   int64_t *) color_231964)[sext_i32_i64(local_tid_232328)];\n    ((__global int64_t *) mem_229178)[gtid_206892 * n_203490 +\n                                      sext_i32_i64(local_tid_232328)] =\n        tmp_232351;\n    barrier(CLK_LOCAL_MEM_FENCE);\n    if (local_tid_232328 == 0) {\n        ((__global int64_t *) mem_229181)[gtid_206892] = last_res_206906;\n    }\n    \n  error_2:\n    return;\n}\n__kernel void mainzisegmap_intragroup_207248(__global int *global_failure,\n                                             __local volatile\n                                             int64_t *color_231967_backing_aligned_0,\n                                             __local volatile\n                                             int64_t *color_231966_backing_aligned_1,\n                                             int64_t n_p_203492,\n                                             int64_t partition_sizze_203577,\n                                             int64_t defunc_0_f_res_203631,\n                                             int64_t i_203718,\n                                             int64_t computed_group_sizze_207187,\n                                             __global unsigned char *mem_229206,\n                                             __global unsigned char *mem_229222,\n                                             __global unsigned char *mem_229226)\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_231967_backing_1 =\n                                   (__local volatile\n                                    unsigned char *) color_231967_backing_aligned_0;\n    __local volatile unsigned char *restrict color_231966_backing_0 =\n                                   (__local volatile\n                                    unsigned char *) color_231966_backing_aligned_1;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_232462;\n    int32_t local_tid_232463;\n    int64_t group_sizze_232466;\n    int32_t wave_sizze_232465;\n    int32_t group_tid_232464;\n    \n    global_tid_232462 = get_global_id(0);\n    local_tid_232463 = get_local_id(0);\n    group_sizze_232466 = get_local_size(0);\n    wave_sizze_232465 = LOCKSTEP_WIDTH;\n    group_tid_232464 = get_group_id(0);\n    \n    int32_t phys_tid_207248 = group_tid_232464;\n    int64_t slice_232469 = defunc_0_f_res_203631;\n    int64_t slice_232470 = n_p_203492 * slice_232469;\n    int64_t ltid_pre_232467 = squot64(sext_i32_i64(local_tid_232463),\n                                      slice_232469);\n    int64_t remnant_232471 = sext_i32_i64(local_tid_232463) - ltid_pre_232467 *\n            slice_232469;\n    int64_t ltid_pre_232468 = remnant_232471;\n    int64_t remnant_232472 = remnant_232471 - ltid_pre_232468;\n    int64_t slice_232473 = partition_sizze_203577;\n    int64_t gtid_207247 = sext_i32_i64(group_tid_232464);\n    int64_t remnant_232474 = sext_i32_i64(group_tid_232464) - gtid_207247;\n    __local unsigned char *color_231966;\n    \n    color_231966 = (__local unsigned char *) color_231966_backing_0;\n    \n    __local unsigned char *color_231967;\n    \n    color_231967 = (__local unsigned char *) color_231967_backing_1;\n    \n    int64_t gtid_207252 = sext_i32_i64(sext_i64_i32(ltid_pre_232467));\n    int64_t gtid_207253 = sext_i32_i64(sext_i64_i32(ltid_pre_232468));\n    int32_t phys_tid_207254 = local_tid_232463;\n    \n    if (slt64(gtid_207252, n_",
                   "p_203492) && slt64(gtid_207253,\n                                                defunc_0_f_res_203631)) {\n        double x_207259;\n        \n        x_207259 = ((__global double *) mem_229206)[gtid_207247 *\n                                                    (defunc_0_f_res_203631 *\n                                                     n_p_203492) + gtid_207252 *\n                                                    defunc_0_f_res_203631 +\n                                                    gtid_207253];\n        \n        bool isnan_res_207260;\n        \n        isnan_res_207260 = futrts_isnan64(x_207259);\n        \n        bool defunc_0_p_res_207261 = !isnan_res_207260;\n        int64_t defunc_0_f_res_207262 = btoi_bool_i64(defunc_0_p_res_207261);\n        \n        ((__local int64_t *) color_231967)[gtid_207252 * defunc_0_f_res_203631 +\n                                           gtid_207253] = defunc_0_f_res_207262;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int64_t dims_flat_232475 = n_p_203492 * defunc_0_f_res_203631;\n    int64_t x_207255;\n    int64_t x_207256;\n    int64_t x_232477;\n    int64_t x_232478;\n    bool ltid_in_bounds_232480 = slt64(sext_i32_i64(local_tid_232463),\n                                       n_p_203492 * defunc_0_f_res_203631);\n    int32_t skip_threads_232481;\n    \n    // read input for in-block scan\n    {\n        if (ltid_in_bounds_232480) {\n            x_207256 = ((volatile __local\n                         int64_t *) color_231967)[sext_i32_i64(local_tid_232463)];\n            if ((local_tid_232463 - squot32(local_tid_232463, 32) * 32) == 0) {\n                x_207255 = x_207256;\n            }\n        }\n    }\n    // in-block scan (hopefully no barriers needed)\n    {\n        skip_threads_232481 = 1;\n        while (slt32(skip_threads_232481, 32)) {\n            bool thread_active_232482 = sle32(skip_threads_232481,\n                                              local_tid_232463 -\n                                              squot32(local_tid_232463",
                   ", 32) *\n                                              32) && ltid_in_bounds_232480;\n            \n            if (thread_active_232482) {\n                // read operands\n                {\n                    x_207255 = ((volatile __local\n                                 int64_t *) color_231967)[sext_i32_i64(local_tid_232463) -\n                                                          sext_i32_i64(skip_threads_232481)];\n                }\n            }\n            // perform operation\n            {\n                bool inactive_232483 =\n                     slt64(srem64(sext_i32_i64(local_tid_232463),\n                                  defunc_0_f_res_203631),\n                           sext_i32_i64(local_tid_232463) -\n                           sext_i32_i64(local_tid_232463 -\n                           skip_threads_232481));\n                \n                if (thread_active_232482 && inactive_232483) {\n                    x_207255 = x_207256;\n                }\n                if (thread_active_232482) {\n                    if (!inactive_232483) {\n                        int64_t defunc_1_op_res_207257 = add64(x_207255,\n                                                               x_207256);\n                        \n                        x_207255 = defunc_1_op_res_207257;\n                    }\n                }\n            }\n            if (sle32(wave_sizze_232465, skip_threads_232481)) {\n                barrier(CLK_LOCAL_MEM_FENCE);\n            }\n            if (thread_active_232482) {\n                // write result\n                {\n                    ((volatile __local\n                      int64_t *) color_231967)[sext_i32_i64(local_tid_232463)] =\n                        x_207255;\n                    x_207256 = x_207255;\n                }\n            }\n            if (sle32(wave_sizze_232465, skip_threads_232481)) {\n                barrier(CLK_LOCAL_MEM_FENCE);\n            }\n            skip_threads_232481 *= 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_232463 - squot32(local_tid_232463, 32) * 32) == 31 &&\n            ltid_in_bounds_232480) {\n            ((volatile __local\n              int64_t *) color_231967)[sext_i32_i64(squot32(local_tid_232463,\n                                                            32))] = x_207255;\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_232484;\n        \n        // read input for in-block scan\n        {\n            if (squot32(local_tid_232463, 32) == 0 && ltid_in_bounds_232480) {\n                x_232478 = ((volatile __local\n                             int64_t *) color_231967)[sext_i32_i64(local_tid_232463)];\n                if ((local_tid_232463 - squot32(local_tid_232463, 32) * 32) ==\n                    0) {\n                    x_232477 = x_232478;\n                }\n            }\n        }\n        // in-block scan (hopefully no barriers needed)\n        {\n            skip_threads_232484 = 1;\n            while (slt32(skip_threads_232484, 32)) {\n                bool thread_active_232485 = sle32(skip_threads_232484,\n                                                  local_tid_232463 -\n                                                  squot32(local_tid_232463,\n                                                          32) * 32) &&\n                     (squot32(local_tid_232463, 32) == 0 &&\n                      ltid_in_bounds_232480);\n                \n                if (thread_active_232485) {\n                    // read operands\n                    {\n                        x_232477 = ((volatile __local\n                                     int64_t *) color_231967)[sext_i32_i64(local_tid_232463) -\n                                                              sext_i32_i64(skip_threads_232484)];\n                    }\n                }\n                // perform operatio",
                   "n\n                {\n                    bool inactive_232486 =\n                         slt64(srem64(sext_i32_i64(local_tid_232463 * 32 + 32 -\n                                      1), defunc_0_f_res_203631),\n                               sext_i32_i64(local_tid_232463 * 32 + 32 - 1) -\n                               sext_i32_i64((local_tid_232463 -\n                                             skip_threads_232484) * 32 + 32 -\n                               1));\n                    \n                    if (thread_active_232485 && inactive_232486) {\n                        x_232477 = x_232478;\n                    }\n                    if (thread_active_232485) {\n                        if (!inactive_232486) {\n                            int64_t defunc_1_op_res_232479 = add64(x_232477,\n                                                                   x_232478);\n                            \n                            x_232477 = defunc_1_op_res_232479;\n                        }\n                    }\n                }\n                if (sle32(wave_sizze_232465, skip_threads_232484)) {\n                    barrier(CLK_LOCAL_MEM_FENCE);\n                }\n                if (thread_active_232485) {\n                    // write result\n                    {\n                        ((volatile __local\n                          int64_t *) color_231967)[sext_i32_i64(local_tid_232463)] =\n                            x_232477;\n                        x_232478 = x_232477;\n                    }\n                }\n                if (sle32(wave_sizze_232465, skip_threads_232484)) {\n                    barrier(CLK_LOCAL_MEM_FENCE);\n                }\n                skip_threads_232484 *= 2;\n            }\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    bool no_carry_in_232487 = squot32(local_tid_232463, 32) == 0 ||\n         !ltid_in_bounds_232480;\n    \n    // carry-in for every block except the first\n    {\n        // read operands\n        {\n            if (!no_carry_in_232487) ",
                   "{\n                x_207256 = x_207255;\n                x_207255 = ((__local\n                             int64_t *) color_231967)[sext_i32_i64(squot32(local_tid_232463,\n                                                                           32)) -\n                                                      (int64_t) 1];\n            }\n        }\n        // perform operation\n        {\n            bool inactive_232488 = slt64(srem64(sext_i32_i64(local_tid_232463),\n                                                defunc_0_f_res_203631),\n                                         sext_i32_i64(local_tid_232463) -\n                                         sext_i32_i64(squot32(local_tid_232463,\n                                                              32) * 32 - 1));\n            \n            if (!no_carry_in_232487) {\n                if (inactive_232488) {\n                    x_207255 = x_207256;\n                }\n            }\n            if (!no_carry_in_232487) {\n                if (!inactive_232488) {\n                    int64_t defunc_1_op_res_207257 = add64(x_207255, x_207256);\n                    \n                    x_207255 = defunc_1_op_res_207257;\n                }\n            }\n        }\n        // write final result\n        {\n            if (!no_carry_in_232487) {\n                ((__local\n                  int64_t *) color_231967)[sext_i32_i64(local_tid_232463)] =\n                    x_207255;\n            }\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    // restore correct values for first block\n    {\n        if (squot32(local_tid_232463, 32) == 0 && ltid_in_bounds_232480) {\n            ((__local int64_t *) color_231967)[sext_i32_i64(local_tid_232463)] =\n                x_207256;\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    for (int64_t i_232489 = 0; i_232489 < sdiv_up64(n_p_203492 *\n                                                    defunc_0_f_res_203631 -\n                                                    sext_i32_i64(local_tid_232463),\n        ",
                   "                                            computed_group_sizze_207187);\n         i_232489++) {\n        ((__local int64_t *) color_231966)[squot64(i_232489 *\n                                                   computed_group_sizze_207187 +\n                                                   sext_i32_i64(local_tid_232463),\n                                                   defunc_0_f_res_203631) *\n                                           defunc_0_f_res_203631 + (i_232489 *\n                                                                    computed_group_sizze_207187 +\n                                                                    sext_i32_i64(local_tid_232463) -\n                                                                    squot64(i_232489 *\n                                                                            computed_group_sizze_207187 +\n                                                                            sext_i32_i64(local_tid_232463),\n                                                                            defunc_0_f_res_203631) *\n                                                                    defunc_0_f_res_203631)] =\n            (int64_t) -1;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int64_t gtid_207274 = sext_i32_i64(sext_i64_i32(ltid_pre_232467));\n    int64_t gtid_207275 = sext_i32_i64(sext_i64_i32(ltid_pre_232468));\n    int32_t phys_tid_207276 = local_tid_232463;\n    \n    if (slt64(gtid_207274, n_p_203492) && slt64(gtid_207275,\n                                                defunc_0_f_res_203631)) {\n        double x_207277;\n        \n        x_207277 = ((__global double *) mem_229206)[gtid_207247 *\n                                                    (defunc_0_f_res_203631 *\n                                                     n_p_203492) + gtid_207274 *\n                                                    defunc_0_f_res_203631 +\n                                                    gtid_207275];\n        \n        bool isna",
                   "n_res_207280;\n        \n        isnan_res_207280 = futrts_isnan64(x_207277);\n        \n        bool defunc_0_p_res_207281 = !isnan_res_207280;\n        int64_t defunc_1_f_res_207282;\n        \n        if (defunc_0_p_res_207281) {\n            int64_t x_207278;\n            \n            x_207278 = ((__local int64_t *) color_231967)[gtid_207274 *\n                                                          defunc_0_f_res_203631 +\n                                                          gtid_207275];\n            \n            int64_t defunc_1_f_res_t_res_207283 = sub64(x_207278, (int64_t) 1);\n            \n            defunc_1_f_res_207282 = defunc_1_f_res_t_res_207283;\n        } else {\n            defunc_1_f_res_207282 = (int64_t) -1;\n        }\n        if ((sle64((int64_t) 0, gtid_207274) && slt64(gtid_207274,\n                                                      n_p_203492)) &&\n            (sle64((int64_t) 0, defunc_1_f_res_207282) &&\n             slt64(defunc_1_f_res_207282, defunc_0_f_res_203631))) {\n            ((__local int64_t *) color_231966)[gtid_207274 *\n                                               defunc_0_f_res_203631 +\n                                               defunc_1_f_res_207282] =\n                gtid_207275;\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    for (int64_t i_232490 = 0; i_232490 < sdiv_up64(n_p_203492 *\n                                                    defunc_0_f_res_203631 -\n                                                    sext_i32_i64(local_tid_232463),\n                                                    computed_group_sizze_207187);\n         i_232490++) {\n        int64_t tmp_232491;\n        \n        tmp_232491 = ((__local int64_t *) color_231966)[squot64(i_232490 *\n                                                                computed_group_sizze_207187 +\n                                                                sext_i32_i64(local_tid_232463),\n                                                                defunc_0_f_res",
                   "_203631) *\n                                                        defunc_0_f_res_203631 +\n                                                        (i_232490 *\n                                                         computed_group_sizze_207187 +\n                                                         sext_i32_i64(local_tid_232463) -\n                                                         squot64(i_232490 *\n                                                                 computed_group_sizze_207187 +\n                                                                 sext_i32_i64(local_tid_232463),\n                                                                 defunc_0_f_res_203631) *\n                                                         defunc_0_f_res_203631)];\n        ((__global int64_t *) mem_229222)[gtid_207247 * (defunc_0_f_res_203631 *\n                                                         n_p_203492) +\n                                          squot64(i_232490 *\n                                                  computed_group_sizze_207187 +\n                                                  sext_i32_i64(local_tid_232463),\n                                                  defunc_0_f_res_203631) *\n                                          defunc_0_f_res_203631 + (i_232490 *\n                                                                   computed_group_sizze_207187 +\n                                                                   sext_i32_i64(local_tid_232463) -\n                                                                   squot64(i_232490 *\n                                                                           computed_group_sizze_207187 +\n                                                                           sext_i32_i64(local_tid_232463),\n                                                                           defunc_0_f_res_203631) *\n                                                                   defunc_0_f_res_203631)] =\n        ",
                   "    tmp_232491;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    for (int64_t i_232492 = 0; i_232492 < sdiv_up64(n_p_203492 -\n                                                    sext_i32_i64(local_tid_232463),\n                                                    computed_group_sizze_207187);\n         i_232492++) {\n        int64_t tmp_232493;\n        \n        tmp_232493 = ((__local int64_t *) color_231967)[i_203718 + (i_232492 *\n                                                                    computed_group_sizze_207187 +\n                                                                    sext_i32_i64(local_tid_232463)) *\n                                                        defunc_0_f_res_203631];\n        ((__global int64_t *) mem_229226)[gtid_207247 * n_p_203492 + (i_232492 *\n                                                                      computed_group_sizze_207187 +\n                                                                      sext_i32_i64(local_tid_232463))] =\n            tmp_232493;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n  error_2:\n    return;\n}\n__kernel void mainzisegmap_intragroup_207524(__global int *global_failure,\n                                             __local volatile\n                                             int64_t *color_231969_backing_aligned_0,\n                                             __local volatile\n                                             int64_t *color_231968_backing_aligned_1,\n                                             int64_t n_p_203492,\n                                             int64_t partition_sizze_203577,\n                                             int64_t defunc_0_f_res_203631,\n                                             int64_t i_203718, __global\n                                             unsigned char *mem_229206, __global\n                                             unsigned char *mem_229240, __global\n                                             unsigned char *mem_229244)\n{\n    const int blo",
                   "ck_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    __local volatile unsigned char *restrict color_231969_backing_1 =\n                                   (__local volatile\n                                    unsigned char *) color_231969_backing_aligned_0;\n    __local volatile unsigned char *restrict color_231968_backing_0 =\n                                   (__local volatile\n                                    unsigned char *) color_231968_backing_aligned_1;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_232494;\n    int32_t local_tid_232495;\n    int64_t group_sizze_232498;\n    int32_t wave_sizze_232497;\n    int32_t group_tid_232496;\n    \n    global_tid_232494 = get_global_id(0);\n    local_tid_232495 = get_local_id(0);\n    group_sizze_232498 = get_local_size(0);\n    wave_sizze_232497 = LOCKSTEP_WIDTH;\n    group_tid_232496 = get_group_id(0);\n    \n    int32_t phys_tid_207524 = group_tid_232496;\n    int64_t slice_232500 = defunc_0_f_res_203631;\n    int64_t ltid_pre_232499 = sext_i32_i64(local_tid_232495);\n    int64_t remnant_232501 = sext_i32_i64(local_tid_232495) - ltid_pre_232499;\n    int64_t slice_232502 = n_p_203492;\n    int64_t slice_232503 = partition_sizze_203577 * slice_232502;\n    int64_t gtid_207522 = squot64(sext_i32_i64(group_tid_232496), slice_232502);\n    int64_t remnant_232504 = sext_i32_i64(group_tid_232496) - gtid_207522 *\n            slice_232502;\n    int64_t gtid_207523 = remnant_232504;\n    int64_t remnant_232505 = remnant_232504 - gtid_207523;\n    __local unsigned char *color_231968;\n    \n    color_231968 = (__local unsigned char *) color_231968_backing_0;\n    \n    __local unsigned char *color_231969;\n    \n    color_231969 = (__local unsigned char *) color_231969_backing_1;\n    \n    int64_t gtid_207528 = sext_i32_i64(sext_i64_i32(ltid_pre_232499));\n    int32_t phys_tid_207529 = local_tid_232495;\n    double x_207533;\n    \n    x_207533 = ((__global double *) mem_229206)[gtid_207522 *\n          ",
                   "                                      (defunc_0_f_res_203631 *\n                                                 n_p_203492) + gtid_207523 *\n                                                defunc_0_f_res_203631 +\n                                                gtid_207528];\n    \n    bool isnan_res_207534;\n    \n    isnan_res_207534 = futrts_isnan64(x_207533);\n    \n    bool defunc_0_p_res_207535 = !isnan_res_207534;\n    int64_t defunc_0_f_res_207536 = btoi_bool_i64(defunc_0_p_res_207535);\n    \n    ((__local int64_t *) color_231969)[gtid_207528] = defunc_0_f_res_207536;\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int64_t dims_flat_232506 = defunc_0_f_res_203631;\n    int64_t x_207530;\n    int64_t x_207531;\n    int64_t x_232508;\n    int64_t x_232509;\n    bool ltid_in_bounds_232511 = slt64(sext_i32_i64(local_tid_232495),\n                                       defunc_0_f_res_203631);\n    int32_t skip_threads_232512;\n    \n    // read input for in-block scan\n    {\n        if (ltid_in_bounds_232511) {\n            x_207531 = ((volatile __local\n                         int64_t *) color_231969)[sext_i32_i64(local_tid_232495)];\n            if ((local_tid_232495 - squot32(local_tid_232495, 32) * 32) == 0) {\n                x_207530 = x_207531;\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_232495 -\n                                              squot32(local_tid_232495, 32) *\n                                              32) && ltid_in_bounds_232511;\n            \n            if (thread_active_232513) {\n                // read operands\n                {\n                    x_207530 = ((volatile __local\n                                 int64_t *) color_231969)[sext_i32_i64(local_tid_232495) -\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_232495),\n                                  defunc_0_f_res_203631),\n                           sext_i32_i64(local_tid_232495) -\n                           sext_i32_i64(local_tid_232495 -\n                           skip_threads_232512));\n                \n                if (thread_active_232513 && inactive_232514) {\n                    x_207530 = x_207531;\n                }\n                if (thread_active_232513) {\n                    if (!inactive_232514) {\n                        int64_t defunc_1_op_res_207532 = add64(x_207530,\n                                                               x_207531);\n                        \n                        x_207530 = defunc_1_op_res_207532;\n                    }\n                }\n            }\n            if (sle32(wave_sizze_232497, 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 *) color_231969)[sext_i32_i64(local_tid_232495)] =\n                        x_207530;\n                    x_207531 = x_207530;\n                }\n            }\n            if (sle32(wave_sizze_232497, skip_threads_232512)) {\n                barrier(CLK_LOCAL_MEM_FENCE);\n            }\n            skip_threads_232512 *= 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_232495 - squot32(local_tid_232495, 32) * 32) == 31 &&\n            ltid_in_bounds_232511) {\n            ((volatile __local\n              int64_t *) color_231969)[sext_i32_i64(squot32(local_tid_232495,\n                                                            32))] = x_207530;\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_232515;\n        \n        // read input for in-block scan\n        {\n            if (squot32(local_tid_232495, 32) == 0 && ltid_in_bounds_232511) {\n                x_232509 = ((volatile __local\n                             int64_t *) color_231969)[sext_i32_i64(local_tid_232495)];\n                if ((local_tid_232495 - squot32(local_tid_232495, 32) * 32) ==\n                    0) {\n                    x_232508 = x_232509;\n                }\n            }\n        }\n        // in-block scan (hopefully no barriers needed)\n        {\n            skip_threads_232515 = 1;\n            while (slt32(skip_threads_232515, 32)) {\n                bool thread_active_232516 = sle32(skip_threads_232515,\n                                                  local_tid_232495 -\n                                                  squot32(local_tid_232495,\n                                                          32) * 32) &&\n                     (squot32(local_tid_232495, 32) == 0 &&\n                      ltid_in_bounds_232511);\n                \n                if (thread_active_232516) {\n                    // read operands\n                    {\n                        x_232508 = ((volatile __local\n                                     int64_t *) color_231969)[sext_i32_i64(local_tid_232495) -\n                                                              sext_i32_i64(skip_threads_232515)];\n                    }\n                }\n                // perform operation\n                {\n                    bool inactive_232517 =\n                         slt64(srem64(sext_i32_i64(local_tid_232495 * 32 + 32 -\n                                      1), defunc_0_f_res_203631),\n                               sext_i32_i64(local_tid_232495 * 32 + 32 - 1) -\n                               sext_i32_i64((local_tid_232495 -\n                              ",
                   "               skip_threads_232515) * 32 + 32 -\n                               1));\n                    \n                    if (thread_active_232516 && inactive_232517) {\n                        x_232508 = x_232509;\n                    }\n                    if (thread_active_232516) {\n                        if (!inactive_232517) {\n                            int64_t defunc_1_op_res_232510 = add64(x_232508,\n                                                                   x_232509);\n                            \n                            x_232508 = defunc_1_op_res_232510;\n                        }\n                    }\n                }\n                if (sle32(wave_sizze_232497, skip_threads_232515)) {\n                    barrier(CLK_LOCAL_MEM_FENCE);\n                }\n                if (thread_active_232516) {\n                    // write result\n                    {\n                        ((volatile __local\n                          int64_t *) color_231969)[sext_i32_i64(local_tid_232495)] =\n                            x_232508;\n                        x_232509 = x_232508;\n                    }\n                }\n                if (sle32(wave_sizze_232497, skip_threads_232515)) {\n                    barrier(CLK_LOCAL_MEM_FENCE);\n                }\n                skip_threads_232515 *= 2;\n            }\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    bool no_carry_in_232518 = squot32(local_tid_232495, 32) == 0 ||\n         !ltid_in_bounds_232511;\n    \n    // carry-in for every block except the first\n    {\n        // read operands\n        {\n            if (!no_carry_in_232518) {\n                x_207531 = x_207530;\n                x_207530 = ((__local\n                             int64_t *) color_231969)[sext_i32_i64(squot32(local_tid_232495,\n                                                                           32)) -\n                                                      (int64_t) 1];\n            }\n        }\n        // perform operation\n        {",
                   "\n            bool inactive_232519 = slt64(srem64(sext_i32_i64(local_tid_232495),\n                                                defunc_0_f_res_203631),\n                                         sext_i32_i64(local_tid_232495) -\n                                         sext_i32_i64(squot32(local_tid_232495,\n                                                              32) * 32 - 1));\n            \n            if (!no_carry_in_232518) {\n                if (inactive_232519) {\n                    x_207530 = x_207531;\n                }\n            }\n            if (!no_carry_in_232518) {\n                if (!inactive_232519) {\n                    int64_t defunc_1_op_res_207532 = add64(x_207530, x_207531);\n                    \n                    x_207530 = defunc_1_op_res_207532;\n                }\n            }\n        }\n        // write final result\n        {\n            if (!no_carry_in_232518) {\n                ((__local\n                  int64_t *) color_231969)[sext_i32_i64(local_tid_232495)] =\n                    x_207530;\n            }\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    // restore correct values for first block\n    {\n        if (squot32(local_tid_232495, 32) == 0 && ltid_in_bounds_232511) {\n            ((__local int64_t *) color_231969)[sext_i32_i64(local_tid_232495)] =\n                x_207531;\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int64_t last_res_207537;\n    \n    last_res_207537 = ((__local int64_t *) color_231969)[i_203718];\n    ((__local int64_t *) color_231968)[sext_i32_i64(local_tid_232495)] =\n        (int64_t) -1;\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int64_t write_i_207540 = sext_i32_i64(sext_i64_i32(ltid_pre_232499));\n    int32_t phys_tid_207541 = local_tid_232495;\n    double x_207542;\n    \n    x_207542 = ((__global double *) mem_229206)[gtid_207522 *\n                                                (defunc_0_f_res_203631 *\n                                                 n_p_203492) + gtid_207523 *\n             ",
                   "                                   defunc_0_f_res_203631 +\n                                                write_i_207540];\n    \n    bool isnan_res_207545;\n    \n    isnan_res_207545 = futrts_isnan64(x_207542);\n    \n    bool defunc_0_p_res_207546 = !isnan_res_207545;\n    int64_t defunc_1_f_res_207547;\n    \n    if (defunc_0_p_res_207546) {\n        int64_t x_207543;\n        \n        x_207543 = ((__local int64_t *) color_231969)[write_i_207540];\n        \n        int64_t defunc_1_f_res_t_res_207548 = sub64(x_207543, (int64_t) 1);\n        \n        defunc_1_f_res_207547 = defunc_1_f_res_t_res_207548;\n    } else {\n        defunc_1_f_res_207547 = (int64_t) -1;\n    }\n    if (sle64((int64_t) 0, defunc_1_f_res_207547) &&\n        slt64(defunc_1_f_res_207547, defunc_0_f_res_203631)) {\n        ((__local int64_t *) color_231968)[defunc_1_f_res_207547] =\n            write_i_207540;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int64_t tmp_232520;\n    \n    tmp_232520 = ((__local\n                   int64_t *) color_231968)[sext_i32_i64(local_tid_232495)];\n    ((__global int64_t *) mem_229240)[gtid_207522 * (defunc_0_f_res_203631 *\n                                                     n_p_203492) + gtid_207523 *\n                                      defunc_0_f_res_203631 +\n                                      sext_i32_i64(local_tid_232495)] =\n        tmp_232520;\n    barrier(CLK_LOCAL_MEM_FENCE);\n    if (local_tid_232495 == 0) {\n        ((__global int64_t *) mem_229244)[gtid_207522 * n_p_203492 +\n                                          gtid_207523] = last_res_207537;\n    }\n    \n  error_2:\n    return;\n}\n__kernel void mainzisegmap_intragroup_207777(__global int *global_failure,\n                                             int failure_is_an_option, __global\n                                             int64_t *global_failure_args,\n                                             __local volatile\n                                             int64_t *color_231976_backing_aligned_0,\n        ",
                   "                                     __local volatile\n                                             int64_t *color_231975_backing_aligned_1,\n                                             __local volatile\n                                             int64_t *color_231974_backing_aligned_2,\n                                             __local volatile\n                                             int64_t *color_231973_backing_aligned_3,\n                                             __local volatile\n                                             int64_t *color_231972_backing_aligned_4,\n                                             __local volatile\n                                             int64_t *color_231971_backing_aligned_5,\n                                             __local volatile\n                                             int64_t *color_231970_backing_aligned_6,\n                                             int64_t n_p_203492,\n                                             int64_t q_s_203493,\n                                             int64_t jump_s_203499,\n                                             int64_t partition_sizze_203577,\n                                             int64_t defunc_0_f_res_203631,\n                                             int64_t pad_css_len_203632,\n                                             int64_t s_n_m_203636,\n                                             int64_t i_203718,\n                                             unsigned char x_203719_bits,\n                                             int64_t min_res_203749,\n                                             unsigned char loop_cond_203754_bits,\n                                             double i64_res_203755,\n                                             int64_t computed_group_sizze_207619,\n                                             __global\n                                             unsigned char *ext_mem_229264,\n                                             __global\n       ",
                   "                                      unsigned char *ext_mem_229265,\n                                             __global unsigned char *mem_229298,\n                                             __global unsigned char *mem_229303)\n{\n    bool x_203719 = x_203719_bits;\n    bool loop_cond_203754 = loop_cond_203754_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_231976_backing_6 =\n                                   (__local volatile\n                                    unsigned char *) color_231976_backing_aligned_0;\n    __local volatile unsigned char *restrict color_231975_backing_5 =\n                                   (__local volatile\n                                    unsigned char *) color_231975_backing_aligned_1;\n    __local volatile unsigned char *restrict color_231974_backing_4 =\n                                   (__local volatile\n                                    unsigned char *) color_231974_backing_aligned_2;\n    __local volatile unsigned char *restrict color_231973_backing_3 =\n                                   (__local volatile\n                                    unsigned char *) color_231973_backing_aligned_3;\n    __local volatile unsigned char *restrict color_231972_backing_2 =\n                                   (__local volatile\n                                    unsigned char *) color_231972_backing_aligned_4;\n    __local volatile unsigned char *restrict color_231971_backing_1 =\n                                   (__local volatile\n                                    unsigned char *) color_231971_backing_aligned_5;\n    __local volatile unsigned char *restrict color_231970_backing_0 =\n                                   (__local volatile\n                                    unsigned char *) color_231970_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_232612;\n    int32_t local_tid_232613;\n    int64_t group_sizze_232616;\n    int32_t wave_sizze_232615;\n    int32_t group_tid_232614;\n    \n    global_tid_232612 = get_global_id(0);\n    local_tid_232613 = get_local_id(0);\n    group_sizze_232616 = get_local_size(0);\n    wave_sizze_232615 = LOCKSTEP_WIDTH;\n    group_tid_232614 = get_group_id(0);\n    \n    int32_t phys_tid_207777 = group_tid_232614;\n    int64_t slice_232618 = n_p_203492;\n    int64_t ltid_pre_232617 = sext_i32_i64(local_tid_232613);\n    int64_t remnant_232619 = sext_i32_i64(local_tid_232613) - ltid_pre_232617;\n    int64_t slice_232622 = defunc_0_f_res_203631;\n    int64_t slice_232623 = n_p_203492 * slice_232622;\n    int64_t ltid_pre_232620 = squot64(sext_i32_i64(local_tid_232613),\n                                      slice_232622);\n    int64_t remnant_232624 = sext_i32_i64(local_tid_232613) - ltid_pre_232620 *\n            slice_232622;\n    int64_t ltid_pre_232621 = remnant_232624;\n    int64_t remnant_232625 = remnant_232624 - ltid_pre_232621;\n    int64_t slice_232628 = s_n_m_203636;\n    int64_t slice_232629 = n_p_203492 * slice_232628;\n    int64_t ltid_pre_232626 = squot64(sext_i32_i64(local_tid_232613),\n                                      slice_232628);\n    int64_t remnant_232630 = sext_i32_i64(local_tid_232613) - ltid_pre_232626 *\n            slice_232628;\n    int64_t ltid_pre_232627 = remnant_232630;\n    int64_t remnant_232631 = remnant_232630 - ltid_pre_232627;\n    int64_t slice_232632 = partition_sizze_203577;\n    int64_t gtid_207776 = sext_i32_i64(group_tid_232614);\n    int64_t remnant_232633 = sext_i32_i64(group_tid_232614) - gtid_207776;\n    __local unsigned char *color_231970;\n    \n    color_231970 = (__local unsigned char *) color_231970_backing_0;\n    \n    __local unsigned char *color_231971;\n    \n    color_231971 = (__local unsigned char *) color_231971_backing_1;\n ",
                   "   \n    __local unsigned char *color_231972;\n    \n    color_231972 = (__local unsigned char *) color_231972_backing_2;\n    \n    __local unsigned char *color_231973;\n    \n    color_231973 = (__local unsigned char *) color_231973_backing_3;\n    \n    __local unsigned char *color_231974;\n    \n    color_231974 = (__local unsigned char *) color_231974_backing_4;\n    \n    __local unsigned char *color_231975;\n    \n    color_231975 = (__local unsigned char *) color_231975_backing_5;\n    \n    __local unsigned char *color_231976;\n    \n    color_231976 = (__local unsigned char *) color_231976_backing_6;\n    \n    int64_t gtid_207783 = sext_i32_i64(sext_i64_i32(ltid_pre_232620));\n    int64_t gtid_207784 = sext_i32_i64(sext_i64_i32(ltid_pre_232621));\n    int32_t phys_tid_207785 = local_tid_232613;\n    \n    if (slt64(gtid_207783, n_p_203492) && slt64(gtid_207784,\n                                                defunc_0_f_res_203631)) {\n        int64_t x_207786;\n        \n        x_207786 = ((__global int64_t *) ext_mem_229265)[gtid_207776 *\n                                                         (defunc_0_f_res_203631 *\n                                                          n_p_203492) +\n                                                         gtid_207783 *\n                                                         defunc_0_f_res_203631 +\n                                                         gtid_207784];\n        \n        int64_t defunc_0_f_res_207787 = add64((int64_t) 1, x_207786);\n        \n        ((__local int64_t *) color_231976)[gtid_207783 * defunc_0_f_res_203631 +\n                                           gtid_207784] = defunc_0_f_res_207787;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int64_t gtid_207792 = sext_i32_i64(sext_i64_i32(ltid_pre_232617));\n    int32_t phys_tid_207793 = local_tid_232613;\n    \n    if (slt64(gtid_207792, n_p_203492)) {\n        int64_t x_207794;\n        \n        x_207794 = ((__global int64_t *) ext_mem_229264)[gtid_207776 *\n                ",
                   "                                         n_p_203492 +\n                                                         gtid_207792];\n        \n        int64_t min_arg_207795 = sub64(x_207794, (int64_t) 1);\n        int64_t min_arg_207796 = sub64(x_207794, min_res_203749);\n        int64_t min_res_207797 = smin64(q_s_203493, x_207794);\n        double i64_res_207798 = sitofp_i64_f64(x_207794);\n        double x_207799 = i64_res_203755 - i64_res_207798;\n        double max_arg_207800 = x_207799 / 2.0;\n        double max_res_207801 = fmax64(0.0, max_arg_207800);\n        \n        ((__local int64_t *) color_231975)[gtid_207792] = min_arg_207795;\n        ((__local int64_t *) color_231974)[gtid_207792] = min_arg_207796;\n        ((__local int64_t *) color_231973)[gtid_207792] = min_res_207797;\n        ((__local double *) color_231972)[gtid_207792] = max_res_207801;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int64_t gtid_207804 = sext_i32_i64(sext_i64_i32(ltid_pre_232626));\n    int64_t gtid_207805 = sext_i32_i64(sext_i64_i32(ltid_pre_232627));\n    int32_t phys_tid_207806 = local_tid_232613;\n    \n    if (slt64(gtid_207804, n_p_203492) && slt64(gtid_207805, s_n_m_203636)) {\n        int64_t min_arg_207808;\n        \n        min_arg_207808 = ((__local int64_t *) color_231975)[gtid_207804];\n        \n        int64_t min_arg_207809;\n        \n        min_arg_207809 = ((__local int64_t *) color_231974)[gtid_207804];\n        \n        int64_t min_res_207810;\n        \n        min_res_207810 = ((__local int64_t *) color_231973)[gtid_207804];\n        \n        double max_res_207811;\n        \n        max_res_207811 = ((__local double *) color_231972)[gtid_207804];\n        \n        bool cond_207813 = gtid_207805 == (int64_t) 0;\n        int64_t defunc_0_m_fun_res_207814;\n        \n        if (cond_207813) {\n            defunc_0_m_fun_res_207814 = (int64_t) 0;\n        } else {\n            int64_t y_207815 = sub64(s_n_m_203636, (int64_t) 1);\n            bool cond_207816 = gtid_207805 == y_207815;\n       ",
                   "     int64_t defunc_0_m_fun_res_f_res_207817;\n            \n            if (cond_207816) {\n                int64_t defunc_0_m_fun_res_f_res_t_res_207818 =\n                        sub64(pad_css_len_203632, (int64_t) 1);\n                \n                defunc_0_m_fun_res_f_res_207817 =\n                    defunc_0_m_fun_res_f_res_t_res_207818;\n            } else {\n                int64_t x_207819 = sub64(gtid_207805, (int64_t) 1);\n                int64_t x_207820 = mul64(jump_s_203499, x_207819);\n                int64_t min_arg_207821 = add64((int64_t) 1, x_207820);\n                int64_t min_res_207822 = smin64(defunc_0_f_res_203631,\n                                                min_arg_207821);\n                \n                defunc_0_m_fun_res_f_res_207817 = min_res_207822;\n            }\n            defunc_0_m_fun_res_207814 = defunc_0_m_fun_res_f_res_207817;\n        }\n        \n        bool init_idx_207823;\n        int64_t init_idx_207824;\n        int64_t init_idx_207825;\n        bool loop_while_207826;\n        int64_t low_207827;\n        int64_t high_207828;\n        \n        loop_while_207826 = x_203719;\n        low_207827 = (int64_t) 0;\n        high_207828 = i_203718;\n        while (loop_while_207826) {\n            int64_t x_207829 = add64(low_207827, high_207828);\n            int64_t mid_207830 = sdiv64(x_207829, (int64_t) 2);\n            bool x_207831 = sle64((int64_t) 0, mid_207830);\n            bool y_207832 = slt64(mid_207830, defunc_0_f_res_203631);\n            bool bounds_check_207833 = x_207831 && y_207832;\n            bool index_certs_207834;\n            \n            if (!bounds_check_207833) {\n                {\n                    if (atomic_cmpxchg_i32_global(global_failure, -1, 2) ==\n                        -1) {\n                        global_failure_args[0] = (int64_t) mid_207830;\n                        global_failure_args[1] =\n                            (int64_t) defunc_0_f_res_203631;\n                        ;\n                    }\n         ",
                   "           local_failure = true;\n                    goto error_2;\n                }\n            }\n            \n            int64_t mid_id_207835;\n            \n            mid_id_207835 = ((__local int64_t *) color_231976)[gtid_207804 *\n                                                               defunc_0_f_res_203631 +\n                                                               mid_207830];\n            \n            bool cond_207836 = slt64(mid_id_207835, (int64_t) 0);\n            int64_t mid_idx_207837;\n            \n            if (cond_207836) {\n                mid_idx_207837 = (int64_t) 9223372036854775807;\n            } else {\n                mid_idx_207837 = mid_id_207835;\n            }\n            \n            bool cond_207838 = sle64(defunc_0_m_fun_res_207814, mid_idx_207837);\n            int64_t loopres_207839;\n            int64_t loopres_207840;\n            \n            if (cond_207838) {\n                int64_t loopres_t_res_207841 = sub64(mid_207830, (int64_t) 1);\n                \n                loopres_207839 = low_207827;\n                loopres_207840 = loopres_t_res_207841;\n            } else {\n                int64_t loopres_f_res_207842 = add64((int64_t) 1, mid_207830);\n                \n                loopres_207839 = loopres_f_res_207842;\n                loopres_207840 = high_207828;\n            }\n            \n            bool loop_cond_207843 = sle64(loopres_207839, loopres_207840);\n            bool loop_while_tmp_232634 = loop_cond_207843;\n            int64_t low_tmp_232635 = loopres_207839;\n            int64_t high_tmp_232636 = loopres_207840;\n            \n            loop_while_207826 = loop_while_tmp_232634;\n            low_207827 = low_tmp_232635;\n            high_207828 = high_tmp_232636;\n        }\n        init_idx_207823 = loop_while_207826;\n        init_idx_207824 = low_207827;\n        init_idx_207825 = high_207828;\n        \n        bool idx_207844;\n        int64_t idx_207845;\n        int64_t idx_207846;\n        int64_t idx_207847;\n",
                   "        bool loop_while_207848;\n        int64_t l_idx_207849;\n        int64_t r_idx_207850;\n        int64_t span_207851;\n        \n        loop_while_207848 = loop_cond_203754;\n        l_idx_207849 = init_idx_207824;\n        r_idx_207850 = init_idx_207824;\n        span_207851 = (int64_t) 1;\n        while (loop_while_207848) {\n            int64_t max_arg_207852 = sub64(l_idx_207849, (int64_t) 1);\n            int64_t max_res_207853 = smax64((int64_t) 0, max_arg_207852);\n            int64_t min_arg_207854 = add64((int64_t) 1, r_idx_207850);\n            int64_t min_res_207855 = smin64(min_arg_207808, min_arg_207854);\n            bool x_207856 = sle64((int64_t) 0, max_res_207853);\n            bool y_207857 = slt64(max_res_207853, defunc_0_f_res_203631);\n            bool bounds_check_207858 = x_207856 && y_207857;\n            bool index_certs_207859;\n            \n            if (!bounds_check_207858) {\n                {\n                    if (atomic_cmpxchg_i32_global(global_failure, -1, 3) ==\n                        -1) {\n                        global_failure_args[0] = (int64_t) max_res_207853;\n                        global_failure_args[1] =\n                            (int64_t) defunc_0_f_res_203631;\n                        ;\n                    }\n                    local_failure = true;\n                    goto error_2;\n                }\n            }\n            \n            int64_t x_207860;\n            \n            x_207860 = ((__local int64_t *) color_231976)[gtid_207804 *\n                                                          defunc_0_f_res_203631 +\n                                                          max_res_207853];\n            \n            int64_t abs_arg_207861 = sub64(x_207860, defunc_0_m_fun_res_207814);\n            int64_t abs_res_207862 = abs64(abs_arg_207861);\n            bool x_207863 = sle64((int64_t) 0, min_res_207855);\n            bool y_207864 = slt64(min_res_207855, defunc_0_f_res_203631);\n            bool bounds_check_207865 = x_207863 &",
                   "& y_207864;\n            bool index_certs_207866;\n            \n            if (!bounds_check_207865) {\n                {\n                    if (atomic_cmpxchg_i32_global(global_failure, -1, 4) ==\n                        -1) {\n                        global_failure_args[0] = (int64_t) min_res_207855;\n                        global_failure_args[1] =\n                            (int64_t) defunc_0_f_res_203631;\n                        ;\n                    }\n                    local_failure = true;\n                    goto error_2;\n                }\n            }\n            \n            int64_t x_207867;\n            \n            x_207867 = ((__local int64_t *) color_231976)[gtid_207804 *\n                                                          defunc_0_f_res_203631 +\n                                                          min_res_207855];\n            \n            int64_t abs_arg_207868 = sub64(x_207867, defunc_0_m_fun_res_207814);\n            int64_t abs_res_207869 = abs64(abs_arg_207868);\n            bool cond_207870 = max_res_207853 == l_idx_207849;\n            int64_t loopres_207871;\n            int64_t loopres_207872;\n            int64_t loopres_207873;\n            \n            if (cond_207870) {\n                loopres_207871 = l_idx_207849;\n                loopres_207872 = r_idx_207850;\n                loopres_207873 = min_res_203749;\n            } else {\n                bool cond_207874 = slt64(abs_res_207862, abs_res_207869);\n                bool cond_f_res_207875 = min_res_207855 == r_idx_207850;\n                bool x_207876 = !cond_207874;\n                bool y_207877 = cond_f_res_207875 && x_207876;\n                bool cond_207878 = cond_207874 || y_207877;\n                int64_t loopres_f_res_207879;\n                \n                if (cond_207878) {\n                    loopres_f_res_207879 = max_res_207853;\n                } else {\n                    loopres_f_res_207879 = l_idx_207849;\n                }\n                \n                int64_t l",
                   "oopres_f_res_207880;\n                \n                if (cond_207878) {\n                    loopres_f_res_207880 = r_idx_207850;\n                } else {\n                    loopres_f_res_207880 = min_res_207855;\n                }\n                \n                int64_t loopres_f_res_207881;\n                \n                if (cond_207878) {\n                    int64_t loopres_f_res_t_res_207882 = add64((int64_t) 1,\n                                                               span_207851);\n                    \n                    loopres_f_res_207881 = loopres_f_res_t_res_207882;\n                } else {\n                    int64_t loopres_f_res_f_res_207883 = add64((int64_t) 1,\n                                                               span_207851);\n                    \n                    loopres_f_res_207881 = loopres_f_res_f_res_207883;\n                }\n                loopres_207871 = loopres_f_res_207879;\n                loopres_207872 = loopres_f_res_207880;\n                loopres_207873 = loopres_f_res_207881;\n            }\n            \n            bool loop_cond_207884 = slt64(loopres_207873, min_res_203749);\n            bool loop_while_tmp_232637 = loop_cond_207884;\n            int64_t l_idx_tmp_232638 = loopres_207871;\n            int64_t r_idx_tmp_232639 = loopres_207872;\n            int64_t span_tmp_232640 = loopres_207873;\n            \n            loop_while_207848 = loop_while_tmp_232637;\n            l_idx_207849 = l_idx_tmp_232638;\n            r_idx_207850 = r_idx_tmp_232639;\n            span_207851 = span_tmp_232640;\n        }\n        idx_207844 = loop_while_207848;\n        idx_207845 = l_idx_207849;\n        idx_207846 = r_idx_207850;\n        idx_207847 = span_207851;\n        \n        int64_t min_res_207885 = smin64(min_arg_207809, idx_207845);\n        int64_t max_res_207886 = smax64((int64_t) 0, min_res_207885);\n        int64_t defunc_0_m_fun_res_207887;\n        \n        if (cond_207813) {\n            defunc_0_m_fun_res_207887 = (int64_t",
                   ") 0;\n        } else {\n            int64_t y_207888 = sub64(s_n_m_203636, (int64_t) 1);\n            bool cond_207889 = gtid_207805 == y_207888;\n            int64_t defunc_0_m_fun_res_f_res_207890;\n            \n            if (cond_207889) {\n                int64_t defunc_0_m_fun_res_f_res_t_res_207891 =\n                        sub64(pad_css_len_203632, (int64_t) 1);\n                \n                defunc_0_m_fun_res_f_res_207890 =\n                    defunc_0_m_fun_res_f_res_t_res_207891;\n            } else {\n                int64_t x_207892 = sub64(gtid_207805, (int64_t) 1);\n                int64_t x_207893 = mul64(jump_s_203499, x_207892);\n                int64_t min_arg_207894 = add64((int64_t) 1, x_207893);\n                int64_t min_res_207895 = smin64(defunc_0_f_res_203631,\n                                                min_arg_207894);\n                \n                defunc_0_m_fun_res_f_res_207890 = min_res_207895;\n            }\n            defunc_0_m_fun_res_207887 = defunc_0_m_fun_res_f_res_207890;\n        }\n        \n        int64_t x_207896 = add64(min_res_207810, max_res_207886);\n        int64_t r_207897 = sub64(x_207896, (int64_t) 1);\n        bool x_207898 = sle64((int64_t) 0, r_207897);\n        bool y_207899 = slt64(r_207897, defunc_0_f_res_203631);\n        bool bounds_check_207900 = x_207898 && y_207899;\n        bool index_certs_207901;\n        \n        if (!bounds_check_207900) {\n            {\n                if (atomic_cmpxchg_i32_global(global_failure, -1, 5) == -1) {\n                    global_failure_args[0] = (int64_t) r_207897;\n                    global_failure_args[1] = (int64_t) defunc_0_f_res_203631;\n                    ;\n                }\n                local_failure = true;\n                goto error_2;\n            }\n        }\n        \n        int64_t x_207902;\n        \n        x_207902 = ((__local int64_t *) color_231976)[gtid_207804 *\n                                                      defunc_0_f_res_203631 +\n                     ",
                   "                                 r_207897];\n        \n        int64_t abs_arg_207903 = sub64(x_207902, defunc_0_m_fun_res_207887);\n        int64_t abs_res_207904 = abs64(abs_arg_207903);\n        bool x_207905 = sle64((int64_t) 0, max_res_207886);\n        bool y_207906 = slt64(max_res_207886, defunc_0_f_res_203631);\n        bool bounds_check_207907 = x_207905 && y_207906;\n        bool index_certs_207908;\n        \n        if (!bounds_check_207907) {\n            {\n                if (atomic_cmpxchg_i32_global(global_failure, -1, 6) == -1) {\n                    global_failure_args[0] = (int64_t) max_res_207886;\n                    global_failure_args[1] = (int64_t) defunc_0_f_res_203631;\n                    ;\n                }\n                local_failure = true;\n                goto error_2;\n            }\n        }\n        \n        int64_t x_207909;\n        \n        x_207909 = ((__local int64_t *) color_231976)[gtid_207804 *\n                                                      defunc_0_f_res_203631 +\n                                                      max_res_207886];\n        \n        int64_t abs_arg_207910 = sub64(x_207909, defunc_0_m_fun_res_207887);\n        int64_t abs_res_207911 = abs64(abs_arg_207910);\n        int64_t max_res_207912 = smax64(abs_res_207904, abs_res_207911);\n        double defunc_0_f_res_207913 = sitofp_i64_f64(max_res_207912);\n        double defunc_1_f_res_207914 = max_res_207811 + defunc_0_f_res_207913;\n        \n        ((__local double *) color_231971)[gtid_207804 * s_n_m_203636 +\n                                          gtid_207805] = defunc_1_f_res_207914;\n        ((__local int64_t *) color_231970)[gtid_207804 * s_n_m_203636 +\n                                           gtid_207805] = max_res_207886;\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_232641 = 0; i_232641 < sdiv_up64(n_p_203492 * s_n_m_203636 -\n                                   ",
                   "                 sext_i32_i64(local_tid_232613),\n                                                    computed_group_sizze_207619);\n         i_232641++) {\n        int64_t tmp_232642;\n        \n        tmp_232642 = ((__local int64_t *) color_231970)[squot64(i_232641 *\n                                                                computed_group_sizze_207619 +\n                                                                sext_i32_i64(local_tid_232613),\n                                                                s_n_m_203636) *\n                                                        s_n_m_203636 +\n                                                        (i_232641 *\n                                                         computed_group_sizze_207619 +\n                                                         sext_i32_i64(local_tid_232613) -\n                                                         squot64(i_232641 *\n                                                                 computed_group_sizze_207619 +\n                                                                 sext_i32_i64(local_tid_232613),\n                                                                 s_n_m_203636) *\n                                                         s_n_m_203636)];\n        ((__global int64_t *) mem_229298)[gtid_207776 * (s_n_m_203636 *\n                                                         n_p_203492) +\n                                          squot64(i_232641 *\n                                                  computed_group_sizze_207619 +\n                                                  sext_i32_i64(local_tid_232613),\n                                                  s_n_m_203636) * s_n_m_203636 +\n                                          (i_232641 *\n                                           computed_group_sizze_207619 +\n                                           sext_i32_i64(local_tid_232613) -\n                                           squot64(i_232641 *\n              ",
                   "                                     computed_group_sizze_207619 +\n                                                   sext_i32_i64(local_tid_232613),\n                                                   s_n_m_203636) *\n                                           s_n_m_203636)] = tmp_232642;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    for (int64_t i_232643 = 0; i_232643 < sdiv_up64(n_p_203492 * s_n_m_203636 -\n                                                    sext_i32_i64(local_tid_232613),\n                                                    computed_group_sizze_207619);\n         i_232643++) {\n        double tmp_232644;\n        \n        tmp_232644 = ((__local double *) color_231971)[squot64(i_232643 *\n                                                               computed_group_sizze_207619 +\n                                                               sext_i32_i64(local_tid_232613),\n                                                               s_n_m_203636) *\n                                                       s_n_m_203636 +\n                                                       (i_232643 *\n                                                        computed_group_sizze_207619 +\n                                                        sext_i32_i64(local_tid_232613) -\n                                                        squot64(i_232643 *\n                                                                computed_group_sizze_207619 +\n                                                                sext_i32_i64(local_tid_232613),\n                                                                s_n_m_203636) *\n                                                        s_n_m_203636)];\n        ((__global double *) mem_229303)[gtid_207776 * (s_n_m_203636 *\n                                                        n_p_203492) +\n                                         squot64(i_232643 *\n                                                 computed_group_sizze_207619 +\n                ",
                   "                                 sext_i32_i64(local_tid_232613),\n                                                 s_n_m_203636) * s_n_m_203636 +\n                                         (i_232643 *\n                                          computed_group_sizze_207619 +\n                                          sext_i32_i64(local_tid_232613) -\n                                          squot64(i_232643 *\n                                                  computed_group_sizze_207619 +\n                                                  sext_i32_i64(local_tid_232613),\n                                                  s_n_m_203636) *\n                                          s_n_m_203636)] = tmp_232644;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n  error_3:\n    return;\n}\n__kernel void mainzisegmap_intragroup_208681(__global int *global_failure,\n                                             int failure_is_an_option, __global\n                                             int64_t *global_failure_args,\n                                             __local volatile\n                                             int64_t *color_231979_backing_aligned_0,\n                                             __local volatile\n                                             int64_t *color_231978_backing_aligned_1,\n                                             __local volatile\n                                             int64_t *color_231977_backing_aligned_2,\n                                             int64_t n_p_203492,\n                                             int64_t q_s_203493,\n                                             int64_t jump_s_203499,\n                                             int64_t partition_sizze_203577,\n                                             int64_t defunc_0_f_res_203631,\n                                             int64_t pad_css_len_203632,\n                                             int64_t s_n_m_203636,\n                                             int64_t i_20371",
                   "8,\n                                             unsigned char x_203719_bits,\n                                             int64_t min_res_203749,\n                                             unsigned char loop_cond_203754_bits,\n                                             double i64_res_203755,\n                                             int64_t computed_group_sizze_208667,\n                                             __global\n                                             unsigned char *ext_mem_229264,\n                                             __global\n                                             unsigned char *ext_mem_229265,\n                                             __global unsigned char *mem_229320,\n                                             __global unsigned char *mem_229325)\n{\n    bool x_203719 = x_203719_bits;\n    bool loop_cond_203754 = loop_cond_203754_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_231979_backing_2 =\n                                   (__local volatile\n                                    unsigned char *) color_231979_backing_aligned_0;\n    __local volatile unsigned char *restrict color_231978_backing_1 =\n                                   (__local volatile\n                                    unsigned char *) color_231978_backing_aligned_1;\n    __local volatile unsigned char *restrict color_231977_backing_0 =\n                                   (__local volatile\n                                    unsigned char *) color_231977_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_232645;\n    int32_t local_tid_232646;\n    int64_t group_sizze_232649;\n    int32_t wave_sizze_232648;\n    int32_t group_tid_232647;\n  ",
                   "  \n    global_tid_232645 = get_global_id(0);\n    local_tid_232646 = get_local_id(0);\n    group_sizze_232649 = get_local_size(0);\n    wave_sizze_232648 = LOCKSTEP_WIDTH;\n    group_tid_232647 = get_group_id(0);\n    \n    int32_t phys_tid_208681 = group_tid_232647;\n    int64_t slice_232651 = defunc_0_f_res_203631;\n    int64_t ltid_pre_232650 = sext_i32_i64(local_tid_232646);\n    int64_t remnant_232652 = sext_i32_i64(local_tid_232646) - ltid_pre_232650;\n    int64_t slice_232654 = s_n_m_203636;\n    int64_t ltid_pre_232653 = sext_i32_i64(local_tid_232646);\n    int64_t remnant_232655 = sext_i32_i64(local_tid_232646) - ltid_pre_232653;\n    int64_t slice_232656 = n_p_203492;\n    int64_t slice_232657 = partition_sizze_203577 * slice_232656;\n    int64_t gtid_208679 = squot64(sext_i32_i64(group_tid_232647), slice_232656);\n    int64_t remnant_232658 = sext_i32_i64(group_tid_232647) - gtid_208679 *\n            slice_232656;\n    int64_t gtid_208680 = remnant_232658;\n    int64_t remnant_232659 = remnant_232658 - gtid_208680;\n    __local unsigned char *color_231977;\n    \n    color_231977 = (__local unsigned char *) color_231977_backing_0;\n    \n    __local unsigned char *color_231978;\n    \n    color_231978 = (__local unsigned char *) color_231978_backing_1;\n    \n    __local unsigned char *color_231979;\n    \n    color_231979 = (__local unsigned char *) color_231979_backing_2;\n    \n    int64_t x_208684;\n    \n    x_208684 = ((__global int64_t *) ext_mem_229264)[gtid_208679 * n_p_203492 +\n                                                     gtid_208680];\n    \n    int64_t gtid_208686 = sext_i32_i64(sext_i64_i32(ltid_pre_232650));\n    int32_t phys_tid_208687 = local_tid_232646;\n    \n    if (slt64(gtid_208686, defunc_0_f_res_203631)) {\n        int64_t x_208688;\n        \n        x_208688 = ((__global int64_t *) ext_mem_229265)[gtid_208679 *\n                                                         (defunc_0_f_res_203631 *\n                                                          n_p_203492) +\n",
                   "                                                         gtid_208680 *\n                                                         defunc_0_f_res_203631 +\n                                                         gtid_208686];\n        \n        int64_t defunc_0_f_res_208689 = add64((int64_t) 1, x_208688);\n        \n        ((__local int64_t *) color_231979)[gtid_208686] = defunc_0_f_res_208689;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int64_t min_arg_208690 = sub64(x_208684, (int64_t) 1);\n    int64_t min_arg_208691 = sub64(x_208684, min_res_203749);\n    int64_t min_res_208692 = smin64(q_s_203493, x_208684);\n    double i64_res_208693 = sitofp_i64_f64(x_208684);\n    double x_208694 = i64_res_203755 - i64_res_208693;\n    double max_arg_208695 = x_208694 / 2.0;\n    double max_res_208696 = fmax64(0.0, max_arg_208695);\n    int64_t gtid_208699 = sext_i32_i64(sext_i64_i32(ltid_pre_232653));\n    int32_t phys_tid_208700 = local_tid_232646;\n    \n    if (slt64(gtid_208699, s_n_m_203636)) {\n        bool cond_208702 = gtid_208699 == (int64_t) 0;\n        int64_t defunc_0_m_fun_res_208703;\n        \n        if (cond_208702) {\n            defunc_0_m_fun_res_208703 = (int64_t) 0;\n        } else {\n            int64_t y_208704 = sub64(s_n_m_203636, (int64_t) 1);\n            bool cond_208705 = gtid_208699 == y_208704;\n            int64_t defunc_0_m_fun_res_f_res_208706;\n            \n            if (cond_208705) {\n                int64_t defunc_0_m_fun_res_f_res_t_res_208707 =\n                        sub64(pad_css_len_203632, (int64_t) 1);\n                \n                defunc_0_m_fun_res_f_res_208706 =\n                    defunc_0_m_fun_res_f_res_t_res_208707;\n            } else {\n                int64_t x_208708 = sub64(gtid_208699, (int64_t) 1);\n                int64_t x_208709 = mul64(jump_s_203499, x_208708);\n                int64_t min_arg_208710 = add64((int64_t) 1, x_208709);\n                int64_t min_res_208711 = smin64(defunc_0_f_res_203631,\n                               ",
                   "                 min_arg_208710);\n                \n                defunc_0_m_fun_res_f_res_208706 = min_res_208711;\n            }\n            defunc_0_m_fun_res_208703 = defunc_0_m_fun_res_f_res_208706;\n        }\n        \n        bool init_idx_208712;\n        int64_t init_idx_208713;\n        int64_t init_idx_208714;\n        bool loop_while_208715;\n        int64_t low_208716;\n        int64_t high_208717;\n        \n        loop_while_208715 = x_203719;\n        low_208716 = (int64_t) 0;\n        high_208717 = i_203718;\n        while (loop_while_208715) {\n            int64_t x_208718 = add64(low_208716, high_208717);\n            int64_t mid_208719 = sdiv64(x_208718, (int64_t) 2);\n            bool x_208720 = sle64((int64_t) 0, mid_208719);\n            bool y_208721 = slt64(mid_208719, defunc_0_f_res_203631);\n            bool bounds_check_208722 = x_208720 && y_208721;\n            bool index_certs_208723;\n            \n            if (!bounds_check_208722) {\n                {\n                    if (atomic_cmpxchg_i32_global(global_failure, -1, 7) ==\n                        -1) {\n                        global_failure_args[0] = (int64_t) mid_208719;\n                        global_failure_args[1] =\n                            (int64_t) defunc_0_f_res_203631;\n                        ;\n                    }\n                    local_failure = true;\n                    goto error_1;\n                }\n            }\n            \n            int64_t mid_id_208724;\n            \n            mid_id_208724 = ((__local int64_t *) color_231979)[mid_208719];\n            \n            bool cond_208725 = slt64(mid_id_208724, (int64_t) 0);\n            int64_t mid_idx_208726;\n            \n            if (cond_208725) {\n                mid_idx_208726 = (int64_t) 9223372036854775807;\n            } else {\n                mid_idx_208726 = mid_id_208724;\n            }\n            \n            bool cond_208727 = sle64(defunc_0_m_fun_res_208703, mid_idx_208726);\n            int64_t loopres_208728;\n ",
                   "           int64_t loopres_208729;\n            \n            if (cond_208727) {\n                int64_t loopres_t_res_208730 = sub64(mid_208719, (int64_t) 1);\n                \n                loopres_208728 = low_208716;\n                loopres_208729 = loopres_t_res_208730;\n            } else {\n                int64_t loopres_f_res_208731 = add64((int64_t) 1, mid_208719);\n                \n                loopres_208728 = loopres_f_res_208731;\n                loopres_208729 = high_208717;\n            }\n            \n            bool loop_cond_208732 = sle64(loopres_208728, loopres_208729);\n            bool loop_while_tmp_232660 = loop_cond_208732;\n            int64_t low_tmp_232661 = loopres_208728;\n            int64_t high_tmp_232662 = loopres_208729;\n            \n            loop_while_208715 = loop_while_tmp_232660;\n            low_208716 = low_tmp_232661;\n            high_208717 = high_tmp_232662;\n        }\n        init_idx_208712 = loop_while_208715;\n        init_idx_208713 = low_208716;\n        init_idx_208714 = high_208717;\n        \n        bool idx_208733;\n        int64_t idx_208734;\n        int64_t idx_208735;\n        int64_t idx_208736;\n        bool loop_while_208737;\n        int64_t l_idx_208738;\n        int64_t r_idx_208739;\n        int64_t span_208740;\n        \n        loop_while_208737 = loop_cond_203754;\n        l_idx_208738 = init_idx_208713;\n        r_idx_208739 = init_idx_208713;\n        span_208740 = (int64_t) 1;\n        while (loop_while_208737) {\n            int64_t max_arg_208741 = sub64(l_idx_208738, (int64_t) 1);\n            int64_t max_res_208742 = smax64((int64_t) 0, max_arg_208741);\n            int64_t min_arg_208743 = add64((int64_t) 1, r_idx_208739);\n            int64_t min_res_208744 = smin64(min_arg_208690, min_arg_208743);\n            bool x_208745 = sle64((int64_t) 0, max_res_208742);\n            bool y_208746 = slt64(max_res_208742, defunc_0_f_res_203631);\n            bool bounds_check_208747 = x_208745 && y_208746;\n            bool i",
                   "ndex_certs_208748;\n            \n            if (!bounds_check_208747) {\n                {\n                    if (atomic_cmpxchg_i32_global(global_failure, -1, 8) ==\n                        -1) {\n                        global_failure_args[0] = (int64_t) max_res_208742;\n                        global_failure_args[1] =\n                            (int64_t) defunc_0_f_res_203631;\n                        ;\n                    }\n                    local_failure = true;\n                    goto error_1;\n                }\n            }\n            \n            int64_t x_208749;\n            \n            x_208749 = ((__local int64_t *) color_231979)[max_res_208742];\n            \n            int64_t abs_arg_208750 = sub64(x_208749, defunc_0_m_fun_res_208703);\n            int64_t abs_res_208751 = abs64(abs_arg_208750);\n            bool x_208752 = sle64((int64_t) 0, min_res_208744);\n            bool y_208753 = slt64(min_res_208744, defunc_0_f_res_203631);\n            bool bounds_check_208754 = x_208752 && y_208753;\n            bool index_certs_208755;\n            \n            if (!bounds_check_208754) {\n                {\n                    if (atomic_cmpxchg_i32_global(global_failure, -1, 9) ==\n                        -1) {\n                        global_failure_args[0] = (int64_t) min_res_208744;\n                        global_failure_args[1] =\n                            (int64_t) defunc_0_f_res_203631;\n                        ;\n                    }\n                    local_failure = true;\n                    goto error_1;\n                }\n            }\n            \n            int64_t x_208756;\n            \n            x_208756 = ((__local int64_t *) color_231979)[min_res_208744];\n            \n            int64_t abs_arg_208757 = sub64(x_208756, defunc_0_m_fun_res_208703);\n            int64_t abs_res_208758 = abs64(abs_arg_208757);\n            bool cond_208759 = max_res_208742 == l_idx_208738;\n            int64_t loopres_208760;\n            int64_t loopres_208761;\n    ",
                   "        int64_t loopres_208762;\n            \n            if (cond_208759) {\n                loopres_208760 = l_idx_208738;\n                loopres_208761 = r_idx_208739;\n                loopres_208762 = min_res_203749;\n            } else {\n                bool cond_208763 = slt64(abs_res_208751, abs_res_208758);\n                bool cond_f_res_208764 = min_res_208744 == r_idx_208739;\n                bool x_208765 = !cond_208763;\n                bool y_208766 = cond_f_res_208764 && x_208765;\n                bool cond_208767 = cond_208763 || y_208766;\n                int64_t loopres_f_res_208768;\n                \n                if (cond_208767) {\n                    loopres_f_res_208768 = max_res_208742;\n                } else {\n                    loopres_f_res_208768 = l_idx_208738;\n                }\n                \n                int64_t loopres_f_res_208769;\n                \n                if (cond_208767) {\n                    loopres_f_res_208769 = r_idx_208739;\n                } else {\n                    loopres_f_res_208769 = min_res_208744;\n                }\n                \n                int64_t loopres_f_res_208770;\n                \n                if (cond_208767) {\n                    int64_t loopres_f_res_t_res_208771 = add64((int64_t) 1,\n                                                               span_208740);\n                    \n                    loopres_f_res_208770 = loopres_f_res_t_res_208771;\n                } else {\n                    int64_t loopres_f_res_f_res_208772 = add64((int64_t) 1,\n                                                               span_208740);\n                    \n                    loopres_f_res_208770 = loopres_f_res_f_res_208772;\n                }\n                loopres_208760 = loopres_f_res_208768;\n                loopres_208761 = loopres_f_res_208769;\n                loopres_208762 = loopres_f_res_208770;\n            }\n            \n            bool loop_cond_208773 = slt64(loopres_208762, min_res_203749)",
                   ";\n            bool loop_while_tmp_232663 = loop_cond_208773;\n            int64_t l_idx_tmp_232664 = loopres_208760;\n            int64_t r_idx_tmp_232665 = loopres_208761;\n            int64_t span_tmp_232666 = loopres_208762;\n            \n            loop_while_208737 = loop_while_tmp_232663;\n            l_idx_208738 = l_idx_tmp_232664;\n            r_idx_208739 = r_idx_tmp_232665;\n            span_208740 = span_tmp_232666;\n        }\n        idx_208733 = loop_while_208737;\n        idx_208734 = l_idx_208738;\n        idx_208735 = r_idx_208739;\n        idx_208736 = span_208740;\n        \n        int64_t min_res_208774 = smin64(min_arg_208691, idx_208734);\n        int64_t max_res_208775 = smax64((int64_t) 0, min_res_208774);\n        int64_t defunc_0_m_fun_res_208776;\n        \n        if (cond_208702) {\n            defunc_0_m_fun_res_208776 = (int64_t) 0;\n        } else {\n            int64_t y_208777 = sub64(s_n_m_203636, (int64_t) 1);\n            bool cond_208778 = gtid_208699 == y_208777;\n            int64_t defunc_0_m_fun_res_f_res_208779;\n            \n            if (cond_208778) {\n                int64_t defunc_0_m_fun_res_f_res_t_res_208780 =\n                        sub64(pad_css_len_203632, (int64_t) 1);\n                \n                defunc_0_m_fun_res_f_res_208779 =\n                    defunc_0_m_fun_res_f_res_t_res_208780;\n            } else {\n                int64_t x_208781 = sub64(gtid_208699, (int64_t) 1);\n                int64_t x_208782 = mul64(jump_s_203499, x_208781);\n                int64_t min_arg_208783 = add64((int64_t) 1, x_208782);\n                int64_t min_res_208784 = smin64(defunc_0_f_res_203631,\n                                                min_arg_208783);\n                \n                defunc_0_m_fun_res_f_res_208779 = min_res_208784;\n            }\n            defunc_0_m_fun_res_208776 = defunc_0_m_fun_res_f_res_208779;\n        }\n        \n        int64_t x_208785 = add64(min_res_208692, max_res_208775);\n        int64_t r_208786 = sub64(",
                   "x_208785, (int64_t) 1);\n        bool x_208787 = sle64((int64_t) 0, r_208786);\n        bool y_208788 = slt64(r_208786, defunc_0_f_res_203631);\n        bool bounds_check_208789 = x_208787 && y_208788;\n        bool index_certs_208790;\n        \n        if (!bounds_check_208789) {\n            {\n                if (atomic_cmpxchg_i32_global(global_failure, -1, 10) == -1) {\n                    global_failure_args[0] = (int64_t) r_208786;\n                    global_failure_args[1] = (int64_t) defunc_0_f_res_203631;\n                    ;\n                }\n                local_failure = true;\n                goto error_1;\n            }\n        }\n        \n        int64_t x_208791;\n        \n        x_208791 = ((__local int64_t *) color_231979)[r_208786];\n        \n        int64_t abs_arg_208792 = sub64(x_208791, defunc_0_m_fun_res_208776);\n        int64_t abs_res_208793 = abs64(abs_arg_208792);\n        bool x_208794 = sle64((int64_t) 0, max_res_208775);\n        bool y_208795 = slt64(max_res_208775, defunc_0_f_res_203631);\n        bool bounds_check_208796 = x_208794 && y_208795;\n        bool index_certs_208797;\n        \n        if (!bounds_check_208796) {\n            {\n                if (atomic_cmpxchg_i32_global(global_failure, -1, 11) == -1) {\n                    global_failure_args[0] = (int64_t) max_res_208775;\n                    global_failure_args[1] = (int64_t) defunc_0_f_res_203631;\n                    ;\n                }\n                local_failure = true;\n                goto error_1;\n            }\n        }\n        \n        int64_t x_208798;\n        \n        x_208798 = ((__local int64_t *) color_231979)[max_res_208775];\n        \n        int64_t abs_arg_208799 = sub64(x_208798, defunc_0_m_fun_res_208776);\n        int64_t abs_res_208800 = abs64(abs_arg_208799);\n        int64_t max_res_208801 = smax64(abs_res_208793, abs_res_208800);\n        double defunc_0_f_res_208802 = sitofp_i64_f64(max_res_208801);\n        double defunc_1_f_res_208803 = max_res_208696 + defunc_0",
                   "_f_res_208802;\n        \n        ((__local double *) color_231978)[gtid_208699] = defunc_1_f_res_208803;\n        ((__local int64_t *) color_231977)[gtid_208699] = max_res_208775;\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_232667 = 0; i_232667 < sdiv_up64(s_n_m_203636 -\n                                                    sext_i32_i64(local_tid_232646),\n                                                    computed_group_sizze_208667);\n         i_232667++) {\n        int64_t tmp_232668;\n        \n        tmp_232668 = ((__local int64_t *) color_231977)[i_232667 *\n                                                        computed_group_sizze_208667 +\n                                                        sext_i32_i64(local_tid_232646)];\n        ((__global int64_t *) mem_229320)[gtid_208679 * (s_n_m_203636 *\n                                                         n_p_203492) +\n                                          gtid_208680 * s_n_m_203636 +\n                                          (i_232667 *\n                                           computed_group_sizze_208667 +\n                                           sext_i32_i64(local_tid_232646))] =\n            tmp_232668;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    for (int64_t i_232669 = 0; i_232669 < sdiv_up64(s_n_m_203636 -\n                                                    sext_i32_i64(local_tid_232646),\n                                                    computed_group_sizze_208667);\n         i_232669++) {\n        double tmp_232670;\n        \n        tmp_232670 = ((__local double *) color_231978)[i_232669 *\n                                                       computed_group_sizze_208667 +\n                                                       sext_i32_i64(local_tid_232646)];\n        ((__global double *) mem_229325)[gtid_208679 * (s_n_m_203636 *\n                                                        n_p_203492) +\n   ",
                   "                                      gtid_208680 * s_n_m_203636 +\n                                         (i_232669 *\n                                          computed_group_sizze_208667 +\n                                          sext_i32_i64(local_tid_232646))] =\n            tmp_232670;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n  error_2:\n    return;\n}\n__kernel void mainzisegmap_intragroup_209082(__global int *global_failure,\n                                             int failure_is_an_option, __global\n                                             int64_t *global_failure_args,\n                                             __local volatile\n                                             int64_t *color_231982_backing_aligned_0,\n                                             __local volatile\n                                             int64_t *color_231981_backing_aligned_1,\n                                             __local volatile\n                                             int64_t *color_231980_backing_aligned_2,\n                                             int64_t n_203490,\n                                             int64_t q_l_203495,\n                                             int64_t jump_l_203501,\n                                             int64_t partition_sizze_203577,\n                                             int64_t l_n_m_203643,\n                                             int64_t i_203670,\n                                             unsigned char x_203671_bits,\n                                             int64_t min_res_203881,\n                                             unsigned char loop_cond_203886_bits,\n                                             double i64_res_203887,\n                                             int64_t computed_group_sizze_208973,\n                                             __global\n                                             unsigned char *ext_mem_229196,\n                                             __global\n ",
                   "                                            unsigned char *ext_mem_229197,\n                                             __global unsigned char *mem_229379,\n                                             __global unsigned char *mem_229383)\n{\n    bool x_203671 = x_203671_bits;\n    bool loop_cond_203886 = loop_cond_203886_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_231982_backing_2 =\n                                   (__local volatile\n                                    unsigned char *) color_231982_backing_aligned_0;\n    __local volatile unsigned char *restrict color_231981_backing_1 =\n                                   (__local volatile\n                                    unsigned char *) color_231981_backing_aligned_1;\n    __local volatile unsigned char *restrict color_231980_backing_0 =\n                                   (__local volatile\n                                    unsigned char *) color_231980_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_232714;\n    int32_t local_tid_232715;\n    int64_t group_sizze_232718;\n    int32_t wave_sizze_232717;\n    int32_t group_tid_232716;\n    \n    global_tid_232714 = get_global_id(0);\n    local_tid_232715 = get_local_id(0);\n    group_sizze_232718 = get_local_size(0);\n    wave_sizze_232717 = LOCKSTEP_WIDTH;\n    group_tid_232716 = get_group_id(0);\n    \n    int32_t phys_tid_209082 = group_tid_232716;\n    int64_t slice_232720 = n_203490;\n    int64_t ltid_pre_232719 = sext_i32_i64(local_tid_232715);\n    int64_t remnant_232721 = sext_i32_i64(local_tid_232715) - ltid_pre_232719;\n    int64_t slice_232723 = l_n_m_203643;\n    int64_t ltid_pre_232722 = sext_i32_i64(local_tid_232715);\n    int64_t remnant_",
                   "232724 = sext_i32_i64(local_tid_232715) - ltid_pre_232722;\n    int64_t slice_232725 = partition_sizze_203577;\n    int64_t gtid_209081 = sext_i32_i64(group_tid_232716);\n    int64_t remnant_232726 = sext_i32_i64(group_tid_232716) - gtid_209081;\n    __local unsigned char *color_231980;\n    \n    color_231980 = (__local unsigned char *) color_231980_backing_0;\n    \n    __local unsigned char *color_231981;\n    \n    color_231981 = (__local unsigned char *) color_231981_backing_1;\n    \n    __local unsigned char *color_231982;\n    \n    color_231982 = (__local unsigned char *) color_231982_backing_2;\n    \n    int64_t x_209085;\n    \n    x_209085 = ((__global int64_t *) ext_mem_229196)[gtid_209081];\n    \n    int64_t gtid_209087 = sext_i32_i64(sext_i64_i32(ltid_pre_232719));\n    int32_t phys_tid_209088 = local_tid_232715;\n    \n    if (slt64(gtid_209087, n_203490)) {\n        int64_t x_209089;\n        \n        x_209089 = ((__global int64_t *) ext_mem_229197)[gtid_209081 *\n                                                         n_203490 +\n                                                         gtid_209087];\n        \n        int64_t defunc_0_f_res_209090 = add64((int64_t) 1, x_209089);\n        \n        ((__local int64_t *) color_231982)[gtid_209087] = defunc_0_f_res_209090;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int64_t min_arg_209091 = sub64(x_209085, (int64_t) 1);\n    int64_t min_arg_209092 = sub64(x_209085, min_res_203881);\n    int64_t min_res_209093 = smin64(q_l_203495, x_209085);\n    double i64_res_209094 = sitofp_i64_f64(x_209085);\n    double x_209095 = i64_res_203887 - i64_res_209094;\n    double max_arg_209096 = x_209095 / 2.0;\n    double max_res_209097 = fmax64(0.0, max_arg_209096);\n    int64_t gtid_209100 = sext_i32_i64(sext_i64_i32(ltid_pre_232722));\n    int32_t phys_tid_209101 = local_tid_232715;\n    \n    if (slt64(gtid_209100, l_n_m_203643)) {\n        int64_t min_arg_209103 = mul64(jump_l_203501, gtid_209100);\n        int64_t min_res_209104 = smin64(i_203670,",
                   " min_arg_209103);\n        int64_t defunc_0_g_res_209105 = add64((int64_t) 1, min_res_209104);\n        bool init_idx_209106;\n        int64_t init_idx_209107;\n        int64_t init_idx_209108;\n        bool loop_while_209109;\n        int64_t low_209110;\n        int64_t high_209111;\n        \n        loop_while_209109 = x_203671;\n        low_209110 = (int64_t) 0;\n        high_209111 = i_203670;\n        while (loop_while_209109) {\n            int64_t x_209112 = add64(low_209110, high_209111);\n            int64_t mid_209113 = sdiv64(x_209112, (int64_t) 2);\n            bool x_209114 = sle64((int64_t) 0, mid_209113);\n            bool y_209115 = slt64(mid_209113, n_203490);\n            bool bounds_check_209116 = x_209114 && y_209115;\n            bool index_certs_209117;\n            \n            if (!bounds_check_209116) {\n                {\n                    if (atomic_cmpxchg_i32_global(global_failure, -1, 17) ==\n                        -1) {\n                        global_failure_args[0] = (int64_t) mid_209113;\n                        global_failure_args[1] = (int64_t) n_203490;\n                        ;\n                    }\n                    local_failure = true;\n                    goto error_1;\n                }\n            }\n            \n            int64_t mid_id_209118;\n            \n            mid_id_209118 = ((__local int64_t *) color_231982)[mid_209113];\n            \n            bool cond_209119 = slt64(mid_id_209118, (int64_t) 0);\n            int64_t mid_idx_209120;\n            \n            if (cond_209119) {\n                mid_idx_209120 = (int64_t) 9223372036854775807;\n            } else {\n                mid_idx_209120 = mid_id_209118;\n            }\n            \n            bool cond_209121 = sle64(defunc_0_g_res_209105, mid_idx_209120);\n            int64_t loopres_209122;\n            int64_t loopres_209123;\n            \n            if (cond_209121) {\n                int64_t loopres_t_res_209124 = sub64(mid_209113, (int64_t) 1);\n                \n           ",
                   "     loopres_209122 = low_209110;\n                loopres_209123 = loopres_t_res_209124;\n            } else {\n                int64_t loopres_f_res_209125 = add64((int64_t) 1, mid_209113);\n                \n                loopres_209122 = loopres_f_res_209125;\n                loopres_209123 = high_209111;\n            }\n            \n            bool loop_cond_209126 = sle64(loopres_209122, loopres_209123);\n            bool loop_while_tmp_232727 = loop_cond_209126;\n            int64_t low_tmp_232728 = loopres_209122;\n            int64_t high_tmp_232729 = loopres_209123;\n            \n            loop_while_209109 = loop_while_tmp_232727;\n            low_209110 = low_tmp_232728;\n            high_209111 = high_tmp_232729;\n        }\n        init_idx_209106 = loop_while_209109;\n        init_idx_209107 = low_209110;\n        init_idx_209108 = high_209111;\n        \n        bool idx_209127;\n        int64_t idx_209128;\n        int64_t idx_209129;\n        int64_t idx_209130;\n        bool loop_while_209131;\n        int64_t l_idx_209132;\n        int64_t r_idx_209133;\n        int64_t span_209134;\n        \n        loop_while_209131 = loop_cond_203886;\n        l_idx_209132 = init_idx_209107;\n        r_idx_209133 = init_idx_209107;\n        span_209134 = (int64_t) 1;\n        while (loop_while_209131) {\n            int64_t max_arg_209135 = sub64(l_idx_209132, (int64_t) 1);\n            int64_t max_res_209136 = smax64((int64_t) 0, max_arg_209135);\n            int64_t min_arg_209137 = add64((int64_t) 1, r_idx_209133);\n            int64_t min_res_209138 = smin64(min_arg_209091, min_arg_209137);\n            bool x_209139 = sle64((int64_t) 0, max_res_209136);\n            bool y_209140 = slt64(max_res_209136, n_203490);\n            bool bounds_check_209141 = x_209139 && y_209140;\n            bool index_certs_209142;\n            \n            if (!bounds_check_209141) {\n                {\n                    if (atomic_cmpxchg_i32_global(global_failure, -1, 18) ==\n                        -1) {\n  ",
                   "                      global_failure_args[0] = (int64_t) max_res_209136;\n                        global_failure_args[1] = (int64_t) n_203490;\n                        ;\n                    }\n                    local_failure = true;\n                    goto error_1;\n                }\n            }\n            \n            int64_t x_209143;\n            \n            x_209143 = ((__local int64_t *) color_231982)[max_res_209136];\n            \n            int64_t abs_arg_209144 = sub64(x_209143, defunc_0_g_res_209105);\n            int64_t abs_res_209145 = abs64(abs_arg_209144);\n            bool x_209146 = sle64((int64_t) 0, min_res_209138);\n            bool y_209147 = slt64(min_res_209138, n_203490);\n            bool bounds_check_209148 = x_209146 && y_209147;\n            bool index_certs_209149;\n            \n            if (!bounds_check_209148) {\n                {\n                    if (atomic_cmpxchg_i32_global(global_failure, -1, 19) ==\n                        -1) {\n                        global_failure_args[0] = (int64_t) min_res_209138;\n                        global_failure_args[1] = (int64_t) n_203490;\n                        ;\n                    }\n                    local_failure = true;\n                    goto error_1;\n                }\n            }\n            \n            int64_t x_209150;\n            \n            x_209150 = ((__local int64_t *) color_231982)[min_res_209138];\n            \n            int64_t abs_arg_209151 = sub64(x_209150, defunc_0_g_res_209105);\n            int64_t abs_res_209152 = abs64(abs_arg_209151);\n            bool cond_209153 = max_res_209136 == l_idx_209132;\n            int64_t loopres_209154;\n            int64_t loopres_209155;\n            int64_t loopres_209156;\n            \n            if (cond_209153) {\n                loopres_209154 = l_idx_209132;\n                loopres_209155 = r_idx_209133;\n                loopres_209156 = min_res_203881;\n            } else {\n                bool cond_209157 = slt64(abs_res_209145, abs",
                   "_res_209152);\n                bool cond_f_res_209158 = min_res_209138 == r_idx_209133;\n                bool x_209159 = !cond_209157;\n                bool y_209160 = cond_f_res_209158 && x_209159;\n                bool cond_209161 = cond_209157 || y_209160;\n                int64_t loopres_f_res_209162;\n                \n                if (cond_209161) {\n                    loopres_f_res_209162 = max_res_209136;\n                } else {\n                    loopres_f_res_209162 = l_idx_209132;\n                }\n                \n                int64_t loopres_f_res_209163;\n                \n                if (cond_209161) {\n                    loopres_f_res_209163 = r_idx_209133;\n                } else {\n                    loopres_f_res_209163 = min_res_209138;\n                }\n                \n                int64_t loopres_f_res_209164;\n                \n                if (cond_209161) {\n                    int64_t loopres_f_res_t_res_209165 = add64((int64_t) 1,\n                                                               span_209134);\n                    \n                    loopres_f_res_209164 = loopres_f_res_t_res_209165;\n                } else {\n                    int64_t loopres_f_res_f_res_209166 = add64((int64_t) 1,\n                                                               span_209134);\n                    \n                    loopres_f_res_209164 = loopres_f_res_f_res_209166;\n                }\n                loopres_209154 = loopres_f_res_209162;\n                loopres_209155 = loopres_f_res_209163;\n                loopres_209156 = loopres_f_res_209164;\n            }\n            \n            bool loop_cond_209167 = slt64(loopres_209156, min_res_203881);\n            bool loop_while_tmp_232730 = loop_cond_209167;\n            int64_t l_idx_tmp_232731 = loopres_209154;\n            int64_t r_idx_tmp_232732 = loopres_209155;\n            int64_t span_tmp_232733 = loopres_209156;\n            \n            loop_while_209131 = loop_while_tmp_232730;\n       ",
                   "     l_idx_209132 = l_idx_tmp_232731;\n            r_idx_209133 = r_idx_tmp_232732;\n            span_209134 = span_tmp_232733;\n        }\n        idx_209127 = loop_while_209131;\n        idx_209128 = l_idx_209132;\n        idx_209129 = r_idx_209133;\n        idx_209130 = span_209134;\n        \n        int64_t min_res_209168 = smin64(min_arg_209092, idx_209128);\n        int64_t max_res_209169 = smax64((int64_t) 0, min_res_209168);\n        int64_t x_209170 = add64(min_res_209093, max_res_209169);\n        int64_t r_209171 = sub64(x_209170, (int64_t) 1);\n        bool x_209172 = sle64((int64_t) 0, r_209171);\n        bool y_209173 = slt64(r_209171, n_203490);\n        bool bounds_check_209174 = x_209172 && y_209173;\n        bool index_certs_209175;\n        \n        if (!bounds_check_209174) {\n            {\n                if (atomic_cmpxchg_i32_global(global_failure, -1, 20) == -1) {\n                    global_failure_args[0] = (int64_t) r_209171;\n                    global_failure_args[1] = (int64_t) n_203490;\n                    ;\n                }\n                local_failure = true;\n                goto error_1;\n            }\n        }\n        \n        int64_t x_209176;\n        \n        x_209176 = ((__global int64_t *) ext_mem_229197)[gtid_209081 *\n                                                         n_203490 + r_209171];\n        \n        int64_t abs_arg_209177 = sub64(x_209176, min_res_209104);\n        int64_t abs_res_209178 = abs64(abs_arg_209177);\n        bool x_209179 = sle64((int64_t) 0, max_res_209169);\n        bool y_209180 = slt64(max_res_209169, n_203490);\n        bool bounds_check_209181 = x_209179 && y_209180;\n        bool index_certs_209182;\n        \n        if (!bounds_check_209181) {\n            {\n                if (atomic_cmpxchg_i32_global(global_failure, -1, 21) == -1) {\n                    global_failure_args[0] = (int64_t) max_res_209169;\n                    global_failure_args[1] = (int64_t) n_203490;\n                    ;\n                }\n        ",
                   "        local_failure = true;\n                goto error_1;\n            }\n        }\n        \n        int64_t x_209183;\n        \n        x_209183 = ((__global int64_t *) ext_mem_229197)[gtid_209081 *\n                                                         n_203490 +\n                                                         max_res_209169];\n        \n        int64_t abs_arg_209184 = sub64(x_209183, min_res_209104);\n        int64_t abs_res_209185 = abs64(abs_arg_209184);\n        int64_t max_res_209186 = smax64(abs_res_209178, abs_res_209185);\n        double defunc_0_f_res_209187 = sitofp_i64_f64(max_res_209186);\n        double defunc_1_f_res_209188 = max_res_209097 + defunc_0_f_res_209187;\n        \n        ((__local double *) color_231981)[gtid_209100] = defunc_1_f_res_209188;\n        ((__local int64_t *) color_231980)[gtid_209100] = max_res_209169;\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_232734 = 0; i_232734 < sdiv_up64(l_n_m_203643 -\n                                                    sext_i32_i64(local_tid_232715),\n                                                    computed_group_sizze_208973);\n         i_232734++) {\n        int64_t tmp_232735;\n        \n        tmp_232735 = ((__local int64_t *) color_231980)[i_232734 *\n                                                        computed_group_sizze_208973 +\n                                                        sext_i32_i64(local_tid_232715)];\n        ((__global int64_t *) mem_229379)[gtid_209081 * l_n_m_203643 +\n                                          (i_232734 *\n                                           computed_group_sizze_208973 +\n                                           sext_i32_i64(local_tid_232715))] =\n            tmp_232735;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    for (int64_t i_232736 = 0; i_232736 < sdiv_up64(l_n_m_203643 -\n                                                    sext_i32_i64(local_",
                   "tid_232715),\n                                                    computed_group_sizze_208973);\n         i_232736++) {\n        double tmp_232737;\n        \n        tmp_232737 = ((__local double *) color_231981)[i_232736 *\n                                                       computed_group_sizze_208973 +\n                                                       sext_i32_i64(local_tid_232715)];\n        ((__global double *) mem_229383)[gtid_209081 * l_n_m_203643 +\n                                         (i_232736 *\n                                          computed_group_sizze_208973 +\n                                          sext_i32_i64(local_tid_232715))] =\n            tmp_232737;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n  error_2:\n    return;\n}\n__kernel void mainzisegmap_intragroup_209708(__global int *global_failure,\n                                             int failure_is_an_option, __global\n                                             int64_t *global_failure_args,\n                                             __local volatile\n                                             int64_t *color_231985_backing_aligned_0,\n                                             __local volatile\n                                             int64_t *color_231984_backing_aligned_1,\n                                             __local volatile\n                                             int64_t *color_231983_backing_aligned_2,\n                                             int64_t n_203490,\n                                             int64_t q_t_203494,\n                                             int64_t jump_t_203500,\n                                             int64_t partition_sizze_203577,\n                                             int64_t t_n_m_203650,\n                                             int64_t i_203670,\n                                             unsigned char x_203671_bits,\n                                             int64_t min_res_203993,\n                     ",
                   "                        unsigned char loop_cond_203998_bits,\n                                             double i64_res_203999,\n                                             int64_t computed_group_sizze_209599,\n                                             __global\n                                             unsigned char *ext_mem_229196,\n                                             __global\n                                             unsigned char *ext_mem_229197,\n                                             __global unsigned char *mem_229428,\n                                             __global unsigned char *mem_229432)\n{\n    bool x_203671 = x_203671_bits;\n    bool loop_cond_203998 = loop_cond_203998_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_231985_backing_2 =\n                                   (__local volatile\n                                    unsigned char *) color_231985_backing_aligned_0;\n    __local volatile unsigned char *restrict color_231984_backing_1 =\n                                   (__local volatile\n                                    unsigned char *) color_231984_backing_aligned_1;\n    __local volatile unsigned char *restrict color_231983_backing_0 =\n                                   (__local volatile\n                                    unsigned char *) color_231983_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_232774;\n    int32_t local_tid_232775;\n    int64_t group_sizze_232778;\n    int32_t wave_sizze_232777;\n    int32_t group_tid_232776;\n    \n    global_tid_232774 = get_global_id(0);\n    local_tid_232775 = get_local_id(0);\n    group_sizze_232778 = get_local_size(0);\n    wave_sizze_232777 = LOCKSTEP_WIDTH",
                   ";\n    group_tid_232776 = get_group_id(0);\n    \n    int32_t phys_tid_209708 = group_tid_232776;\n    int64_t slice_232780 = n_203490;\n    int64_t ltid_pre_232779 = sext_i32_i64(local_tid_232775);\n    int64_t remnant_232781 = sext_i32_i64(local_tid_232775) - ltid_pre_232779;\n    int64_t slice_232783 = t_n_m_203650;\n    int64_t ltid_pre_232782 = sext_i32_i64(local_tid_232775);\n    int64_t remnant_232784 = sext_i32_i64(local_tid_232775) - ltid_pre_232782;\n    int64_t slice_232785 = partition_sizze_203577;\n    int64_t gtid_209707 = sext_i32_i64(group_tid_232776);\n    int64_t remnant_232786 = sext_i32_i64(group_tid_232776) - gtid_209707;\n    __local unsigned char *color_231983;\n    \n    color_231983 = (__local unsigned char *) color_231983_backing_0;\n    \n    __local unsigned char *color_231984;\n    \n    color_231984 = (__local unsigned char *) color_231984_backing_1;\n    \n    __local unsigned char *color_231985;\n    \n    color_231985 = (__local unsigned char *) color_231985_backing_2;\n    \n    int64_t x_209711;\n    \n    x_209711 = ((__global int64_t *) ext_mem_229196)[gtid_209707];\n    \n    int64_t gtid_209713 = sext_i32_i64(sext_i64_i32(ltid_pre_232779));\n    int32_t phys_tid_209714 = local_tid_232775;\n    \n    if (slt64(gtid_209713, n_203490)) {\n        int64_t x_209715;\n        \n        x_209715 = ((__global int64_t *) ext_mem_229197)[gtid_209707 *\n                                                         n_203490 +\n                                                         gtid_209713];\n        \n        int64_t defunc_0_f_res_209716 = add64((int64_t) 1, x_209715);\n        \n        ((__local int64_t *) color_231985)[gtid_209713] = defunc_0_f_res_209716;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int64_t min_arg_209717 = sub64(x_209711, (int64_t) 1);\n    int64_t min_arg_209718 = sub64(x_209711, min_res_203993);\n    int64_t min_res_209719 = smin64(q_t_203494, x_209711);\n    double i64_res_209720 = sitofp_i64_f64(x_209711);\n    double x_209721 = i64_res_203999 - i64_re",
                   "s_209720;\n    double max_arg_209722 = x_209721 / 2.0;\n    double max_res_209723 = fmax64(0.0, max_arg_209722);\n    int64_t gtid_209726 = sext_i32_i64(sext_i64_i32(ltid_pre_232782));\n    int32_t phys_tid_209727 = local_tid_232775;\n    \n    if (slt64(gtid_209726, t_n_m_203650)) {\n        int64_t min_arg_209729 = mul64(jump_t_203500, gtid_209726);\n        int64_t min_res_209730 = smin64(i_203670, min_arg_209729);\n        int64_t defunc_0_g_res_209731 = add64((int64_t) 1, min_res_209730);\n        bool init_idx_209732;\n        int64_t init_idx_209733;\n        int64_t init_idx_209734;\n        bool loop_while_209735;\n        int64_t low_209736;\n        int64_t high_209737;\n        \n        loop_while_209735 = x_203671;\n        low_209736 = (int64_t) 0;\n        high_209737 = i_203670;\n        while (loop_while_209735) {\n            int64_t x_209738 = add64(low_209736, high_209737);\n            int64_t mid_209739 = sdiv64(x_209738, (int64_t) 2);\n            bool x_209740 = sle64((int64_t) 0, mid_209739);\n            bool y_209741 = slt64(mid_209739, n_203490);\n            bool bounds_check_209742 = x_209740 && y_209741;\n            bool index_certs_209743;\n            \n            if (!bounds_check_209742) {\n                {\n                    if (atomic_cmpxchg_i32_global(global_failure, -1, 27) ==\n                        -1) {\n                        global_failure_args[0] = (int64_t) mid_209739;\n                        global_failure_args[1] = (int64_t) n_203490;\n                        ;\n                    }\n                    local_failure = true;\n                    goto error_1;\n                }\n            }\n            \n            int64_t mid_id_209744;\n            \n            mid_id_209744 = ((__local int64_t *) color_231985)[mid_209739];\n            \n            bool cond_209745 = slt64(mid_id_209744, (int64_t) 0);\n            int64_t mid_idx_209746;\n            \n            if (cond_209745) {\n                mid_idx_209746 = (int64_t) 9223372036854775807;\n",
                   "            } else {\n                mid_idx_209746 = mid_id_209744;\n            }\n            \n            bool cond_209747 = sle64(defunc_0_g_res_209731, mid_idx_209746);\n            int64_t loopres_209748;\n            int64_t loopres_209749;\n            \n            if (cond_209747) {\n                int64_t loopres_t_res_209750 = sub64(mid_209739, (int64_t) 1);\n                \n                loopres_209748 = low_209736;\n                loopres_209749 = loopres_t_res_209750;\n            } else {\n                int64_t loopres_f_res_209751 = add64((int64_t) 1, mid_209739);\n                \n                loopres_209748 = loopres_f_res_209751;\n                loopres_209749 = high_209737;\n            }\n            \n            bool loop_cond_209752 = sle64(loopres_209748, loopres_209749);\n            bool loop_while_tmp_232787 = loop_cond_209752;\n            int64_t low_tmp_232788 = loopres_209748;\n            int64_t high_tmp_232789 = loopres_209749;\n            \n            loop_while_209735 = loop_while_tmp_232787;\n            low_209736 = low_tmp_232788;\n            high_209737 = high_tmp_232789;\n        }\n        init_idx_209732 = loop_while_209735;\n        init_idx_209733 = low_209736;\n        init_idx_209734 = high_209737;\n        \n        bool idx_209753;\n        int64_t idx_209754;\n        int64_t idx_209755;\n        int64_t idx_209756;\n        bool loop_while_209757;\n        int64_t l_idx_209758;\n        int64_t r_idx_209759;\n        int64_t span_209760;\n        \n        loop_while_209757 = loop_cond_203998;\n        l_idx_209758 = init_idx_209733;\n        r_idx_209759 = init_idx_209733;\n        span_209760 = (int64_t) 1;\n        while (loop_while_209757) {\n            int64_t max_arg_209761 = sub64(l_idx_209758, (int64_t) 1);\n            int64_t max_res_209762 = smax64((int64_t) 0, max_arg_209761);\n            int64_t min_arg_209763 = add64((int64_t) 1, r_idx_209759);\n            int64_t min_res_209764 = smin64(min_arg_209717, min_arg_209763);\n       ",
                   "     bool x_209765 = sle64((int64_t) 0, max_res_209762);\n            bool y_209766 = slt64(max_res_209762, n_203490);\n            bool bounds_check_209767 = x_209765 && y_209766;\n            bool index_certs_209768;\n            \n            if (!bounds_check_209767) {\n                {\n                    if (atomic_cmpxchg_i32_global(global_failure, -1, 28) ==\n                        -1) {\n                        global_failure_args[0] = (int64_t) max_res_209762;\n                        global_failure_args[1] = (int64_t) n_203490;\n                        ;\n                    }\n                    local_failure = true;\n                    goto error_1;\n                }\n            }\n            \n            int64_t x_209769;\n            \n            x_209769 = ((__local int64_t *) color_231985)[max_res_209762];\n            \n            int64_t abs_arg_209770 = sub64(x_209769, defunc_0_g_res_209731);\n            int64_t abs_res_209771 = abs64(abs_arg_209770);\n            bool x_209772 = sle64((int64_t) 0, min_res_209764);\n            bool y_209773 = slt64(min_res_209764, n_203490);\n            bool bounds_check_209774 = x_209772 && y_209773;\n            bool index_certs_209775;\n            \n            if (!bounds_check_209774) {\n                {\n                    if (atomic_cmpxchg_i32_global(global_failure, -1, 29) ==\n                        -1) {\n                        global_failure_args[0] = (int64_t) min_res_209764;\n                        global_failure_args[1] = (int64_t) n_203490;\n                        ;\n                    }\n                    local_failure = true;\n                    goto error_1;\n                }\n            }\n            \n            int64_t x_209776;\n            \n            x_209776 = ((__local int64_t *) color_231985)[min_res_209764];\n            \n            int64_t abs_arg_209777 = sub64(x_209776, defunc_0_g_res_209731);\n            int64_t abs_res_209778 = abs64(abs_arg_209777);\n            bool cond_209779 = max_res_2097",
                   "62 == l_idx_209758;\n            int64_t loopres_209780;\n            int64_t loopres_209781;\n            int64_t loopres_209782;\n            \n            if (cond_209779) {\n                loopres_209780 = l_idx_209758;\n                loopres_209781 = r_idx_209759;\n                loopres_209782 = min_res_203993;\n            } else {\n                bool cond_209783 = slt64(abs_res_209771, abs_res_209778);\n                bool cond_f_res_209784 = min_res_209764 == r_idx_209759;\n                bool x_209785 = !cond_209783;\n                bool y_209786 = cond_f_res_209784 && x_209785;\n                bool cond_209787 = cond_209783 || y_209786;\n                int64_t loopres_f_res_209788;\n                \n                if (cond_209787) {\n                    loopres_f_res_209788 = max_res_209762;\n                } else {\n                    loopres_f_res_209788 = l_idx_209758;\n                }\n                \n                int64_t loopres_f_res_209789;\n                \n                if (cond_209787) {\n                    loopres_f_res_209789 = r_idx_209759;\n                } else {\n                    loopres_f_res_209789 = min_res_209764;\n                }\n                \n                int64_t loopres_f_res_209790;\n                \n                if (cond_209787) {\n                    int64_t loopres_f_res_t_res_209791 = add64((int64_t) 1,\n                                                               span_209760);\n                    \n                    loopres_f_res_209790 = loopres_f_res_t_res_209791;\n                } else {\n                    int64_t loopres_f_res_f_res_209792 = add64((int64_t) 1,\n                                                               span_209760);\n                    \n                    loopres_f_res_209790 = loopres_f_res_f_res_209792;\n                }\n                loopres_209780 = loopres_f_res_209788;\n                loopres_209781 = loopres_f_res_209789;\n                loopres_209782 = loopres_f_res_209790;\n    ",
                   "        }\n            \n            bool loop_cond_209793 = slt64(loopres_209782, min_res_203993);\n            bool loop_while_tmp_232790 = loop_cond_209793;\n            int64_t l_idx_tmp_232791 = loopres_209780;\n            int64_t r_idx_tmp_232792 = loopres_209781;\n            int64_t span_tmp_232793 = loopres_209782;\n            \n            loop_while_209757 = loop_while_tmp_232790;\n            l_idx_209758 = l_idx_tmp_232791;\n            r_idx_209759 = r_idx_tmp_232792;\n            span_209760 = span_tmp_232793;\n        }\n        idx_209753 = loop_while_209757;\n        idx_209754 = l_idx_209758;\n        idx_209755 = r_idx_209759;\n        idx_209756 = span_209760;\n        \n        int64_t min_res_209794 = smin64(min_arg_209718, idx_209754);\n        int64_t max_res_209795 = smax64((int64_t) 0, min_res_209794);\n        int64_t x_209796 = add64(min_res_209719, max_res_209795);\n        int64_t r_209797 = sub64(x_209796, (int64_t) 1);\n        bool x_209798 = sle64((int64_t) 0, r_209797);\n        bool y_209799 = slt64(r_209797, n_203490);\n        bool bounds_check_209800 = x_209798 && y_209799;\n        bool index_certs_209801;\n        \n        if (!bounds_check_209800) {\n            {\n                if (atomic_cmpxchg_i32_global(global_failure, -1, 30) == -1) {\n                    global_failure_args[0] = (int64_t) r_209797;\n                    global_failure_args[1] = (int64_t) n_203490;\n                    ;\n                }\n                local_failure = true;\n                goto error_1;\n            }\n        }\n        \n        int64_t x_209802;\n        \n        x_209802 = ((__global int64_t *) ext_mem_229197)[gtid_209707 *\n                                                         n_203490 + r_209797];\n        \n        int64_t abs_arg_209803 = sub64(x_209802, min_res_209730);\n        int64_t abs_res_209804 = abs64(abs_arg_209803);\n        bool x_209805 = sle64((int64_t) 0, max_res_209795);\n        bool y_209806 = slt64(max_res_209795, n_203490);\n        bool bou",
                   "nds_check_209807 = x_209805 && y_209806;\n        bool index_certs_209808;\n        \n        if (!bounds_check_209807) {\n            {\n                if (atomic_cmpxchg_i32_global(global_failure, -1, 31) == -1) {\n                    global_failure_args[0] = (int64_t) max_res_209795;\n                    global_failure_args[1] = (int64_t) n_203490;\n                    ;\n                }\n                local_failure = true;\n                goto error_1;\n            }\n        }\n        \n        int64_t x_209809;\n        \n        x_209809 = ((__global int64_t *) ext_mem_229197)[gtid_209707 *\n                                                         n_203490 +\n                                                         max_res_209795];\n        \n        int64_t abs_arg_209810 = sub64(x_209809, min_res_209730);\n        int64_t abs_res_209811 = abs64(abs_arg_209810);\n        int64_t max_res_209812 = smax64(abs_res_209804, abs_res_209811);\n        double defunc_0_f_res_209813 = sitofp_i64_f64(max_res_209812);\n        double defunc_1_f_res_209814 = max_res_209723 + defunc_0_f_res_209813;\n        \n        ((__local double *) color_231984)[gtid_209726] = defunc_1_f_res_209814;\n        ((__local int64_t *) color_231983)[gtid_209726] = max_res_209795;\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_232794 = 0; i_232794 < sdiv_up64(t_n_m_203650 -\n                                                    sext_i32_i64(local_tid_232775),\n                                                    computed_group_sizze_209599);\n         i_232794++) {\n        int64_t tmp_232795;\n        \n        tmp_232795 = ((__local int64_t *) color_231983)[i_232794 *\n                                                        computed_group_sizze_209599 +\n                                                        sext_i32_i64(local_tid_232775)];\n        ((__global int64_t *) mem_229428)[gtid_209707 * t_n_m_203650 +\n           ",
                   "                               (i_232794 *\n                                           computed_group_sizze_209599 +\n                                           sext_i32_i64(local_tid_232775))] =\n            tmp_232795;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    for (int64_t i_232796 = 0; i_232796 < sdiv_up64(t_n_m_203650 -\n                                                    sext_i32_i64(local_tid_232775),\n                                                    computed_group_sizze_209599);\n         i_232796++) {\n        double tmp_232797;\n        \n        tmp_232797 = ((__local double *) color_231984)[i_232796 *\n                                                       computed_group_sizze_209599 +\n                                                       sext_i32_i64(local_tid_232775)];\n        ((__global double *) mem_229432)[gtid_209707 * t_n_m_203650 +\n                                         (i_232796 *\n                                          computed_group_sizze_209599 +\n                                          sext_i32_i64(local_tid_232775))] =\n            tmp_232797;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n  error_2:\n    return;\n}\n__kernel void mainzisegmap_intragroup_211768(__global int *global_failure,\n                                             __local volatile\n                                             int64_t *red_arr_mem_232971_backing_aligned_0,\n                                             __local volatile\n                                             int64_t *red_arr_mem_232953_backing_aligned_1,\n                                             __local volatile\n                                             int64_t *color_231991_backing_aligned_2,\n                                             __local volatile\n                                             int64_t *color_231990_backing_aligned_3,\n                                             __local volatile\n                                             int64_t *color_231989_backing_aligned_4,\n                  ",
                   "                           __local volatile\n                                             int64_t *color_231988_backing_aligned_5,\n                                             int64_t n_p_203492,\n                                             int64_t q_s_203493,\n                                             int64_t jump_s_203499,\n                                             int64_t partition_sizze_203577,\n                                             int64_t defunc_0_f_res_203631,\n                                             int64_t pad_css_len_203632,\n                                             int64_t s_n_m_203636,\n                                             int64_t computed_group_sizze_211670,\n                                             __global\n                                             unsigned char *ext_mem_229264,\n                                             __global\n                                             unsigned char *ext_mem_229265,\n                                             __global\n                                             unsigned char *ext_mem_229362,\n                                             __global\n                                             unsigned char *ext_mem_229363,\n                                             __global unsigned char *mem_229526,\n                                             __global unsigned char *mem_229531,\n                                             __global unsigned char *mem_229675)\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_232971_backing_5 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_232971_backing_aligned_0;\n    __local volatile unsigned char *restrict red_arr_mem_232953_backing_4 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_232953_backing_aligned_1;\n  ",
                   "  __local volatile unsigned char *restrict color_231991_backing_3 =\n                                   (__local volatile\n                                    unsigned char *) color_231991_backing_aligned_2;\n    __local volatile unsigned char *restrict color_231990_backing_2 =\n                                   (__local volatile\n                                    unsigned char *) color_231990_backing_aligned_3;\n    __local volatile unsigned char *restrict color_231989_backing_1 =\n                                   (__local volatile\n                                    unsigned char *) color_231989_backing_aligned_4;\n    __local volatile unsigned char *restrict color_231988_backing_0 =\n                                   (__local volatile\n                                    unsigned char *) color_231988_backing_aligned_5;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_232935;\n    int32_t local_tid_232936;\n    int64_t group_sizze_232939;\n    int32_t wave_sizze_232938;\n    int32_t group_tid_232937;\n    \n    global_tid_232935 = get_global_id(0);\n    local_tid_232936 = get_local_id(0);\n    group_sizze_232939 = get_local_size(0);\n    wave_sizze_232938 = LOCKSTEP_WIDTH;\n    group_tid_232937 = get_group_id(0);\n    \n    int32_t phys_tid_211768 = group_tid_232937;\n    int64_t slice_232941 = s_n_m_203636;\n    int64_t ltid_pre_232940 = sext_i32_i64(local_tid_232936);\n    int64_t remnant_232942 = sext_i32_i64(local_tid_232936) - ltid_pre_232940;\n    int64_t slice_232945 = q_s_203493;\n    int64_t slice_232946 = s_n_m_203636 * slice_232945;\n    int64_t ltid_pre_232943 = squot64(sext_i32_i64(local_tid_232936),\n                                      slice_232945);\n    int64_t remnant_232947 = sext_i32_i64(local_tid_232936) - ltid_pre_232943 *\n            slice_232945;\n    int64_t ltid_pre_232944 = remnant_232947;\n    int64_t remnant_232948 = remnant_232947 - ltid_pre_232944;\n    int64_t slice_232949 = n_p_203492;\n    int64_t slice_232950 = partition_sizze",
                   "_203577 * slice_232949;\n    int64_t gtid_211766 = squot64(sext_i32_i64(group_tid_232937), slice_232949);\n    int64_t remnant_232951 = sext_i32_i64(group_tid_232937) - gtid_211766 *\n            slice_232949;\n    int64_t gtid_211767 = remnant_232951;\n    int64_t remnant_232952 = remnant_232951 - gtid_211767;\n    __local unsigned char *color_231988;\n    \n    color_231988 = (__local unsigned char *) color_231988_backing_0;\n    \n    __local unsigned char *color_231989;\n    \n    color_231989 = (__local unsigned char *) color_231989_backing_1;\n    \n    __local unsigned char *color_231990;\n    \n    color_231990 = (__local unsigned char *) color_231990_backing_2;\n    \n    __local unsigned char *color_231991;\n    \n    color_231991 = (__local unsigned char *) color_231991_backing_3;\n    \n    int64_t x_211775;\n    \n    x_211775 = ((__global int64_t *) ext_mem_229264)[gtid_211766 * n_p_203492 +\n                                                     gtid_211767];\n    \n    int64_t gtid_211782 = sext_i32_i64(sext_i64_i32(ltid_pre_232940));\n    int32_t phys_tid_211783 = local_tid_232936;\n    \n    if (slt64(gtid_211782, s_n_m_203636)) {\n        bool cond_211785 = gtid_211782 == (int64_t) 0;\n        int64_t defunc_0_m_fun_res_211786;\n        \n        if (cond_211785) {\n            defunc_0_m_fun_res_211786 = (int64_t) 0;\n        } else {\n            int64_t y_211787 = sub64(s_n_m_203636, (int64_t) 1);\n            bool cond_211788 = gtid_211782 == y_211787;\n            int64_t defunc_0_m_fun_res_f_res_211789;\n            \n            if (cond_211788) {\n                int64_t defunc_0_m_fun_res_f_res_t_res_211790 =\n                        sub64(pad_css_len_203632, (int64_t) 1);\n                \n                defunc_0_m_fun_res_f_res_211789 =\n                    defunc_0_m_fun_res_f_res_t_res_211790;\n            } else {\n                int64_t x_211791 = sub64(gtid_211782, (int64_t) 1);\n                int64_t x_211792 = mul64(jump_s_203499, x_211791);\n                int64_t min_arg_2",
                   "11793 = add64((int64_t) 1, x_211792);\n                int64_t min_res_211794 = smin64(defunc_0_f_res_203631,\n                                                min_arg_211793);\n                \n                defunc_0_m_fun_res_f_res_211789 = min_res_211794;\n            }\n            defunc_0_m_fun_res_211786 = defunc_0_m_fun_res_f_res_211789;\n        }\n        ((__local int64_t *) color_231989)[gtid_211782] =\n            defunc_0_m_fun_res_211786;\n        ((__local bool *) color_231991)[gtid_211782] = cond_211785;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int64_t gtid_211796 = sext_i32_i64(sext_i64_i32(ltid_pre_232943));\n    int64_t gtid_211797 = sext_i32_i64(sext_i64_i32(ltid_pre_232944));\n    int32_t phys_tid_211798 = local_tid_232936;\n    __local unsigned char *red_arr_mem_232953;\n    \n    red_arr_mem_232953 = (__local unsigned char *) red_arr_mem_232953_backing_4;\n    if (slt64(gtid_211796, s_n_m_203636) && slt64(gtid_211797, q_s_203493)) {\n        int64_t x_211802;\n        \n        x_211802 = ((__global int64_t *) ext_mem_229363)[gtid_211766 *\n                                                         (s_n_m_203636 *\n                                                          n_p_203492) +\n                                                         gtid_211767 *\n                                                         s_n_m_203636 +\n                                                         gtid_211796];\n        \n        double x_211803;\n        \n        x_211803 = ((__global double *) ext_mem_229362)[gtid_211766 *\n                                                        (s_n_m_203636 *\n                                                         n_p_203492) +\n                                                        gtid_211767 *\n                                                        s_n_m_203636 +\n                                                        gtid_211796];\n        \n        int64_t defunc_0_m_fun_res_211804;\n        \n        defunc_0_m_fun_res_211804 = ((__lo",
                   "cal\n                                      int64_t *) color_231989)[gtid_211796];\n        \n        bool cond_211806 = sle64(x_211775, gtid_211797);\n        int64_t defunc_0_f_res_211807;\n        \n        if (cond_211806) {\n            defunc_0_f_res_211807 = (int64_t) 0;\n        } else {\n            int64_t i_211808 = add64(gtid_211797, x_211802);\n            int64_t defunc_0_add_arg_211809;\n            \n            defunc_0_add_arg_211809 = ((__global\n                                        int64_t *) ext_mem_229265)[gtid_211766 *\n                                                                   (defunc_0_f_res_203631 *\n                                                                    n_p_203492) +\n                                                                   gtid_211767 *\n                                                                   defunc_0_f_res_203631 +\n                                                                   i_211808];\n            \n            int64_t defunc_1_add_res_211810 = add64((int64_t) 1,\n                                                    defunc_0_add_arg_211809);\n            \n            defunc_0_f_res_211807 = defunc_1_add_res_211810;\n        }\n        \n        double defunc_0_f_res_211811;\n        \n        if (cond_211806) {\n            defunc_0_f_res_211811 = 0.0;\n        } else {\n            int64_t i_211812 = add64(gtid_211797, x_211802);\n            double defunc_0_add_arg_211813;\n            \n            defunc_0_add_arg_211813 = ((__global\n                                        double *) mem_229531)[gtid_211766 *\n                                                              (defunc_0_f_res_203631 *\n                                                               n_p_203492) +\n                                                              gtid_211767 *\n                                                              defunc_0_f_res_203631 +\n                                                              i_211812];\n            defu",
                   "nc_0_f_res_211811 = defunc_0_add_arg_211813;\n        }\n        \n        int64_t binop_p_211814 = sub64(defunc_0_f_res_211807,\n                                       defunc_0_m_fun_res_211804);\n        double defunc_0_f_res_211815 = sitofp_i64_f64(binop_p_211814);\n        double abs_res_211816 = fabs(defunc_0_f_res_211815);\n        double tmp1_211817 = abs_res_211816 / x_211803;\n        double x_211818 = tmp1_211817 * tmp1_211817;\n        double y_211819 = tmp1_211817 * x_211818;\n        double tmp2_211820 = 1.0 - y_211819;\n        double x_211821 = tmp2_211820 * tmp2_211820;\n        double tmp3_211822 = tmp2_211820 * x_211821;\n        double w_j_211823 = defunc_0_f_res_211811 * tmp3_211822;\n        \n        ((__local double *) red_arr_mem_232953)[gtid_211796 * q_s_203493 +\n                                                gtid_211797] = w_j_211823;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int64_t dims_flat_232955 = s_n_m_203636 * q_s_203493;\n    double x_211799;\n    double x_211800;\n    double x_232957;\n    double x_232958;\n    bool ltid_in_bounds_232960 = slt64(sext_i32_i64(local_tid_232936),\n                                       s_n_m_203636 * q_s_203493);\n    int32_t skip_threads_232961;\n    \n    // read input for in-block scan\n    {\n        if (ltid_in_bounds_232960) {\n            x_211800 = ((volatile __local\n                         double *) red_arr_mem_232953)[sext_i32_i64(local_tid_232936)];\n            if ((local_tid_232936 - squot32(local_tid_232936, 32) * 32) == 0) {\n                x_211799 = x_211800;\n            }\n        }\n    }\n    // in-block scan (hopefully no barriers needed)\n    {\n        skip_threads_232961 = 1;\n        while (slt32(skip_threads_232961, 32)) {\n            bool thread_active_232962 = sle32(skip_threads_232961,\n                                              local_tid_232936 -\n                                              squot32(local_tid_232936, 32) *\n                                              32) && ltid_in_bounds_2329",
                   "60;\n            \n            if (thread_active_232962) {\n                // read operands\n                {\n                    x_211799 = ((volatile __local\n                                 double *) red_arr_mem_232953)[sext_i32_i64(local_tid_232936) -\n                                                               sext_i32_i64(skip_threads_232961)];\n                }\n            }\n            // perform operation\n            {\n                bool inactive_232963 =\n                     slt64(srem64(sext_i32_i64(local_tid_232936), q_s_203493),\n                           sext_i32_i64(local_tid_232936) -\n                           sext_i32_i64(local_tid_232936 -\n                           skip_threads_232961));\n                \n                if (thread_active_232962 && inactive_232963) {\n                    x_211799 = x_211800;\n                }\n                if (thread_active_232962) {\n                    if (!inactive_232963) {\n                        double defunc_1_op_res_211801 = x_211799 + x_211800;\n                        \n                        x_211799 = defunc_1_op_res_211801;\n                    }\n                }\n            }\n            if (sle32(wave_sizze_232938, skip_threads_232961)) {\n                barrier(CLK_LOCAL_MEM_FENCE);\n            }\n            if (thread_active_232962) {\n                // write result\n                {\n                    ((volatile __local\n                      double *) red_arr_mem_232953)[sext_i32_i64(local_tid_232936)] =\n                        x_211799;\n                    x_211800 = x_211799;\n                }\n            }\n            if (sle32(wave_sizze_232938, skip_threads_232961)) {\n                barrier(CLK_LOCAL_MEM_FENCE);\n            }\n            skip_threads_232961 *= 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_232936 - squot32(local_tid_232936, 32) * 32) == 31 &&\n            ltid_in_bounds_23296",
                   "0) {\n            ((volatile __local\n              double *) red_arr_mem_232953)[sext_i32_i64(squot32(local_tid_232936,\n                                                                 32))] =\n                x_211799;\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_232964;\n        \n        // read input for in-block scan\n        {\n            if (squot32(local_tid_232936, 32) == 0 && ltid_in_bounds_232960) {\n                x_232958 = ((volatile __local\n                             double *) red_arr_mem_232953)[sext_i32_i64(local_tid_232936)];\n                if ((local_tid_232936 - squot32(local_tid_232936, 32) * 32) ==\n                    0) {\n                    x_232957 = x_232958;\n                }\n            }\n        }\n        // in-block scan (hopefully no barriers needed)\n        {\n            skip_threads_232964 = 1;\n            while (slt32(skip_threads_232964, 32)) {\n                bool thread_active_232965 = sle32(skip_threads_232964,\n                                                  local_tid_232936 -\n                                                  squot32(local_tid_232936,\n                                                          32) * 32) &&\n                     (squot32(local_tid_232936, 32) == 0 &&\n                      ltid_in_bounds_232960);\n                \n                if (thread_active_232965) {\n                    // read operands\n                    {\n                        x_232957 = ((volatile __local\n                                     double *) red_arr_mem_232953)[sext_i32_i64(local_tid_232936) -\n                                                                   sext_i32_i64(skip_threads_232964)];\n                    }\n                }\n                // perform operation\n                {\n                    bool inactive_232966 =\n                         slt64(srem64(sext_i32_i64(local_tid_232936 * 32 + 3",
                   "2 -\n                                      1), q_s_203493),\n                               sext_i32_i64(local_tid_232936 * 32 + 32 - 1) -\n                               sext_i32_i64((local_tid_232936 -\n                                             skip_threads_232964) * 32 + 32 -\n                               1));\n                    \n                    if (thread_active_232965 && inactive_232966) {\n                        x_232957 = x_232958;\n                    }\n                    if (thread_active_232965) {\n                        if (!inactive_232966) {\n                            double defunc_1_op_res_232959 = x_232957 + x_232958;\n                            \n                            x_232957 = defunc_1_op_res_232959;\n                        }\n                    }\n                }\n                if (sle32(wave_sizze_232938, skip_threads_232964)) {\n                    barrier(CLK_LOCAL_MEM_FENCE);\n                }\n                if (thread_active_232965) {\n                    // write result\n                    {\n                        ((volatile __local\n                          double *) red_arr_mem_232953)[sext_i32_i64(local_tid_232936)] =\n                            x_232957;\n                        x_232958 = x_232957;\n                    }\n                }\n                if (sle32(wave_sizze_232938, skip_threads_232964)) {\n                    barrier(CLK_LOCAL_MEM_FENCE);\n                }\n                skip_threads_232964 *= 2;\n            }\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    bool no_carry_in_232967 = squot32(local_tid_232936, 32) == 0 ||\n         !ltid_in_bounds_232960;\n    \n    // carry-in for every block except the first\n    {\n        // read operands\n        {\n            if (!no_carry_in_232967) {\n                x_211800 = x_211799;\n                x_211799 = ((__local\n                             double *) red_arr_mem_232953)[sext_i32_i64(squot32(local_tid_232936,\n                                             ",
                   "                                   32)) -\n                                                           (int64_t) 1];\n            }\n        }\n        // perform operation\n        {\n            bool inactive_232968 = slt64(srem64(sext_i32_i64(local_tid_232936),\n                                                q_s_203493),\n                                         sext_i32_i64(local_tid_232936) -\n                                         sext_i32_i64(squot32(local_tid_232936,\n                                                              32) * 32 - 1));\n            \n            if (!no_carry_in_232967) {\n                if (inactive_232968) {\n                    x_211799 = x_211800;\n                }\n            }\n            if (!no_carry_in_232967) {\n                if (!inactive_232968) {\n                    double defunc_1_op_res_211801 = x_211799 + x_211800;\n                    \n                    x_211799 = defunc_1_op_res_211801;\n                }\n            }\n        }\n        // write final result\n        {\n            if (!no_carry_in_232967) {\n                ((__local\n                  double *) red_arr_mem_232953)[sext_i32_i64(local_tid_232936)] =\n                    x_211799;\n            }\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    // restore correct values for first block\n    {\n        if (squot32(local_tid_232936, 32) == 0 && ltid_in_bounds_232960) {\n            ((__local\n              double *) red_arr_mem_232953)[sext_i32_i64(local_tid_232936)] =\n                x_211800;\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    barrier(CLK_LOCAL_MEM_FENCE);\n    for (int64_t i_232969 = 0; i_232969 < sdiv_up64(s_n_m_203636 -\n                                                    sext_i32_i64(local_tid_232936),\n                                                    computed_group_sizze_211670);\n         i_232969++) {\n        double tmp_232970;\n        \n        tmp_232970 = ((__local double *) red_arr_mem_232953)[q_s_203493 -\n                               ",
                   "                              (int64_t) 1 +\n                                                             (i_232969 *\n                                                              computed_group_sizze_211670 +\n                                                              sext_i32_i64(local_tid_232936)) *\n                                                             q_s_203493];\n        ((__local double *) color_231988)[i_232969 *\n                                          computed_group_sizze_211670 +\n                                          sext_i32_i64(local_tid_232936)] =\n            tmp_232970;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int64_t gtid_211826 = sext_i32_i64(sext_i64_i32(ltid_pre_232940));\n    int32_t phys_tid_211827 = local_tid_232936;\n    \n    if (slt64(gtid_211826, s_n_m_203636)) {\n        bool index_primexp_228719 = gtid_211826 == (int64_t) 0;\n        double defunc_2_reduce_res_211830;\n        \n        defunc_2_reduce_res_211830 = ((__local\n                                       double *) color_231988)[gtid_211826];\n        \n        double a0_211831 = 1.0 / defunc_2_reduce_res_211830;\n        int64_t defunc_0_m_fun_res_211832;\n        \n        if (index_primexp_228719) {\n            defunc_0_m_fun_res_211832 = (int64_t) 0;\n        } else {\n            int64_t y_211833 = sub64(s_n_m_203636, (int64_t) 1);\n            bool cond_211834 = gtid_211826 == y_211833;\n            int64_t defunc_0_m_fun_res_f_res_211835;\n            \n            if (cond_211834) {\n                int64_t defunc_0_m_fun_res_f_res_t_res_211836 =\n                        sub64(pad_css_len_203632, (int64_t) 1);\n                \n                defunc_0_m_fun_res_f_res_211835 =\n                    defunc_0_m_fun_res_f_res_t_res_211836;\n            } else {\n                int64_t x_211837 = sub64(gtid_211826, (int64_t) 1);\n                int64_t x_211838 = mul64(jump_s_203499, x_211837);\n                int64_t min_arg_211839 = add64((int64",
                   "_t) 1, x_211838);\n                int64_t min_res_211840 = smin64(defunc_0_f_res_203631,\n                                                min_arg_211839);\n                \n                defunc_0_m_fun_res_f_res_211835 = min_res_211840;\n            }\n            defunc_0_m_fun_res_211832 = defunc_0_m_fun_res_f_res_211835;\n        }\n        ((__local double *) color_231990)[gtid_211826] = a0_211831;\n        ((__local int64_t *) color_231989)[gtid_211826] =\n            defunc_0_m_fun_res_211832;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int64_t gtid_211842 = sext_i32_i64(sext_i64_i32(ltid_pre_232943));\n    int64_t gtid_211843 = sext_i32_i64(sext_i64_i32(ltid_pre_232944));\n    int32_t phys_tid_211844 = local_tid_232936;\n    __local unsigned char *red_arr_mem_232971;\n    \n    red_arr_mem_232971 = (__local unsigned char *) red_arr_mem_232971_backing_5;\n    if (slt64(gtid_211842, s_n_m_203636) && slt64(gtid_211843, q_s_203493)) {\n        int64_t x_211848;\n        \n        x_211848 = ((__global int64_t *) ext_mem_229363)[gtid_211766 *\n                                                         (s_n_m_203636 *\n                                                          n_p_203492) +\n                                                         gtid_211767 *\n                                                         s_n_m_203636 +\n                                                         gtid_211842];\n        \n        double x_211849;\n        \n        x_211849 = ((__global double *) ext_mem_229362)[gtid_211766 *\n                                                        (s_n_m_203636 *\n                                                         n_p_203492) +\n                                                        gtid_211767 *\n                                                        s_n_m_203636 +\n                                                        gtid_211842];\n        \n        double a0_211850;\n        \n        a0_211850 = ((__local double *) color_231990)[gtid_211842];\n        \n  ",
                   "      int64_t defunc_0_m_fun_res_211851;\n        \n        defunc_0_m_fun_res_211851 = ((__local\n                                      int64_t *) color_231989)[gtid_211842];\n        \n        bool cond_211853 = sle64(x_211775, gtid_211843);\n        int64_t defunc_0_f_res_211854;\n        \n        if (cond_211853) {\n            defunc_0_f_res_211854 = (int64_t) 0;\n        } else {\n            int64_t i_211855 = add64(gtid_211843, x_211848);\n            int64_t defunc_0_add_arg_211856;\n            \n            defunc_0_add_arg_211856 = ((__global\n                                        int64_t *) ext_mem_229265)[gtid_211766 *\n                                                                   (defunc_0_f_res_203631 *\n                                                                    n_p_203492) +\n                                                                   gtid_211767 *\n                                                                   defunc_0_f_res_203631 +\n                                                                   i_211855];\n            \n            int64_t defunc_1_add_res_211857 = add64((int64_t) 1,\n                                                    defunc_0_add_arg_211856);\n            \n            defunc_0_f_res_211854 = defunc_1_add_res_211857;\n        }\n        \n        double defunc_0_f_res_211858;\n        \n        if (cond_211853) {\n            defunc_0_f_res_211858 = 0.0;\n        } else {\n            int64_t i_211859 = add64(gtid_211843, x_211848);\n            double defunc_0_add_arg_211860;\n            \n            defunc_0_add_arg_211860 = ((__global\n                                        double *) mem_229531)[gtid_211766 *\n                                                              (defunc_0_f_res_203631 *\n                                                               n_p_203492) +\n                                                              gtid_211767 *\n                                                              defunc_0_f_res_203631",
                   " +\n                                                              i_211859];\n            defunc_0_f_res_211858 = defunc_0_add_arg_211860;\n        }\n        \n        int64_t binop_p_211861 = sub64(defunc_0_f_res_211854,\n                                       defunc_0_m_fun_res_211851);\n        double defunc_0_f_res_211862 = sitofp_i64_f64(binop_p_211861);\n        double abs_res_211863 = fabs(defunc_0_f_res_211862);\n        double tmp1_211864 = abs_res_211863 / x_211849;\n        double x_211865 = tmp1_211864 * tmp1_211864;\n        double y_211866 = tmp1_211864 * x_211865;\n        double tmp2_211867 = 1.0 - y_211866;\n        double x_211868 = tmp2_211867 * tmp2_211867;\n        double tmp3_211869 = tmp2_211867 * x_211868;\n        double tmp4_211870 = defunc_0_f_res_211858 * tmp3_211869;\n        double defunc_0_f_res_211871;\n        \n        if (cond_211853) {\n            defunc_0_f_res_211871 = 0.0;\n        } else {\n            int64_t i_211872 = add64(gtid_211843, x_211848);\n            double defunc_0_add_arg_211873;\n            \n            defunc_0_add_arg_211873 = ((__global\n                                        double *) mem_229526)[gtid_211766 *\n                                                              (defunc_0_f_res_203631 *\n                                                               n_p_203492) +\n                                                              gtid_211767 *\n                                                              defunc_0_f_res_203631 +\n                                                              i_211872];\n            defunc_0_f_res_211871 = defunc_0_add_arg_211873;\n        }\n        \n        double x_211874 = a0_211850 * tmp4_211870;\n        double defunc_9_fit_fun_res_211875 = defunc_0_f_res_211871 * x_211874;\n        \n        ((__local double *) red_arr_mem_232971)[gtid_211842 * q_s_203493 +\n                                                gtid_211843] =\n            defunc_9_fit_fun_res_211875;\n    }\n    barrier(CLK_LOCAL_MEM_FEN",
                   "CE);\n    \n    int64_t dims_flat_232973 = s_n_m_203636 * q_s_203493;\n    double x_211845;\n    double x_211846;\n    double x_232975;\n    double x_232976;\n    bool ltid_in_bounds_232978 = slt64(sext_i32_i64(local_tid_232936),\n                                       s_n_m_203636 * q_s_203493);\n    int32_t skip_threads_232979;\n    \n    // read input for in-block scan\n    {\n        if (ltid_in_bounds_232978) {\n            x_211846 = ((volatile __local\n                         double *) red_arr_mem_232971)[sext_i32_i64(local_tid_232936)];\n            if ((local_tid_232936 - squot32(local_tid_232936, 32) * 32) == 0) {\n                x_211845 = x_211846;\n            }\n        }\n    }\n    // in-block scan (hopefully no barriers needed)\n    {\n        skip_threads_232979 = 1;\n        while (slt32(skip_threads_232979, 32)) {\n            bool thread_active_232980 = sle32(skip_threads_232979,\n                                              local_tid_232936 -\n                                              squot32(local_tid_232936, 32) *\n                                              32) && ltid_in_bounds_232978;\n            \n            if (thread_active_232980) {\n                // read operands\n                {\n                    x_211845 = ((volatile __local\n                                 double *) red_arr_mem_232971)[sext_i32_i64(local_tid_232936) -\n                                                               sext_i32_i64(skip_threads_232979)];\n                }\n            }\n            // perform operation\n            {\n                bool inactive_232981 =\n                     slt64(srem64(sext_i32_i64(local_tid_232936), q_s_203493),\n                           sext_i32_i64(local_tid_232936) -\n                           sext_i32_i64(local_tid_232936 -\n                           skip_threads_232979));\n                \n                if (thread_active_232980 && inactive_232981) {\n                    x_211845 = x_211846;\n                }\n                if (thread_active_23",
                   "2980) {\n                    if (!inactive_232981) {\n                        double defunc_1_op_res_211847 = x_211845 + x_211846;\n                        \n                        x_211845 = defunc_1_op_res_211847;\n                    }\n                }\n            }\n            if (sle32(wave_sizze_232938, skip_threads_232979)) {\n                barrier(CLK_LOCAL_MEM_FENCE);\n            }\n            if (thread_active_232980) {\n                // write result\n                {\n                    ((volatile __local\n                      double *) red_arr_mem_232971)[sext_i32_i64(local_tid_232936)] =\n                        x_211845;\n                    x_211846 = x_211845;\n                }\n            }\n            if (sle32(wave_sizze_232938, skip_threads_232979)) {\n                barrier(CLK_LOCAL_MEM_FENCE);\n            }\n            skip_threads_232979 *= 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_232936 - squot32(local_tid_232936, 32) * 32) == 31 &&\n            ltid_in_bounds_232978) {\n            ((volatile __local\n              double *) red_arr_mem_232971)[sext_i32_i64(squot32(local_tid_232936,\n                                                                 32))] =\n                x_211845;\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_232982;\n        \n        // read input for in-block scan\n        {\n            if (squot32(local_tid_232936, 32) == 0 && ltid_in_bounds_232978) {\n                x_232976 = ((volatile __local\n                             double *) red_arr_mem_232971)[sext_i32_i64(local_tid_232936)];\n                if ((local_tid_232936 - squot32(local_tid_232936, 32) * 32) ==\n                    0) {\n                    x_232975 = x_232976;\n                }\n            }\n        }\n        // in-block scan (hopefull",
                   "y no barriers needed)\n        {\n            skip_threads_232982 = 1;\n            while (slt32(skip_threads_232982, 32)) {\n                bool thread_active_232983 = sle32(skip_threads_232982,\n                                                  local_tid_232936 -\n                                                  squot32(local_tid_232936,\n                                                          32) * 32) &&\n                     (squot32(local_tid_232936, 32) == 0 &&\n                      ltid_in_bounds_232978);\n                \n                if (thread_active_232983) {\n                    // read operands\n                    {\n                        x_232975 = ((volatile __local\n                                     double *) red_arr_mem_232971)[sext_i32_i64(local_tid_232936) -\n                                                                   sext_i32_i64(skip_threads_232982)];\n                    }\n                }\n                // perform operation\n                {\n                    bool inactive_232984 =\n                         slt64(srem64(sext_i32_i64(local_tid_232936 * 32 + 32 -\n                                      1), q_s_203493),\n                               sext_i32_i64(local_tid_232936 * 32 + 32 - 1) -\n                               sext_i32_i64((local_tid_232936 -\n                                             skip_threads_232982) * 32 + 32 -\n                               1));\n                    \n                    if (thread_active_232983 && inactive_232984) {\n                        x_232975 = x_232976;\n                    }\n                    if (thread_active_232983) {\n                        if (!inactive_232984) {\n                            double defunc_1_op_res_232977 = x_232975 + x_232976;\n                            \n                            x_232975 = defunc_1_op_res_232977;\n                        }\n                    }\n                }\n                if (sle32(wave_sizze_232938, skip_threads_232982)) {\n                    ",
                   "barrier(CLK_LOCAL_MEM_FENCE);\n                }\n                if (thread_active_232983) {\n                    // write result\n                    {\n                        ((volatile __local\n                          double *) red_arr_mem_232971)[sext_i32_i64(local_tid_232936)] =\n                            x_232975;\n                        x_232976 = x_232975;\n                    }\n                }\n                if (sle32(wave_sizze_232938, skip_threads_232982)) {\n                    barrier(CLK_LOCAL_MEM_FENCE);\n                }\n                skip_threads_232982 *= 2;\n            }\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    bool no_carry_in_232985 = squot32(local_tid_232936, 32) == 0 ||\n         !ltid_in_bounds_232978;\n    \n    // carry-in for every block except the first\n    {\n        // read operands\n        {\n            if (!no_carry_in_232985) {\n                x_211846 = x_211845;\n                x_211845 = ((__local\n                             double *) red_arr_mem_232971)[sext_i32_i64(squot32(local_tid_232936,\n                                                                                32)) -\n                                                           (int64_t) 1];\n            }\n        }\n        // perform operation\n        {\n            bool inactive_232986 = slt64(srem64(sext_i32_i64(local_tid_232936),\n                                                q_s_203493),\n                                         sext_i32_i64(local_tid_232936) -\n                                         sext_i32_i64(squot32(local_tid_232936,\n                                                              32) * 32 - 1));\n            \n            if (!no_carry_in_232985) {\n                if (inactive_232986) {\n                    x_211845 = x_211846;\n                }\n            }\n            if (!no_carry_in_232985) {\n                if (!inactive_232986) {\n                    double defunc_1_op_res_211847 = x_211845 + x_211846;\n                    \n      ",
                   "              x_211845 = defunc_1_op_res_211847;\n                }\n            }\n        }\n        // write final result\n        {\n            if (!no_carry_in_232985) {\n                ((__local\n                  double *) red_arr_mem_232971)[sext_i32_i64(local_tid_232936)] =\n                    x_211845;\n            }\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    // restore correct values for first block\n    {\n        if (squot32(local_tid_232936, 32) == 0 && ltid_in_bounds_232978) {\n            ((__local\n              double *) red_arr_mem_232971)[sext_i32_i64(local_tid_232936)] =\n                x_211846;\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    barrier(CLK_LOCAL_MEM_FENCE);\n    for (int64_t i_232987 = 0; i_232987 < sdiv_up64(s_n_m_203636 -\n                                                    sext_i32_i64(local_tid_232936),\n                                                    computed_group_sizze_211670);\n         i_232987++) {\n        double tmp_232988;\n        \n        tmp_232988 = ((__local double *) red_arr_mem_232971)[q_s_203493 -\n                                                             (int64_t) 1 +\n                                                             (i_232987 *\n                                                              computed_group_sizze_211670 +\n                                                              sext_i32_i64(local_tid_232936)) *\n                                                             q_s_203493];\n        ((__local double *) color_231988)[i_232987 *\n                                          computed_group_sizze_211670 +\n                                          sext_i32_i64(local_tid_232936)] =\n            tmp_232988;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    barrier(CLK_LOCAL_MEM_FENCE);\n    for (int64_t i_232989 = 0; i_232989 < sdiv_up64(s_n_m_203636 -\n                                                    sext_i32_i64(local_tid_232936),\n                                                    computed_grou",
                   "p_sizze_211670);\n         i_232989++) {\n        double tmp_232990;\n        \n        tmp_232990 = ((__local double *) color_231988)[i_232989 *\n                                                       computed_group_sizze_211670 +\n                                                       sext_i32_i64(local_tid_232936)];\n        ((__global double *) mem_229675)[gtid_211766 * (s_n_m_203636 *\n                                                        n_p_203492) +\n                                         gtid_211767 * s_n_m_203636 +\n                                         (i_232989 *\n                                          computed_group_sizze_211670 +\n                                          sext_i32_i64(local_tid_232936))] =\n            tmp_232990;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n  error_6:\n    return;\n}\n__kernel void mainzisegmap_intragroup_213836(__global int *global_failure,\n                                             __local volatile\n                                             int64_t *red_arr_mem_233293_backing_aligned_0,\n                                             __local volatile\n                                             int64_t *red_arr_mem_233291_backing_aligned_1,\n                                             __local volatile\n                                             int64_t *red_arr_mem_233261_backing_aligned_2,\n                                             __local volatile\n                                             int64_t *red_arr_mem_233259_backing_aligned_3,\n                                             __local volatile\n                                             int64_t *red_arr_mem_233257_backing_aligned_4,\n                                             __local volatile\n                                             int64_t *color_232003_backing_aligned_5,\n                                             __local volatile\n                                             int64_t *color_232002_backing_aligned_6,\n                                     ",
                   "        __local volatile\n                                             int64_t *color_232001_backing_aligned_7,\n                                             __local volatile\n                                             int64_t *color_232000_backing_aligned_8,\n                                             __local volatile\n                                             int64_t *color_231999_backing_aligned_9,\n                                             __local volatile\n                                             int64_t *color_231998_backing_aligned_10,\n                                             __local volatile\n                                             int64_t *color_231997_backing_aligned_11,\n                                             __local volatile\n                                             int64_t *color_231996_backing_aligned_12,\n                                             int64_t n_p_203492,\n                                             int64_t q_s_203493,\n                                             int64_t jump_s_203499,\n                                             int64_t partition_sizze_203577,\n                                             int64_t defunc_0_f_res_203631,\n                                             int64_t pad_css_len_203632,\n                                             int64_t s_n_m_203636,\n                                             int64_t computed_group_sizze_213705,\n                                             __global\n                                             unsigned char *ext_mem_229264,\n                                             __global\n                                             unsigned char *ext_mem_229265,\n                                             __global\n                                             unsigned char *ext_mem_229362,\n                                             __global\n                                             unsigned char *ext_mem_229363,\n                                             __global",
                   " unsigned char *mem_229526,\n                                             __global unsigned char *mem_229531,\n                                             __global unsigned char *mem_229951,\n                                             __global unsigned char *mem_229956)\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_233293_backing_12 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_233293_backing_aligned_0;\n    __local volatile unsigned char *restrict red_arr_mem_233291_backing_11 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_233291_backing_aligned_1;\n    __local volatile unsigned char *restrict red_arr_mem_233261_backing_10 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_233261_backing_aligned_2;\n    __local volatile unsigned char *restrict red_arr_mem_233259_backing_9 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_233259_backing_aligned_3;\n    __local volatile unsigned char *restrict red_arr_mem_233257_backing_8 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_233257_backing_aligned_4;\n    __local volatile unsigned char *restrict color_232003_backing_7 =\n                                   (__local volatile\n                                    unsigned char *) color_232003_backing_aligned_5;\n    __local volatile unsigned char *restrict color_232002_backing_6 =\n                                   (__local volatile\n                                    unsigned char *) color_232002_backing_aligned_6;\n    __local volatile unsigned char *restrict color_232001_backing_5 =\n                                   (__local vola",
                   "tile\n                                    unsigned char *) color_232001_backing_aligned_7;\n    __local volatile unsigned char *restrict color_232000_backing_4 =\n                                   (__local volatile\n                                    unsigned char *) color_232000_backing_aligned_8;\n    __local volatile unsigned char *restrict color_231999_backing_3 =\n                                   (__local volatile\n                                    unsigned char *) color_231999_backing_aligned_9;\n    __local volatile unsigned char *restrict color_231998_backing_2 =\n                                   (__local volatile\n                                    unsigned char *) color_231998_backing_aligned_10;\n    __local volatile unsigned char *restrict color_231997_backing_1 =\n                                   (__local volatile\n                                    unsigned char *) color_231997_backing_aligned_11;\n    __local volatile unsigned char *restrict color_231996_backing_0 =\n                                   (__local volatile\n                                    unsigned char *) color_231996_backing_aligned_12;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_233239;\n    int32_t local_tid_233240;\n    int64_t group_sizze_233243;\n    int32_t wave_sizze_233242;\n    int32_t group_tid_233241;\n    \n    global_tid_233239 = get_global_id(0);\n    local_tid_233240 = get_local_id(0);\n    group_sizze_233243 = get_local_size(0);\n    wave_sizze_233242 = LOCKSTEP_WIDTH;\n    group_tid_233241 = get_group_id(0);\n    \n    int32_t phys_tid_213836 = group_tid_233241;\n    int64_t slice_233245 = s_n_m_203636;\n    int64_t ltid_pre_233244 = sext_i32_i64(local_tid_233240);\n    int64_t remnant_233246 = sext_i32_i64(local_tid_233240) - ltid_pre_233244;\n    int64_t slice_233249 = q_s_203493;\n    int64_t slice_233250 = s_n_m_203636 * slice_233249;\n    int64_t ltid_pre_233247 = squot64(sext_i32_i64(local_tid_233240),\n                                      slice_23",
                   "3249);\n    int64_t remnant_233251 = sext_i32_i64(local_tid_233240) - ltid_pre_233247 *\n            slice_233249;\n    int64_t ltid_pre_233248 = remnant_233251;\n    int64_t remnant_233252 = remnant_233251 - ltid_pre_233248;\n    int64_t slice_233253 = n_p_203492;\n    int64_t slice_233254 = partition_sizze_203577 * slice_233253;\n    int64_t gtid_213834 = squot64(sext_i32_i64(group_tid_233241), slice_233253);\n    int64_t remnant_233255 = sext_i32_i64(group_tid_233241) - gtid_213834 *\n            slice_233253;\n    int64_t gtid_213835 = remnant_233255;\n    int64_t remnant_233256 = remnant_233255 - gtid_213835;\n    __local unsigned char *color_231996;\n    \n    color_231996 = (__local unsigned char *) color_231996_backing_0;\n    \n    __local unsigned char *color_231997;\n    \n    color_231997 = (__local unsigned char *) color_231997_backing_1;\n    \n    __local unsigned char *color_231998;\n    \n    color_231998 = (__local unsigned char *) color_231998_backing_2;\n    \n    __local unsigned char *color_231999;\n    \n    color_231999 = (__local unsigned char *) color_231999_backing_3;\n    \n    __local unsigned char *color_232000;\n    \n    color_232000 = (__local unsigned char *) color_232000_backing_4;\n    \n    __local unsigned char *color_232001;\n    \n    color_232001 = (__local unsigned char *) color_232001_backing_5;\n    \n    __local unsigned char *color_232002;\n    \n    color_232002 = (__local unsigned char *) color_232002_backing_6;\n    \n    __local unsigned char *color_232003;\n    \n    color_232003 = (__local unsigned char *) color_232003_backing_7;\n    \n    int64_t x_213843;\n    \n    x_213843 = ((__global int64_t *) ext_mem_229264)[gtid_213834 * n_p_203492 +\n                                                     gtid_213835];\n    \n    int64_t gtid_213850 = sext_i32_i64(sext_i64_i32(ltid_pre_233244));\n    int32_t phys_tid_213851 = local_tid_233240;\n    \n    if (slt64(gtid_213850, s_n_m_203636)) {\n        bool cond_213853 = gtid_213850 == (int64_t) 0;\n        int64_t defunc_0_m_",
                   "fun_res_213854;\n        \n        if (cond_213853) {\n            defunc_0_m_fun_res_213854 = (int64_t) 0;\n        } else {\n            int64_t y_213855 = sub64(s_n_m_203636, (int64_t) 1);\n            bool cond_213856 = gtid_213850 == y_213855;\n            int64_t defunc_0_m_fun_res_f_res_213857;\n            \n            if (cond_213856) {\n                int64_t defunc_0_m_fun_res_f_res_t_res_213858 =\n                        sub64(pad_css_len_203632, (int64_t) 1);\n                \n                defunc_0_m_fun_res_f_res_213857 =\n                    defunc_0_m_fun_res_f_res_t_res_213858;\n            } else {\n                int64_t x_213859 = sub64(gtid_213850, (int64_t) 1);\n                int64_t x_213860 = mul64(jump_s_203499, x_213859);\n                int64_t min_arg_213861 = add64((int64_t) 1, x_213860);\n                int64_t min_res_213862 = smin64(defunc_0_f_res_203631,\n                                                min_arg_213861);\n                \n                defunc_0_m_fun_res_f_res_213857 = min_res_213862;\n            }\n            defunc_0_m_fun_res_213854 = defunc_0_m_fun_res_f_res_213857;\n        }\n        ((__local int64_t *) color_231998)[gtid_213850] =\n            defunc_0_m_fun_res_213854;\n        ((__local bool *) color_232003)[gtid_213850] = cond_213853;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int64_t gtid_213866 = sext_i32_i64(sext_i64_i32(ltid_pre_233247));\n    int64_t gtid_213867 = sext_i32_i64(sext_i64_i32(ltid_pre_233248));\n    int32_t phys_tid_213868 = local_tid_233240;\n    __local unsigned char *red_arr_mem_233257;\n    \n    red_arr_mem_233257 = (__local unsigned char *) red_arr_mem_233257_backing_8;\n    \n    __local unsigned char *red_arr_mem_233259;\n    \n    red_arr_mem_233259 = (__local unsigned char *) red_arr_mem_233259_backing_9;\n    \n    __local unsigned char *red_arr_mem_233261;\n    \n    red_arr_mem_233261 = (__local\n                          unsigned char *) red_arr_mem_233261_backing_10;\n    if (slt64(gtid_213866, ",
                   "s_n_m_203636) && slt64(gtid_213867, q_s_203493)) {\n        int64_t x_213878;\n        \n        x_213878 = ((__global int64_t *) ext_mem_229363)[gtid_213834 *\n                                                         (s_n_m_203636 *\n                                                          n_p_203492) +\n                                                         gtid_213835 *\n                                                         s_n_m_203636 +\n                                                         gtid_213866];\n        \n        double x_213879;\n        \n        x_213879 = ((__global double *) ext_mem_229362)[gtid_213834 *\n                                                        (s_n_m_203636 *\n                                                         n_p_203492) +\n                                                        gtid_213835 *\n                                                        s_n_m_203636 +\n                                                        gtid_213866];\n        \n        int64_t defunc_0_m_fun_res_213880;\n        \n        defunc_0_m_fun_res_213880 = ((__local\n                                      int64_t *) color_231998)[gtid_213866];\n        \n        bool cond_213882 = sle64(x_213843, gtid_213867);\n        int64_t defunc_0_f_res_213883;\n        \n        if (cond_213882) {\n            defunc_0_f_res_213883 = (int64_t) 0;\n        } else {\n            int64_t i_213884 = add64(gtid_213867, x_213878);\n            int64_t defunc_0_add_arg_213885;\n            \n            defunc_0_add_arg_213885 = ((__global\n                                        int64_t *) ext_mem_229265)[gtid_213834 *\n                                                                   (defunc_0_f_res_203631 *\n                                                                    n_p_203492) +\n                                                                   gtid_213835 *\n                                                                   defunc_0_f_res_203631 +\n                               ",
                   "                                    i_213884];\n            \n            int64_t defunc_1_add_res_213886 = add64((int64_t) 1,\n                                                    defunc_0_add_arg_213885);\n            \n            defunc_0_f_res_213883 = defunc_1_add_res_213886;\n        }\n        \n        double defunc_0_f_res_213887;\n        \n        if (cond_213882) {\n            defunc_0_f_res_213887 = 0.0;\n        } else {\n            int64_t i_213888 = add64(gtid_213867, x_213878);\n            double defunc_0_add_arg_213889;\n            \n            defunc_0_add_arg_213889 = ((__global\n                                        double *) mem_229531)[gtid_213834 *\n                                                              (defunc_0_f_res_203631 *\n                                                               n_p_203492) +\n                                                              gtid_213835 *\n                                                              defunc_0_f_res_203631 +\n                                                              i_213888];\n            defunc_0_f_res_213887 = defunc_0_add_arg_213889;\n        }\n        \n        int64_t binop_p_213890 = sub64(defunc_0_f_res_213883,\n                                       defunc_0_m_fun_res_213880);\n        double defunc_0_f_res_213891 = sitofp_i64_f64(binop_p_213890);\n        double abs_res_213892 = fabs(defunc_0_f_res_213891);\n        double tmp1_213893 = abs_res_213892 / x_213879;\n        double x_213894 = tmp1_213893 * tmp1_213893;\n        double y_213895 = tmp1_213893 * x_213894;\n        double tmp2_213896 = 1.0 - y_213895;\n        double x_213897 = tmp2_213896 * tmp2_213896;\n        double tmp3_213898 = tmp2_213896 * x_213897;\n        double w_j_213899 = defunc_0_f_res_213887 * tmp3_213898;\n        double xw_j_213900 = defunc_0_f_res_213891 * w_j_213899;\n        double x2w_j_213901 = defunc_0_f_res_213891 * xw_j_213900;\n        \n        ((__local double *) red_arr_mem_233257)[gtid_213866 * q_s_203493 ",
                   "+\n                                                gtid_213867] = w_j_213899;\n        ((__local double *) red_arr_mem_233259)[gtid_213866 * q_s_203493 +\n                                                gtid_213867] = xw_j_213900;\n        ((__local double *) red_arr_mem_233261)[gtid_213866 * q_s_203493 +\n                                                gtid_213867] = x2w_j_213901;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int64_t dims_flat_233263 = s_n_m_203636 * q_s_203493;\n    double x_213869;\n    double x_213870;\n    double x_213871;\n    double x_213872;\n    double x_213873;\n    double x_213874;\n    double x_233267;\n    double x_233268;\n    double x_233269;\n    double x_233270;\n    double x_233271;\n    double x_233272;\n    bool ltid_in_bounds_233276 = slt64(sext_i32_i64(local_tid_233240),\n                                       s_n_m_203636 * q_s_203493);\n    int32_t skip_threads_233277;\n    \n    // read input for in-block scan\n    {\n        if (ltid_in_bounds_233276) {\n            x_213872 = ((volatile __local\n                         double *) red_arr_mem_233257)[sext_i32_i64(local_tid_233240)];\n            x_213873 = ((volatile __local\n                         double *) red_arr_mem_233259)[sext_i32_i64(local_tid_233240)];\n            x_213874 = ((volatile __local\n                         double *) red_arr_mem_233261)[sext_i32_i64(local_tid_233240)];\n            if ((local_tid_233240 - squot32(local_tid_233240, 32) * 32) == 0) {\n                x_213869 = x_213872;\n                x_213870 = x_213873;\n                x_213871 = x_213874;\n            }\n        }\n    }\n    // in-block scan (hopefully no barriers needed)\n    {\n        skip_threads_233277 = 1;\n        while (slt32(skip_threads_233277, 32)) {\n            bool thread_active_233278 = sle32(skip_threads_233277,\n                                              local_tid_233240 -\n                                              squot32(local_tid_233240, 32) *\n                                              32)",
                   " && ltid_in_bounds_233276;\n            \n            if (thread_active_233278) {\n                // read operands\n                {\n                    x_213869 = ((volatile __local\n                                 double *) red_arr_mem_233257)[sext_i32_i64(local_tid_233240) -\n                                                               sext_i32_i64(skip_threads_233277)];\n                    x_213870 = ((volatile __local\n                                 double *) red_arr_mem_233259)[sext_i32_i64(local_tid_233240) -\n                                                               sext_i32_i64(skip_threads_233277)];\n                    x_213871 = ((volatile __local\n                                 double *) red_arr_mem_233261)[sext_i32_i64(local_tid_233240) -\n                                                               sext_i32_i64(skip_threads_233277)];\n                }\n            }\n            // perform operation\n            {\n                bool inactive_233279 =\n                     slt64(srem64(sext_i32_i64(local_tid_233240), q_s_203493),\n                           sext_i32_i64(local_tid_233240) -\n                           sext_i32_i64(local_tid_233240 -\n                           skip_threads_233277));\n                \n                if (thread_active_233278 && inactive_233279) {\n                    x_213869 = x_213872;\n                    x_213870 = x_213873;\n                    x_213871 = x_213874;\n                }\n                if (thread_active_233278) {\n                    if (!inactive_233279) {\n                        double defunc_1_op_res_213875 = x_213869 + x_213872;\n                        double defunc_1_op_res_213876 = x_213870 + x_213873;\n                        double defunc_1_op_res_213877 = x_213871 + x_213874;\n                        \n                        x_213869 = defunc_1_op_res_213875;\n                        x_213870 = defunc_1_op_res_213876;\n                        x_213871 = defunc_1_op_res_213877;\n                    }\n    ",
                   "            }\n            }\n            if (sle32(wave_sizze_233242, skip_threads_233277)) {\n                barrier(CLK_LOCAL_MEM_FENCE);\n            }\n            if (thread_active_233278) {\n                // write result\n                {\n                    ((volatile __local\n                      double *) red_arr_mem_233257)[sext_i32_i64(local_tid_233240)] =\n                        x_213869;\n                    x_213872 = x_213869;\n                    ((volatile __local\n                      double *) red_arr_mem_233259)[sext_i32_i64(local_tid_233240)] =\n                        x_213870;\n                    x_213873 = x_213870;\n                    ((volatile __local\n                      double *) red_arr_mem_233261)[sext_i32_i64(local_tid_233240)] =\n                        x_213871;\n                    x_213874 = x_213871;\n                }\n            }\n            if (sle32(wave_sizze_233242, skip_threads_233277)) {\n                barrier(CLK_LOCAL_MEM_FENCE);\n            }\n            skip_threads_233277 *= 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_233240 - squot32(local_tid_233240, 32) * 32) == 31 &&\n            ltid_in_bounds_233276) {\n            ((volatile __local\n              double *) red_arr_mem_233257)[sext_i32_i64(squot32(local_tid_233240,\n                                                                 32))] =\n                x_213869;\n            ((volatile __local\n              double *) red_arr_mem_233259)[sext_i32_i64(squot32(local_tid_233240,\n                                                                 32))] =\n                x_213870;\n            ((volatile __local\n              double *) red_arr_mem_233261)[sext_i32_i64(squot32(local_tid_233240,\n                                                                 32))] =\n                x_213871;\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    // scan the first block, after whic",
                   "h offset 'i' contains carry-in for block 'i+1'\n    {\n        int32_t skip_threads_233280;\n        \n        // read input for in-block scan\n        {\n            if (squot32(local_tid_233240, 32) == 0 && ltid_in_bounds_233276) {\n                x_233270 = ((volatile __local\n                             double *) red_arr_mem_233257)[sext_i32_i64(local_tid_233240)];\n                x_233271 = ((volatile __local\n                             double *) red_arr_mem_233259)[sext_i32_i64(local_tid_233240)];\n                x_233272 = ((volatile __local\n                             double *) red_arr_mem_233261)[sext_i32_i64(local_tid_233240)];\n                if ((local_tid_233240 - squot32(local_tid_233240, 32) * 32) ==\n                    0) {\n                    x_233267 = x_233270;\n                    x_233268 = x_233271;\n                    x_233269 = x_233272;\n                }\n            }\n        }\n        // in-block scan (hopefully no barriers needed)\n        {\n            skip_threads_233280 = 1;\n            while (slt32(skip_threads_233280, 32)) {\n                bool thread_active_233281 = sle32(skip_threads_233280,\n                                                  local_tid_233240 -\n                                                  squot32(local_tid_233240,\n                                                          32) * 32) &&\n                     (squot32(local_tid_233240, 32) == 0 &&\n                      ltid_in_bounds_233276);\n                \n                if (thread_active_233281) {\n                    // read operands\n                    {\n                        x_233267 = ((volatile __local\n                                     double *) red_arr_mem_233257)[sext_i32_i64(local_tid_233240) -\n                                                                   sext_i32_i64(skip_threads_233280)];\n                        x_233268 = ((volatile __local\n                                     double *) red_arr_mem_233259)[sext_i32_i64(local_tid_233240) -\n         ",
                   "                                                          sext_i32_i64(skip_threads_233280)];\n                        x_233269 = ((volatile __local\n                                     double *) red_arr_mem_233261)[sext_i32_i64(local_tid_233240) -\n                                                                   sext_i32_i64(skip_threads_233280)];\n                    }\n                }\n                // perform operation\n                {\n                    bool inactive_233282 =\n                         slt64(srem64(sext_i32_i64(local_tid_233240 * 32 + 32 -\n                                      1), q_s_203493),\n                               sext_i32_i64(local_tid_233240 * 32 + 32 - 1) -\n                               sext_i32_i64((local_tid_233240 -\n                                             skip_threads_233280) * 32 + 32 -\n                               1));\n                    \n                    if (thread_active_233281 && inactive_233282) {\n                        x_233267 = x_233270;\n                        x_233268 = x_233271;\n                        x_233269 = x_233272;\n                    }\n                    if (thread_active_233281) {\n                        if (!inactive_233282) {\n                            double defunc_1_op_res_233273 = x_233267 + x_233270;\n                            double defunc_1_op_res_233274 = x_233268 + x_233271;\n                            double defunc_1_op_res_233275 = x_233269 + x_233272;\n                            \n                            x_233267 = defunc_1_op_res_233273;\n                            x_233268 = defunc_1_op_res_233274;\n                            x_233269 = defunc_1_op_res_233275;\n                        }\n                    }\n                }\n                if (sle32(wave_sizze_233242, skip_threads_233280)) {\n                    barrier(CLK_LOCAL_MEM_FENCE);\n                }\n                if (thread_active_233281) {\n                    // write result\n                    {\n             ",
                   "           ((volatile __local\n                          double *) red_arr_mem_233257)[sext_i32_i64(local_tid_233240)] =\n                            x_233267;\n                        x_233270 = x_233267;\n                        ((volatile __local\n                          double *) red_arr_mem_233259)[sext_i32_i64(local_tid_233240)] =\n                            x_233268;\n                        x_233271 = x_233268;\n                        ((volatile __local\n                          double *) red_arr_mem_233261)[sext_i32_i64(local_tid_233240)] =\n                            x_233269;\n                        x_233272 = x_233269;\n                    }\n                }\n                if (sle32(wave_sizze_233242, skip_threads_233280)) {\n                    barrier(CLK_LOCAL_MEM_FENCE);\n                }\n                skip_threads_233280 *= 2;\n            }\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    bool no_carry_in_233283 = squot32(local_tid_233240, 32) == 0 ||\n         !ltid_in_bounds_233276;\n    \n    // carry-in for every block except the first\n    {\n        // read operands\n        {\n            if (!no_carry_in_233283) {\n                x_213872 = x_213869;\n                x_213873 = x_213870;\n                x_213874 = x_213871;\n                x_213869 = ((__local\n                             double *) red_arr_mem_233257)[sext_i32_i64(squot32(local_tid_233240,\n                                                                                32)) -\n                                                           (int64_t) 1];\n                x_213870 = ((__local\n                             double *) red_arr_mem_233259)[sext_i32_i64(squot32(local_tid_233240,\n                                                                                32)) -\n                                                           (int64_t) 1];\n                x_213871 = ((__local\n                             double *) red_arr_mem_233261)[sext_i32_i64(squot32(local_tid_233240,\n      ",
                   "                                                                          32)) -\n                                                           (int64_t) 1];\n            }\n        }\n        // perform operation\n        {\n            bool inactive_233284 = slt64(srem64(sext_i32_i64(local_tid_233240),\n                                                q_s_203493),\n                                         sext_i32_i64(local_tid_233240) -\n                                         sext_i32_i64(squot32(local_tid_233240,\n                                                              32) * 32 - 1));\n            \n            if (!no_carry_in_233283) {\n                if (inactive_233284) {\n                    x_213869 = x_213872;\n                    x_213870 = x_213873;\n                    x_213871 = x_213874;\n                }\n            }\n            if (!no_carry_in_233283) {\n                if (!inactive_233284) {\n                    double defunc_1_op_res_213875 = x_213869 + x_213872;\n                    double defunc_1_op_res_213876 = x_213870 + x_213873;\n                    double defunc_1_op_res_213877 = x_213871 + x_213874;\n                    \n                    x_213869 = defunc_1_op_res_213875;\n                    x_213870 = defunc_1_op_res_213876;\n                    x_213871 = defunc_1_op_res_213877;\n                }\n            }\n        }\n        // write final result\n        {\n            if (!no_carry_in_233283) {\n                ((__local\n                  double *) red_arr_mem_233257)[sext_i32_i64(local_tid_233240)] =\n                    x_213869;\n                ((__local\n                  double *) red_arr_mem_233259)[sext_i32_i64(local_tid_233240)] =\n                    x_213870;\n                ((__local\n                  double *) red_arr_mem_233261)[sext_i32_i64(local_tid_233240)] =\n                    x_213871;\n            }\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    // restore correct values for first block\n    {\n        if (squot32(local_tid",
                   "_233240, 32) == 0 && ltid_in_bounds_233276) {\n            ((__local\n              double *) red_arr_mem_233257)[sext_i32_i64(local_tid_233240)] =\n                x_213872;\n            ((__local\n              double *) red_arr_mem_233259)[sext_i32_i64(local_tid_233240)] =\n                x_213873;\n            ((__local\n              double *) red_arr_mem_233261)[sext_i32_i64(local_tid_233240)] =\n                x_213874;\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    barrier(CLK_LOCAL_MEM_FENCE);\n    for (int64_t i_233285 = 0; i_233285 < sdiv_up64(s_n_m_203636 -\n                                                    sext_i32_i64(local_tid_233240),\n                                                    computed_group_sizze_213705);\n         i_233285++) {\n        double tmp_233286;\n        \n        tmp_233286 = ((__local double *) red_arr_mem_233257)[q_s_203493 -\n                                                             (int64_t) 1 +\n                                                             (i_233285 *\n                                                              computed_group_sizze_213705 +\n                                                              sext_i32_i64(local_tid_233240)) *\n                                                             q_s_203493];\n        ((__local double *) color_232002)[i_233285 *\n                                          computed_group_sizze_213705 +\n                                          sext_i32_i64(local_tid_233240)] =\n            tmp_233286;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    for (int64_t i_233287 = 0; i_233287 < sdiv_up64(s_n_m_203636 -\n                                                    sext_i32_i64(local_tid_233240),\n                                                    computed_group_sizze_213705);\n         i_233287++) {\n        double tmp_233288;\n        \n        tmp_233288 = ((__local double *) red_arr_mem_233259)[q_s_203493 -\n                                                             (int64_t) 1 +\n          ",
                   "                                                   (i_233287 *\n                                                              computed_group_sizze_213705 +\n                                                              sext_i32_i64(local_tid_233240)) *\n                                                             q_s_203493];\n        ((__local double *) color_231997)[i_233287 *\n                                          computed_group_sizze_213705 +\n                                          sext_i32_i64(local_tid_233240)] =\n            tmp_233288;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    for (int64_t i_233289 = 0; i_233289 < sdiv_up64(s_n_m_203636 -\n                                                    sext_i32_i64(local_tid_233240),\n                                                    computed_group_sizze_213705);\n         i_233289++) {\n        double tmp_233290;\n        \n        tmp_233290 = ((__local double *) red_arr_mem_233261)[q_s_203493 -\n                                                             (int64_t) 1 +\n                                                             (i_233289 *\n                                                              computed_group_sizze_213705 +\n                                                              sext_i32_i64(local_tid_233240)) *\n                                                             q_s_203493];\n        ((__local double *) color_231996)[i_233289 *\n                                          computed_group_sizze_213705 +\n                                          sext_i32_i64(local_tid_233240)] =\n            tmp_233290;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int64_t gtid_213906 = sext_i32_i64(sext_i64_i32(ltid_pre_233244));\n    int32_t phys_tid_213907 = local_tid_233240;\n    \n    if (slt64(gtid_213906, s_n_m_203636)) {\n        bool index_primexp_228725 = gtid_213906 == (int64_t) 0;\n        double defunc_2_reduce_res_213910;\n        \n        defunc_2_reduce_res_213910 = ((__local",
                   "\n                                       double *) color_232002)[gtid_213906];\n        \n        double defunc_2_reduce_res_213911;\n        \n        defunc_2_reduce_res_213911 = ((__local\n                                       double *) color_231997)[gtid_213906];\n        \n        double defunc_2_reduce_res_213912;\n        \n        defunc_2_reduce_res_213912 = ((__local\n                                       double *) color_231996)[gtid_213906];\n        \n        double x_213913 = defunc_2_reduce_res_213910 *\n               defunc_2_reduce_res_213912;\n        double y_213914 = defunc_2_reduce_res_213911 *\n               defunc_2_reduce_res_213911;\n        double y_213915 = x_213913 - y_213914;\n        double det1_213916 = 1.0 / y_213915;\n        double a11_213917 = defunc_2_reduce_res_213912 * det1_213916;\n        double x_213918 = 0.0 - defunc_2_reduce_res_213911;\n        double b11_213919 = det1_213916 * x_213918;\n        double c11_213920 = defunc_2_reduce_res_213910 * det1_213916;\n        int64_t defunc_0_m_fun_res_213921;\n        \n        if (index_primexp_228725) {\n            defunc_0_m_fun_res_213921 = (int64_t) 0;\n        } else {\n            int64_t y_213922 = sub64(s_n_m_203636, (int64_t) 1);\n            bool cond_213923 = gtid_213906 == y_213922;\n            int64_t defunc_0_m_fun_res_f_res_213924;\n            \n            if (cond_213923) {\n                int64_t defunc_0_m_fun_res_f_res_t_res_213925 =\n                        sub64(pad_css_len_203632, (int64_t) 1);\n                \n                defunc_0_m_fun_res_f_res_213924 =\n                    defunc_0_m_fun_res_f_res_t_res_213925;\n            } else {\n                int64_t x_213926 = sub64(gtid_213906, (int64_t) 1);\n                int64_t x_213927 = mul64(jump_s_203499, x_213926);\n                int64_t min_arg_213928 = add64((int64_t) 1, x_213927);\n                int64_t min_res_213929 = smin64(defunc_0_f_res_203631,\n                                                min_arg_213928);\n          ",
                   "      \n                defunc_0_m_fun_res_f_res_213924 = min_res_213929;\n            }\n            defunc_0_m_fun_res_213921 = defunc_0_m_fun_res_f_res_213924;\n        }\n        ((__local double *) color_232001)[gtid_213906] = a11_213917;\n        ((__local double *) color_232000)[gtid_213906] = b11_213919;\n        ((__local double *) color_231999)[gtid_213906] = c11_213920;\n        ((__local int64_t *) color_231998)[gtid_213906] =\n            defunc_0_m_fun_res_213921;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int64_t gtid_213932 = sext_i32_i64(sext_i64_i32(ltid_pre_233247));\n    int64_t gtid_213933 = sext_i32_i64(sext_i64_i32(ltid_pre_233248));\n    int32_t phys_tid_213934 = local_tid_233240;\n    __local unsigned char *red_arr_mem_233291;\n    \n    red_arr_mem_233291 = (__local\n                          unsigned char *) red_arr_mem_233291_backing_11;\n    \n    __local unsigned char *red_arr_mem_233293;\n    \n    red_arr_mem_233293 = (__local\n                          unsigned char *) red_arr_mem_233293_backing_12;\n    if (slt64(gtid_213932, s_n_m_203636) && slt64(gtid_213933, q_s_203493)) {\n        int64_t x_213941;\n        \n        x_213941 = ((__global int64_t *) ext_mem_229363)[gtid_213834 *\n                                                         (s_n_m_203636 *\n                                                          n_p_203492) +\n                                                         gtid_213835 *\n                                                         s_n_m_203636 +\n                                                         gtid_213932];\n        \n        double x_213942;\n        \n        x_213942 = ((__global double *) ext_mem_229362)[gtid_213834 *\n                                                        (s_n_m_203636 *\n                                                         n_p_203492) +\n                                                        gtid_213835 *\n                                                        s_n_m_203636 +\n                          ",
                   "                              gtid_213932];\n        \n        double a11_213943;\n        \n        a11_213943 = ((__local double *) color_232001)[gtid_213932];\n        \n        double b11_213944;\n        \n        b11_213944 = ((__local double *) color_232000)[gtid_213932];\n        \n        double c11_213945;\n        \n        c11_213945 = ((__local double *) color_231999)[gtid_213932];\n        \n        int64_t defunc_0_m_fun_res_213946;\n        \n        defunc_0_m_fun_res_213946 = ((__local\n                                      int64_t *) color_231998)[gtid_213932];\n        \n        bool cond_213948 = sle64(x_213843, gtid_213933);\n        int64_t defunc_0_f_res_213949;\n        \n        if (cond_213948) {\n            defunc_0_f_res_213949 = (int64_t) 0;\n        } else {\n            int64_t i_213950 = add64(gtid_213933, x_213941);\n            int64_t defunc_0_add_arg_213951;\n            \n            defunc_0_add_arg_213951 = ((__global\n                                        int64_t *) ext_mem_229265)[gtid_213834 *\n                                                                   (defunc_0_f_res_203631 *\n                                                                    n_p_203492) +\n                                                                   gtid_213835 *\n                                                                   defunc_0_f_res_203631 +\n                                                                   i_213950];\n            \n            int64_t defunc_1_add_res_213952 = add64((int64_t) 1,\n                                                    defunc_0_add_arg_213951);\n            \n            defunc_0_f_res_213949 = defunc_1_add_res_213952;\n        }\n        \n        double defunc_0_f_res_213953;\n        \n        if (cond_213948) {\n            defunc_0_f_res_213953 = 0.0;\n        } else {\n            int64_t i_213954 = add64(gtid_213933, x_213941);\n            double defunc_0_add_arg_213955;\n            \n            defunc_0_add_arg_213955 = ((__global\n  ",
                   "                                      double *) mem_229531)[gtid_213834 *\n                                                              (defunc_0_f_res_203631 *\n                                                               n_p_203492) +\n                                                              gtid_213835 *\n                                                              defunc_0_f_res_203631 +\n                                                              i_213954];\n            defunc_0_f_res_213953 = defunc_0_add_arg_213955;\n        }\n        \n        int64_t binop_p_213956 = sub64(defunc_0_f_res_213949,\n                                       defunc_0_m_fun_res_213946);\n        double defunc_0_f_res_213957 = sitofp_i64_f64(binop_p_213956);\n        double abs_res_213958 = fabs(defunc_0_f_res_213957);\n        double tmp1_213959 = abs_res_213958 / x_213942;\n        double x_213960 = tmp1_213959 * tmp1_213959;\n        double y_213961 = tmp1_213959 * x_213960;\n        double tmp2_213962 = 1.0 - y_213961;\n        double x_213963 = tmp2_213962 * tmp2_213962;\n        double tmp3_213964 = tmp2_213962 * x_213963;\n        double tmp4_213965 = defunc_0_f_res_213953 * tmp3_213964;\n        double defunc_1_f_res_213966 = defunc_0_f_res_213957 * tmp4_213965;\n        double defunc_0_f_res_213967;\n        \n        if (cond_213948) {\n            defunc_0_f_res_213967 = 0.0;\n        } else {\n            int64_t i_213968 = add64(gtid_213933, x_213941);\n            double defunc_0_add_arg_213969;\n            \n            defunc_0_add_arg_213969 = ((__global\n                                        double *) mem_229526)[gtid_213834 *\n                                                              (defunc_0_f_res_203631 *\n                                                               n_p_203492) +\n                                                              gtid_213835 *\n                                                              defunc_0_f_res_203631 +\n                                 ",
                   "                             i_213968];\n            defunc_0_f_res_213967 = defunc_0_add_arg_213969;\n        }\n        \n        double x_213970 = a11_213943 * tmp4_213965;\n        double y_213971 = b11_213944 * defunc_1_f_res_213966;\n        double x_213972 = x_213970 + y_213971;\n        double defunc_9_fit_fun_res_213973 = defunc_0_f_res_213967 * x_213972;\n        double x_213974 = b11_213944 * tmp4_213965;\n        double y_213975 = c11_213945 * defunc_1_f_res_213966;\n        double x_213976 = x_213974 + y_213975;\n        double defunc_9_slope_fun_res_213977 = defunc_0_f_res_213967 * x_213976;\n        \n        ((__local double *) red_arr_mem_233291)[gtid_213932 * q_s_203493 +\n                                                gtid_213933] =\n            defunc_9_fit_fun_res_213973;\n        ((__local double *) red_arr_mem_233293)[gtid_213932 * q_s_203493 +\n                                                gtid_213933] =\n            defunc_9_slope_fun_res_213977;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int64_t dims_flat_233295 = s_n_m_203636 * q_s_203493;\n    double x_213935;\n    double x_213936;\n    double x_213937;\n    double x_213938;\n    double x_233298;\n    double x_233299;\n    double x_233300;\n    double x_233301;\n    bool ltid_in_bounds_233304 = slt64(sext_i32_i64(local_tid_233240),\n                                       s_n_m_203636 * q_s_203493);\n    int32_t skip_threads_233305;\n    \n    // read input for in-block scan\n    {\n        if (ltid_in_bounds_233304) {\n            x_213937 = ((volatile __local\n                         double *) red_arr_mem_233291)[sext_i32_i64(local_tid_233240)];\n            x_213938 = ((volatile __local\n                         double *) red_arr_mem_233293)[sext_i32_i64(local_tid_233240)];\n            if ((local_tid_233240 - squot32(local_tid_233240, 32) * 32) == 0) {\n                x_213935 = x_213937;\n                x_213936 = x_213938;\n            }\n        }\n    }\n    // in-block scan (hopefully no barriers needed)\n    {\n ",
                   "       skip_threads_233305 = 1;\n        while (slt32(skip_threads_233305, 32)) {\n            bool thread_active_233306 = sle32(skip_threads_233305,\n                                              local_tid_233240 -\n                                              squot32(local_tid_233240, 32) *\n                                              32) && ltid_in_bounds_233304;\n            \n            if (thread_active_233306) {\n                // read operands\n                {\n                    x_213935 = ((volatile __local\n                                 double *) red_arr_mem_233291)[sext_i32_i64(local_tid_233240) -\n                                                               sext_i32_i64(skip_threads_233305)];\n                    x_213936 = ((volatile __local\n                                 double *) red_arr_mem_233293)[sext_i32_i64(local_tid_233240) -\n                                                               sext_i32_i64(skip_threads_233305)];\n                }\n            }\n            // perform operation\n            {\n                bool inactive_233307 =\n                     slt64(srem64(sext_i32_i64(local_tid_233240), q_s_203493),\n                           sext_i32_i64(local_tid_233240) -\n                           sext_i32_i64(local_tid_233240 -\n                           skip_threads_233305));\n                \n                if (thread_active_233306 && inactive_233307) {\n                    x_213935 = x_213937;\n                    x_213936 = x_213938;\n                }\n                if (thread_active_233306) {\n                    if (!inactive_233307) {\n                        double defunc_1_op_res_213939 = x_213935 + x_213937;\n                        double defunc_1_op_res_213940 = x_213936 + x_213938;\n                        \n                        x_213935 = defunc_1_op_res_213939;\n                        x_213936 = defunc_1_op_res_213940;\n                    }\n                }\n            }\n            if (sle32(wave_sizze_233242, skip_threads_",
                   "233305)) {\n                barrier(CLK_LOCAL_MEM_FENCE);\n            }\n            if (thread_active_233306) {\n                // write result\n                {\n                    ((volatile __local\n                      double *) red_arr_mem_233291)[sext_i32_i64(local_tid_233240)] =\n                        x_213935;\n                    x_213937 = x_213935;\n                    ((volatile __local\n                      double *) red_arr_mem_233293)[sext_i32_i64(local_tid_233240)] =\n                        x_213936;\n                    x_213938 = x_213936;\n                }\n            }\n            if (sle32(wave_sizze_233242, skip_threads_233305)) {\n                barrier(CLK_LOCAL_MEM_FENCE);\n            }\n            skip_threads_233305 *= 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_233240 - squot32(local_tid_233240, 32) * 32) == 31 &&\n            ltid_in_bounds_233304) {\n            ((volatile __local\n              double *) red_arr_mem_233291)[sext_i32_i64(squot32(local_tid_233240,\n                                                                 32))] =\n                x_213935;\n            ((volatile __local\n              double *) red_arr_mem_233293)[sext_i32_i64(squot32(local_tid_233240,\n                                                                 32))] =\n                x_213936;\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_233308;\n        \n        // read input for in-block scan\n        {\n            if (squot32(local_tid_233240, 32) == 0 && ltid_in_bounds_233304) {\n                x_233300 = ((volatile __local\n                             double *) red_arr_mem_233291)[sext_i32_i64(local_tid_233240)];\n                x_233301 = ((volatile __local\n                             double *) red_arr_mem_233293)[sext_i32_i64(local_tid_2",
                   "33240)];\n                if ((local_tid_233240 - squot32(local_tid_233240, 32) * 32) ==\n                    0) {\n                    x_233298 = x_233300;\n                    x_233299 = x_233301;\n                }\n            }\n        }\n        // in-block scan (hopefully no barriers needed)\n        {\n            skip_threads_233308 = 1;\n            while (slt32(skip_threads_233308, 32)) {\n                bool thread_active_233309 = sle32(skip_threads_233308,\n                                                  local_tid_233240 -\n                                                  squot32(local_tid_233240,\n                                                          32) * 32) &&\n                     (squot32(local_tid_233240, 32) == 0 &&\n                      ltid_in_bounds_233304);\n                \n                if (thread_active_233309) {\n                    // read operands\n                    {\n                        x_233298 = ((volatile __local\n                                     double *) red_arr_mem_233291)[sext_i32_i64(local_tid_233240) -\n                                                                   sext_i32_i64(skip_threads_233308)];\n                        x_233299 = ((volatile __local\n                                     double *) red_arr_mem_233293)[sext_i32_i64(local_tid_233240) -\n                                                                   sext_i32_i64(skip_threads_233308)];\n                    }\n                }\n                // perform operation\n                {\n                    bool inactive_233310 =\n                         slt64(srem64(sext_i32_i64(local_tid_233240 * 32 + 32 -\n                                      1), q_s_203493),\n                               sext_i32_i64(local_tid_233240 * 32 + 32 - 1) -\n                               sext_i32_i64((local_tid_233240 -\n                                             skip_threads_233308) * 32 + 32 -\n                               1));\n                    \n                    if (thread",
                   "_active_233309 && inactive_233310) {\n                        x_233298 = x_233300;\n                        x_233299 = x_233301;\n                    }\n                    if (thread_active_233309) {\n                        if (!inactive_233310) {\n                            double defunc_1_op_res_233302 = x_233298 + x_233300;\n                            double defunc_1_op_res_233303 = x_233299 + x_233301;\n                            \n                            x_233298 = defunc_1_op_res_233302;\n                            x_233299 = defunc_1_op_res_233303;\n                        }\n                    }\n                }\n                if (sle32(wave_sizze_233242, skip_threads_233308)) {\n                    barrier(CLK_LOCAL_MEM_FENCE);\n                }\n                if (thread_active_233309) {\n                    // write result\n                    {\n                        ((volatile __local\n                          double *) red_arr_mem_233291)[sext_i32_i64(local_tid_233240)] =\n                            x_233298;\n                        x_233300 = x_233298;\n                        ((volatile __local\n                          double *) red_arr_mem_233293)[sext_i32_i64(local_tid_233240)] =\n                            x_233299;\n                        x_233301 = x_233299;\n                    }\n                }\n                if (sle32(wave_sizze_233242, skip_threads_233308)) {\n                    barrier(CLK_LOCAL_MEM_FENCE);\n                }\n                skip_threads_233308 *= 2;\n            }\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    bool no_carry_in_233311 = squot32(local_tid_233240, 32) == 0 ||\n         !ltid_in_bounds_233304;\n    \n    // carry-in for every block except the first\n    {\n        // read operands\n        {\n            if (!no_carry_in_233311) {\n                x_213937 = x_213935;\n                x_213938 = x_213936;\n                x_213935 = ((__local\n                             double *) red_arr_mem_233291)[sext_i32",
                   "_i64(squot32(local_tid_233240,\n                                                                                32)) -\n                                                           (int64_t) 1];\n                x_213936 = ((__local\n                             double *) red_arr_mem_233293)[sext_i32_i64(squot32(local_tid_233240,\n                                                                                32)) -\n                                                           (int64_t) 1];\n            }\n        }\n        // perform operation\n        {\n            bool inactive_233312 = slt64(srem64(sext_i32_i64(local_tid_233240),\n                                                q_s_203493),\n                                         sext_i32_i64(local_tid_233240) -\n                                         sext_i32_i64(squot32(local_tid_233240,\n                                                              32) * 32 - 1));\n            \n            if (!no_carry_in_233311) {\n                if (inactive_233312) {\n                    x_213935 = x_213937;\n                    x_213936 = x_213938;\n                }\n            }\n            if (!no_carry_in_233311) {\n                if (!inactive_233312) {\n                    double defunc_1_op_res_213939 = x_213935 + x_213937;\n                    double defunc_1_op_res_213940 = x_213936 + x_213938;\n                    \n                    x_213935 = defunc_1_op_res_213939;\n                    x_213936 = defunc_1_op_res_213940;\n                }\n            }\n        }\n        // write final result\n        {\n            if (!no_carry_in_233311) {\n                ((__local\n                  double *) red_arr_mem_233291)[sext_i32_i64(local_tid_233240)] =\n                    x_213935;\n                ((__local\n                  double *) red_arr_mem_233293)[sext_i32_i64(local_tid_233240)] =\n                    x_213936;\n            }\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    // restore correct values for first block\n    {\n    ",
                   "    if (squot32(local_tid_233240, 32) == 0 && ltid_in_bounds_233304) {\n            ((__local\n              double *) red_arr_mem_233291)[sext_i32_i64(local_tid_233240)] =\n                x_213937;\n            ((__local\n              double *) red_arr_mem_233293)[sext_i32_i64(local_tid_233240)] =\n                x_213938;\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    barrier(CLK_LOCAL_MEM_FENCE);\n    for (int64_t i_233313 = 0; i_233313 < sdiv_up64(s_n_m_203636 -\n                                                    sext_i32_i64(local_tid_233240),\n                                                    computed_group_sizze_213705);\n         i_233313++) {\n        double tmp_233314;\n        \n        tmp_233314 = ((__local double *) red_arr_mem_233291)[q_s_203493 -\n                                                             (int64_t) 1 +\n                                                             (i_233313 *\n                                                              computed_group_sizze_213705 +\n                                                              sext_i32_i64(local_tid_233240)) *\n                                                             q_s_203493];\n        ((__local double *) color_231997)[i_233313 *\n                                          computed_group_sizze_213705 +\n                                          sext_i32_i64(local_tid_233240)] =\n            tmp_233314;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    for (int64_t i_233315 = 0; i_233315 < sdiv_up64(s_n_m_203636 -\n                                                    sext_i32_i64(local_tid_233240),\n                                                    computed_group_sizze_213705);\n         i_233315++) {\n        double tmp_233316;\n        \n        tmp_233316 = ((__local double *) red_arr_mem_233293)[q_s_203493 -\n                                                             (int64_t) 1 +\n                                                             (i_233315 *\n                                      ",
                   "                        computed_group_sizze_213705 +\n                                                              sext_i32_i64(local_tid_233240)) *\n                                                             q_s_203493];\n        ((__local double *) color_231996)[i_233315 *\n                                          computed_group_sizze_213705 +\n                                          sext_i32_i64(local_tid_233240)] =\n            tmp_233316;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    barrier(CLK_LOCAL_MEM_FENCE);\n    for (int64_t i_233317 = 0; i_233317 < sdiv_up64(s_n_m_203636 -\n                                                    sext_i32_i64(local_tid_233240),\n                                                    computed_group_sizze_213705);\n         i_233317++) {\n        double tmp_233318;\n        \n        tmp_233318 = ((__local double *) color_231997)[i_233317 *\n                                                       computed_group_sizze_213705 +\n                                                       sext_i32_i64(local_tid_233240)];\n        ((__global double *) mem_229951)[gtid_213834 * (s_n_m_203636 *\n                                                        n_p_203492) +\n                                         gtid_213835 * s_n_m_203636 +\n                                         (i_233317 *\n                                          computed_group_sizze_213705 +\n                                          sext_i32_i64(local_tid_233240))] =\n            tmp_233318;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    for (int64_t i_233319 = 0; i_233319 < sdiv_up64(s_n_m_203636 -\n                                                    sext_i32_i64(local_tid_233240),\n                                                    computed_group_sizze_213705);\n         i_233319++) {\n        double tmp_233320;\n        \n        tmp_233320 = ((__local double *) color_231996)[i_233319 *\n                                                       computed_group_sizze_213705 +\n                          ",
                   "                             sext_i32_i64(local_tid_233240)];\n        ((__global double *) mem_229956)[gtid_213834 * (s_n_m_203636 *\n                                                        n_p_203492) +\n                                         gtid_213835 * s_n_m_203636 +\n                                         (i_233319 *\n                                          computed_group_sizze_213705 +\n                                          sext_i32_i64(local_tid_233240))] =\n            tmp_233320;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n  error_6:\n    return;\n}\n__kernel void mainzisegmap_intragroup_216411(__global int *global_failure,\n                                             __local volatile\n                                             int64_t *red_arr_mem_233688_backing_aligned_0,\n                                             __local volatile\n                                             int64_t *red_arr_mem_233686_backing_aligned_1,\n                                             __local volatile\n                                             int64_t *red_arr_mem_233644_backing_aligned_2,\n                                             __local volatile\n                                             int64_t *red_arr_mem_233642_backing_aligned_3,\n                                             __local volatile\n                                             int64_t *red_arr_mem_233640_backing_aligned_4,\n                                             __local volatile\n                                             int64_t *red_arr_mem_233638_backing_aligned_5,\n                                             __local volatile\n                                             int64_t *red_arr_mem_233636_backing_aligned_6,\n                                             __local volatile\n                                             int64_t *color_232019_backing_aligned_7,\n                                             __local volatile\n                                             int64_t *color_232018_b",
                   "acking_aligned_8,\n                                             __local volatile\n                                             int64_t *color_232017_backing_aligned_9,\n                                             __local volatile\n                                             int64_t *color_232016_backing_aligned_10,\n                                             __local volatile\n                                             int64_t *color_232015_backing_aligned_11,\n                                             __local volatile\n                                             int64_t *color_232014_backing_aligned_12,\n                                             __local volatile\n                                             int64_t *color_232013_backing_aligned_13,\n                                             __local volatile\n                                             int64_t *color_232012_backing_aligned_14,\n                                             __local volatile\n                                             int64_t *color_232011_backing_aligned_15,\n                                             __local volatile\n                                             int64_t *color_232010_backing_aligned_16,\n                                             __local volatile\n                                             int64_t *color_232009_backing_aligned_17,\n                                             __local volatile\n                                             int64_t *color_232008_backing_aligned_18,\n                                             int64_t n_p_203492,\n                                             int64_t q_s_203493,\n                                             int64_t jump_s_203499,\n                                             int64_t partition_sizze_203577,\n                                             int64_t defunc_0_f_res_203631,\n                                             int64_t pad_css_len_203632,\n                                             int64_t s_n_m_203636,\n  ",
                   "                                           int64_t computed_group_sizze_216248,\n                                             __global\n                                             unsigned char *ext_mem_229264,\n                                             __global\n                                             unsigned char *ext_mem_229265,\n                                             __global\n                                             unsigned char *ext_mem_229362,\n                                             __global\n                                             unsigned char *ext_mem_229363,\n                                             __global unsigned char *mem_229526,\n                                             __global unsigned char *mem_229531,\n                                             __global unsigned char *mem_230290,\n                                             __global unsigned char *mem_230295)\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_233688_backing_18 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_233688_backing_aligned_0;\n    __local volatile unsigned char *restrict red_arr_mem_233686_backing_17 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_233686_backing_aligned_1;\n    __local volatile unsigned char *restrict red_arr_mem_233644_backing_16 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_233644_backing_aligned_2;\n    __local volatile unsigned char *restrict red_arr_mem_233642_backing_15 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_233642_backing_aligned_3;\n    __local volatile unsigned char *restrict red_arr_mem_233640_backing_14 =\n                       ",
                   "            (__local volatile\n                                    unsigned char *) red_arr_mem_233640_backing_aligned_4;\n    __local volatile unsigned char *restrict red_arr_mem_233638_backing_13 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_233638_backing_aligned_5;\n    __local volatile unsigned char *restrict red_arr_mem_233636_backing_12 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_233636_backing_aligned_6;\n    __local volatile unsigned char *restrict color_232019_backing_11 =\n                                   (__local volatile\n                                    unsigned char *) color_232019_backing_aligned_7;\n    __local volatile unsigned char *restrict color_232018_backing_10 =\n                                   (__local volatile\n                                    unsigned char *) color_232018_backing_aligned_8;\n    __local volatile unsigned char *restrict color_232017_backing_9 =\n                                   (__local volatile\n                                    unsigned char *) color_232017_backing_aligned_9;\n    __local volatile unsigned char *restrict color_232016_backing_8 =\n                                   (__local volatile\n                                    unsigned char *) color_232016_backing_aligned_10;\n    __local volatile unsigned char *restrict color_232015_backing_7 =\n                                   (__local volatile\n                                    unsigned char *) color_232015_backing_aligned_11;\n    __local volatile unsigned char *restrict color_232014_backing_6 =\n                                   (__local volatile\n                                    unsigned char *) color_232014_backing_aligned_12;\n    __local volatile unsigned char *restrict color_232013_backing_5 =\n                                   (__local volatile\n                                    unsigned char *) color_23",
                   "2013_backing_aligned_13;\n    __local volatile unsigned char *restrict color_232012_backing_4 =\n                                   (__local volatile\n                                    unsigned char *) color_232012_backing_aligned_14;\n    __local volatile unsigned char *restrict color_232011_backing_3 =\n                                   (__local volatile\n                                    unsigned char *) color_232011_backing_aligned_15;\n    __local volatile unsigned char *restrict color_232010_backing_2 =\n                                   (__local volatile\n                                    unsigned char *) color_232010_backing_aligned_16;\n    __local volatile unsigned char *restrict color_232009_backing_1 =\n                                   (__local volatile\n                                    unsigned char *) color_232009_backing_aligned_17;\n    __local volatile unsigned char *restrict color_232008_backing_0 =\n                                   (__local volatile\n                                    unsigned char *) color_232008_backing_aligned_18;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_233618;\n    int32_t local_tid_233619;\n    int64_t group_sizze_233622;\n    int32_t wave_sizze_233621;\n    int32_t group_tid_233620;\n    \n    global_tid_233618 = get_global_id(0);\n    local_tid_233619 = get_local_id(0);\n    group_sizze_233622 = get_local_size(0);\n    wave_sizze_233621 = LOCKSTEP_WIDTH;\n    group_tid_233620 = get_group_id(0);\n    \n    int32_t phys_tid_216411 = group_tid_233620;\n    int64_t slice_233624 = s_n_m_203636;\n    int64_t ltid_pre_233623 = sext_i32_i64(local_tid_233619);\n    int64_t remnant_233625 = sext_i32_i64(local_tid_233619) - ltid_pre_233623;\n    int64_t slice_233628 = q_s_203493;\n    int64_t slice_233629 = s_n_m_203636 * slice_233628;\n    int64_t ltid_pre_233626 = squot64(sext_i32_i64(local_tid_233619),\n                                      slice_233628);\n    int64_t remnant_233630 = sext_i32_i64(local_tid_2336",
                   "19) - ltid_pre_233626 *\n            slice_233628;\n    int64_t ltid_pre_233627 = remnant_233630;\n    int64_t remnant_233631 = remnant_233630 - ltid_pre_233627;\n    int64_t slice_233632 = n_p_203492;\n    int64_t slice_233633 = partition_sizze_203577 * slice_233632;\n    int64_t gtid_216409 = squot64(sext_i32_i64(group_tid_233620), slice_233632);\n    int64_t remnant_233634 = sext_i32_i64(group_tid_233620) - gtid_216409 *\n            slice_233632;\n    int64_t gtid_216410 = remnant_233634;\n    int64_t remnant_233635 = remnant_233634 - gtid_216410;\n    __local unsigned char *color_232008;\n    \n    color_232008 = (__local unsigned char *) color_232008_backing_0;\n    \n    __local unsigned char *color_232009;\n    \n    color_232009 = (__local unsigned char *) color_232009_backing_1;\n    \n    __local unsigned char *color_232010;\n    \n    color_232010 = (__local unsigned char *) color_232010_backing_2;\n    \n    __local unsigned char *color_232011;\n    \n    color_232011 = (__local unsigned char *) color_232011_backing_3;\n    \n    __local unsigned char *color_232012;\n    \n    color_232012 = (__local unsigned char *) color_232012_backing_4;\n    \n    __local unsigned char *color_232013;\n    \n    color_232013 = (__local unsigned char *) color_232013_backing_5;\n    \n    __local unsigned char *color_232014;\n    \n    color_232014 = (__local unsigned char *) color_232014_backing_6;\n    \n    __local unsigned char *color_232015;\n    \n    color_232015 = (__local unsigned char *) color_232015_backing_7;\n    \n    __local unsigned char *color_232016;\n    \n    color_232016 = (__local unsigned char *) color_232016_backing_8;\n    \n    __local unsigned char *color_232017;\n    \n    color_232017 = (__local unsigned char *) color_232017_backing_9;\n    \n    __local unsigned char *color_232018;\n    \n    color_232018 = (__local unsigned char *) color_232018_backing_10;\n    \n    __local unsigned char *color_232019;\n    \n    color_232019 = (__local unsigned char *) color_232019_backing_11;\n    \n    int64_",
                   "t x_216418;\n    \n    x_216418 = ((__global int64_t *) ext_mem_229264)[gtid_216409 * n_p_203492 +\n                                                     gtid_216410];\n    \n    int64_t gtid_216425 = sext_i32_i64(sext_i64_i32(ltid_pre_233623));\n    int32_t phys_tid_216426 = local_tid_233619;\n    \n    if (slt64(gtid_216425, s_n_m_203636)) {\n        bool cond_216428 = gtid_216425 == (int64_t) 0;\n        int64_t defunc_0_m_fun_res_216429;\n        \n        if (cond_216428) {\n            defunc_0_m_fun_res_216429 = (int64_t) 0;\n        } else {\n            int64_t y_216430 = sub64(s_n_m_203636, (int64_t) 1);\n            bool cond_216431 = gtid_216425 == y_216430;\n            int64_t defunc_0_m_fun_res_f_res_216432;\n            \n            if (cond_216431) {\n                int64_t defunc_0_m_fun_res_f_res_t_res_216433 =\n                        sub64(pad_css_len_203632, (int64_t) 1);\n                \n                defunc_0_m_fun_res_f_res_216432 =\n                    defunc_0_m_fun_res_f_res_t_res_216433;\n            } else {\n                int64_t x_216434 = sub64(gtid_216425, (int64_t) 1);\n                int64_t x_216435 = mul64(jump_s_203499, x_216434);\n                int64_t min_arg_216436 = add64((int64_t) 1, x_216435);\n                int64_t min_res_216437 = smin64(defunc_0_f_res_203631,\n                                                min_arg_216436);\n                \n                defunc_0_m_fun_res_f_res_216432 = min_res_216437;\n            }\n            defunc_0_m_fun_res_216429 = defunc_0_m_fun_res_f_res_216432;\n        }\n        ((__local int64_t *) color_232010)[gtid_216425] =\n            defunc_0_m_fun_res_216429;\n        ((__local bool *) color_232019)[gtid_216425] = cond_216428;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int64_t gtid_216443 = sext_i32_i64(sext_i64_i32(ltid_pre_233626));\n    int64_t gtid_216444 = sext_i32_i64(sext_i64_i32(ltid_pre_233627));\n    int32_t phys_tid_216445 = local_tid_233619;\n    __local unsigned char *red_arr_mem_23363",
                   "6;\n    \n    red_arr_mem_233636 = (__local\n                          unsigned char *) red_arr_mem_233636_backing_12;\n    \n    __local unsigned char *red_arr_mem_233638;\n    \n    red_arr_mem_233638 = (__local\n                          unsigned char *) red_arr_mem_233638_backing_13;\n    \n    __local unsigned char *red_arr_mem_233640;\n    \n    red_arr_mem_233640 = (__local\n                          unsigned char *) red_arr_mem_233640_backing_14;\n    \n    __local unsigned char *red_arr_mem_233642;\n    \n    red_arr_mem_233642 = (__local\n                          unsigned char *) red_arr_mem_233642_backing_15;\n    \n    __local unsigned char *red_arr_mem_233644;\n    \n    red_arr_mem_233644 = (__local\n                          unsigned char *) red_arr_mem_233644_backing_16;\n    if (slt64(gtid_216443, s_n_m_203636) && slt64(gtid_216444, q_s_203493)) {\n        int64_t x_216461;\n        \n        x_216461 = ((__global int64_t *) ext_mem_229363)[gtid_216409 *\n                                                         (s_n_m_203636 *\n                                                          n_p_203492) +\n                                                         gtid_216410 *\n                                                         s_n_m_203636 +\n                                                         gtid_216443];\n        \n        double x_216462;\n        \n        x_216462 = ((__global double *) ext_mem_229362)[gtid_216409 *\n                                                        (s_n_m_203636 *\n                                                         n_p_203492) +\n                                                        gtid_216410 *\n                                                        s_n_m_203636 +\n                                                        gtid_216443];\n        \n        int64_t defunc_0_m_fun_res_216463;\n        \n        defunc_0_m_fun_res_216463 = ((__local\n                                      int64_t *) color_232010)[gtid_216443];\n        \n        bool cond_216",
                   "465 = sle64(x_216418, gtid_216444);\n        int64_t defunc_0_f_res_216466;\n        \n        if (cond_216465) {\n            defunc_0_f_res_216466 = (int64_t) 0;\n        } else {\n            int64_t i_216467 = add64(gtid_216444, x_216461);\n            int64_t defunc_0_add_arg_216468;\n            \n            defunc_0_add_arg_216468 = ((__global\n                                        int64_t *) ext_mem_229265)[gtid_216409 *\n                                                                   (defunc_0_f_res_203631 *\n                                                                    n_p_203492) +\n                                                                   gtid_216410 *\n                                                                   defunc_0_f_res_203631 +\n                                                                   i_216467];\n            \n            int64_t defunc_1_add_res_216469 = add64((int64_t) 1,\n                                                    defunc_0_add_arg_216468);\n            \n            defunc_0_f_res_216466 = defunc_1_add_res_216469;\n        }\n        \n        double defunc_0_f_res_216470;\n        \n        if (cond_216465) {\n            defunc_0_f_res_216470 = 0.0;\n        } else {\n            int64_t i_216471 = add64(gtid_216444, x_216461);\n            double defunc_0_add_arg_216472;\n            \n            defunc_0_add_arg_216472 = ((__global\n                                        double *) mem_229531)[gtid_216409 *\n                                                              (defunc_0_f_res_203631 *\n                                                               n_p_203492) +\n                                                              gtid_216410 *\n                                                              defunc_0_f_res_203631 +\n                                                              i_216471];\n            defunc_0_f_res_216470 = defunc_0_add_arg_216472;\n        }\n        \n        int64_t binop_p_216473 = sub64(defunc_0",
                   "_f_res_216466,\n                                       defunc_0_m_fun_res_216463);\n        double defunc_0_f_res_216474 = sitofp_i64_f64(binop_p_216473);\n        double abs_res_216475 = fabs(defunc_0_f_res_216474);\n        double tmp1_216476 = abs_res_216475 / x_216462;\n        double x_216477 = tmp1_216476 * tmp1_216476;\n        double y_216478 = tmp1_216476 * x_216477;\n        double tmp2_216479 = 1.0 - y_216478;\n        double x_216480 = tmp2_216479 * tmp2_216479;\n        double tmp3_216481 = tmp2_216479 * x_216480;\n        double w_j_216482 = defunc_0_f_res_216470 * tmp3_216481;\n        double xw_j_216483 = defunc_0_f_res_216474 * w_j_216482;\n        double x2w_j_216484 = defunc_0_f_res_216474 * xw_j_216483;\n        double x3w_j_216485 = defunc_0_f_res_216474 * x2w_j_216484;\n        double x4w_j_216486 = defunc_0_f_res_216474 * x3w_j_216485;\n        \n        ((__local double *) red_arr_mem_233636)[gtid_216443 * q_s_203493 +\n                                                gtid_216444] = w_j_216482;\n        ((__local double *) red_arr_mem_233638)[gtid_216443 * q_s_203493 +\n                                                gtid_216444] = xw_j_216483;\n        ((__local double *) red_arr_mem_233640)[gtid_216443 * q_s_203493 +\n                                                gtid_216444] = x2w_j_216484;\n        ((__local double *) red_arr_mem_233642)[gtid_216443 * q_s_203493 +\n                                                gtid_216444] = x3w_j_216485;\n        ((__local double *) red_arr_mem_233644)[gtid_216443 * q_s_203493 +\n                                                gtid_216444] = x4w_j_216486;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int64_t dims_flat_233646 = s_n_m_203636 * q_s_203493;\n    double x_216446;\n    double x_216447;\n    double x_216448;\n    double x_216449;\n    double x_216450;\n    double x_216451;\n    double x_216452;\n    double x_216453;\n    double x_216454;\n    double x_216455;\n    double x_233652;\n    double x_233653;\n    double x_233654;\n ",
                   "   double x_233655;\n    double x_233656;\n    double x_233657;\n    double x_233658;\n    double x_233659;\n    double x_233660;\n    double x_233661;\n    bool ltid_in_bounds_233667 = slt64(sext_i32_i64(local_tid_233619),\n                                       s_n_m_203636 * q_s_203493);\n    int32_t skip_threads_233668;\n    \n    // read input for in-block scan\n    {\n        if (ltid_in_bounds_233667) {\n            x_216451 = ((volatile __local\n                         double *) red_arr_mem_233636)[sext_i32_i64(local_tid_233619)];\n            x_216452 = ((volatile __local\n                         double *) red_arr_mem_233638)[sext_i32_i64(local_tid_233619)];\n            x_216453 = ((volatile __local\n                         double *) red_arr_mem_233640)[sext_i32_i64(local_tid_233619)];\n            x_216454 = ((volatile __local\n                         double *) red_arr_mem_233642)[sext_i32_i64(local_tid_233619)];\n            x_216455 = ((volatile __local\n                         double *) red_arr_mem_233644)[sext_i32_i64(local_tid_233619)];\n            if ((local_tid_233619 - squot32(local_tid_233619, 32) * 32) == 0) {\n                x_216446 = x_216451;\n                x_216447 = x_216452;\n                x_216448 = x_216453;\n                x_216449 = x_216454;\n                x_216450 = x_216455;\n            }\n        }\n    }\n    // in-block scan (hopefully no barriers needed)\n    {\n        skip_threads_233668 = 1;\n        while (slt32(skip_threads_233668, 32)) {\n            bool thread_active_233669 = sle32(skip_threads_233668,\n                                              local_tid_233619 -\n                                              squot32(local_tid_233619, 32) *\n                                              32) && ltid_in_bounds_233667;\n            \n            if (thread_active_233669) {\n                // read operands\n                {\n                    x_216446 = ((volatile __local\n                                 double *) red_arr_mem_233636)[sext_i32_i6",
                   "4(local_tid_233619) -\n                                                               sext_i32_i64(skip_threads_233668)];\n                    x_216447 = ((volatile __local\n                                 double *) red_arr_mem_233638)[sext_i32_i64(local_tid_233619) -\n                                                               sext_i32_i64(skip_threads_233668)];\n                    x_216448 = ((volatile __local\n                                 double *) red_arr_mem_233640)[sext_i32_i64(local_tid_233619) -\n                                                               sext_i32_i64(skip_threads_233668)];\n                    x_216449 = ((volatile __local\n                                 double *) red_arr_mem_233642)[sext_i32_i64(local_tid_233619) -\n                                                               sext_i32_i64(skip_threads_233668)];\n                    x_216450 = ((volatile __local\n                                 double *) red_arr_mem_233644)[sext_i32_i64(local_tid_233619) -\n                                                               sext_i32_i64(skip_threads_233668)];\n                }\n            }\n            // perform operation\n            {\n                bool inactive_233670 =\n                     slt64(srem64(sext_i32_i64(local_tid_233619), q_s_203493),\n                           sext_i32_i64(local_tid_233619) -\n                           sext_i32_i64(local_tid_233619 -\n                           skip_threads_233668));\n                \n                if (thread_active_233669 && inactive_233670) {\n                    x_216446 = x_216451;\n                    x_216447 = x_216452;\n                    x_216448 = x_216453;\n                    x_216449 = x_216454;\n                    x_216450 = x_216455;\n                }\n                if (thread_active_233669) {\n                    if (!inactive_233670) {\n                        double defunc_1_op_res_216456 = x_216446 + x_216451;\n                        double defunc_1_op_res_216457 = x_216447 ",
                   "+ x_216452;\n                        double defunc_1_op_res_216458 = x_216448 + x_216453;\n                        double defunc_1_op_res_216459 = x_216449 + x_216454;\n                        double defunc_1_op_res_216460 = x_216450 + x_216455;\n                        \n                        x_216446 = defunc_1_op_res_216456;\n                        x_216447 = defunc_1_op_res_216457;\n                        x_216448 = defunc_1_op_res_216458;\n                        x_216449 = defunc_1_op_res_216459;\n                        x_216450 = defunc_1_op_res_216460;\n                    }\n                }\n            }\n            if (sle32(wave_sizze_233621, skip_threads_233668)) {\n                barrier(CLK_LOCAL_MEM_FENCE);\n            }\n            if (thread_active_233669) {\n                // write result\n                {\n                    ((volatile __local\n                      double *) red_arr_mem_233636)[sext_i32_i64(local_tid_233619)] =\n                        x_216446;\n                    x_216451 = x_216446;\n                    ((volatile __local\n                      double *) red_arr_mem_233638)[sext_i32_i64(local_tid_233619)] =\n                        x_216447;\n                    x_216452 = x_216447;\n                    ((volatile __local\n                      double *) red_arr_mem_233640)[sext_i32_i64(local_tid_233619)] =\n                        x_216448;\n                    x_216453 = x_216448;\n                    ((volatile __local\n                      double *) red_arr_mem_233642)[sext_i32_i64(local_tid_233619)] =\n                        x_216449;\n                    x_216454 = x_216449;\n                    ((volatile __local\n                      double *) red_arr_mem_233644)[sext_i32_i64(local_tid_233619)] =\n                        x_216450;\n                    x_216455 = x_216450;\n                }\n            }\n            if (sle32(wave_sizze_233621, skip_threads_233668)) {\n                barrier(CLK_LOCAL_MEM_FENCE);\n            }\n           ",
                   " skip_threads_233668 *= 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_233619 - squot32(local_tid_233619, 32) * 32) == 31 &&\n            ltid_in_bounds_233667) {\n            ((volatile __local\n              double *) red_arr_mem_233636)[sext_i32_i64(squot32(local_tid_233619,\n                                                                 32))] =\n                x_216446;\n            ((volatile __local\n              double *) red_arr_mem_233638)[sext_i32_i64(squot32(local_tid_233619,\n                                                                 32))] =\n                x_216447;\n            ((volatile __local\n              double *) red_arr_mem_233640)[sext_i32_i64(squot32(local_tid_233619,\n                                                                 32))] =\n                x_216448;\n            ((volatile __local\n              double *) red_arr_mem_233642)[sext_i32_i64(squot32(local_tid_233619,\n                                                                 32))] =\n                x_216449;\n            ((volatile __local\n              double *) red_arr_mem_233644)[sext_i32_i64(squot32(local_tid_233619,\n                                                                 32))] =\n                x_216450;\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_233671;\n        \n        // read input for in-block scan\n        {\n            if (squot32(local_tid_233619, 32) == 0 && ltid_in_bounds_233667) {\n                x_233657 = ((volatile __local\n                             double *) red_arr_mem_233636)[sext_i32_i64(local_tid_233619)];\n                x_233658 = ((volatile __local\n                             double *) red_arr_mem_233638)[sext_i32_i64(local_tid_233619)];\n                x_233659 = ((volatile __local\n                             double",
                   " *) red_arr_mem_233640)[sext_i32_i64(local_tid_233619)];\n                x_233660 = ((volatile __local\n                             double *) red_arr_mem_233642)[sext_i32_i64(local_tid_233619)];\n                x_233661 = ((volatile __local\n                             double *) red_arr_mem_233644)[sext_i32_i64(local_tid_233619)];\n                if ((local_tid_233619 - squot32(local_tid_233619, 32) * 32) ==\n                    0) {\n                    x_233652 = x_233657;\n                    x_233653 = x_233658;\n                    x_233654 = x_233659;\n                    x_233655 = x_233660;\n                    x_233656 = x_233661;\n                }\n            }\n        }\n        // in-block scan (hopefully no barriers needed)\n        {\n            skip_threads_233671 = 1;\n            while (slt32(skip_threads_233671, 32)) {\n                bool thread_active_233672 = sle32(skip_threads_233671,\n                                                  local_tid_233619 -\n                                                  squot32(local_tid_233619,\n                                                          32) * 32) &&\n                     (squot32(local_tid_233619, 32) == 0 &&\n                      ltid_in_bounds_233667);\n                \n                if (thread_active_233672) {\n                    // read operands\n                    {\n                        x_233652 = ((volatile __local\n                                     double *) red_arr_mem_233636)[sext_i32_i64(local_tid_233619) -\n                                                                   sext_i32_i64(skip_threads_233671)];\n                        x_233653 = ((volatile __local\n                                     double *) red_arr_mem_233638)[sext_i32_i64(local_tid_233619) -\n                                                                   sext_i32_i64(skip_threads_233671)];\n                        x_233654 = ((volatile __local\n                                     double *) red_arr_mem_233640)[sext_i32_i64",
                   "(local_tid_233619) -\n                                                                   sext_i32_i64(skip_threads_233671)];\n                        x_233655 = ((volatile __local\n                                     double *) red_arr_mem_233642)[sext_i32_i64(local_tid_233619) -\n                                                                   sext_i32_i64(skip_threads_233671)];\n                        x_233656 = ((volatile __local\n                                     double *) red_arr_mem_233644)[sext_i32_i64(local_tid_233619) -\n                                                                   sext_i32_i64(skip_threads_233671)];\n                    }\n                }\n                // perform operation\n                {\n                    bool inactive_233673 =\n                         slt64(srem64(sext_i32_i64(local_tid_233619 * 32 + 32 -\n                                      1), q_s_203493),\n                               sext_i32_i64(local_tid_233619 * 32 + 32 - 1) -\n                               sext_i32_i64((local_tid_233619 -\n                                             skip_threads_233671) * 32 + 32 -\n                               1));\n                    \n                    if (thread_active_233672 && inactive_233673) {\n                        x_233652 = x_233657;\n                        x_233653 = x_233658;\n                        x_233654 = x_233659;\n                        x_233655 = x_233660;\n                        x_233656 = x_233661;\n                    }\n                    if (thread_active_233672) {\n                        if (!inactive_233673) {\n                            double defunc_1_op_res_233662 = x_233652 + x_233657;\n                            double defunc_1_op_res_233663 = x_233653 + x_233658;\n                            double defunc_1_op_res_233664 = x_233654 + x_233659;\n                            double defunc_1_op_res_233665 = x_233655 + x_233660;\n                            double defunc_1_op_res_233666 = x_233656 + x_23366",
                   "1;\n                            \n                            x_233652 = defunc_1_op_res_233662;\n                            x_233653 = defunc_1_op_res_233663;\n                            x_233654 = defunc_1_op_res_233664;\n                            x_233655 = defunc_1_op_res_233665;\n                            x_233656 = defunc_1_op_res_233666;\n                        }\n                    }\n                }\n                if (sle32(wave_sizze_233621, skip_threads_233671)) {\n                    barrier(CLK_LOCAL_MEM_FENCE);\n                }\n                if (thread_active_233672) {\n                    // write result\n                    {\n                        ((volatile __local\n                          double *) red_arr_mem_233636)[sext_i32_i64(local_tid_233619)] =\n                            x_233652;\n                        x_233657 = x_233652;\n                        ((volatile __local\n                          double *) red_arr_mem_233638)[sext_i32_i64(local_tid_233619)] =\n                            x_233653;\n                        x_233658 = x_233653;\n                        ((volatile __local\n                          double *) red_arr_mem_233640)[sext_i32_i64(local_tid_233619)] =\n                            x_233654;\n                        x_233659 = x_233654;\n                        ((volatile __local\n                          double *) red_arr_mem_233642)[sext_i32_i64(local_tid_233619)] =\n                            x_233655;\n                        x_233660 = x_233655;\n                        ((volatile __local\n                          double *) red_arr_mem_233644)[sext_i32_i64(local_tid_233619)] =\n                            x_233656;\n                        x_233661 = x_233656;\n                    }\n                }\n                if (sle32(wave_sizze_233621, skip_threads_233671)) {\n                    barrier(CLK_LOCAL_MEM_FENCE);\n                }\n                skip_threads_233671 *= 2;\n            }\n        }\n    }\n    barrier(CLK_LOC",
                   "AL_MEM_FENCE);\n    \n    bool no_carry_in_233674 = squot32(local_tid_233619, 32) == 0 ||\n         !ltid_in_bounds_233667;\n    \n    // carry-in for every block except the first\n    {\n        // read operands\n        {\n            if (!no_carry_in_233674) {\n                x_216451 = x_216446;\n                x_216452 = x_216447;\n                x_216453 = x_216448;\n                x_216454 = x_216449;\n                x_216455 = x_216450;\n                x_216446 = ((__local\n                             double *) red_arr_mem_233636)[sext_i32_i64(squot32(local_tid_233619,\n                                                                                32)) -\n                                                           (int64_t) 1];\n                x_216447 = ((__local\n                             double *) red_arr_mem_233638)[sext_i32_i64(squot32(local_tid_233619,\n                                                                                32)) -\n                                                           (int64_t) 1];\n                x_216448 = ((__local\n                             double *) red_arr_mem_233640)[sext_i32_i64(squot32(local_tid_233619,\n                                                                                32)) -\n                                                           (int64_t) 1];\n                x_216449 = ((__local\n                             double *) red_arr_mem_233642)[sext_i32_i64(squot32(local_tid_233619,\n                                                                                32)) -\n                                                           (int64_t) 1];\n                x_216450 = ((__local\n                             double *) red_arr_mem_233644)[sext_i32_i64(squot32(local_tid_233619,\n                                                                                32)) -\n                                                           (int64_t) 1];\n            }\n        }\n        // perform operation\n        {\n            bool inact",
                   "ive_233675 = slt64(srem64(sext_i32_i64(local_tid_233619),\n                                                q_s_203493),\n                                         sext_i32_i64(local_tid_233619) -\n                                         sext_i32_i64(squot32(local_tid_233619,\n                                                              32) * 32 - 1));\n            \n            if (!no_carry_in_233674) {\n                if (inactive_233675) {\n                    x_216446 = x_216451;\n                    x_216447 = x_216452;\n                    x_216448 = x_216453;\n                    x_216449 = x_216454;\n                    x_216450 = x_216455;\n                }\n            }\n            if (!no_carry_in_233674) {\n                if (!inactive_233675) {\n                    double defunc_1_op_res_216456 = x_216446 + x_216451;\n                    double defunc_1_op_res_216457 = x_216447 + x_216452;\n                    double defunc_1_op_res_216458 = x_216448 + x_216453;\n                    double defunc_1_op_res_216459 = x_216449 + x_216454;\n                    double defunc_1_op_res_216460 = x_216450 + x_216455;\n                    \n                    x_216446 = defunc_1_op_res_216456;\n                    x_216447 = defunc_1_op_res_216457;\n                    x_216448 = defunc_1_op_res_216458;\n                    x_216449 = defunc_1_op_res_216459;\n                    x_216450 = defunc_1_op_res_216460;\n                }\n            }\n        }\n        // write final result\n        {\n            if (!no_carry_in_233674) {\n                ((__local\n                  double *) red_arr_mem_233636)[sext_i32_i64(local_tid_233619)] =\n                    x_216446;\n                ((__local\n                  double *) red_arr_mem_233638)[sext_i32_i64(local_tid_233619)] =\n                    x_216447;\n                ((__local\n                  double *) red_arr_mem_233640)[sext_i32_i64(local_tid_233619)] =\n                    x_216448;\n                ((__local\n                  do",
                   "uble *) red_arr_mem_233642)[sext_i32_i64(local_tid_233619)] =\n                    x_216449;\n                ((__local\n                  double *) red_arr_mem_233644)[sext_i32_i64(local_tid_233619)] =\n                    x_216450;\n            }\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    // restore correct values for first block\n    {\n        if (squot32(local_tid_233619, 32) == 0 && ltid_in_bounds_233667) {\n            ((__local\n              double *) red_arr_mem_233636)[sext_i32_i64(local_tid_233619)] =\n                x_216451;\n            ((__local\n              double *) red_arr_mem_233638)[sext_i32_i64(local_tid_233619)] =\n                x_216452;\n            ((__local\n              double *) red_arr_mem_233640)[sext_i32_i64(local_tid_233619)] =\n                x_216453;\n            ((__local\n              double *) red_arr_mem_233642)[sext_i32_i64(local_tid_233619)] =\n                x_216454;\n            ((__local\n              double *) red_arr_mem_233644)[sext_i32_i64(local_tid_233619)] =\n                x_216455;\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    barrier(CLK_LOCAL_MEM_FENCE);\n    for (int64_t i_233676 = 0; i_233676 < sdiv_up64(s_n_m_203636 -\n                                                    sext_i32_i64(local_tid_233619),\n                                                    computed_group_sizze_216248);\n         i_233676++) {\n        double tmp_233677;\n        \n        tmp_233677 = ((__local double *) red_arr_mem_233636)[q_s_203493 -\n                                                             (int64_t) 1 +\n                                                             (i_233676 *\n                                                              computed_group_sizze_216248 +\n                                                              sext_i32_i64(local_tid_233619)) *\n                                                             q_s_203493];\n        ((__local double *) color_232018)[i_233676 *\n                                    ",
                   "      computed_group_sizze_216248 +\n                                          sext_i32_i64(local_tid_233619)] =\n            tmp_233677;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    for (int64_t i_233678 = 0; i_233678 < sdiv_up64(s_n_m_203636 -\n                                                    sext_i32_i64(local_tid_233619),\n                                                    computed_group_sizze_216248);\n         i_233678++) {\n        double tmp_233679;\n        \n        tmp_233679 = ((__local double *) red_arr_mem_233638)[q_s_203493 -\n                                                             (int64_t) 1 +\n                                                             (i_233678 *\n                                                              computed_group_sizze_216248 +\n                                                              sext_i32_i64(local_tid_233619)) *\n                                                             q_s_203493];\n        ((__local double *) color_232017)[i_233678 *\n                                          computed_group_sizze_216248 +\n                                          sext_i32_i64(local_tid_233619)] =\n            tmp_233679;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    for (int64_t i_233680 = 0; i_233680 < sdiv_up64(s_n_m_203636 -\n                                                    sext_i32_i64(local_tid_233619),\n                                                    computed_group_sizze_216248);\n         i_233680++) {\n        double tmp_233681;\n        \n        tmp_233681 = ((__local double *) red_arr_mem_233640)[q_s_203493 -\n                                                             (int64_t) 1 +\n                                                             (i_233680 *\n                                                              computed_group_sizze_216248 +\n                                                              sext_i32_i64(local_tid_233619)) *\n                                                             q_s_203493];\n       ",
                   " ((__local double *) color_232016)[i_233680 *\n                                          computed_group_sizze_216248 +\n                                          sext_i32_i64(local_tid_233619)] =\n            tmp_233681;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    for (int64_t i_233682 = 0; i_233682 < sdiv_up64(s_n_m_203636 -\n                                                    sext_i32_i64(local_tid_233619),\n                                                    computed_group_sizze_216248);\n         i_233682++) {\n        double tmp_233683;\n        \n        tmp_233683 = ((__local double *) red_arr_mem_233642)[q_s_203493 -\n                                                             (int64_t) 1 +\n                                                             (i_233682 *\n                                                              computed_group_sizze_216248 +\n                                                              sext_i32_i64(local_tid_233619)) *\n                                                             q_s_203493];\n        ((__local double *) color_232009)[i_233682 *\n                                          computed_group_sizze_216248 +\n                                          sext_i32_i64(local_tid_233619)] =\n            tmp_233683;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    for (int64_t i_233684 = 0; i_233684 < sdiv_up64(s_n_m_203636 -\n                                                    sext_i32_i64(local_tid_233619),\n                                                    computed_group_sizze_216248);\n         i_233684++) {\n        double tmp_233685;\n        \n        tmp_233685 = ((__local double *) red_arr_mem_233644)[q_s_203493 -\n                                                             (int64_t) 1 +\n                                                             (i_233684 *\n                                                              computed_group_sizze_216248 +\n                                                              sext_i32_i64(local_tid_233619)) *",
                   "\n                                                             q_s_203493];\n        ((__local double *) color_232008)[i_233684 *\n                                          computed_group_sizze_216248 +\n                                          sext_i32_i64(local_tid_233619)] =\n            tmp_233685;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int64_t gtid_216493 = sext_i32_i64(sext_i64_i32(ltid_pre_233623));\n    int32_t phys_tid_216494 = local_tid_233619;\n    \n    if (slt64(gtid_216493, s_n_m_203636)) {\n        bool index_primexp_228731 = gtid_216493 == (int64_t) 0;\n        double defunc_2_reduce_res_216497;\n        \n        defunc_2_reduce_res_216497 = ((__local\n                                       double *) color_232018)[gtid_216493];\n        \n        double defunc_2_reduce_res_216498;\n        \n        defunc_2_reduce_res_216498 = ((__local\n                                       double *) color_232017)[gtid_216493];\n        \n        double defunc_2_reduce_res_216499;\n        \n        defunc_2_reduce_res_216499 = ((__local\n                                       double *) color_232016)[gtid_216493];\n        \n        double defunc_2_reduce_res_216500;\n        \n        defunc_2_reduce_res_216500 = ((__local\n                                       double *) color_232009)[gtid_216493];\n        \n        double defunc_2_reduce_res_216501;\n        \n        defunc_2_reduce_res_216501 = ((__local\n                                       double *) color_232008)[gtid_216493];\n        \n        double x_216502 = defunc_2_reduce_res_216499 *\n               defunc_2_reduce_res_216501;\n        double y_216503 = defunc_2_reduce_res_216500 *\n               defunc_2_reduce_res_216500;\n        double a12_216504 = x_216502 - y_216503;\n        double x_216505 = defunc_2_reduce_res_216499 *\n               defunc_2_reduce_res_216500;\n        double y_216506 = defunc_2_reduce_res_216498 *\n               defunc_2_reduce_res_216501;\n        double b12_2165",
                   "07 = x_216505 - y_216506;\n        double x_216508 = defunc_2_reduce_res_216498 *\n               defunc_2_reduce_res_216500;\n        double y_216509 = defunc_2_reduce_res_216499 *\n               defunc_2_reduce_res_216499;\n        double c12_216510 = x_216508 - y_216509;\n        double x_216511 = defunc_2_reduce_res_216497 *\n               defunc_2_reduce_res_216501;\n        double b2_216512 = x_216511 - y_216509;\n        double x_216513 = defunc_2_reduce_res_216498 *\n               defunc_2_reduce_res_216499;\n        double y_216514 = defunc_2_reduce_res_216497 *\n               defunc_2_reduce_res_216500;\n        double c2_216515 = x_216513 - y_216514;\n        double x_216516 = defunc_2_reduce_res_216497 * a12_216504;\n        double y_216517 = defunc_2_reduce_res_216498 * b12_216507;\n        double x_216518 = x_216516 + y_216517;\n        double y_216519 = defunc_2_reduce_res_216499 * c12_216510;\n        double y_216520 = x_216518 + y_216519;\n        double det_216521 = 1.0 / y_216520;\n        double a12_216522 = a12_216504 * det_216521;\n        double b12_216523 = b12_216507 * det_216521;\n        double c12_216524 = c12_216510 * det_216521;\n        double b2_216525 = b2_216512 * det_216521;\n        double c2_216526 = c2_216515 * det_216521;\n        int64_t defunc_0_m_fun_res_216527;\n        \n        if (index_primexp_228731) {\n            defunc_0_m_fun_res_216527 = (int64_t) 0;\n        } else {\n            int64_t y_216528 = sub64(s_n_m_203636, (int64_t) 1);\n            bool cond_216529 = gtid_216493 == y_216528;\n            int64_t defunc_0_m_fun_res_f_res_216530;\n            \n            if (cond_216529) {\n                int64_t defunc_0_m_fun_res_f_res_t_res_216531 =\n                        sub64(pad_css_len_203632, (int64_t) 1);\n                \n                defunc_0_m_fun_res_f_res_216530 =\n                    defunc_0_m_fun_res_f_res_t_res_216531;\n            } else {\n                int64_t x_216532 = sub64(gtid_216493, (int64_t) 1);\n                int6",
                   "4_t x_216533 = mul64(jump_s_203499, x_216532);\n                int64_t min_arg_216534 = add64((int64_t) 1, x_216533);\n                int64_t min_res_216535 = smin64(defunc_0_f_res_203631,\n                                                min_arg_216534);\n                \n                defunc_0_m_fun_res_f_res_216530 = min_res_216535;\n            }\n            defunc_0_m_fun_res_216527 = defunc_0_m_fun_res_f_res_216530;\n        }\n        ((__local double *) color_232015)[gtid_216493] = a12_216522;\n        ((__local double *) color_232014)[gtid_216493] = b12_216523;\n        ((__local double *) color_232013)[gtid_216493] = c12_216524;\n        ((__local double *) color_232012)[gtid_216493] = b2_216525;\n        ((__local double *) color_232011)[gtid_216493] = c2_216526;\n        ((__local int64_t *) color_232010)[gtid_216493] =\n            defunc_0_m_fun_res_216527;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int64_t gtid_216538 = sext_i32_i64(sext_i64_i32(ltid_pre_233626));\n    int64_t gtid_216539 = sext_i32_i64(sext_i64_i32(ltid_pre_233627));\n    int32_t phys_tid_216540 = local_tid_233619;\n    __local unsigned char *red_arr_mem_233686;\n    \n    red_arr_mem_233686 = (__local\n                          unsigned char *) red_arr_mem_233686_backing_17;\n    \n    __local unsigned char *red_arr_mem_233688;\n    \n    red_arr_mem_233688 = (__local\n                          unsigned char *) red_arr_mem_233688_backing_18;\n    if (slt64(gtid_216538, s_n_m_203636) && slt64(gtid_216539, q_s_203493)) {\n        int64_t x_216547;\n        \n        x_216547 = ((__global int64_t *) ext_mem_229363)[gtid_216409 *\n                                                         (s_n_m_203636 *\n                                                          n_p_203492) +\n                                                         gtid_216410 *\n                                                         s_n_m_203636 +\n                                                         gtid_216538];\n        \n        double",
                   " x_216548;\n        \n        x_216548 = ((__global double *) ext_mem_229362)[gtid_216409 *\n                                                        (s_n_m_203636 *\n                                                         n_p_203492) +\n                                                        gtid_216410 *\n                                                        s_n_m_203636 +\n                                                        gtid_216538];\n        \n        double a12_216549;\n        \n        a12_216549 = ((__local double *) color_232015)[gtid_216538];\n        \n        double b12_216550;\n        \n        b12_216550 = ((__local double *) color_232014)[gtid_216538];\n        \n        double c12_216551;\n        \n        c12_216551 = ((__local double *) color_232013)[gtid_216538];\n        \n        double b2_216552;\n        \n        b2_216552 = ((__local double *) color_232012)[gtid_216538];\n        \n        double c2_216553;\n        \n        c2_216553 = ((__local double *) color_232011)[gtid_216538];\n        \n        int64_t defunc_0_m_fun_res_216554;\n        \n        defunc_0_m_fun_res_216554 = ((__local\n                                      int64_t *) color_232010)[gtid_216538];\n        \n        bool cond_216556 = sle64(x_216418, gtid_216539);\n        int64_t defunc_0_f_res_216557;\n        \n        if (cond_216556) {\n            defunc_0_f_res_216557 = (int64_t) 0;\n        } else {\n            int64_t i_216558 = add64(gtid_216539, x_216547);\n            int64_t defunc_0_add_arg_216559;\n            \n            defunc_0_add_arg_216559 = ((__global\n                                        int64_t *) ext_mem_229265)[gtid_216409 *\n                                                                   (defunc_0_f_res_203631 *\n                                                                    n_p_203492) +\n                                                                   gtid_216410 *\n                                                                   defunc_0_f_res_203631 +\n    ",
                   "                                                               i_216558];\n            \n            int64_t defunc_1_add_res_216560 = add64((int64_t) 1,\n                                                    defunc_0_add_arg_216559);\n            \n            defunc_0_f_res_216557 = defunc_1_add_res_216560;\n        }\n        \n        double defunc_0_f_res_216561;\n        \n        if (cond_216556) {\n            defunc_0_f_res_216561 = 0.0;\n        } else {\n            int64_t i_216562 = add64(gtid_216539, x_216547);\n            double defunc_0_add_arg_216563;\n            \n            defunc_0_add_arg_216563 = ((__global\n                                        double *) mem_229531)[gtid_216409 *\n                                                              (defunc_0_f_res_203631 *\n                                                               n_p_203492) +\n                                                              gtid_216410 *\n                                                              defunc_0_f_res_203631 +\n                                                              i_216562];\n            defunc_0_f_res_216561 = defunc_0_add_arg_216563;\n        }\n        \n        int64_t binop_p_216564 = sub64(defunc_0_f_res_216557,\n                                       defunc_0_m_fun_res_216554);\n        double defunc_0_f_res_216565 = sitofp_i64_f64(binop_p_216564);\n        double abs_res_216566 = fabs(defunc_0_f_res_216565);\n        double tmp1_216567 = abs_res_216566 / x_216548;\n        double x_216568 = tmp1_216567 * tmp1_216567;\n        double y_216569 = tmp1_216567 * x_216568;\n        double tmp2_216570 = 1.0 - y_216569;\n        double x_216571 = tmp2_216570 * tmp2_216570;\n        double tmp3_216572 = tmp2_216570 * x_216571;\n        double tmp4_216573 = defunc_0_f_res_216561 * tmp3_216572;\n        double defunc_1_f_res_216574 = defunc_0_f_res_216565 * tmp4_216573;\n        double defunc_1_f_res_216575 = defunc_0_f_res_216565 *\n               defunc_1_f_res_216574;\n        d",
                   "ouble defunc_0_f_res_216576;\n        \n        if (cond_216556) {\n            defunc_0_f_res_216576 = 0.0;\n        } else {\n            int64_t i_216577 = add64(gtid_216539, x_216547);\n            double defunc_0_add_arg_216578;\n            \n            defunc_0_add_arg_216578 = ((__global\n                                        double *) mem_229526)[gtid_216409 *\n                                                              (defunc_0_f_res_203631 *\n                                                               n_p_203492) +\n                                                              gtid_216410 *\n                                                              defunc_0_f_res_203631 +\n                                                              i_216577];\n            defunc_0_f_res_216576 = defunc_0_add_arg_216578;\n        }\n        \n        double x_216579 = a12_216549 * tmp4_216573;\n        double y_216580 = b12_216550 * defunc_1_f_res_216574;\n        double x_216581 = x_216579 + y_216580;\n        double y_216582 = c12_216551 * defunc_1_f_res_216575;\n        double x_216583 = x_216581 + y_216582;\n        double defunc_9_fit_fun_res_216584 = defunc_0_f_res_216576 * x_216583;\n        double x_216585 = b12_216550 * tmp4_216573;\n        double y_216586 = b2_216552 * defunc_1_f_res_216574;\n        double x_216587 = x_216585 + y_216586;\n        double y_216588 = c2_216553 * defunc_1_f_res_216575;\n        double x_216589 = x_216587 + y_216588;\n        double defunc_9_slope_fun_res_216590 = defunc_0_f_res_216576 * x_216589;\n        \n        ((__local double *) red_arr_mem_233686)[gtid_216538 * q_s_203493 +\n                                                gtid_216539] =\n            defunc_9_fit_fun_res_216584;\n        ((__local double *) red_arr_mem_233688)[gtid_216538 * q_s_203493 +\n                                                gtid_216539] =\n            defunc_9_slope_fun_res_216590;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int64_t dims_flat_233690 = s_n_m_203636",
                   " * q_s_203493;\n    double x_216541;\n    double x_216542;\n    double x_216543;\n    double x_216544;\n    double x_233693;\n    double x_233694;\n    double x_233695;\n    double x_233696;\n    bool ltid_in_bounds_233699 = slt64(sext_i32_i64(local_tid_233619),\n                                       s_n_m_203636 * q_s_203493);\n    int32_t skip_threads_233700;\n    \n    // read input for in-block scan\n    {\n        if (ltid_in_bounds_233699) {\n            x_216543 = ((volatile __local\n                         double *) red_arr_mem_233686)[sext_i32_i64(local_tid_233619)];\n            x_216544 = ((volatile __local\n                         double *) red_arr_mem_233688)[sext_i32_i64(local_tid_233619)];\n            if ((local_tid_233619 - squot32(local_tid_233619, 32) * 32) == 0) {\n                x_216541 = x_216543;\n                x_216542 = x_216544;\n            }\n        }\n    }\n    // in-block scan (hopefully no barriers needed)\n    {\n        skip_threads_233700 = 1;\n        while (slt32(skip_threads_233700, 32)) {\n            bool thread_active_233701 = sle32(skip_threads_233700,\n                                              local_tid_233619 -\n                                              squot32(local_tid_233619, 32) *\n                                              32) && ltid_in_bounds_233699;\n            \n            if (thread_active_233701) {\n                // read operands\n                {\n                    x_216541 = ((volatile __local\n                                 double *) red_arr_mem_233686)[sext_i32_i64(local_tid_233619) -\n                                                               sext_i32_i64(skip_threads_233700)];\n                    x_216542 = ((volatile __local\n                                 double *) red_arr_mem_233688)[sext_i32_i64(local_tid_233619) -\n                                                               sext_i32_i64(skip_threads_233700)];\n                }\n            }\n            // perform operation\n            {\n                boo",
                   "l inactive_233702 =\n                     slt64(srem64(sext_i32_i64(local_tid_233619), q_s_203493),\n                           sext_i32_i64(local_tid_233619) -\n                           sext_i32_i64(local_tid_233619 -\n                           skip_threads_233700));\n                \n                if (thread_active_233701 && inactive_233702) {\n                    x_216541 = x_216543;\n                    x_216542 = x_216544;\n                }\n                if (thread_active_233701) {\n                    if (!inactive_233702) {\n                        double defunc_1_op_res_216545 = x_216541 + x_216543;\n                        double defunc_1_op_res_216546 = x_216542 + x_216544;\n                        \n                        x_216541 = defunc_1_op_res_216545;\n                        x_216542 = defunc_1_op_res_216546;\n                    }\n                }\n            }\n            if (sle32(wave_sizze_233621, skip_threads_233700)) {\n                barrier(CLK_LOCAL_MEM_FENCE);\n            }\n            if (thread_active_233701) {\n                // write result\n                {\n                    ((volatile __local\n                      double *) red_arr_mem_233686)[sext_i32_i64(local_tid_233619)] =\n                        x_216541;\n                    x_216543 = x_216541;\n                    ((volatile __local\n                      double *) red_arr_mem_233688)[sext_i32_i64(local_tid_233619)] =\n                        x_216542;\n                    x_216544 = x_216542;\n                }\n            }\n            if (sle32(wave_sizze_233621, skip_threads_233700)) {\n                barrier(CLK_LOCAL_MEM_FENCE);\n            }\n            skip_threads_233700 *= 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_233619 - squot32(local_tid_233619, 32) * 32) == 31 &&\n            ltid_in_bounds_233699) {\n            ((volatile __local\n              double *) red_arr_mem_23",
                   "3686)[sext_i32_i64(squot32(local_tid_233619,\n                                                                 32))] =\n                x_216541;\n            ((volatile __local\n              double *) red_arr_mem_233688)[sext_i32_i64(squot32(local_tid_233619,\n                                                                 32))] =\n                x_216542;\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_233703;\n        \n        // read input for in-block scan\n        {\n            if (squot32(local_tid_233619, 32) == 0 && ltid_in_bounds_233699) {\n                x_233695 = ((volatile __local\n                             double *) red_arr_mem_233686)[sext_i32_i64(local_tid_233619)];\n                x_233696 = ((volatile __local\n                             double *) red_arr_mem_233688)[sext_i32_i64(local_tid_233619)];\n                if ((local_tid_233619 - squot32(local_tid_233619, 32) * 32) ==\n                    0) {\n                    x_233693 = x_233695;\n                    x_233694 = x_233696;\n                }\n            }\n        }\n        // in-block scan (hopefully no barriers needed)\n        {\n            skip_threads_233703 = 1;\n            while (slt32(skip_threads_233703, 32)) {\n                bool thread_active_233704 = sle32(skip_threads_233703,\n                                                  local_tid_233619 -\n                                                  squot32(local_tid_233619,\n                                                          32) * 32) &&\n                     (squot32(local_tid_233619, 32) == 0 &&\n                      ltid_in_bounds_233699);\n                \n                if (thread_active_233704) {\n                    // read operands\n                    {\n                        x_233693 = ((volatile __local\n                                     double *) red_arr_mem_233686)[sext_i32_i64(local_tid_233619) -",
                   "\n                                                                   sext_i32_i64(skip_threads_233703)];\n                        x_233694 = ((volatile __local\n                                     double *) red_arr_mem_233688)[sext_i32_i64(local_tid_233619) -\n                                                                   sext_i32_i64(skip_threads_233703)];\n                    }\n                }\n                // perform operation\n                {\n                    bool inactive_233705 =\n                         slt64(srem64(sext_i32_i64(local_tid_233619 * 32 + 32 -\n                                      1), q_s_203493),\n                               sext_i32_i64(local_tid_233619 * 32 + 32 - 1) -\n                               sext_i32_i64((local_tid_233619 -\n                                             skip_threads_233703) * 32 + 32 -\n                               1));\n                    \n                    if (thread_active_233704 && inactive_233705) {\n                        x_233693 = x_233695;\n                        x_233694 = x_233696;\n                    }\n                    if (thread_active_233704) {\n                        if (!inactive_233705) {\n                            double defunc_1_op_res_233697 = x_233693 + x_233695;\n                            double defunc_1_op_res_233698 = x_233694 + x_233696;\n                            \n                            x_233693 = defunc_1_op_res_233697;\n                            x_233694 = defunc_1_op_res_233698;\n                        }\n                    }\n                }\n                if (sle32(wave_sizze_233621, skip_threads_233703)) {\n                    barrier(CLK_LOCAL_MEM_FENCE);\n                }\n                if (thread_active_233704) {\n                    // write result\n                    {\n                        ((volatile __local\n                          double *) red_arr_mem_233686)[sext_i32_i64(local_tid_233619)] =\n                            x_233693;\n                     ",
                   "   x_233695 = x_233693;\n                        ((volatile __local\n                          double *) red_arr_mem_233688)[sext_i32_i64(local_tid_233619)] =\n                            x_233694;\n                        x_233696 = x_233694;\n                    }\n                }\n                if (sle32(wave_sizze_233621, skip_threads_233703)) {\n                    barrier(CLK_LOCAL_MEM_FENCE);\n                }\n                skip_threads_233703 *= 2;\n            }\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    bool no_carry_in_233706 = squot32(local_tid_233619, 32) == 0 ||\n         !ltid_in_bounds_233699;\n    \n    // carry-in for every block except the first\n    {\n        // read operands\n        {\n            if (!no_carry_in_233706) {\n                x_216543 = x_216541;\n                x_216544 = x_216542;\n                x_216541 = ((__local\n                             double *) red_arr_mem_233686)[sext_i32_i64(squot32(local_tid_233619,\n                                                                                32)) -\n                                                           (int64_t) 1];\n                x_216542 = ((__local\n                             double *) red_arr_mem_233688)[sext_i32_i64(squot32(local_tid_233619,\n                                                                                32)) -\n                                                           (int64_t) 1];\n            }\n        }\n        // perform operation\n        {\n            bool inactive_233707 = slt64(srem64(sext_i32_i64(local_tid_233619),\n                                                q_s_203493),\n                                         sext_i32_i64(local_tid_233619) -\n                                         sext_i32_i64(squot32(local_tid_233619,\n                                                              32) * 32 - 1));\n            \n            if (!no_carry_in_233706) {\n                if (inactive_233707) {\n                    x_216541 = x_216543;\n     ",
                   "               x_216542 = x_216544;\n                }\n            }\n            if (!no_carry_in_233706) {\n                if (!inactive_233707) {\n                    double defunc_1_op_res_216545 = x_216541 + x_216543;\n                    double defunc_1_op_res_216546 = x_216542 + x_216544;\n                    \n                    x_216541 = defunc_1_op_res_216545;\n                    x_216542 = defunc_1_op_res_216546;\n                }\n            }\n        }\n        // write final result\n        {\n            if (!no_carry_in_233706) {\n                ((__local\n                  double *) red_arr_mem_233686)[sext_i32_i64(local_tid_233619)] =\n                    x_216541;\n                ((__local\n                  double *) red_arr_mem_233688)[sext_i32_i64(local_tid_233619)] =\n                    x_216542;\n            }\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    // restore correct values for first block\n    {\n        if (squot32(local_tid_233619, 32) == 0 && ltid_in_bounds_233699) {\n            ((__local\n              double *) red_arr_mem_233686)[sext_i32_i64(local_tid_233619)] =\n                x_216543;\n            ((__local\n              double *) red_arr_mem_233688)[sext_i32_i64(local_tid_233619)] =\n                x_216544;\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    barrier(CLK_LOCAL_MEM_FENCE);\n    for (int64_t i_233708 = 0; i_233708 < sdiv_up64(s_n_m_203636 -\n                                                    sext_i32_i64(local_tid_233619),\n                                                    computed_group_sizze_216248);\n         i_233708++) {\n        double tmp_233709;\n        \n        tmp_233709 = ((__local double *) red_arr_mem_233686)[q_s_203493 -\n                                                             (int64_t) 1 +\n                                                             (i_233708 *\n                                                              computed_group_sizze_216248 +\n                                              ",
                   "                sext_i32_i64(local_tid_233619)) *\n                                                             q_s_203493];\n        ((__local double *) color_232009)[i_233708 *\n                                          computed_group_sizze_216248 +\n                                          sext_i32_i64(local_tid_233619)] =\n            tmp_233709;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    for (int64_t i_233710 = 0; i_233710 < sdiv_up64(s_n_m_203636 -\n                                                    sext_i32_i64(local_tid_233619),\n                                                    computed_group_sizze_216248);\n         i_233710++) {\n        double tmp_233711;\n        \n        tmp_233711 = ((__local double *) red_arr_mem_233688)[q_s_203493 -\n                                                             (int64_t) 1 +\n                                                             (i_233710 *\n                                                              computed_group_sizze_216248 +\n                                                              sext_i32_i64(local_tid_233619)) *\n                                                             q_s_203493];\n        ((__local double *) color_232008)[i_233710 *\n                                          computed_group_sizze_216248 +\n                                          sext_i32_i64(local_tid_233619)] =\n            tmp_233711;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    barrier(CLK_LOCAL_MEM_FENCE);\n    for (int64_t i_233712 = 0; i_233712 < sdiv_up64(s_n_m_203636 -\n                                                    sext_i32_i64(local_tid_233619),\n                                                    computed_group_sizze_216248);\n         i_233712++) {\n        double tmp_233713;\n        \n        tmp_233713 = ((__local double *) color_232009)[i_233712 *\n                                                       computed_group_sizze_216248 +\n                                                       sext_i32_i64(local_tid_233619)];\n     ",
                   "   ((__global double *) mem_230290)[gtid_216409 * (s_n_m_203636 *\n                                                        n_p_203492) +\n                                         gtid_216410 * s_n_m_203636 +\n                                         (i_233712 *\n                                          computed_group_sizze_216248 +\n                                          sext_i32_i64(local_tid_233619))] =\n            tmp_233713;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    for (int64_t i_233714 = 0; i_233714 < sdiv_up64(s_n_m_203636 -\n                                                    sext_i32_i64(local_tid_233619),\n                                                    computed_group_sizze_216248);\n         i_233714++) {\n        double tmp_233715;\n        \n        tmp_233715 = ((__local double *) color_232008)[i_233714 *\n                                                       computed_group_sizze_216248 +\n                                                       sext_i32_i64(local_tid_233619)];\n        ((__global double *) mem_230295)[gtid_216409 * (s_n_m_203636 *\n                                                        n_p_203492) +\n                                         gtid_216410 * s_n_m_203636 +\n                                         (i_233714 *\n                                          computed_group_sizze_216248 +\n                                          sext_i32_i64(local_tid_233619))] =\n            tmp_233715;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n  error_6:\n    return;\n}\n__kernel void mainzisegmap_intragroup_217183(__global int *global_failure,\n                                             __local volatile\n                                             int64_t *red_arr_mem_234003_backing_aligned_0,\n                                             __local volatile\n                                             int64_t *red_arr_mem_233999_backing_aligned_1,\n                                             __local volatile\n                                             ",
                   "int64_t *color_232020_backing_aligned_2,\n                                             int64_t n_p_203492,\n                                             int64_t q_s_203493,\n                                             int64_t jump_s_203499,\n                                             int64_t partition_sizze_203577,\n                                             int64_t defunc_0_f_res_203631,\n                                             int64_t pad_css_len_203632,\n                                             int64_t s_n_m_203636, __global\n                                             unsigned char *ext_mem_229264,\n                                             __global\n                                             unsigned char *ext_mem_229265,\n                                             __global\n                                             unsigned char *ext_mem_229362,\n                                             __global\n                                             unsigned char *ext_mem_229363,\n                                             __global unsigned char *mem_229526,\n                                             __global unsigned char *mem_229531,\n                                             __global unsigned char *mem_230436)\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_234003_backing_2 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_234003_backing_aligned_0;\n    __local volatile unsigned char *restrict red_arr_mem_233999_backing_1 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_233999_backing_aligned_1;\n    __local volatile unsigned char *restrict color_232020_backing_0 =\n                                   (__local volatile\n                                    unsigned char *) color_232020_backing_aligned_2;\n    \n    i",
                   "f (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_233985;\n    int32_t local_tid_233986;\n    int64_t group_sizze_233989;\n    int32_t wave_sizze_233988;\n    int32_t group_tid_233987;\n    \n    global_tid_233985 = get_global_id(0);\n    local_tid_233986 = get_local_id(0);\n    group_sizze_233989 = get_local_size(0);\n    wave_sizze_233988 = LOCKSTEP_WIDTH;\n    group_tid_233987 = get_group_id(0);\n    \n    int32_t phys_tid_217183 = group_tid_233987;\n    int64_t slice_233991 = q_s_203493;\n    int64_t ltid_pre_233990 = sext_i32_i64(local_tid_233986);\n    int64_t remnant_233992 = sext_i32_i64(local_tid_233986) - ltid_pre_233990;\n    int64_t slice_233993 = s_n_m_203636;\n    int64_t slice_233994 = n_p_203492 * slice_233993;\n    int64_t slice_233995 = partition_sizze_203577 * slice_233994;\n    int64_t gtid_217180 = squot64(sext_i32_i64(group_tid_233987), slice_233994);\n    int64_t remnant_233996 = sext_i32_i64(group_tid_233987) - gtid_217180 *\n            slice_233994;\n    int64_t gtid_217181 = squot64(remnant_233996, slice_233993);\n    int64_t remnant_233997 = remnant_233996 - gtid_217181 * slice_233993;\n    int64_t gtid_217182 = remnant_233997;\n    int64_t remnant_233998 = remnant_233997 - gtid_217182;\n    __local unsigned char *color_232020;\n    \n    color_232020 = (__local unsigned char *) color_232020_backing_0;\n    \n    int64_t x_217190;\n    \n    x_217190 = ((__global int64_t *) ext_mem_229264)[gtid_217180 * n_p_203492 +\n                                                     gtid_217181];\n    \n    int64_t x_217192;\n    \n    x_217192 = ((__global int64_t *) ext_mem_229363)[gtid_217180 *\n                                                     (s_n_m_203636 *\n                                                      n_p_203492) +\n                                                     gtid_217181 *\n                                                     s_n_m_203636 +\n                                                     gtid_217182];\n    \n    double x_217193;\n    \n    x_217",
                   "193 = ((__global double *) ext_mem_229362)[gtid_217180 *\n                                                    (s_n_m_203636 *\n                                                     n_p_203492) + gtid_217181 *\n                                                    s_n_m_203636 + gtid_217182];\n    \n    bool cond_217194 = gtid_217182 == (int64_t) 0;\n    int64_t defunc_0_m_fun_res_217195;\n    \n    if (cond_217194) {\n        defunc_0_m_fun_res_217195 = (int64_t) 0;\n    } else {\n        int64_t y_217196 = sub64(s_n_m_203636, (int64_t) 1);\n        bool cond_217197 = gtid_217182 == y_217196;\n        int64_t defunc_0_m_fun_res_f_res_217198;\n        \n        if (cond_217197) {\n            int64_t defunc_0_m_fun_res_f_res_t_res_217199 =\n                    sub64(pad_css_len_203632, (int64_t) 1);\n            \n            defunc_0_m_fun_res_f_res_217198 =\n                defunc_0_m_fun_res_f_res_t_res_217199;\n        } else {\n            int64_t x_217200 = sub64(gtid_217182, (int64_t) 1);\n            int64_t x_217201 = mul64(jump_s_203499, x_217200);\n            int64_t min_arg_217202 = add64((int64_t) 1, x_217201);\n            int64_t min_res_217203 = smin64(defunc_0_f_res_203631,\n                                            min_arg_217202);\n            \n            defunc_0_m_fun_res_f_res_217198 = min_res_217203;\n        }\n        defunc_0_m_fun_res_217195 = defunc_0_m_fun_res_f_res_217198;\n    }\n    \n    double defunc_2_reduce_res_217204;\n    int64_t gtid_217206 = sext_i32_i64(sext_i64_i32(ltid_pre_233990));\n    int32_t phys_tid_217207 = local_tid_233986;\n    __local unsigned char *red_arr_mem_233999;\n    \n    red_arr_mem_233999 = (__local unsigned char *) red_arr_mem_233999_backing_1;\n    \n    bool cond_217212 = sle64(x_217190, gtid_217206);\n    int64_t defunc_0_f_res_217213;\n    \n    if (cond_217212) {\n        defunc_0_f_res_217213 = (int64_t) 0;\n    } else {\n        int64_t i_217214 = add64(x_217192, gtid_217206);\n        int64_t defunc_0_add_arg_217215;\n        \n        defunc_",
                   "0_add_arg_217215 = ((__global\n                                    int64_t *) ext_mem_229265)[gtid_217180 *\n                                                               (defunc_0_f_res_203631 *\n                                                                n_p_203492) +\n                                                               gtid_217181 *\n                                                               defunc_0_f_res_203631 +\n                                                               i_217214];\n        \n        int64_t defunc_1_add_res_217216 = add64((int64_t) 1,\n                                                defunc_0_add_arg_217215);\n        \n        defunc_0_f_res_217213 = defunc_1_add_res_217216;\n    }\n    \n    double defunc_0_f_res_217217;\n    \n    if (cond_217212) {\n        defunc_0_f_res_217217 = 0.0;\n    } else {\n        int64_t i_217218 = add64(x_217192, gtid_217206);\n        double defunc_0_add_arg_217219;\n        \n        defunc_0_add_arg_217219 = ((__global double *) mem_229531)[gtid_217180 *\n                                                                   (defunc_0_f_res_203631 *\n                                                                    n_p_203492) +\n                                                                   gtid_217181 *\n                                                                   defunc_0_f_res_203631 +\n                                                                   i_217218];\n        defunc_0_f_res_217217 = defunc_0_add_arg_217219;\n    }\n    \n    int64_t binop_p_217220 = sub64(defunc_0_f_res_217213,\n                                   defunc_0_m_fun_res_217195);\n    double defunc_0_f_res_217221 = sitofp_i64_f64(binop_p_217220);\n    double abs_res_217222 = fabs(defunc_0_f_res_217221);\n    double tmp1_217223 = abs_res_217222 / x_217193;\n    double x_217224 = tmp1_217223 * tmp1_217223;\n    double y_217225 = tmp1_217223 * x_217224;\n    double tmp2_217226 = 1.0 - y_217225;\n    double x_217227 = tmp2_217226 * tmp2_217",
                   "226;\n    double tmp3_217228 = tmp2_217226 * x_217227;\n    double tmp4_217229 = defunc_0_f_res_217217 * tmp3_217228;\n    \n    ((__local double *) red_arr_mem_233999)[gtid_217206] = tmp4_217229;\n    ((__local double *) color_232020)[gtid_217206] = tmp4_217229;\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int32_t offset_234001;\n    int32_t skip_waves_234002 = 1;\n    double x_217208;\n    double x_217209;\n    \n    offset_234001 = 0;\n    // participating threads read initial accumulator\n    {\n        if (slt32(local_tid_233986, sext_i64_i32(q_s_203493))) {\n            x_217208 = ((__local\n                         double *) red_arr_mem_233999)[sext_i32_i64(local_tid_233986 +\n                                                       offset_234001)];\n        }\n    }\n    offset_234001 = 1;\n    while (slt32(offset_234001, wave_sizze_233988)) {\n        if (slt32(local_tid_233986 + offset_234001, sext_i64_i32(q_s_203493)) &&\n            ((local_tid_233986 - squot32(local_tid_233986, wave_sizze_233988) *\n              wave_sizze_233988) & (2 * offset_234001 - 1)) == 0) {\n            // read array element\n            {\n                x_217209 = ((volatile __local\n                             double *) red_arr_mem_233999)[sext_i32_i64(local_tid_233986 +\n                                                           offset_234001)];\n            }\n            // apply reduction operation\n            {\n                double defunc_1_op_res_217210 = x_217208 + x_217209;\n                \n                x_217208 = defunc_1_op_res_217210;\n            }\n            // write result of operation\n            {\n                ((volatile __local\n                  double *) red_arr_mem_233999)[sext_i32_i64(local_tid_233986)] =\n                    x_217208;\n            }\n        }\n        offset_234001 *= 2;\n    }\n    while (slt32(skip_waves_234002, squot32(sext_i64_i32(q_s_203493) +\n                                            wave_sizze_233988 - 1,\n                                            wave_siz",
                   "ze_233988))) {\n        barrier(CLK_LOCAL_MEM_FENCE);\n        offset_234001 = skip_waves_234002 * wave_sizze_233988;\n        if (slt32(local_tid_233986 + offset_234001, sext_i64_i32(q_s_203493)) &&\n            ((local_tid_233986 - squot32(local_tid_233986, wave_sizze_233988) *\n              wave_sizze_233988) == 0 && (squot32(local_tid_233986,\n                                                  wave_sizze_233988) & (2 *\n                                                                        skip_waves_234002 -\n                                                                        1)) ==\n             0)) {\n            // read array element\n            {\n                x_217209 = ((__local\n                             double *) red_arr_mem_233999)[sext_i32_i64(local_tid_233986 +\n                                                           offset_234001)];\n            }\n            // apply reduction operation\n            {\n                double defunc_1_op_res_217210 = x_217208 + x_217209;\n                \n                x_217208 = defunc_1_op_res_217210;\n            }\n            // write result of operation\n            {\n                ((__local\n                  double *) red_arr_mem_233999)[sext_i32_i64(local_tid_233986)] =\n                    x_217208;\n            }\n        }\n        skip_waves_234002 *= 2;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    defunc_2_reduce_res_217204 = ((__local\n                                   double *) red_arr_mem_233999)[(int64_t) 0];\n    \n    double a0_217230 = 1.0 / defunc_2_reduce_res_217204;\n    double defunc_2_reduce_res_217231;\n    int64_t gtid_217232 = sext_i32_i64(sext_i64_i32(ltid_pre_233990));\n    int32_t phys_tid_217233 = local_tid_233986;\n    __local unsigned char *red_arr_mem_234003;\n    \n    red_arr_mem_234003 = (__local unsigned char *) red_arr_mem_234003_backing_2;\n    \n    double x_217238;\n    \n    x_217238 = ((__local double *) color_232020)[gtid_217232];\n    \n    bool cond_217239 = sle64(x_217190, gtid_217232);\n ",
                   "   double defunc_0_f_res_217240;\n    \n    if (cond_217239) {\n        defunc_0_f_res_217240 = 0.0;\n    } else {\n        int64_t i_217241 = add64(x_217192, gtid_217232);\n        double defunc_0_add_arg_217242;\n        \n        defunc_0_add_arg_217242 = ((__global double *) mem_229526)[gtid_217180 *\n                                                                   (defunc_0_f_res_203631 *\n                                                                    n_p_203492) +\n                                                                   gtid_217181 *\n                                                                   defunc_0_f_res_203631 +\n                                                                   i_217241];\n        defunc_0_f_res_217240 = defunc_0_add_arg_217242;\n    }\n    \n    double x_217243 = a0_217230 * x_217238;\n    double defunc_9_fit_fun_res_217244 = defunc_0_f_res_217240 * x_217243;\n    \n    ((__local double *) red_arr_mem_234003)[gtid_217232] =\n        defunc_9_fit_fun_res_217244;\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int32_t offset_234005;\n    int32_t skip_waves_234006 = 1;\n    double x_217234;\n    double x_217235;\n    \n    offset_234005 = 0;\n    // participating threads read initial accumulator\n    {\n        if (slt32(local_tid_233986, sext_i64_i32(q_s_203493))) {\n            x_217234 = ((__local\n                         double *) red_arr_mem_234003)[sext_i32_i64(local_tid_233986 +\n                                                       offset_234005)];\n        }\n    }\n    offset_234005 = 1;\n    while (slt32(offset_234005, wave_sizze_233988)) {\n        if (slt32(local_tid_233986 + offset_234005, sext_i64_i32(q_s_203493)) &&\n            ((local_tid_233986 - squot32(local_tid_233986, wave_sizze_233988) *\n              wave_sizze_233988) & (2 * offset_234005 - 1)) == 0) {\n            // read array element\n            {\n                x_217235 = ((volatile __local\n                             double *) red_arr_mem_234003)[sext_i32_i64(local_tid_2339",
                   "86 +\n                                                           offset_234005)];\n            }\n            // apply reduction operation\n            {\n                double defunc_1_op_res_217236 = x_217234 + x_217235;\n                \n                x_217234 = defunc_1_op_res_217236;\n            }\n            // write result of operation\n            {\n                ((volatile __local\n                  double *) red_arr_mem_234003)[sext_i32_i64(local_tid_233986)] =\n                    x_217234;\n            }\n        }\n        offset_234005 *= 2;\n    }\n    while (slt32(skip_waves_234006, squot32(sext_i64_i32(q_s_203493) +\n                                            wave_sizze_233988 - 1,\n                                            wave_sizze_233988))) {\n        barrier(CLK_LOCAL_MEM_FENCE);\n        offset_234005 = skip_waves_234006 * wave_sizze_233988;\n        if (slt32(local_tid_233986 + offset_234005, sext_i64_i32(q_s_203493)) &&\n            ((local_tid_233986 - squot32(local_tid_233986, wave_sizze_233988) *\n              wave_sizze_233988) == 0 && (squot32(local_tid_233986,\n                                                  wave_sizze_233988) & (2 *\n                                                                        skip_waves_234006 -\n                                                                        1)) ==\n             0)) {\n            // read array element\n            {\n                x_217235 = ((__local\n                             double *) red_arr_mem_234003)[sext_i32_i64(local_tid_233986 +\n                                                           offset_234005)];\n            }\n            // apply reduction operation\n            {\n                double defunc_1_op_res_217236 = x_217234 + x_217235;\n                \n                x_217234 = defunc_1_op_res_217236;\n            }\n            // write result of operation\n            {\n                ((__local\n                  double *) red_arr_mem_234003)[sext_i32_i64(local_tid_233986)] =\n   ",
                   "                 x_217234;\n            }\n        }\n        skip_waves_234006 *= 2;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    defunc_2_reduce_res_217231 = ((__local\n                                   double *) red_arr_mem_234003)[(int64_t) 0];\n    if (local_tid_233986 == 0) {\n        ((__global double *) mem_230436)[gtid_217180 * (s_n_m_203636 *\n                                                        n_p_203492) +\n                                         gtid_217181 * s_n_m_203636 +\n                                         gtid_217182] =\n            defunc_2_reduce_res_217231;\n    }\n    \n  error_4:\n    return;\n}\n__kernel void mainzisegmap_intragroup_217504(__global int *global_failure,\n                                             __local volatile\n                                             int64_t *red_arr_mem_234031_backing_aligned_0,\n                                             __local volatile\n                                             int64_t *red_arr_mem_234029_backing_aligned_1,\n                                             __local volatile\n                                             int64_t *red_arr_mem_234025_backing_aligned_2,\n                                             __local volatile\n                                             int64_t *red_arr_mem_234023_backing_aligned_3,\n                                             __local volatile\n                                             int64_t *red_arr_mem_234021_backing_aligned_4,\n                                             __local volatile\n                                             int64_t *color_232022_backing_aligned_5,\n                                             __local volatile\n                                             int64_t *color_232021_backing_aligned_6,\n                                             int64_t n_p_203492,\n                                             int64_t q_s_203493,\n                                             int64_t jump_s_203499,\n                                        ",
                   "     int64_t partition_sizze_203577,\n                                             int64_t defunc_0_f_res_203631,\n                                             int64_t pad_css_len_203632,\n                                             int64_t s_n_m_203636, __global\n                                             unsigned char *ext_mem_229264,\n                                             __global\n                                             unsigned char *ext_mem_229265,\n                                             __global\n                                             unsigned char *ext_mem_229362,\n                                             __global\n                                             unsigned char *ext_mem_229363,\n                                             __global unsigned char *mem_229526,\n                                             __global unsigned char *mem_229531,\n                                             __global unsigned char *mem_230450,\n                                             __global unsigned char *mem_230455)\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_234031_backing_6 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_234031_backing_aligned_0;\n    __local volatile unsigned char *restrict red_arr_mem_234029_backing_5 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_234029_backing_aligned_1;\n    __local volatile unsigned char *restrict red_arr_mem_234025_backing_4 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_234025_backing_aligned_2;\n    __local volatile unsigned char *restrict red_arr_mem_234023_backing_3 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_23",
                   "4023_backing_aligned_3;\n    __local volatile unsigned char *restrict red_arr_mem_234021_backing_2 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_234021_backing_aligned_4;\n    __local volatile unsigned char *restrict color_232022_backing_1 =\n                                   (__local volatile\n                                    unsigned char *) color_232022_backing_aligned_5;\n    __local volatile unsigned char *restrict color_232021_backing_0 =\n                                   (__local volatile\n                                    unsigned char *) color_232021_backing_aligned_6;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_234007;\n    int32_t local_tid_234008;\n    int64_t group_sizze_234011;\n    int32_t wave_sizze_234010;\n    int32_t group_tid_234009;\n    \n    global_tid_234007 = get_global_id(0);\n    local_tid_234008 = get_local_id(0);\n    group_sizze_234011 = get_local_size(0);\n    wave_sizze_234010 = LOCKSTEP_WIDTH;\n    group_tid_234009 = get_group_id(0);\n    \n    int32_t phys_tid_217504 = group_tid_234009;\n    int64_t slice_234013 = q_s_203493;\n    int64_t ltid_pre_234012 = sext_i32_i64(local_tid_234008);\n    int64_t remnant_234014 = sext_i32_i64(local_tid_234008) - ltid_pre_234012;\n    int64_t slice_234015 = s_n_m_203636;\n    int64_t slice_234016 = n_p_203492 * slice_234015;\n    int64_t slice_234017 = partition_sizze_203577 * slice_234016;\n    int64_t gtid_217501 = squot64(sext_i32_i64(group_tid_234009), slice_234016);\n    int64_t remnant_234018 = sext_i32_i64(group_tid_234009) - gtid_217501 *\n            slice_234016;\n    int64_t gtid_217502 = squot64(remnant_234018, slice_234015);\n    int64_t remnant_234019 = remnant_234018 - gtid_217502 * slice_234015;\n    int64_t gtid_217503 = remnant_234019;\n    int64_t remnant_234020 = remnant_234019 - gtid_217503;\n    __local unsigned char *color_232021;\n    \n    color_232021 = (__local unsigned char *) color_23202",
                   "1_backing_0;\n    \n    __local unsigned char *color_232022;\n    \n    color_232022 = (__local unsigned char *) color_232022_backing_1;\n    \n    int64_t x_217511;\n    \n    x_217511 = ((__global int64_t *) ext_mem_229264)[gtid_217501 * n_p_203492 +\n                                                     gtid_217502];\n    \n    int64_t x_217513;\n    \n    x_217513 = ((__global int64_t *) ext_mem_229363)[gtid_217501 *\n                                                     (s_n_m_203636 *\n                                                      n_p_203492) +\n                                                     gtid_217502 *\n                                                     s_n_m_203636 +\n                                                     gtid_217503];\n    \n    double x_217514;\n    \n    x_217514 = ((__global double *) ext_mem_229362)[gtid_217501 *\n                                                    (s_n_m_203636 *\n                                                     n_p_203492) + gtid_217502 *\n                                                    s_n_m_203636 + gtid_217503];\n    \n    bool cond_217515 = gtid_217503 == (int64_t) 0;\n    int64_t defunc_0_m_fun_res_217516;\n    \n    if (cond_217515) {\n        defunc_0_m_fun_res_217516 = (int64_t) 0;\n    } else {\n        int64_t y_217517 = sub64(s_n_m_203636, (int64_t) 1);\n        bool cond_217518 = gtid_217503 == y_217517;\n        int64_t defunc_0_m_fun_res_f_res_217519;\n        \n        if (cond_217518) {\n            int64_t defunc_0_m_fun_res_f_res_t_res_217520 =\n                    sub64(pad_css_len_203632, (int64_t) 1);\n            \n            defunc_0_m_fun_res_f_res_217519 =\n                defunc_0_m_fun_res_f_res_t_res_217520;\n        } else {\n            int64_t x_217521 = sub64(gtid_217503, (int64_t) 1);\n            int64_t x_217522 = mul64(jump_s_203499, x_217521);\n            int64_t min_arg_217523 = add64((int64_t) 1, x_217522);\n            int64_t min_res_217524 = smin64(defunc_0_f_res_203631,\n                            ",
                   "                min_arg_217523);\n            \n            defunc_0_m_fun_res_f_res_217519 = min_res_217524;\n        }\n        defunc_0_m_fun_res_217516 = defunc_0_m_fun_res_f_res_217519;\n    }\n    \n    double defunc_2_reduce_res_217525;\n    double defunc_2_reduce_res_217526;\n    double defunc_2_reduce_res_217527;\n    int64_t gtid_217530 = sext_i32_i64(sext_i64_i32(ltid_pre_234012));\n    int32_t phys_tid_217531 = local_tid_234008;\n    __local unsigned char *red_arr_mem_234021;\n    \n    red_arr_mem_234021 = (__local unsigned char *) red_arr_mem_234021_backing_2;\n    \n    __local unsigned char *red_arr_mem_234023;\n    \n    red_arr_mem_234023 = (__local unsigned char *) red_arr_mem_234023_backing_3;\n    \n    __local unsigned char *red_arr_mem_234025;\n    \n    red_arr_mem_234025 = (__local unsigned char *) red_arr_mem_234025_backing_4;\n    \n    bool cond_217542 = sle64(x_217511, gtid_217530);\n    int64_t defunc_0_f_res_217543;\n    \n    if (cond_217542) {\n        defunc_0_f_res_217543 = (int64_t) 0;\n    } else {\n        int64_t i_217544 = add64(x_217513, gtid_217530);\n        int64_t defunc_0_add_arg_217545;\n        \n        defunc_0_add_arg_217545 = ((__global\n                                    int64_t *) ext_mem_229265)[gtid_217501 *\n                                                               (defunc_0_f_res_203631 *\n                                                                n_p_203492) +\n                                                               gtid_217502 *\n                                                               defunc_0_f_res_203631 +\n                                                               i_217544];\n        \n        int64_t defunc_1_add_res_217546 = add64((int64_t) 1,\n                                                defunc_0_add_arg_217545);\n        \n        defunc_0_f_res_217543 = defunc_1_add_res_217546;\n    }\n    \n    double defunc_0_f_res_217547;\n    \n    if (cond_217542) {\n        defunc_0_f_res_217547 = 0.0;\n    } else {\n        int6",
                   "4_t i_217548 = add64(x_217513, gtid_217530);\n        double defunc_0_add_arg_217549;\n        \n        defunc_0_add_arg_217549 = ((__global double *) mem_229531)[gtid_217501 *\n                                                                   (defunc_0_f_res_203631 *\n                                                                    n_p_203492) +\n                                                                   gtid_217502 *\n                                                                   defunc_0_f_res_203631 +\n                                                                   i_217548];\n        defunc_0_f_res_217547 = defunc_0_add_arg_217549;\n    }\n    \n    int64_t binop_p_217550 = sub64(defunc_0_f_res_217543,\n                                   defunc_0_m_fun_res_217516);\n    double defunc_0_f_res_217551 = sitofp_i64_f64(binop_p_217550);\n    double abs_res_217552 = fabs(defunc_0_f_res_217551);\n    double tmp1_217553 = abs_res_217552 / x_217514;\n    double x_217554 = tmp1_217553 * tmp1_217553;\n    double y_217555 = tmp1_217553 * x_217554;\n    double tmp2_217556 = 1.0 - y_217555;\n    double x_217557 = tmp2_217556 * tmp2_217556;\n    double tmp3_217558 = tmp2_217556 * x_217557;\n    double tmp4_217559 = defunc_0_f_res_217547 * tmp3_217558;\n    double defunc_1_f_res_217560 = defunc_0_f_res_217551 * tmp4_217559;\n    double defunc_1_f_res_217561 = defunc_0_f_res_217551 *\n           defunc_1_f_res_217560;\n    \n    ((__local double *) red_arr_mem_234021)[gtid_217530] = tmp4_217559;\n    ((__local double *) red_arr_mem_234023)[gtid_217530] =\n        defunc_1_f_res_217560;\n    ((__local double *) red_arr_mem_234025)[gtid_217530] =\n        defunc_1_f_res_217561;\n    ((__local double *) color_232022)[gtid_217530] = defunc_1_f_res_217560;\n    ((__local double *) color_232021)[gtid_217530] = tmp4_217559;\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int32_t offset_234027;\n    int32_t skip_waves_234028 = 1;\n    double x_217532;\n    double x_217533;\n    double x_217534;\n    double x",
                   "_217535;\n    double x_217536;\n    double x_217537;\n    \n    offset_234027 = 0;\n    // participating threads read initial accumulator\n    {\n        if (slt32(local_tid_234008, sext_i64_i32(q_s_203493))) {\n            x_217532 = ((__local\n                         double *) red_arr_mem_234021)[sext_i32_i64(local_tid_234008 +\n                                                       offset_234027)];\n            x_217533 = ((__local\n                         double *) red_arr_mem_234023)[sext_i32_i64(local_tid_234008 +\n                                                       offset_234027)];\n            x_217534 = ((__local\n                         double *) red_arr_mem_234025)[sext_i32_i64(local_tid_234008 +\n                                                       offset_234027)];\n        }\n    }\n    offset_234027 = 1;\n    while (slt32(offset_234027, wave_sizze_234010)) {\n        if (slt32(local_tid_234008 + offset_234027, sext_i64_i32(q_s_203493)) &&\n            ((local_tid_234008 - squot32(local_tid_234008, wave_sizze_234010) *\n              wave_sizze_234010) & (2 * offset_234027 - 1)) == 0) {\n            // read array element\n            {\n                x_217535 = ((volatile __local\n                             double *) red_arr_mem_234021)[sext_i32_i64(local_tid_234008 +\n                                                           offset_234027)];\n                x_217536 = ((volatile __local\n                             double *) red_arr_mem_234023)[sext_i32_i64(local_tid_234008 +\n                                                           offset_234027)];\n                x_217537 = ((volatile __local\n                             double *) red_arr_mem_234025)[sext_i32_i64(local_tid_234008 +\n                                                           offset_234027)];\n            }\n            // apply reduction operation\n            {\n                double defunc_1_op_res_217538 = x_217532 + x_217535;\n                double defunc_1_op_res_217539 = x_217533 + x_217536;\n    ",
                   "            double defunc_1_op_res_217540 = x_217534 + x_217537;\n                \n                x_217532 = defunc_1_op_res_217538;\n                x_217533 = defunc_1_op_res_217539;\n                x_217534 = defunc_1_op_res_217540;\n            }\n            // write result of operation\n            {\n                ((volatile __local\n                  double *) red_arr_mem_234021)[sext_i32_i64(local_tid_234008)] =\n                    x_217532;\n                ((volatile __local\n                  double *) red_arr_mem_234023)[sext_i32_i64(local_tid_234008)] =\n                    x_217533;\n                ((volatile __local\n                  double *) red_arr_mem_234025)[sext_i32_i64(local_tid_234008)] =\n                    x_217534;\n            }\n        }\n        offset_234027 *= 2;\n    }\n    while (slt32(skip_waves_234028, squot32(sext_i64_i32(q_s_203493) +\n                                            wave_sizze_234010 - 1,\n                                            wave_sizze_234010))) {\n        barrier(CLK_LOCAL_MEM_FENCE);\n        offset_234027 = skip_waves_234028 * wave_sizze_234010;\n        if (slt32(local_tid_234008 + offset_234027, sext_i64_i32(q_s_203493)) &&\n            ((local_tid_234008 - squot32(local_tid_234008, wave_sizze_234010) *\n              wave_sizze_234010) == 0 && (squot32(local_tid_234008,\n                                                  wave_sizze_234010) & (2 *\n                                                                        skip_waves_234028 -\n                                                                        1)) ==\n             0)) {\n            // read array element\n            {\n                x_217535 = ((__local\n                             double *) red_arr_mem_234021)[sext_i32_i64(local_tid_234008 +\n                                                           offset_234027)];\n                x_217536 = ((__local\n                             double *) red_arr_mem_234023)[sext_i32_i64(local_tid_234008 +\n                ",
                   "                                           offset_234027)];\n                x_217537 = ((__local\n                             double *) red_arr_mem_234025)[sext_i32_i64(local_tid_234008 +\n                                                           offset_234027)];\n            }\n            // apply reduction operation\n            {\n                double defunc_1_op_res_217538 = x_217532 + x_217535;\n                double defunc_1_op_res_217539 = x_217533 + x_217536;\n                double defunc_1_op_res_217540 = x_217534 + x_217537;\n                \n                x_217532 = defunc_1_op_res_217538;\n                x_217533 = defunc_1_op_res_217539;\n                x_217534 = defunc_1_op_res_217540;\n            }\n            // write result of operation\n            {\n                ((__local\n                  double *) red_arr_mem_234021)[sext_i32_i64(local_tid_234008)] =\n                    x_217532;\n                ((__local\n                  double *) red_arr_mem_234023)[sext_i32_i64(local_tid_234008)] =\n                    x_217533;\n                ((__local\n                  double *) red_arr_mem_234025)[sext_i32_i64(local_tid_234008)] =\n                    x_217534;\n            }\n        }\n        skip_waves_234028 *= 2;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    defunc_2_reduce_res_217525 = ((__local\n                                   double *) red_arr_mem_234021)[(int64_t) 0];\n    defunc_2_reduce_res_217526 = ((__local\n                                   double *) red_arr_mem_234023)[(int64_t) 0];\n    defunc_2_reduce_res_217527 = ((__local\n                                   double *) red_arr_mem_234025)[(int64_t) 0];\n    \n    double x_217562 = defunc_2_reduce_res_217525 * defunc_2_reduce_res_217527;\n    double y_217563 = defunc_2_reduce_res_217526 * defunc_2_reduce_res_217526;\n    double y_217564 = x_217562 - y_217563;\n    double det1_217565 = 1.0 / y_217564;\n    double a11_217566 = defunc_2_reduce_res_217527 * det1_217565;\n    double x_217567 = 0.0 - defu",
                   "nc_2_reduce_res_217526;\n    double b11_217568 = det1_217565 * x_217567;\n    double c11_217569 = defunc_2_reduce_res_217525 * det1_217565;\n    double defunc_2_reduce_res_217570;\n    double defunc_2_reduce_res_217571;\n    int64_t gtid_217572 = sext_i32_i64(sext_i64_i32(ltid_pre_234012));\n    int32_t phys_tid_217573 = local_tid_234008;\n    __local unsigned char *red_arr_mem_234029;\n    \n    red_arr_mem_234029 = (__local unsigned char *) red_arr_mem_234029_backing_5;\n    \n    __local unsigned char *red_arr_mem_234031;\n    \n    red_arr_mem_234031 = (__local unsigned char *) red_arr_mem_234031_backing_6;\n    \n    double x_217581;\n    \n    x_217581 = ((__local double *) color_232021)[gtid_217572];\n    \n    double x_217582;\n    \n    x_217582 = ((__local double *) color_232022)[gtid_217572];\n    \n    bool cond_217583 = sle64(x_217511, gtid_217572);\n    double defunc_0_f_res_217584;\n    \n    if (cond_217583) {\n        defunc_0_f_res_217584 = 0.0;\n    } else {\n        int64_t i_217585 = add64(x_217513, gtid_217572);\n        double defunc_0_add_arg_217586;\n        \n        defunc_0_add_arg_217586 = ((__global double *) mem_229526)[gtid_217501 *\n                                                                   (defunc_0_f_res_203631 *\n                                                                    n_p_203492) +\n                                                                   gtid_217502 *\n                                                                   defunc_0_f_res_203631 +\n                                                                   i_217585];\n        defunc_0_f_res_217584 = defunc_0_add_arg_217586;\n    }\n    \n    double x_217587 = a11_217566 * x_217581;\n    double y_217588 = b11_217568 * x_217582;\n    double x_217589 = x_217587 + y_217588;\n    double defunc_9_fit_fun_res_217590 = defunc_0_f_res_217584 * x_217589;\n    double x_217591 = b11_217568 * x_217581;\n    double y_217592 = c11_217569 * x_217582;\n    double x_217593 = x_217591 + y_217592;\n    double defun",
                   "c_9_slope_fun_res_217594 = defunc_0_f_res_217584 * x_217593;\n    \n    ((__local double *) red_arr_mem_234029)[gtid_217572] =\n        defunc_9_fit_fun_res_217590;\n    ((__local double *) red_arr_mem_234031)[gtid_217572] =\n        defunc_9_slope_fun_res_217594;\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int32_t offset_234033;\n    int32_t skip_waves_234034 = 1;\n    double x_217574;\n    double x_217575;\n    double x_217576;\n    double x_217577;\n    \n    offset_234033 = 0;\n    // participating threads read initial accumulator\n    {\n        if (slt32(local_tid_234008, sext_i64_i32(q_s_203493))) {\n            x_217574 = ((__local\n                         double *) red_arr_mem_234029)[sext_i32_i64(local_tid_234008 +\n                                                       offset_234033)];\n            x_217575 = ((__local\n                         double *) red_arr_mem_234031)[sext_i32_i64(local_tid_234008 +\n                                                       offset_234033)];\n        }\n    }\n    offset_234033 = 1;\n    while (slt32(offset_234033, wave_sizze_234010)) {\n        if (slt32(local_tid_234008 + offset_234033, sext_i64_i32(q_s_203493)) &&\n            ((local_tid_234008 - squot32(local_tid_234008, wave_sizze_234010) *\n              wave_sizze_234010) & (2 * offset_234033 - 1)) == 0) {\n            // read array element\n            {\n                x_217576 = ((volatile __local\n                             double *) red_arr_mem_234029)[sext_i32_i64(local_tid_234008 +\n                                                           offset_234033)];\n                x_217577 = ((volatile __local\n                             double *) red_arr_mem_234031)[sext_i32_i64(local_tid_234008 +\n                                                           offset_234033)];\n            }\n            // apply reduction operation\n            {\n                double defunc_1_op_res_217578 = x_217574 + x_217576;\n                double defunc_1_op_res_217579 = x_217575 + x_217577;\n               ",
                   " \n                x_217574 = defunc_1_op_res_217578;\n                x_217575 = defunc_1_op_res_217579;\n            }\n            // write result of operation\n            {\n                ((volatile __local\n                  double *) red_arr_mem_234029)[sext_i32_i64(local_tid_234008)] =\n                    x_217574;\n                ((volatile __local\n                  double *) red_arr_mem_234031)[sext_i32_i64(local_tid_234008)] =\n                    x_217575;\n            }\n        }\n        offset_234033 *= 2;\n    }\n    while (slt32(skip_waves_234034, squot32(sext_i64_i32(q_s_203493) +\n                                            wave_sizze_234010 - 1,\n                                            wave_sizze_234010))) {\n        barrier(CLK_LOCAL_MEM_FENCE);\n        offset_234033 = skip_waves_234034 * wave_sizze_234010;\n        if (slt32(local_tid_234008 + offset_234033, sext_i64_i32(q_s_203493)) &&\n            ((local_tid_234008 - squot32(local_tid_234008, wave_sizze_234010) *\n              wave_sizze_234010) == 0 && (squot32(local_tid_234008,\n                                                  wave_sizze_234010) & (2 *\n                                                                        skip_waves_234034 -\n                                                                        1)) ==\n             0)) {\n            // read array element\n            {\n                x_217576 = ((__local\n                             double *) red_arr_mem_234029)[sext_i32_i64(local_tid_234008 +\n                                                           offset_234033)];\n                x_217577 = ((__local\n                             double *) red_arr_mem_234031)[sext_i32_i64(local_tid_234008 +\n                                                           offset_234033)];\n            }\n            // apply reduction operation\n            {\n                double defunc_1_op_res_217578 = x_217574 + x_217576;\n                double defunc_1_op_res_217579 = x_217575 + x_217577;\n           ",
                   "     \n                x_217574 = defunc_1_op_res_217578;\n                x_217575 = defunc_1_op_res_217579;\n            }\n            // write result of operation\n            {\n                ((__local\n                  double *) red_arr_mem_234029)[sext_i32_i64(local_tid_234008)] =\n                    x_217574;\n                ((__local\n                  double *) red_arr_mem_234031)[sext_i32_i64(local_tid_234008)] =\n                    x_217575;\n            }\n        }\n        skip_waves_234034 *= 2;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    defunc_2_reduce_res_217570 = ((__local\n                                   double *) red_arr_mem_234029)[(int64_t) 0];\n    defunc_2_reduce_res_217571 = ((__local\n                                   double *) red_arr_mem_234031)[(int64_t) 0];\n    if (local_tid_234008 == 0) {\n        ((__global double *) mem_230450)[gtid_217501 * (s_n_m_203636 *\n                                                        n_p_203492) +\n                                         gtid_217502 * s_n_m_203636 +\n                                         gtid_217503] =\n            defunc_2_reduce_res_217570;\n    }\n    if (local_tid_234008 == 0) {\n        ((__global double *) mem_230455)[gtid_217501 * (s_n_m_203636 *\n                                                        n_p_203492) +\n                                         gtid_217502 * s_n_m_203636 +\n                                         gtid_217503] =\n            defunc_2_reduce_res_217571;\n    }\n    \n  error_4:\n    return;\n}\n__kernel void mainzisegmap_intragroup_217955(__global int *global_failure,\n                                             __local volatile\n                                             int64_t *red_arr_mem_234063_backing_aligned_0,\n                                             __local volatile\n                                             int64_t *red_arr_mem_234061_backing_aligned_1,\n                                             __local volatile\n                                        ",
                   "     int64_t *red_arr_mem_234057_backing_aligned_2,\n                                             __local volatile\n                                             int64_t *red_arr_mem_234055_backing_aligned_3,\n                                             __local volatile\n                                             int64_t *red_arr_mem_234053_backing_aligned_4,\n                                             __local volatile\n                                             int64_t *red_arr_mem_234051_backing_aligned_5,\n                                             __local volatile\n                                             int64_t *red_arr_mem_234049_backing_aligned_6,\n                                             __local volatile\n                                             int64_t *color_232026_backing_aligned_7,\n                                             __local volatile\n                                             int64_t *color_232025_backing_aligned_8,\n                                             __local volatile\n                                             int64_t *color_232024_backing_aligned_9,\n                                             __local volatile\n                                             int64_t *color_232023_backing_aligned_10,\n                                             int64_t n_p_203492,\n                                             int64_t q_s_203493,\n                                             int64_t jump_s_203499,\n                                             int64_t partition_sizze_203577,\n                                             int64_t defunc_0_f_res_203631,\n                                             int64_t pad_css_len_203632,\n                                             int64_t s_n_m_203636, __global\n                                             unsigned char *ext_mem_229264,\n                                             __global\n                                             unsigned char *ext_mem_229265,\n                                 ",
                   "            __global\n                                             unsigned char *ext_mem_229362,\n                                             __global\n                                             unsigned char *ext_mem_229363,\n                                             __global unsigned char *mem_229526,\n                                             __global unsigned char *mem_229531,\n                                             __global unsigned char *mem_230476,\n                                             __global unsigned char *mem_230481)\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_234063_backing_10 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_234063_backing_aligned_0;\n    __local volatile unsigned char *restrict red_arr_mem_234061_backing_9 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_234061_backing_aligned_1;\n    __local volatile unsigned char *restrict red_arr_mem_234057_backing_8 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_234057_backing_aligned_2;\n    __local volatile unsigned char *restrict red_arr_mem_234055_backing_7 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_234055_backing_aligned_3;\n    __local volatile unsigned char *restrict red_arr_mem_234053_backing_6 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_234053_backing_aligned_4;\n    __local volatile unsigned char *restrict red_arr_mem_234051_backing_5 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_234051_backing_aligned_5;\n    __local volatile unsigned char *",
                   "restrict red_arr_mem_234049_backing_4 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_234049_backing_aligned_6;\n    __local volatile unsigned char *restrict color_232026_backing_3 =\n                                   (__local volatile\n                                    unsigned char *) color_232026_backing_aligned_7;\n    __local volatile unsigned char *restrict color_232025_backing_2 =\n                                   (__local volatile\n                                    unsigned char *) color_232025_backing_aligned_8;\n    __local volatile unsigned char *restrict color_232024_backing_1 =\n                                   (__local volatile\n                                    unsigned char *) color_232024_backing_aligned_9;\n    __local volatile unsigned char *restrict color_232023_backing_0 =\n                                   (__local volatile\n                                    unsigned char *) color_232023_backing_aligned_10;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_234035;\n    int32_t local_tid_234036;\n    int64_t group_sizze_234039;\n    int32_t wave_sizze_234038;\n    int32_t group_tid_234037;\n    \n    global_tid_234035 = get_global_id(0);\n    local_tid_234036 = get_local_id(0);\n    group_sizze_234039 = get_local_size(0);\n    wave_sizze_234038 = LOCKSTEP_WIDTH;\n    group_tid_234037 = get_group_id(0);\n    \n    int32_t phys_tid_217955 = group_tid_234037;\n    int64_t slice_234041 = q_s_203493;\n    int64_t ltid_pre_234040 = sext_i32_i64(local_tid_234036);\n    int64_t remnant_234042 = sext_i32_i64(local_tid_234036) - ltid_pre_234040;\n    int64_t slice_234043 = s_n_m_203636;\n    int64_t slice_234044 = n_p_203492 * slice_234043;\n    int64_t slice_234045 = partition_sizze_203577 * slice_234044;\n    int64_t gtid_217952 = squot64(sext_i32_i64(group_tid_234037), slice_234044);\n    int64_t remnant_234046 = sext_i32_i64(group_tid_234037) - gtid_217952 *\n           ",
                   " slice_234044;\n    int64_t gtid_217953 = squot64(remnant_234046, slice_234043);\n    int64_t remnant_234047 = remnant_234046 - gtid_217953 * slice_234043;\n    int64_t gtid_217954 = remnant_234047;\n    int64_t remnant_234048 = remnant_234047 - gtid_217954;\n    __local unsigned char *color_232023;\n    \n    color_232023 = (__local unsigned char *) color_232023_backing_0;\n    \n    __local unsigned char *color_232024;\n    \n    color_232024 = (__local unsigned char *) color_232024_backing_1;\n    \n    __local unsigned char *color_232025;\n    \n    color_232025 = (__local unsigned char *) color_232025_backing_2;\n    \n    __local unsigned char *color_232026;\n    \n    color_232026 = (__local unsigned char *) color_232026_backing_3;\n    \n    int64_t x_217962;\n    \n    x_217962 = ((__global int64_t *) ext_mem_229264)[gtid_217952 * n_p_203492 +\n                                                     gtid_217953];\n    \n    int64_t x_217964;\n    \n    x_217964 = ((__global int64_t *) ext_mem_229363)[gtid_217952 *\n                                                     (s_n_m_203636 *\n                                                      n_p_203492) +\n                                                     gtid_217953 *\n                                                     s_n_m_203636 +\n                                                     gtid_217954];\n    \n    double x_217965;\n    \n    x_217965 = ((__global double *) ext_mem_229362)[gtid_217952 *\n                                                    (s_n_m_203636 *\n                                                     n_p_203492) + gtid_217953 *\n                                                    s_n_m_203636 + gtid_217954];\n    \n    bool cond_217966 = gtid_217954 == (int64_t) 0;\n    int64_t defunc_0_m_fun_res_217967;\n    \n    if (cond_217966) {\n        defunc_0_m_fun_res_217967 = (int64_t) 0;\n    } else {\n        int64_t y_217968 = sub64(s_n_m_203636, (int64_t) 1);\n        bool cond_217969 = gtid_217954 == y_217968;\n        int64_t defunc_0_m_f",
                   "un_res_f_res_217970;\n        \n        if (cond_217969) {\n            int64_t defunc_0_m_fun_res_f_res_t_res_217971 =\n                    sub64(pad_css_len_203632, (int64_t) 1);\n            \n            defunc_0_m_fun_res_f_res_217970 =\n                defunc_0_m_fun_res_f_res_t_res_217971;\n        } else {\n            int64_t x_217972 = sub64(gtid_217954, (int64_t) 1);\n            int64_t x_217973 = mul64(jump_s_203499, x_217972);\n            int64_t min_arg_217974 = add64((int64_t) 1, x_217973);\n            int64_t min_res_217975 = smin64(defunc_0_f_res_203631,\n                                            min_arg_217974);\n            \n            defunc_0_m_fun_res_f_res_217970 = min_res_217975;\n        }\n        defunc_0_m_fun_res_217967 = defunc_0_m_fun_res_f_res_217970;\n    }\n    \n    int64_t gtid_217978 = sext_i32_i64(sext_i64_i32(ltid_pre_234040));\n    int32_t phys_tid_217979 = local_tid_234036;\n    bool cond_217981 = sle64(x_217962, gtid_217978);\n    int64_t defunc_0_f_res_217982;\n    \n    if (cond_217981) {\n        defunc_0_f_res_217982 = (int64_t) 0;\n    } else {\n        int64_t i_217983 = add64(x_217964, gtid_217978);\n        int64_t defunc_0_add_arg_217984;\n        \n        defunc_0_add_arg_217984 = ((__global\n                                    int64_t *) ext_mem_229265)[gtid_217952 *\n                                                               (defunc_0_f_res_203631 *\n                                                                n_p_203492) +\n                                                               gtid_217953 *\n                                                               defunc_0_f_res_203631 +\n                                                               i_217983];\n        \n        int64_t defunc_1_add_res_217985 = add64((int64_t) 1,\n                                                defunc_0_add_arg_217984);\n        \n        defunc_0_f_res_217982 = defunc_1_add_res_217985;\n    }\n    \n    double defunc_0_f_res_217986;\n    \n    if (cond_217981",
                   ") {\n        defunc_0_f_res_217986 = 0.0;\n    } else {\n        int64_t i_217987 = add64(x_217964, gtid_217978);\n        double defunc_0_add_arg_217988;\n        \n        defunc_0_add_arg_217988 = ((__global double *) mem_229531)[gtid_217952 *\n                                                                   (defunc_0_f_res_203631 *\n                                                                    n_p_203492) +\n                                                                   gtid_217953 *\n                                                                   defunc_0_f_res_203631 +\n                                                                   i_217987];\n        defunc_0_f_res_217986 = defunc_0_add_arg_217988;\n    }\n    \n    int64_t binop_p_217989 = sub64(defunc_0_f_res_217982,\n                                   defunc_0_m_fun_res_217967);\n    double defunc_0_f_res_217990 = sitofp_i64_f64(binop_p_217989);\n    double abs_res_217991 = fabs(defunc_0_f_res_217990);\n    double tmp1_217992 = abs_res_217991 / x_217965;\n    double x_217993 = tmp1_217992 * tmp1_217992;\n    double y_217994 = tmp1_217992 * x_217993;\n    double tmp2_217995 = 1.0 - y_217994;\n    double x_217996 = tmp2_217995 * tmp2_217995;\n    double tmp3_217997 = tmp2_217995 * x_217996;\n    double tmp4_217998 = defunc_0_f_res_217986 * tmp3_217997;\n    \n    ((__local double *) color_232026)[gtid_217978] = defunc_0_f_res_217990;\n    ((__local double *) color_232025)[gtid_217978] = tmp4_217998;\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    double defunc_2_reduce_res_217999;\n    double defunc_2_reduce_res_218000;\n    double defunc_2_reduce_res_218001;\n    double defunc_2_reduce_res_218002;\n    double defunc_2_reduce_res_218003;\n    int64_t gtid_218006 = sext_i32_i64(sext_i64_i32(ltid_pre_234040));\n    int32_t phys_tid_218007 = local_tid_234036;\n    __local unsigned char *red_arr_mem_234049;\n    \n    red_arr_mem_234049 = (__local unsigned char *) red_arr_mem_234049_backing_4;\n    \n    __local unsigned char *red_arr_m",
                   "em_234051;\n    \n    red_arr_mem_234051 = (__local unsigned char *) red_arr_mem_234051_backing_5;\n    \n    __local unsigned char *red_arr_mem_234053;\n    \n    red_arr_mem_234053 = (__local unsigned char *) red_arr_mem_234053_backing_6;\n    \n    __local unsigned char *red_arr_mem_234055;\n    \n    red_arr_mem_234055 = (__local unsigned char *) red_arr_mem_234055_backing_7;\n    \n    __local unsigned char *red_arr_mem_234057;\n    \n    red_arr_mem_234057 = (__local unsigned char *) red_arr_mem_234057_backing_8;\n    \n    double x_218023;\n    \n    x_218023 = ((__local double *) color_232026)[gtid_218006];\n    \n    double x_218024;\n    \n    x_218024 = ((__local double *) color_232025)[gtid_218006];\n    \n    double defunc_1_f_res_218025 = x_218023 * x_218024;\n    double defunc_1_f_res_218026 = x_218023 * defunc_1_f_res_218025;\n    double defunc_1_f_res_218027 = x_218023 * defunc_1_f_res_218026;\n    double defunc_1_f_res_218028 = x_218023 * defunc_1_f_res_218027;\n    \n    ((__local double *) red_arr_mem_234049)[gtid_218006] = x_218024;\n    ((__local double *) red_arr_mem_234051)[gtid_218006] =\n        defunc_1_f_res_218025;\n    ((__local double *) red_arr_mem_234053)[gtid_218006] =\n        defunc_1_f_res_218026;\n    ((__local double *) red_arr_mem_234055)[gtid_218006] =\n        defunc_1_f_res_218027;\n    ((__local double *) red_arr_mem_234057)[gtid_218006] =\n        defunc_1_f_res_218028;\n    ((__local double *) color_232024)[gtid_218006] = defunc_1_f_res_218026;\n    ((__local double *) color_232023)[gtid_218006] = defunc_1_f_res_218025;\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int32_t offset_234059;\n    int32_t skip_waves_234060 = 1;\n    double x_218008;\n    double x_218009;\n    double x_218010;\n    double x_218011;\n    double x_218012;\n    double x_218013;\n    double x_218014;\n    double x_218015;\n    double x_218016;\n    double x_218017;\n    \n    offset_234059 = 0;\n    // participating threads read initial accumulator\n    {\n        if (slt32(local_tid_234036, sext_i64_i32",
                   "(q_s_203493))) {\n            x_218008 = ((__local\n                         double *) red_arr_mem_234049)[sext_i32_i64(local_tid_234036 +\n                                                       offset_234059)];\n            x_218009 = ((__local\n                         double *) red_arr_mem_234051)[sext_i32_i64(local_tid_234036 +\n                                                       offset_234059)];\n            x_218010 = ((__local\n                         double *) red_arr_mem_234053)[sext_i32_i64(local_tid_234036 +\n                                                       offset_234059)];\n            x_218011 = ((__local\n                         double *) red_arr_mem_234055)[sext_i32_i64(local_tid_234036 +\n                                                       offset_234059)];\n            x_218012 = ((__local\n                         double *) red_arr_mem_234057)[sext_i32_i64(local_tid_234036 +\n                                                       offset_234059)];\n        }\n    }\n    offset_234059 = 1;\n    while (slt32(offset_234059, wave_sizze_234038)) {\n        if (slt32(local_tid_234036 + offset_234059, sext_i64_i32(q_s_203493)) &&\n            ((local_tid_234036 - squot32(local_tid_234036, wave_sizze_234038) *\n              wave_sizze_234038) & (2 * offset_234059 - 1)) == 0) {\n            // read array element\n            {\n                x_218013 = ((volatile __local\n                             double *) red_arr_mem_234049)[sext_i32_i64(local_tid_234036 +\n                                                           offset_234059)];\n                x_218014 = ((volatile __local\n                             double *) red_arr_mem_234051)[sext_i32_i64(local_tid_234036 +\n                                                           offset_234059)];\n                x_218015 = ((volatile __local\n                             double *) red_arr_mem_234053)[sext_i32_i64(local_tid_234036 +\n                                                           offset_234059)];\n              ",
                   "  x_218016 = ((volatile __local\n                             double *) red_arr_mem_234055)[sext_i32_i64(local_tid_234036 +\n                                                           offset_234059)];\n                x_218017 = ((volatile __local\n                             double *) red_arr_mem_234057)[sext_i32_i64(local_tid_234036 +\n                                                           offset_234059)];\n            }\n            // apply reduction operation\n            {\n                double defunc_1_op_res_218018 = x_218008 + x_218013;\n                double defunc_1_op_res_218019 = x_218009 + x_218014;\n                double defunc_1_op_res_218020 = x_218010 + x_218015;\n                double defunc_1_op_res_218021 = x_218011 + x_218016;\n                double defunc_1_op_res_218022 = x_218012 + x_218017;\n                \n                x_218008 = defunc_1_op_res_218018;\n                x_218009 = defunc_1_op_res_218019;\n                x_218010 = defunc_1_op_res_218020;\n                x_218011 = defunc_1_op_res_218021;\n                x_218012 = defunc_1_op_res_218022;\n            }\n            // write result of operation\n            {\n                ((volatile __local\n                  double *) red_arr_mem_234049)[sext_i32_i64(local_tid_234036)] =\n                    x_218008;\n                ((volatile __local\n                  double *) red_arr_mem_234051)[sext_i32_i64(local_tid_234036)] =\n                    x_218009;\n                ((volatile __local\n                  double *) red_arr_mem_234053)[sext_i32_i64(local_tid_234036)] =\n                    x_218010;\n                ((volatile __local\n                  double *) red_arr_mem_234055)[sext_i32_i64(local_tid_234036)] =\n                    x_218011;\n                ((volatile __local\n                  double *) red_arr_mem_234057)[sext_i32_i64(local_tid_234036)] =\n                    x_218012;\n            }\n        }\n        offset_234059 *= 2;\n    }\n    while (slt32(skip_waves_234060, squo",
                   "t32(sext_i64_i32(q_s_203493) +\n                                            wave_sizze_234038 - 1,\n                                            wave_sizze_234038))) {\n        barrier(CLK_LOCAL_MEM_FENCE);\n        offset_234059 = skip_waves_234060 * wave_sizze_234038;\n        if (slt32(local_tid_234036 + offset_234059, sext_i64_i32(q_s_203493)) &&\n            ((local_tid_234036 - squot32(local_tid_234036, wave_sizze_234038) *\n              wave_sizze_234038) == 0 && (squot32(local_tid_234036,\n                                                  wave_sizze_234038) & (2 *\n                                                                        skip_waves_234060 -\n                                                                        1)) ==\n             0)) {\n            // read array element\n            {\n                x_218013 = ((__local\n                             double *) red_arr_mem_234049)[sext_i32_i64(local_tid_234036 +\n                                                           offset_234059)];\n                x_218014 = ((__local\n                             double *) red_arr_mem_234051)[sext_i32_i64(local_tid_234036 +\n                                                           offset_234059)];\n                x_218015 = ((__local\n                             double *) red_arr_mem_234053)[sext_i32_i64(local_tid_234036 +\n                                                           offset_234059)];\n                x_218016 = ((__local\n                             double *) red_arr_mem_234055)[sext_i32_i64(local_tid_234036 +\n                                                           offset_234059)];\n                x_218017 = ((__local\n                             double *) red_arr_mem_234057)[sext_i32_i64(local_tid_234036 +\n                                                           offset_234059)];\n            }\n            // apply reduction operation\n            {\n                double defunc_1_op_res_218018 = x_218008 + x_218013;\n                double defunc_1_o",
                   "p_res_218019 = x_218009 + x_218014;\n                double defunc_1_op_res_218020 = x_218010 + x_218015;\n                double defunc_1_op_res_218021 = x_218011 + x_218016;\n                double defunc_1_op_res_218022 = x_218012 + x_218017;\n                \n                x_218008 = defunc_1_op_res_218018;\n                x_218009 = defunc_1_op_res_218019;\n                x_218010 = defunc_1_op_res_218020;\n                x_218011 = defunc_1_op_res_218021;\n                x_218012 = defunc_1_op_res_218022;\n            }\n            // write result of operation\n            {\n                ((__local\n                  double *) red_arr_mem_234049)[sext_i32_i64(local_tid_234036)] =\n                    x_218008;\n                ((__local\n                  double *) red_arr_mem_234051)[sext_i32_i64(local_tid_234036)] =\n                    x_218009;\n                ((__local\n                  double *) red_arr_mem_234053)[sext_i32_i64(local_tid_234036)] =\n                    x_218010;\n                ((__local\n                  double *) red_arr_mem_234055)[sext_i32_i64(local_tid_234036)] =\n                    x_218011;\n                ((__local\n                  double *) red_arr_mem_234057)[sext_i32_i64(local_tid_234036)] =\n                    x_218012;\n            }\n        }\n        skip_waves_234060 *= 2;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    defunc_2_reduce_res_217999 = ((__local\n                                   double *) red_arr_mem_234049)[(int64_t) 0];\n    defunc_2_reduce_res_218000 = ((__local\n                                   double *) red_arr_mem_234051)[(int64_t) 0];\n    defunc_2_reduce_res_218001 = ((__local\n                                   double *) red_arr_mem_234053)[(int64_t) 0];\n    defunc_2_reduce_res_218002 = ((__local\n                                   double *) red_arr_mem_234055)[(int64_t) 0];\n    defunc_2_reduce_res_218003 = ((__local\n                                   double *) red_arr_mem_234057)[(int64_t) 0];\n    \n    double x_21",
                   "8029 = defunc_2_reduce_res_218001 * defunc_2_reduce_res_218003;\n    double y_218030 = defunc_2_reduce_res_218002 * defunc_2_reduce_res_218002;\n    double a12_218031 = x_218029 - y_218030;\n    double x_218032 = defunc_2_reduce_res_218001 * defunc_2_reduce_res_218002;\n    double y_218033 = defunc_2_reduce_res_218000 * defunc_2_reduce_res_218003;\n    double b12_218034 = x_218032 - y_218033;\n    double x_218035 = defunc_2_reduce_res_218000 * defunc_2_reduce_res_218002;\n    double y_218036 = defunc_2_reduce_res_218001 * defunc_2_reduce_res_218001;\n    double c12_218037 = x_218035 - y_218036;\n    double x_218038 = defunc_2_reduce_res_217999 * defunc_2_reduce_res_218003;\n    double b2_218039 = x_218038 - y_218036;\n    double x_218040 = defunc_2_reduce_res_218000 * defunc_2_reduce_res_218001;\n    double y_218041 = defunc_2_reduce_res_217999 * defunc_2_reduce_res_218002;\n    double c2_218042 = x_218040 - y_218041;\n    double x_218043 = defunc_2_reduce_res_217999 * a12_218031;\n    double y_218044 = defunc_2_reduce_res_218000 * b12_218034;\n    double x_218045 = x_218043 + y_218044;\n    double y_218046 = defunc_2_reduce_res_218001 * c12_218037;\n    double y_218047 = x_218045 + y_218046;\n    double det_218048 = 1.0 / y_218047;\n    double a12_218049 = a12_218031 * det_218048;\n    double b12_218050 = b12_218034 * det_218048;\n    double c12_218051 = c12_218037 * det_218048;\n    double b2_218052 = b2_218039 * det_218048;\n    double c2_218053 = c2_218042 * det_218048;\n    double defunc_2_reduce_res_218054;\n    double defunc_2_reduce_res_218055;\n    int64_t gtid_218056 = sext_i32_i64(sext_i64_i32(ltid_pre_234040));\n    int32_t phys_tid_218057 = local_tid_234036;\n    __local unsigned char *red_arr_mem_234061;\n    \n    red_arr_mem_234061 = (__local unsigned char *) red_arr_mem_234061_backing_9;\n    \n    __local unsigned char *red_arr_mem_234063;\n    \n    red_arr_mem_234063 = (__local\n                          unsigned char *) red_arr_mem_234063_backing_10;\n    \n    double x_218065;\n    ",
                   "\n    x_218065 = ((__local double *) color_232025)[gtid_218056];\n    \n    double x_218066;\n    \n    x_218066 = ((__local double *) color_232023)[gtid_218056];\n    \n    double x_218067;\n    \n    x_218067 = ((__local double *) color_232024)[gtid_218056];\n    \n    bool cond_218068 = sle64(x_217962, gtid_218056);\n    double defunc_0_f_res_218069;\n    \n    if (cond_218068) {\n        defunc_0_f_res_218069 = 0.0;\n    } else {\n        int64_t i_218070 = add64(x_217964, gtid_218056);\n        double defunc_0_add_arg_218071;\n        \n        defunc_0_add_arg_218071 = ((__global double *) mem_229526)[gtid_217952 *\n                                                                   (defunc_0_f_res_203631 *\n                                                                    n_p_203492) +\n                                                                   gtid_217953 *\n                                                                   defunc_0_f_res_203631 +\n                                                                   i_218070];\n        defunc_0_f_res_218069 = defunc_0_add_arg_218071;\n    }\n    \n    double x_218072 = a12_218049 * x_218065;\n    double y_218073 = b12_218050 * x_218066;\n    double x_218074 = x_218072 + y_218073;\n    double y_218075 = c12_218051 * x_218067;\n    double x_218076 = x_218074 + y_218075;\n    double defunc_9_fit_fun_res_218077 = defunc_0_f_res_218069 * x_218076;\n    double x_218078 = b12_218050 * x_218065;\n    double y_218079 = b2_218052 * x_218066;\n    double x_218080 = x_218078 + y_218079;\n    double y_218081 = c2_218053 * x_218067;\n    double x_218082 = x_218080 + y_218081;\n    double defunc_9_slope_fun_res_218083 = defunc_0_f_res_218069 * x_218082;\n    \n    ((__local double *) red_arr_mem_234061)[gtid_218056] =\n        defunc_9_fit_fun_res_218077;\n    ((__local double *) red_arr_mem_234063)[gtid_218056] =\n        defunc_9_slope_fun_res_218083;\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int32_t offset_234065;\n    int32_t skip_waves_234066 = 1;\n    dou",
                   "ble x_218058;\n    double x_218059;\n    double x_218060;\n    double x_218061;\n    \n    offset_234065 = 0;\n    // participating threads read initial accumulator\n    {\n        if (slt32(local_tid_234036, sext_i64_i32(q_s_203493))) {\n            x_218058 = ((__local\n                         double *) red_arr_mem_234061)[sext_i32_i64(local_tid_234036 +\n                                                       offset_234065)];\n            x_218059 = ((__local\n                         double *) red_arr_mem_234063)[sext_i32_i64(local_tid_234036 +\n                                                       offset_234065)];\n        }\n    }\n    offset_234065 = 1;\n    while (slt32(offset_234065, wave_sizze_234038)) {\n        if (slt32(local_tid_234036 + offset_234065, sext_i64_i32(q_s_203493)) &&\n            ((local_tid_234036 - squot32(local_tid_234036, wave_sizze_234038) *\n              wave_sizze_234038) & (2 * offset_234065 - 1)) == 0) {\n            // read array element\n            {\n                x_218060 = ((volatile __local\n                             double *) red_arr_mem_234061)[sext_i32_i64(local_tid_234036 +\n                                                           offset_234065)];\n                x_218061 = ((volatile __local\n                             double *) red_arr_mem_234063)[sext_i32_i64(local_tid_234036 +\n                                                           offset_234065)];\n            }\n            // apply reduction operation\n            {\n                double defunc_1_op_res_218062 = x_218058 + x_218060;\n                double defunc_1_op_res_218063 = x_218059 + x_218061;\n                \n                x_218058 = defunc_1_op_res_218062;\n                x_218059 = defunc_1_op_res_218063;\n            }\n            // write result of operation\n            {\n                ((volatile __local\n                  double *) red_arr_mem_234061)[sext_i32_i64(local_tid_234036)] =\n                    x_218058;\n                ((volatile __local\n             ",
                   "     double *) red_arr_mem_234063)[sext_i32_i64(local_tid_234036)] =\n                    x_218059;\n            }\n        }\n        offset_234065 *= 2;\n    }\n    while (slt32(skip_waves_234066, squot32(sext_i64_i32(q_s_203493) +\n                                            wave_sizze_234038 - 1,\n                                            wave_sizze_234038))) {\n        barrier(CLK_LOCAL_MEM_FENCE);\n        offset_234065 = skip_waves_234066 * wave_sizze_234038;\n        if (slt32(local_tid_234036 + offset_234065, sext_i64_i32(q_s_203493)) &&\n            ((local_tid_234036 - squot32(local_tid_234036, wave_sizze_234038) *\n              wave_sizze_234038) == 0 && (squot32(local_tid_234036,\n                                                  wave_sizze_234038) & (2 *\n                                                                        skip_waves_234066 -\n                                                                        1)) ==\n             0)) {\n            // read array element\n            {\n                x_218060 = ((__local\n                             double *) red_arr_mem_234061)[sext_i32_i64(local_tid_234036 +\n                                                           offset_234065)];\n                x_218061 = ((__local\n                             double *) red_arr_mem_234063)[sext_i32_i64(local_tid_234036 +\n                                                           offset_234065)];\n            }\n            // apply reduction operation\n            {\n                double defunc_1_op_res_218062 = x_218058 + x_218060;\n                double defunc_1_op_res_218063 = x_218059 + x_218061;\n                \n                x_218058 = defunc_1_op_res_218062;\n                x_218059 = defunc_1_op_res_218063;\n            }\n            // write result of operation\n            {\n                ((__local\n                  double *) red_arr_mem_234061)[sext_i32_i64(local_tid_234036)] =\n                    x_218058;\n                ((__local\n                  double *)",
                   " red_arr_mem_234063)[sext_i32_i64(local_tid_234036)] =\n                    x_218059;\n            }\n        }\n        skip_waves_234066 *= 2;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    defunc_2_reduce_res_218054 = ((__local\n                                   double *) red_arr_mem_234061)[(int64_t) 0];\n    defunc_2_reduce_res_218055 = ((__local\n                                   double *) red_arr_mem_234063)[(int64_t) 0];\n    if (local_tid_234036 == 0) {\n        ((__global double *) mem_230476)[gtid_217952 * (s_n_m_203636 *\n                                                        n_p_203492) +\n                                         gtid_217953 * s_n_m_203636 +\n                                         gtid_217954] =\n            defunc_2_reduce_res_218054;\n    }\n    if (local_tid_234036 == 0) {\n        ((__global double *) mem_230481)[gtid_217952 * (s_n_m_203636 *\n                                                        n_p_203492) +\n                                         gtid_217953 * s_n_m_203636 +\n                                         gtid_217954] =\n            defunc_2_reduce_res_218055;\n    }\n    \n  error_5:\n    return;\n}\n__kernel void mainzisegmap_intragroup_221669(__global int *global_failure,\n                                             __local volatile\n                                             int64_t *red_arr_mem_235265_backing_aligned_0,\n                                             __local volatile\n                                             int64_t *red_arr_mem_235261_backing_aligned_1,\n                                             __local volatile\n                                             int64_t *color_232032_backing_aligned_2,\n                                             int64_t n_203490,\n                                             int64_t q_l_203495,\n                                             int64_t jump_t_203500,\n                                             int64_t partition_sizze_203577,\n                                             int6",
                   "4_t l_n_m_203643,\n                                             int64_t i_203670,\n                                             int64_t ctx_param_ext_229488,\n                                             int64_t ctx_param_ext_229489,\n                                             int64_t ctx_param_ext_229491,\n                                             __global\n                                             unsigned char *ext_mem_229411,\n                                             __global\n                                             unsigned char *ext_mem_229412,\n                                             __global\n                                             unsigned char *mem_param_229493,\n                                             __global unsigned char *mem_230551,\n                                             __global unsigned char *mem_230861)\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_235265_backing_2 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_235265_backing_aligned_0;\n    __local volatile unsigned char *restrict red_arr_mem_235261_backing_1 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_235261_backing_aligned_1;\n    __local volatile unsigned char *restrict color_232032_backing_0 =\n                                   (__local volatile\n                                    unsigned char *) color_232032_backing_aligned_2;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_235249;\n    int32_t local_tid_235250;\n    int64_t group_sizze_235253;\n    int32_t wave_sizze_235252;\n    int32_t group_tid_235251;\n    \n    global_tid_235249 = get_global_id(0);\n    local_tid_235250 = get_local_id(0);\n    group_sizze_235253 = get_local_size(0);\n    wave_sizze_235252 = LOCKSTEP_WIDTH;\n    group_tid_23525",
                   "1 = get_group_id(0);\n    \n    int32_t phys_tid_221669 = group_tid_235251;\n    int64_t slice_235255 = q_l_203495;\n    int64_t ltid_pre_235254 = sext_i32_i64(local_tid_235250);\n    int64_t remnant_235256 = sext_i32_i64(local_tid_235250) - ltid_pre_235254;\n    int64_t slice_235257 = l_n_m_203643;\n    int64_t slice_235258 = partition_sizze_203577 * slice_235257;\n    int64_t gtid_221667 = squot64(sext_i32_i64(group_tid_235251), slice_235257);\n    int64_t remnant_235259 = sext_i32_i64(group_tid_235251) - gtid_221667 *\n            slice_235257;\n    int64_t gtid_221668 = remnant_235259;\n    int64_t remnant_235260 = remnant_235259 - gtid_221668;\n    __local unsigned char *color_232032;\n    \n    color_232032 = (__local unsigned char *) color_232032_backing_0;\n    \n    int64_t x_221675;\n    \n    x_221675 = ((__global int64_t *) ext_mem_229412)[gtid_221667 *\n                                                     l_n_m_203643 +\n                                                     gtid_221668];\n    \n    double x_221676;\n    \n    x_221676 = ((__global double *) ext_mem_229411)[gtid_221667 * l_n_m_203643 +\n                                                    gtid_221668];\n    \n    int64_t min_arg_221677 = mul64(jump_t_203500, gtid_221668);\n    int64_t min_res_221678 = smin64(i_203670, min_arg_221677);\n    int64_t defunc_0_g_res_221679 = add64((int64_t) 1, min_res_221678);\n    double defunc_2_reduce_res_221680;\n    int64_t gtid_221682 = sext_i32_i64(sext_i64_i32(ltid_pre_235254));\n    int32_t phys_tid_221683 = local_tid_235250;\n    __local unsigned char *red_arr_mem_235261;\n    \n    red_arr_mem_235261 = (__local unsigned char *) red_arr_mem_235261_backing_1;\n    \n    bool cond_221688 = sle64(n_203490, gtid_221682);\n    int64_t defunc_0_f_res_221689;\n    \n    if (cond_221688) {\n        defunc_0_f_res_221689 = (int64_t) 0;\n    } else {\n        int64_t i_221690 = add64(x_221675, gtid_221682);\n        int64_t defunc_1_add_res_221691 = add64((int64_t) 1, i_221690);\n        \n        defunc_0",
                   "_f_res_221689 = defunc_1_add_res_221691;\n    }\n    \n    double defunc_0_f_res_221692;\n    \n    if (cond_221688) {\n        defunc_0_f_res_221692 = 0.0;\n    } else {\n        int64_t i_221693 = add64(x_221675, gtid_221682);\n        double defunc_0_add_arg_221694;\n        \n        defunc_0_add_arg_221694 = ((__global\n                                    double *) mem_param_229493)[ctx_param_ext_229488 +\n                                                                (gtid_221667 *\n                                                                 ctx_param_ext_229489 +\n                                                                 i_221693 *\n                                                                 ctx_param_ext_229491)];\n        defunc_0_f_res_221692 = defunc_0_add_arg_221694;\n    }\n    \n    int64_t binop_p_221695 = sub64(defunc_0_f_res_221689,\n                                   defunc_0_g_res_221679);\n    double defunc_0_f_res_221696 = sitofp_i64_f64(binop_p_221695);\n    double abs_res_221697 = fabs(defunc_0_f_res_221696);\n    double tmp1_221698 = abs_res_221697 / x_221676;\n    double x_221699 = tmp1_221698 * tmp1_221698;\n    double y_221700 = tmp1_221698 * x_221699;\n    double tmp2_221701 = 1.0 - y_221700;\n    double x_221702 = tmp2_221701 * tmp2_221701;\n    double tmp3_221703 = tmp2_221701 * x_221702;\n    double tmp4_221704 = defunc_0_f_res_221692 * tmp3_221703;\n    \n    ((__local double *) red_arr_mem_235261)[gtid_221682] = tmp4_221704;\n    ((__local double *) color_232032)[gtid_221682] = tmp4_221704;\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int32_t offset_235263;\n    int32_t skip_waves_235264 = 1;\n    double x_221684;\n    double x_221685;\n    \n    offset_235263 = 0;\n    // participating threads read initial accumulator\n    {\n        if (slt32(local_tid_235250, sext_i64_i32(q_l_203495))) {\n            x_221684 = ((__local\n                         double *) red_arr_mem_235261)[sext_i32_i64(local_tid_235250 +\n                                                  ",
                   "     offset_235263)];\n        }\n    }\n    offset_235263 = 1;\n    while (slt32(offset_235263, wave_sizze_235252)) {\n        if (slt32(local_tid_235250 + offset_235263, sext_i64_i32(q_l_203495)) &&\n            ((local_tid_235250 - squot32(local_tid_235250, wave_sizze_235252) *\n              wave_sizze_235252) & (2 * offset_235263 - 1)) == 0) {\n            // read array element\n            {\n                x_221685 = ((volatile __local\n                             double *) red_arr_mem_235261)[sext_i32_i64(local_tid_235250 +\n                                                           offset_235263)];\n            }\n            // apply reduction operation\n            {\n                double defunc_1_op_res_221686 = x_221684 + x_221685;\n                \n                x_221684 = defunc_1_op_res_221686;\n            }\n            // write result of operation\n            {\n                ((volatile __local\n                  double *) red_arr_mem_235261)[sext_i32_i64(local_tid_235250)] =\n                    x_221684;\n            }\n        }\n        offset_235263 *= 2;\n    }\n    while (slt32(skip_waves_235264, squot32(sext_i64_i32(q_l_203495) +\n                                            wave_sizze_235252 - 1,\n                                            wave_sizze_235252))) {\n        barrier(CLK_LOCAL_MEM_FENCE);\n        offset_235263 = skip_waves_235264 * wave_sizze_235252;\n        if (slt32(local_tid_235250 + offset_235263, sext_i64_i32(q_l_203495)) &&\n            ((local_tid_235250 - squot32(local_tid_235250, wave_sizze_235252) *\n              wave_sizze_235252) == 0 && (squot32(local_tid_235250,\n                                                  wave_sizze_235252) & (2 *\n                                                                        skip_waves_235264 -\n                                                                        1)) ==\n             0)) {\n            // read array element\n            {\n                x_221685 = ((__local\n                             ",
                   "double *) red_arr_mem_235261)[sext_i32_i64(local_tid_235250 +\n                                                           offset_235263)];\n            }\n            // apply reduction operation\n            {\n                double defunc_1_op_res_221686 = x_221684 + x_221685;\n                \n                x_221684 = defunc_1_op_res_221686;\n            }\n            // write result of operation\n            {\n                ((__local\n                  double *) red_arr_mem_235261)[sext_i32_i64(local_tid_235250)] =\n                    x_221684;\n            }\n        }\n        skip_waves_235264 *= 2;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    defunc_2_reduce_res_221680 = ((__local\n                                   double *) red_arr_mem_235261)[(int64_t) 0];\n    \n    double a0_221705 = 1.0 / defunc_2_reduce_res_221680;\n    double defunc_2_reduce_res_221706;\n    int64_t gtid_221707 = sext_i32_i64(sext_i64_i32(ltid_pre_235254));\n    int32_t phys_tid_221708 = local_tid_235250;\n    __local unsigned char *red_arr_mem_235265;\n    \n    red_arr_mem_235265 = (__local unsigned char *) red_arr_mem_235265_backing_2;\n    \n    double x_221713;\n    \n    x_221713 = ((__local double *) color_232032)[gtid_221707];\n    \n    bool cond_221714 = sle64(n_203490, gtid_221707);\n    double defunc_0_f_res_221715;\n    \n    if (cond_221714) {\n        defunc_0_f_res_221715 = 0.0;\n    } else {\n        int64_t i_221716 = add64(x_221675, gtid_221707);\n        double defunc_0_add_arg_221717;\n        \n        defunc_0_add_arg_221717 = ((__global double *) mem_230551)[gtid_221667 *\n                                                                   n_203490 +\n                                                                   i_221716];\n        defunc_0_f_res_221715 = defunc_0_add_arg_221717;\n    }\n    \n    double x_221718 = a0_221705 * x_221713;\n    double defunc_9_fit_fun_res_221719 = defunc_0_f_res_221715 * x_221718;\n    \n    ((__local double *) red_arr_mem_235265)[gtid_221707] =\n        defunc_9_fit",
                   "_fun_res_221719;\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int32_t offset_235267;\n    int32_t skip_waves_235268 = 1;\n    double x_221709;\n    double x_221710;\n    \n    offset_235267 = 0;\n    // participating threads read initial accumulator\n    {\n        if (slt32(local_tid_235250, sext_i64_i32(q_l_203495))) {\n            x_221709 = ((__local\n                         double *) red_arr_mem_235265)[sext_i32_i64(local_tid_235250 +\n                                                       offset_235267)];\n        }\n    }\n    offset_235267 = 1;\n    while (slt32(offset_235267, wave_sizze_235252)) {\n        if (slt32(local_tid_235250 + offset_235267, sext_i64_i32(q_l_203495)) &&\n            ((local_tid_235250 - squot32(local_tid_235250, wave_sizze_235252) *\n              wave_sizze_235252) & (2 * offset_235267 - 1)) == 0) {\n            // read array element\n            {\n                x_221710 = ((volatile __local\n                             double *) red_arr_mem_235265)[sext_i32_i64(local_tid_235250 +\n                                                           offset_235267)];\n            }\n            // apply reduction operation\n            {\n                double defunc_1_op_res_221711 = x_221709 + x_221710;\n                \n                x_221709 = defunc_1_op_res_221711;\n            }\n            // write result of operation\n            {\n                ((volatile __local\n                  double *) red_arr_mem_235265)[sext_i32_i64(local_tid_235250)] =\n                    x_221709;\n            }\n        }\n        offset_235267 *= 2;\n    }\n    while (slt32(skip_waves_235268, squot32(sext_i64_i32(q_l_203495) +\n                                            wave_sizze_235252 - 1,\n                                            wave_sizze_235252))) {\n        barrier(CLK_LOCAL_MEM_FENCE);\n        offset_235267 = skip_waves_235268 * wave_sizze_235252;\n        if (slt32(local_tid_235250 + offset_235267, sext_i64_i32(q_l_203495)) &&\n            ((local_tid_235250 - squot32(loca",
                   "l_tid_235250, wave_sizze_235252) *\n              wave_sizze_235252) == 0 && (squot32(local_tid_235250,\n                                                  wave_sizze_235252) & (2 *\n                                                                        skip_waves_235268 -\n                                                                        1)) ==\n             0)) {\n            // read array element\n            {\n                x_221710 = ((__local\n                             double *) red_arr_mem_235265)[sext_i32_i64(local_tid_235250 +\n                                                           offset_235267)];\n            }\n            // apply reduction operation\n            {\n                double defunc_1_op_res_221711 = x_221709 + x_221710;\n                \n                x_221709 = defunc_1_op_res_221711;\n            }\n            // write result of operation\n            {\n                ((__local\n                  double *) red_arr_mem_235265)[sext_i32_i64(local_tid_235250)] =\n                    x_221709;\n            }\n        }\n        skip_waves_235268 *= 2;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    defunc_2_reduce_res_221706 = ((__local\n                                   double *) red_arr_mem_235265)[(int64_t) 0];\n    if (local_tid_235250 == 0) {\n        ((__global double *) mem_230861)[gtid_221667 * l_n_m_203643 +\n                                         gtid_221668] =\n            defunc_2_reduce_res_221706;\n    }\n    \n  error_4:\n    return;\n}\n__kernel void mainzisegmap_intragroup_221836(__global int *global_failure,\n                                             __local volatile\n                                             int64_t *red_arr_mem_235291_backing_aligned_0,\n                                             __local volatile\n                                             int64_t *red_arr_mem_235289_backing_aligned_1,\n                                             __local volatile\n                                             int64_t *red_arr_mem_23",
                   "5285_backing_aligned_2,\n                                             __local volatile\n                                             int64_t *red_arr_mem_235283_backing_aligned_3,\n                                             __local volatile\n                                             int64_t *red_arr_mem_235281_backing_aligned_4,\n                                             __local volatile\n                                             int64_t *color_232034_backing_aligned_5,\n                                             __local volatile\n                                             int64_t *color_232033_backing_aligned_6,\n                                             int64_t n_203490,\n                                             int64_t q_l_203495,\n                                             int64_t jump_t_203500,\n                                             int64_t partition_sizze_203577,\n                                             int64_t l_n_m_203643,\n                                             int64_t i_203670,\n                                             int64_t ctx_param_ext_229488,\n                                             int64_t ctx_param_ext_229489,\n                                             int64_t ctx_param_ext_229491,\n                                             __global\n                                             unsigned char *ext_mem_229411,\n                                             __global\n                                             unsigned char *ext_mem_229412,\n                                             __global\n                                             unsigned char *mem_param_229493,\n                                             __global unsigned char *mem_230551,\n                                             __global unsigned char *mem_230874,\n                                             __global unsigned char *mem_230878)\n{\n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    __local volat",
                   "ile unsigned char *restrict red_arr_mem_235291_backing_6 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_235291_backing_aligned_0;\n    __local volatile unsigned char *restrict red_arr_mem_235289_backing_5 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_235289_backing_aligned_1;\n    __local volatile unsigned char *restrict red_arr_mem_235285_backing_4 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_235285_backing_aligned_2;\n    __local volatile unsigned char *restrict red_arr_mem_235283_backing_3 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_235283_backing_aligned_3;\n    __local volatile unsigned char *restrict red_arr_mem_235281_backing_2 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_235281_backing_aligned_4;\n    __local volatile unsigned char *restrict color_232034_backing_1 =\n                                   (__local volatile\n                                    unsigned char *) color_232034_backing_aligned_5;\n    __local volatile unsigned char *restrict color_232033_backing_0 =\n                                   (__local volatile\n                                    unsigned char *) color_232033_backing_aligned_6;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_235269;\n    int32_t local_tid_235270;\n    int64_t group_sizze_235273;\n    int32_t wave_sizze_235272;\n    int32_t group_tid_235271;\n    \n    global_tid_235269 = get_global_id(0);\n    local_tid_235270 = get_local_id(0);\n    group_sizze_235273 = get_local_size(0);\n    wave_sizze_235272 = LOCKSTEP_WIDTH;\n    group_tid_235271 = get_group_id(0);\n    \n    int32_t phys_tid_221836 = group_tid_235271;\n    int64_t slice_235275 = ",
                   "q_l_203495;\n    int64_t ltid_pre_235274 = sext_i32_i64(local_tid_235270);\n    int64_t remnant_235276 = sext_i32_i64(local_tid_235270) - ltid_pre_235274;\n    int64_t slice_235277 = l_n_m_203643;\n    int64_t slice_235278 = partition_sizze_203577 * slice_235277;\n    int64_t gtid_221834 = squot64(sext_i32_i64(group_tid_235271), slice_235277);\n    int64_t remnant_235279 = sext_i32_i64(group_tid_235271) - gtid_221834 *\n            slice_235277;\n    int64_t gtid_221835 = remnant_235279;\n    int64_t remnant_235280 = remnant_235279 - gtid_221835;\n    __local unsigned char *color_232033;\n    \n    color_232033 = (__local unsigned char *) color_232033_backing_0;\n    \n    __local unsigned char *color_232034;\n    \n    color_232034 = (__local unsigned char *) color_232034_backing_1;\n    \n    int64_t x_221842;\n    \n    x_221842 = ((__global int64_t *) ext_mem_229412)[gtid_221834 *\n                                                     l_n_m_203643 +\n                                                     gtid_221835];\n    \n    double x_221843;\n    \n    x_221843 = ((__global double *) ext_mem_229411)[gtid_221834 * l_n_m_203643 +\n                                                    gtid_221835];\n    \n    int64_t min_arg_221844 = mul64(jump_t_203500, gtid_221835);\n    int64_t min_res_221845 = smin64(i_203670, min_arg_221844);\n    int64_t defunc_0_g_res_221846 = add64((int64_t) 1, min_res_221845);\n    double defunc_2_reduce_res_221847;\n    double defunc_2_reduce_res_221848;\n    double defunc_2_reduce_res_221849;\n    int64_t gtid_221852 = sext_i32_i64(sext_i64_i32(ltid_pre_235274));\n    int32_t phys_tid_221853 = local_tid_235270;\n    __local unsigned char *red_arr_mem_235281;\n    \n    red_arr_mem_235281 = (__local unsigned char *) red_arr_mem_235281_backing_2;\n    \n    __local unsigned char *red_arr_mem_235283;\n    \n    red_arr_mem_235283 = (__local unsigned char *) red_arr_mem_235283_backing_3;\n    \n    __local unsigned char *red_arr_mem_235285;\n    \n    red_arr_mem_235285 = (__local unsigne",
                   "d char *) red_arr_mem_235285_backing_4;\n    \n    bool cond_221864 = sle64(n_203490, gtid_221852);\n    int64_t defunc_0_f_res_221865;\n    \n    if (cond_221864) {\n        defunc_0_f_res_221865 = (int64_t) 0;\n    } else {\n        int64_t i_221866 = add64(x_221842, gtid_221852);\n        int64_t defunc_1_add_res_221867 = add64((int64_t) 1, i_221866);\n        \n        defunc_0_f_res_221865 = defunc_1_add_res_221867;\n    }\n    \n    double defunc_0_f_res_221868;\n    \n    if (cond_221864) {\n        defunc_0_f_res_221868 = 0.0;\n    } else {\n        int64_t i_221869 = add64(x_221842, gtid_221852);\n        double defunc_0_add_arg_221870;\n        \n        defunc_0_add_arg_221870 = ((__global\n                                    double *) mem_param_229493)[ctx_param_ext_229488 +\n                                                                (gtid_221834 *\n                                                                 ctx_param_ext_229489 +\n                                                                 i_221869 *\n                                                                 ctx_param_ext_229491)];\n        defunc_0_f_res_221868 = defunc_0_add_arg_221870;\n    }\n    \n    int64_t binop_p_221871 = sub64(defunc_0_f_res_221865,\n                                   defunc_0_g_res_221846);\n    double defunc_0_f_res_221872 = sitofp_i64_f64(binop_p_221871);\n    double abs_res_221873 = fabs(defunc_0_f_res_221872);\n    double tmp1_221874 = abs_res_221873 / x_221843;\n    double x_221875 = tmp1_221874 * tmp1_221874;\n    double y_221876 = tmp1_221874 * x_221875;\n    double tmp2_221877 = 1.0 - y_221876;\n    double x_221878 = tmp2_221877 * tmp2_221877;\n    double tmp3_221879 = tmp2_221877 * x_221878;\n    double tmp4_221880 = defunc_0_f_res_221868 * tmp3_221879;\n    double defunc_1_f_res_221881 = defunc_0_f_res_221872 * tmp4_221880;\n    double defunc_1_f_res_221882 = defunc_0_f_res_221872 *\n           defunc_1_f_res_221881;\n    \n    ((__local double *) red_arr_mem_235281)[gtid_221852] = tmp4_22",
                   "1880;\n    ((__local double *) red_arr_mem_235283)[gtid_221852] =\n        defunc_1_f_res_221881;\n    ((__local double *) red_arr_mem_235285)[gtid_221852] =\n        defunc_1_f_res_221882;\n    ((__local double *) color_232034)[gtid_221852] = defunc_1_f_res_221881;\n    ((__local double *) color_232033)[gtid_221852] = tmp4_221880;\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int32_t offset_235287;\n    int32_t skip_waves_235288 = 1;\n    double x_221854;\n    double x_221855;\n    double x_221856;\n    double x_221857;\n    double x_221858;\n    double x_221859;\n    \n    offset_235287 = 0;\n    // participating threads read initial accumulator\n    {\n        if (slt32(local_tid_235270, sext_i64_i32(q_l_203495))) {\n            x_221854 = ((__local\n                         double *) red_arr_mem_235281)[sext_i32_i64(local_tid_235270 +\n                                                       offset_235287)];\n            x_221855 = ((__local\n                         double *) red_arr_mem_235283)[sext_i32_i64(local_tid_235270 +\n                                                       offset_235287)];\n            x_221856 = ((__local\n                         double *) red_arr_mem_235285)[sext_i32_i64(local_tid_235270 +\n                                                       offset_235287)];\n        }\n    }\n    offset_235287 = 1;\n    while (slt32(offset_235287, wave_sizze_235272)) {\n        if (slt32(local_tid_235270 + offset_235287, sext_i64_i32(q_l_203495)) &&\n            ((local_tid_235270 - squot32(local_tid_235270, wave_sizze_235272) *\n              wave_sizze_235272) & (2 * offset_235287 - 1)) == 0) {\n            // read array element\n            {\n                x_221857 = ((volatile __local\n                             double *) red_arr_mem_235281)[sext_i32_i64(local_tid_235270 +\n                                                           offset_235287)];\n                x_221858 = ((volatile __local\n                             double *) red_arr_mem_235283)[sext_i32_i64(local_tid_23527",
                   "0 +\n                                                           offset_235287)];\n                x_221859 = ((volatile __local\n                             double *) red_arr_mem_235285)[sext_i32_i64(local_tid_235270 +\n                                                           offset_235287)];\n            }\n            // apply reduction operation\n            {\n                double defunc_1_op_res_221860 = x_221854 + x_221857;\n                double defunc_1_op_res_221861 = x_221855 + x_221858;\n                double defunc_1_op_res_221862 = x_221856 + x_221859;\n                \n                x_221854 = defunc_1_op_res_221860;\n                x_221855 = defunc_1_op_res_221861;\n                x_221856 = defunc_1_op_res_221862;\n            }\n            // write result of operation\n            {\n                ((volatile __local\n                  double *) red_arr_mem_235281)[sext_i32_i64(local_tid_235270)] =\n                    x_221854;\n                ((volatile __local\n                  double *) red_arr_mem_235283)[sext_i32_i64(local_tid_235270)] =\n                    x_221855;\n                ((volatile __local\n                  double *) red_arr_mem_235285)[sext_i32_i64(local_tid_235270)] =\n                    x_221856;\n            }\n        }\n        offset_235287 *= 2;\n    }\n    while (slt32(skip_waves_235288, squot32(sext_i64_i32(q_l_203495) +\n                                            wave_sizze_235272 - 1,\n                                            wave_sizze_235272))) {\n        barrier(CLK_LOCAL_MEM_FENCE);\n        offset_235287 = skip_waves_235288 * wave_sizze_235272;\n        if (slt32(local_tid_235270 + offset_235287, sext_i64_i32(q_l_203495)) &&\n            ((local_tid_235270 - squot32(local_tid_235270, wave_sizze_235272) *\n              wave_sizze_235272) == 0 && (squot32(local_tid_235270,\n                                                  wave_sizze_235272) & (2 *\n                                                                        skip_waves",
                   "_235288 -\n                                                                        1)) ==\n             0)) {\n            // read array element\n            {\n                x_221857 = ((__local\n                             double *) red_arr_mem_235281)[sext_i32_i64(local_tid_235270 +\n                                                           offset_235287)];\n                x_221858 = ((__local\n                             double *) red_arr_mem_235283)[sext_i32_i64(local_tid_235270 +\n                                                           offset_235287)];\n                x_221859 = ((__local\n                             double *) red_arr_mem_235285)[sext_i32_i64(local_tid_235270 +\n                                                           offset_235287)];\n            }\n            // apply reduction operation\n            {\n                double defunc_1_op_res_221860 = x_221854 + x_221857;\n                double defunc_1_op_res_221861 = x_221855 + x_221858;\n                double defunc_1_op_res_221862 = x_221856 + x_221859;\n                \n                x_221854 = defunc_1_op_res_221860;\n                x_221855 = defunc_1_op_res_221861;\n                x_221856 = defunc_1_op_res_221862;\n            }\n            // write result of operation\n            {\n                ((__local\n                  double *) red_arr_mem_235281)[sext_i32_i64(local_tid_235270)] =\n                    x_221854;\n                ((__local\n                  double *) red_arr_mem_235283)[sext_i32_i64(local_tid_235270)] =\n                    x_221855;\n                ((__local\n                  double *) red_arr_mem_235285)[sext_i32_i64(local_tid_235270)] =\n                    x_221856;\n            }\n        }\n        skip_waves_235288 *= 2;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    defunc_2_reduce_res_221847 = ((__local\n                                   double *) red_arr_mem_235281)[(int64_t) 0];\n    defunc_2_reduce_res_221848 = ((__local\n                                   double ",
                   "*) red_arr_mem_235283)[(int64_t) 0];\n    defunc_2_reduce_res_221849 = ((__local\n                                   double *) red_arr_mem_235285)[(int64_t) 0];\n    \n    double x_221883 = defunc_2_reduce_res_221847 * defunc_2_reduce_res_221849;\n    double y_221884 = defunc_2_reduce_res_221848 * defunc_2_reduce_res_221848;\n    double y_221885 = x_221883 - y_221884;\n    double det1_221886 = 1.0 / y_221885;\n    double a11_221887 = defunc_2_reduce_res_221849 * det1_221886;\n    double x_221888 = 0.0 - defunc_2_reduce_res_221848;\n    double b11_221889 = det1_221886 * x_221888;\n    double c11_221890 = defunc_2_reduce_res_221847 * det1_221886;\n    double defunc_2_reduce_res_221891;\n    double defunc_2_reduce_res_221892;\n    int64_t gtid_221893 = sext_i32_i64(sext_i64_i32(ltid_pre_235274));\n    int32_t phys_tid_221894 = local_tid_235270;\n    __local unsigned char *red_arr_mem_235289;\n    \n    red_arr_mem_235289 = (__local unsigned char *) red_arr_mem_235289_backing_5;\n    \n    __local unsigned char *red_arr_mem_235291;\n    \n    red_arr_mem_235291 = (__local unsigned char *) red_arr_mem_235291_backing_6;\n    \n    double x_221902;\n    \n    x_221902 = ((__local double *) color_232033)[gtid_221893];\n    \n    double x_221903;\n    \n    x_221903 = ((__local double *) color_232034)[gtid_221893];\n    \n    bool cond_221904 = sle64(n_203490, gtid_221893);\n    double defunc_0_f_res_221905;\n    \n    if (cond_221904) {\n        defunc_0_f_res_221905 = 0.0;\n    } else {\n        int64_t i_221906 = add64(x_221842, gtid_221893);\n        double defunc_0_add_arg_221907;\n        \n        defunc_0_add_arg_221907 = ((__global double *) mem_230551)[gtid_221834 *\n                                                                   n_203490 +\n                                                                   i_221906];\n        defunc_0_f_res_221905 = defunc_0_add_arg_221907;\n    }\n    \n    double x_221908 = a11_221887 * x_221902;\n    double y_221909 = b11_221889 * x_221903;\n    double x_221910 = x_221908 ",
                   "+ y_221909;\n    double defunc_9_fit_fun_res_221911 = defunc_0_f_res_221905 * x_221910;\n    double x_221912 = b11_221889 * x_221902;\n    double y_221913 = c11_221890 * x_221903;\n    double x_221914 = x_221912 + y_221913;\n    double defunc_9_slope_fun_res_221915 = defunc_0_f_res_221905 * x_221914;\n    \n    ((__local double *) red_arr_mem_235289)[gtid_221893] =\n        defunc_9_fit_fun_res_221911;\n    ((__local double *) red_arr_mem_235291)[gtid_221893] =\n        defunc_9_slope_fun_res_221915;\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int32_t offset_235293;\n    int32_t skip_waves_235294 = 1;\n    double x_221895;\n    double x_221896;\n    double x_221897;\n    double x_221898;\n    \n    offset_235293 = 0;\n    // participating threads read initial accumulator\n    {\n        if (slt32(local_tid_235270, sext_i64_i32(q_l_203495))) {\n            x_221895 = ((__local\n                         double *) red_arr_mem_235289)[sext_i32_i64(local_tid_235270 +\n                                                       offset_235293)];\n            x_221896 = ((__local\n                         double *) red_arr_mem_235291)[sext_i32_i64(local_tid_235270 +\n                                                       offset_235293)];\n        }\n    }\n    offset_235293 = 1;\n    while (slt32(offset_235293, wave_sizze_235272)) {\n        if (slt32(local_tid_235270 + offset_235293, sext_i64_i32(q_l_203495)) &&\n            ((local_tid_235270 - squot32(local_tid_235270, wave_sizze_235272) *\n              wave_sizze_235272) & (2 * offset_235293 - 1)) == 0) {\n            // read array element\n            {\n                x_221897 = ((volatile __local\n                             double *) red_arr_mem_235289)[sext_i32_i64(local_tid_235270 +\n                                                           offset_235293)];\n                x_221898 = ((volatile __local\n                             double *) red_arr_mem_235291)[sext_i32_i64(local_tid_235270 +\n                                                           off",
                   "set_235293)];\n            }\n            // apply reduction operation\n            {\n                double defunc_1_op_res_221899 = x_221895 + x_221897;\n                double defunc_1_op_res_221900 = x_221896 + x_221898;\n                \n                x_221895 = defunc_1_op_res_221899;\n                x_221896 = defunc_1_op_res_221900;\n            }\n            // write result of operation\n            {\n                ((volatile __local\n                  double *) red_arr_mem_235289)[sext_i32_i64(local_tid_235270)] =\n                    x_221895;\n                ((volatile __local\n                  double *) red_arr_mem_235291)[sext_i32_i64(local_tid_235270)] =\n                    x_221896;\n            }\n        }\n        offset_235293 *= 2;\n    }\n    while (slt32(skip_waves_235294, squot32(sext_i64_i32(q_l_203495) +\n                                            wave_sizze_235272 - 1,\n                                            wave_sizze_235272))) {\n        barrier(CLK_LOCAL_MEM_FENCE);\n        offset_235293 = skip_waves_235294 * wave_sizze_235272;\n        if (slt32(local_tid_235270 + offset_235293, sext_i64_i32(q_l_203495)) &&\n            ((local_tid_235270 - squot32(local_tid_235270, wave_sizze_235272) *\n              wave_sizze_235272) == 0 && (squot32(local_tid_235270,\n                                                  wave_sizze_235272) & (2 *\n                                                                        skip_waves_235294 -\n                                                                        1)) ==\n             0)) {\n            // read array element\n            {\n                x_221897 = ((__local\n                             double *) red_arr_mem_235289)[sext_i32_i64(local_tid_235270 +\n                                                           offset_235293)];\n                x_221898 = ((__local\n                             double *) red_arr_mem_235291)[sext_i32_i64(local_tid_235270 +\n                                                          ",
                   " offset_235293)];\n            }\n            // apply reduction operation\n            {\n                double defunc_1_op_res_221899 = x_221895 + x_221897;\n                double defunc_1_op_res_221900 = x_221896 + x_221898;\n                \n                x_221895 = defunc_1_op_res_221899;\n                x_221896 = defunc_1_op_res_221900;\n            }\n            // write result of operation\n            {\n                ((__local\n                  double *) red_arr_mem_235289)[sext_i32_i64(local_tid_235270)] =\n                    x_221895;\n                ((__local\n                  double *) red_arr_mem_235291)[sext_i32_i64(local_tid_235270)] =\n                    x_221896;\n            }\n        }\n        skip_waves_235294 *= 2;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    defunc_2_reduce_res_221891 = ((__local\n                                   double *) red_arr_mem_235289)[(int64_t) 0];\n    defunc_2_reduce_res_221892 = ((__local\n                                   double *) red_arr_mem_235291)[(int64_t) 0];\n    if (local_tid_235270 == 0) {\n        ((__global double *) mem_230874)[gtid_221834 * l_n_m_203643 +\n                                         gtid_221835] =\n            defunc_2_reduce_res_221891;\n    }\n    if (local_tid_235270 == 0) {\n        ((__global double *) mem_230878)[gtid_221834 * l_n_m_203643 +\n                                         gtid_221835] =\n            defunc_2_reduce_res_221892;\n    }\n    \n  error_4:\n    return;\n}\n__kernel void mainzisegmap_intragroup_222093(__global int *global_failure,\n                                             __local volatile\n                                             int64_t *red_arr_mem_235321_backing_aligned_0,\n                                             __local volatile\n                                             int64_t *red_arr_mem_235319_backing_aligned_1,\n                                             __local volatile\n                                             int64_t *red_arr_mem_235315_backing_align",
                   "ed_2,\n                                             __local volatile\n                                             int64_t *red_arr_mem_235313_backing_aligned_3,\n                                             __local volatile\n                                             int64_t *red_arr_mem_235311_backing_aligned_4,\n                                             __local volatile\n                                             int64_t *red_arr_mem_235309_backing_aligned_5,\n                                             __local volatile\n                                             int64_t *red_arr_mem_235307_backing_aligned_6,\n                                             __local volatile\n                                             int64_t *color_232038_backing_aligned_7,\n                                             __local volatile\n                                             int64_t *color_232037_backing_aligned_8,\n                                             __local volatile\n                                             int64_t *color_232036_backing_aligned_9,\n                                             __local volatile\n                                             int64_t *color_232035_backing_aligned_10,\n                                             int64_t n_203490,\n                                             int64_t q_l_203495,\n                                             int64_t jump_t_203500,\n                                             int64_t partition_sizze_203577,\n                                             int64_t l_n_m_203643,\n                                             int64_t i_203670,\n                                             int64_t ctx_param_ext_229488,\n                                             int64_t ctx_param_ext_229489,\n                                             int64_t ctx_param_ext_229491,\n                                             __global\n                                             unsigned char *ext_mem_229411,\n                           ",
                   "                  __global\n                                             unsigned char *ext_mem_229412,\n                                             __global\n                                             unsigned char *mem_param_229493,\n                                             __global unsigned char *mem_230551,\n                                             __global unsigned char *mem_230898,\n                                             __global unsigned char *mem_230902)\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_235321_backing_10 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_235321_backing_aligned_0;\n    __local volatile unsigned char *restrict red_arr_mem_235319_backing_9 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_235319_backing_aligned_1;\n    __local volatile unsigned char *restrict red_arr_mem_235315_backing_8 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_235315_backing_aligned_2;\n    __local volatile unsigned char *restrict red_arr_mem_235313_backing_7 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_235313_backing_aligned_3;\n    __local volatile unsigned char *restrict red_arr_mem_235311_backing_6 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_235311_backing_aligned_4;\n    __local volatile unsigned char *restrict red_arr_mem_235309_backing_5 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_235309_backing_aligned_5;\n    __local volatile unsigned char *restrict red_arr_mem_235307_backing_4 =\n                                 ",
                   "  (__local volatile\n                                    unsigned char *) red_arr_mem_235307_backing_aligned_6;\n    __local volatile unsigned char *restrict color_232038_backing_3 =\n                                   (__local volatile\n                                    unsigned char *) color_232038_backing_aligned_7;\n    __local volatile unsigned char *restrict color_232037_backing_2 =\n                                   (__local volatile\n                                    unsigned char *) color_232037_backing_aligned_8;\n    __local volatile unsigned char *restrict color_232036_backing_1 =\n                                   (__local volatile\n                                    unsigned char *) color_232036_backing_aligned_9;\n    __local volatile unsigned char *restrict color_232035_backing_0 =\n                                   (__local volatile\n                                    unsigned char *) color_232035_backing_aligned_10;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_235295;\n    int32_t local_tid_235296;\n    int64_t group_sizze_235299;\n    int32_t wave_sizze_235298;\n    int32_t group_tid_235297;\n    \n    global_tid_235295 = get_global_id(0);\n    local_tid_235296 = get_local_id(0);\n    group_sizze_235299 = get_local_size(0);\n    wave_sizze_235298 = LOCKSTEP_WIDTH;\n    group_tid_235297 = get_group_id(0);\n    \n    int32_t phys_tid_222093 = group_tid_235297;\n    int64_t slice_235301 = q_l_203495;\n    int64_t ltid_pre_235300 = sext_i32_i64(local_tid_235296);\n    int64_t remnant_235302 = sext_i32_i64(local_tid_235296) - ltid_pre_235300;\n    int64_t slice_235303 = l_n_m_203643;\n    int64_t slice_235304 = partition_sizze_203577 * slice_235303;\n    int64_t gtid_222091 = squot64(sext_i32_i64(group_tid_235297), slice_235303);\n    int64_t remnant_235305 = sext_i32_i64(group_tid_235297) - gtid_222091 *\n            slice_235303;\n    int64_t gtid_222092 = remnant_235305;\n    int64_t remnant_235306 = remnant_235305 - gtid_222092;\n    __local",
                   " unsigned char *color_232035;\n    \n    color_232035 = (__local unsigned char *) color_232035_backing_0;\n    \n    __local unsigned char *color_232036;\n    \n    color_232036 = (__local unsigned char *) color_232036_backing_1;\n    \n    __local unsigned char *color_232037;\n    \n    color_232037 = (__local unsigned char *) color_232037_backing_2;\n    \n    __local unsigned char *color_232038;\n    \n    color_232038 = (__local unsigned char *) color_232038_backing_3;\n    \n    int64_t x_222099;\n    \n    x_222099 = ((__global int64_t *) ext_mem_229412)[gtid_222091 *\n                                                     l_n_m_203643 +\n                                                     gtid_222092];\n    \n    double x_222100;\n    \n    x_222100 = ((__global double *) ext_mem_229411)[gtid_222091 * l_n_m_203643 +\n                                                    gtid_222092];\n    \n    int64_t min_arg_222101 = mul64(jump_t_203500, gtid_222092);\n    int64_t min_res_222102 = smin64(i_203670, min_arg_222101);\n    int64_t defunc_0_g_res_222103 = add64((int64_t) 1, min_res_222102);\n    int64_t gtid_222106 = sext_i32_i64(sext_i64_i32(ltid_pre_235300));\n    int32_t phys_tid_222107 = local_tid_235296;\n    bool cond_222109 = sle64(n_203490, gtid_222106);\n    int64_t defunc_0_f_res_222110;\n    \n    if (cond_222109) {\n        defunc_0_f_res_222110 = (int64_t) 0;\n    } else {\n        int64_t i_222111 = add64(x_222099, gtid_222106);\n        int64_t defunc_1_add_res_222112 = add64((int64_t) 1, i_222111);\n        \n        defunc_0_f_res_222110 = defunc_1_add_res_222112;\n    }\n    \n    double defunc_0_f_res_222113;\n    \n    if (cond_222109) {\n        defunc_0_f_res_222113 = 0.0;\n    } else {\n        int64_t i_222114 = add64(x_222099, gtid_222106);\n        double defunc_0_add_arg_222115;\n        \n        defunc_0_add_arg_222115 = ((__global\n                                    double *) mem_param_229493)[ctx_param_ext_229488 +\n                                                                (gtid_2",
                   "22091 *\n                                                                 ctx_param_ext_229489 +\n                                                                 i_222114 *\n                                                                 ctx_param_ext_229491)];\n        defunc_0_f_res_222113 = defunc_0_add_arg_222115;\n    }\n    \n    int64_t binop_p_222116 = sub64(defunc_0_f_res_222110,\n                                   defunc_0_g_res_222103);\n    double defunc_0_f_res_222117 = sitofp_i64_f64(binop_p_222116);\n    double abs_res_222118 = fabs(defunc_0_f_res_222117);\n    double tmp1_222119 = abs_res_222118 / x_222100;\n    double x_222120 = tmp1_222119 * tmp1_222119;\n    double y_222121 = tmp1_222119 * x_222120;\n    double tmp2_222122 = 1.0 - y_222121;\n    double x_222123 = tmp2_222122 * tmp2_222122;\n    double tmp3_222124 = tmp2_222122 * x_222123;\n    double tmp4_222125 = defunc_0_f_res_222113 * tmp3_222124;\n    \n    ((__local double *) color_232038)[gtid_222106] = defunc_0_f_res_222117;\n    ((__local double *) color_232037)[gtid_222106] = tmp4_222125;\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    double defunc_2_reduce_res_222126;\n    double defunc_2_reduce_res_222127;\n    double defunc_2_reduce_res_222128;\n    double defunc_2_reduce_res_222129;\n    double defunc_2_reduce_res_222130;\n    int64_t gtid_222133 = sext_i32_i64(sext_i64_i32(ltid_pre_235300));\n    int32_t phys_tid_222134 = local_tid_235296;\n    __local unsigned char *red_arr_mem_235307;\n    \n    red_arr_mem_235307 = (__local unsigned char *) red_arr_mem_235307_backing_4;\n    \n    __local unsigned char *red_arr_mem_235309;\n    \n    red_arr_mem_235309 = (__local unsigned char *) red_arr_mem_235309_backing_5;\n    \n    __local unsigned char *red_arr_mem_235311;\n    \n    red_arr_mem_235311 = (__local unsigned char *) red_arr_mem_235311_backing_6;\n    \n    __local unsigned char *red_arr_mem_235313;\n    \n    red_arr_mem_235313 = (__local unsigned char *) red_arr_mem_235313_backing_7;\n    \n    __local unsigned char *red",
                   "_arr_mem_235315;\n    \n    red_arr_mem_235315 = (__local unsigned char *) red_arr_mem_235315_backing_8;\n    \n    double x_222150;\n    \n    x_222150 = ((__local double *) color_232038)[gtid_222133];\n    \n    double x_222151;\n    \n    x_222151 = ((__local double *) color_232037)[gtid_222133];\n    \n    double defunc_1_f_res_222152 = x_222150 * x_222151;\n    double defunc_1_f_res_222153 = x_222150 * defunc_1_f_res_222152;\n    double defunc_1_f_res_222154 = x_222150 * defunc_1_f_res_222153;\n    double defunc_1_f_res_222155 = x_222150 * defunc_1_f_res_222154;\n    \n    ((__local double *) red_arr_mem_235307)[gtid_222133] = x_222151;\n    ((__local double *) red_arr_mem_235309)[gtid_222133] =\n        defunc_1_f_res_222152;\n    ((__local double *) red_arr_mem_235311)[gtid_222133] =\n        defunc_1_f_res_222153;\n    ((__local double *) red_arr_mem_235313)[gtid_222133] =\n        defunc_1_f_res_222154;\n    ((__local double *) red_arr_mem_235315)[gtid_222133] =\n        defunc_1_f_res_222155;\n    ((__local double *) color_232036)[gtid_222133] = defunc_1_f_res_222153;\n    ((__local double *) color_232035)[gtid_222133] = defunc_1_f_res_222152;\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int32_t offset_235317;\n    int32_t skip_waves_235318 = 1;\n    double x_222135;\n    double x_222136;\n    double x_222137;\n    double x_222138;\n    double x_222139;\n    double x_222140;\n    double x_222141;\n    double x_222142;\n    double x_222143;\n    double x_222144;\n    \n    offset_235317 = 0;\n    // participating threads read initial accumulator\n    {\n        if (slt32(local_tid_235296, sext_i64_i32(q_l_203495))) {\n            x_222135 = ((__local\n                         double *) red_arr_mem_235307)[sext_i32_i64(local_tid_235296 +\n                                                       offset_235317)];\n            x_222136 = ((__local\n                         double *) red_arr_mem_235309)[sext_i32_i64(local_tid_235296 +\n                                                       offset_235317)];\n       ",
                   "     x_222137 = ((__local\n                         double *) red_arr_mem_235311)[sext_i32_i64(local_tid_235296 +\n                                                       offset_235317)];\n            x_222138 = ((__local\n                         double *) red_arr_mem_235313)[sext_i32_i64(local_tid_235296 +\n                                                       offset_235317)];\n            x_222139 = ((__local\n                         double *) red_arr_mem_235315)[sext_i32_i64(local_tid_235296 +\n                                                       offset_235317)];\n        }\n    }\n    offset_235317 = 1;\n    while (slt32(offset_235317, wave_sizze_235298)) {\n        if (slt32(local_tid_235296 + offset_235317, sext_i64_i32(q_l_203495)) &&\n            ((local_tid_235296 - squot32(local_tid_235296, wave_sizze_235298) *\n              wave_sizze_235298) & (2 * offset_235317 - 1)) == 0) {\n            // read array element\n            {\n                x_222140 = ((volatile __local\n                             double *) red_arr_mem_235307)[sext_i32_i64(local_tid_235296 +\n                                                           offset_235317)];\n                x_222141 = ((volatile __local\n                             double *) red_arr_mem_235309)[sext_i32_i64(local_tid_235296 +\n                                                           offset_235317)];\n                x_222142 = ((volatile __local\n                             double *) red_arr_mem_235311)[sext_i32_i64(local_tid_235296 +\n                                                           offset_235317)];\n                x_222143 = ((volatile __local\n                             double *) red_arr_mem_235313)[sext_i32_i64(local_tid_235296 +\n                                                           offset_235317)];\n                x_222144 = ((volatile __local\n                             double *) red_arr_mem_235315)[sext_i32_i64(local_tid_235296 +\n                                                           offset_235317",
                   ")];\n            }\n            // apply reduction operation\n            {\n                double defunc_1_op_res_222145 = x_222135 + x_222140;\n                double defunc_1_op_res_222146 = x_222136 + x_222141;\n                double defunc_1_op_res_222147 = x_222137 + x_222142;\n                double defunc_1_op_res_222148 = x_222138 + x_222143;\n                double defunc_1_op_res_222149 = x_222139 + x_222144;\n                \n                x_222135 = defunc_1_op_res_222145;\n                x_222136 = defunc_1_op_res_222146;\n                x_222137 = defunc_1_op_res_222147;\n                x_222138 = defunc_1_op_res_222148;\n                x_222139 = defunc_1_op_res_222149;\n            }\n            // write result of operation\n            {\n                ((volatile __local\n                  double *) red_arr_mem_235307)[sext_i32_i64(local_tid_235296)] =\n                    x_222135;\n                ((volatile __local\n                  double *) red_arr_mem_235309)[sext_i32_i64(local_tid_235296)] =\n                    x_222136;\n                ((volatile __local\n                  double *) red_arr_mem_235311)[sext_i32_i64(local_tid_235296)] =\n                    x_222137;\n                ((volatile __local\n                  double *) red_arr_mem_235313)[sext_i32_i64(local_tid_235296)] =\n                    x_222138;\n                ((volatile __local\n                  double *) red_arr_mem_235315)[sext_i32_i64(local_tid_235296)] =\n                    x_222139;\n            }\n        }\n        offset_235317 *= 2;\n    }\n    while (slt32(skip_waves_235318, squot32(sext_i64_i32(q_l_203495) +\n                                            wave_sizze_235298 - 1,\n                                            wave_sizze_235298))) {\n        barrier(CLK_LOCAL_MEM_FENCE);\n        offset_235317 = skip_waves_235318 * wave_sizze_235298;\n        if (slt32(local_tid_235296 + offset_235317, sext_i64_i32(q_l_203495)) &&\n            ((local_tid_235296 - squot32(local_tid_235296, wa",
                   "ve_sizze_235298) *\n              wave_sizze_235298) == 0 && (squot32(local_tid_235296,\n                                                  wave_sizze_235298) & (2 *\n                                                                        skip_waves_235318 -\n                                                                        1)) ==\n             0)) {\n            // read array element\n            {\n                x_222140 = ((__local\n                             double *) red_arr_mem_235307)[sext_i32_i64(local_tid_235296 +\n                                                           offset_235317)];\n                x_222141 = ((__local\n                             double *) red_arr_mem_235309)[sext_i32_i64(local_tid_235296 +\n                                                           offset_235317)];\n                x_222142 = ((__local\n                             double *) red_arr_mem_235311)[sext_i32_i64(local_tid_235296 +\n                                                           offset_235317)];\n                x_222143 = ((__local\n                             double *) red_arr_mem_235313)[sext_i32_i64(local_tid_235296 +\n                                                           offset_235317)];\n                x_222144 = ((__local\n                             double *) red_arr_mem_235315)[sext_i32_i64(local_tid_235296 +\n                                                           offset_235317)];\n            }\n            // apply reduction operation\n            {\n                double defunc_1_op_res_222145 = x_222135 + x_222140;\n                double defunc_1_op_res_222146 = x_222136 + x_222141;\n                double defunc_1_op_res_222147 = x_222137 + x_222142;\n                double defunc_1_op_res_222148 = x_222138 + x_222143;\n                double defunc_1_op_res_222149 = x_222139 + x_222144;\n                \n                x_222135 = defunc_1_op_res_222145;\n                x_222136 = defunc_1_op_res_222146;\n                x_222137 = defunc_1_op_res_222",
                   "147;\n                x_222138 = defunc_1_op_res_222148;\n                x_222139 = defunc_1_op_res_222149;\n            }\n            // write result of operation\n            {\n                ((__local\n                  double *) red_arr_mem_235307)[sext_i32_i64(local_tid_235296)] =\n                    x_222135;\n                ((__local\n                  double *) red_arr_mem_235309)[sext_i32_i64(local_tid_235296)] =\n                    x_222136;\n                ((__local\n                  double *) red_arr_mem_235311)[sext_i32_i64(local_tid_235296)] =\n                    x_222137;\n                ((__local\n                  double *) red_arr_mem_235313)[sext_i32_i64(local_tid_235296)] =\n                    x_222138;\n                ((__local\n                  double *) red_arr_mem_235315)[sext_i32_i64(local_tid_235296)] =\n                    x_222139;\n            }\n        }\n        skip_waves_235318 *= 2;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    defunc_2_reduce_res_222126 = ((__local\n                                   double *) red_arr_mem_235307)[(int64_t) 0];\n    defunc_2_reduce_res_222127 = ((__local\n                                   double *) red_arr_mem_235309)[(int64_t) 0];\n    defunc_2_reduce_res_222128 = ((__local\n                                   double *) red_arr_mem_235311)[(int64_t) 0];\n    defunc_2_reduce_res_222129 = ((__local\n                                   double *) red_arr_mem_235313)[(int64_t) 0];\n    defunc_2_reduce_res_222130 = ((__local\n                                   double *) red_arr_mem_235315)[(int64_t) 0];\n    \n    double x_222156 = defunc_2_reduce_res_222128 * defunc_2_reduce_res_222130;\n    double y_222157 = defunc_2_reduce_res_222129 * defunc_2_reduce_res_222129;\n    double a12_222158 = x_222156 - y_222157;\n    double x_222159 = defunc_2_reduce_res_222128 * defunc_2_reduce_res_222129;\n    double y_222160 = defunc_2_reduce_res_222127 * defunc_2_reduce_res_222130;\n    double b12_222161 = x_222159 - y_222160;\n    double x_2221",
                   "62 = defunc_2_reduce_res_222127 * defunc_2_reduce_res_222129;\n    double y_222163 = defunc_2_reduce_res_222128 * defunc_2_reduce_res_222128;\n    double c12_222164 = x_222162 - y_222163;\n    double x_222165 = defunc_2_reduce_res_222126 * defunc_2_reduce_res_222130;\n    double b2_222166 = x_222165 - y_222163;\n    double x_222167 = defunc_2_reduce_res_222127 * defunc_2_reduce_res_222128;\n    double y_222168 = defunc_2_reduce_res_222126 * defunc_2_reduce_res_222129;\n    double c2_222169 = x_222167 - y_222168;\n    double x_222170 = defunc_2_reduce_res_222126 * a12_222158;\n    double y_222171 = defunc_2_reduce_res_222127 * b12_222161;\n    double x_222172 = x_222170 + y_222171;\n    double y_222173 = defunc_2_reduce_res_222128 * c12_222164;\n    double y_222174 = x_222172 + y_222173;\n    double det_222175 = 1.0 / y_222174;\n    double a12_222176 = a12_222158 * det_222175;\n    double b12_222177 = b12_222161 * det_222175;\n    double c12_222178 = c12_222164 * det_222175;\n    double b2_222179 = b2_222166 * det_222175;\n    double c2_222180 = c2_222169 * det_222175;\n    double defunc_2_reduce_res_222181;\n    double defunc_2_reduce_res_222182;\n    int64_t gtid_222183 = sext_i32_i64(sext_i64_i32(ltid_pre_235300));\n    int32_t phys_tid_222184 = local_tid_235296;\n    __local unsigned char *red_arr_mem_235319;\n    \n    red_arr_mem_235319 = (__local unsigned char *) red_arr_mem_235319_backing_9;\n    \n    __local unsigned char *red_arr_mem_235321;\n    \n    red_arr_mem_235321 = (__local\n                          unsigned char *) red_arr_mem_235321_backing_10;\n    \n    double x_222192;\n    \n    x_222192 = ((__local double *) color_232037)[gtid_222183];\n    \n    double x_222193;\n    \n    x_222193 = ((__local double *) color_232035)[gtid_222183];\n    \n    double x_222194;\n    \n    x_222194 = ((__local double *) color_232036)[gtid_222183];\n    \n    bool cond_222195 = sle64(n_203490, gtid_222183);\n    double defunc_0_f_res_222196;\n    \n    if (cond_222195) {\n        defunc_0_f_res_222196 = 0.0;",
                   "\n    } else {\n        int64_t i_222197 = add64(x_222099, gtid_222183);\n        double defunc_0_add_arg_222198;\n        \n        defunc_0_add_arg_222198 = ((__global double *) mem_230551)[gtid_222091 *\n                                                                   n_203490 +\n                                                                   i_222197];\n        defunc_0_f_res_222196 = defunc_0_add_arg_222198;\n    }\n    \n    double x_222199 = a12_222176 * x_222192;\n    double y_222200 = b12_222177 * x_222193;\n    double x_222201 = x_222199 + y_222200;\n    double y_222202 = c12_222178 * x_222194;\n    double x_222203 = x_222201 + y_222202;\n    double defunc_9_fit_fun_res_222204 = defunc_0_f_res_222196 * x_222203;\n    double x_222205 = b12_222177 * x_222192;\n    double y_222206 = b2_222179 * x_222193;\n    double x_222207 = x_222205 + y_222206;\n    double y_222208 = c2_222180 * x_222194;\n    double x_222209 = x_222207 + y_222208;\n    double defunc_9_slope_fun_res_222210 = defunc_0_f_res_222196 * x_222209;\n    \n    ((__local double *) red_arr_mem_235319)[gtid_222183] =\n        defunc_9_fit_fun_res_222204;\n    ((__local double *) red_arr_mem_235321)[gtid_222183] =\n        defunc_9_slope_fun_res_222210;\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int32_t offset_235323;\n    int32_t skip_waves_235324 = 1;\n    double x_222185;\n    double x_222186;\n    double x_222187;\n    double x_222188;\n    \n    offset_235323 = 0;\n    // participating threads read initial accumulator\n    {\n        if (slt32(local_tid_235296, sext_i64_i32(q_l_203495))) {\n            x_222185 = ((__local\n                         double *) red_arr_mem_235319)[sext_i32_i64(local_tid_235296 +\n                                                       offset_235323)];\n            x_222186 = ((__local\n                         double *) red_arr_mem_235321)[sext_i32_i64(local_tid_235296 +\n                                                       offset_235323)];\n        }\n    }\n    offset_235323 = 1;\n    while (slt32(offset",
                   "_235323, wave_sizze_235298)) {\n        if (slt32(local_tid_235296 + offset_235323, sext_i64_i32(q_l_203495)) &&\n            ((local_tid_235296 - squot32(local_tid_235296, wave_sizze_235298) *\n              wave_sizze_235298) & (2 * offset_235323 - 1)) == 0) {\n            // read array element\n            {\n                x_222187 = ((volatile __local\n                             double *) red_arr_mem_235319)[sext_i32_i64(local_tid_235296 +\n                                                           offset_235323)];\n                x_222188 = ((volatile __local\n                             double *) red_arr_mem_235321)[sext_i32_i64(local_tid_235296 +\n                                                           offset_235323)];\n            }\n            // apply reduction operation\n            {\n                double defunc_1_op_res_222189 = x_222185 + x_222187;\n                double defunc_1_op_res_222190 = x_222186 + x_222188;\n                \n                x_222185 = defunc_1_op_res_222189;\n                x_222186 = defunc_1_op_res_222190;\n            }\n            // write result of operation\n            {\n                ((volatile __local\n                  double *) red_arr_mem_235319)[sext_i32_i64(local_tid_235296)] =\n                    x_222185;\n                ((volatile __local\n                  double *) red_arr_mem_235321)[sext_i32_i64(local_tid_235296)] =\n                    x_222186;\n            }\n        }\n        offset_235323 *= 2;\n    }\n    while (slt32(skip_waves_235324, squot32(sext_i64_i32(q_l_203495) +\n                                            wave_sizze_235298 - 1,\n                                            wave_sizze_235298))) {\n        barrier(CLK_LOCAL_MEM_FENCE);\n        offset_235323 = skip_waves_235324 * wave_sizze_235298;\n        if (slt32(local_tid_235296 + offset_235323, sext_i64_i32(q_l_203495)) &&\n            ((local_tid_235296 - squot32(local_tid_235296, wave_sizze_235298) *\n              wave_sizze_235298) == 0 && (squot32(lo",
                   "cal_tid_235296,\n                                                  wave_sizze_235298) & (2 *\n                                                                        skip_waves_235324 -\n                                                                        1)) ==\n             0)) {\n            // read array element\n            {\n                x_222187 = ((__local\n                             double *) red_arr_mem_235319)[sext_i32_i64(local_tid_235296 +\n                                                           offset_235323)];\n                x_222188 = ((__local\n                             double *) red_arr_mem_235321)[sext_i32_i64(local_tid_235296 +\n                                                           offset_235323)];\n            }\n            // apply reduction operation\n            {\n                double defunc_1_op_res_222189 = x_222185 + x_222187;\n                double defunc_1_op_res_222190 = x_222186 + x_222188;\n                \n                x_222185 = defunc_1_op_res_222189;\n                x_222186 = defunc_1_op_res_222190;\n            }\n            // write result of operation\n            {\n                ((__local\n                  double *) red_arr_mem_235319)[sext_i32_i64(local_tid_235296)] =\n                    x_222185;\n                ((__local\n                  double *) red_arr_mem_235321)[sext_i32_i64(local_tid_235296)] =\n                    x_222186;\n            }\n        }\n        skip_waves_235324 *= 2;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    defunc_2_reduce_res_222181 = ((__local\n                                   double *) red_arr_mem_235319)[(int64_t) 0];\n    defunc_2_reduce_res_222182 = ((__local\n                                   double *) red_arr_mem_235321)[(int64_t) 0];\n    if (local_tid_235296 == 0) {\n        ((__global double *) mem_230898)[gtid_222091 * l_n_m_203643 +\n                                         gtid_222092] =\n            defunc_2_reduce_res_222181;\n    }\n    if (local_tid_235296 == 0) {\n        ((__g",
                   "lobal double *) mem_230902)[gtid_222091 * l_n_m_203643 +\n                                         gtid_222092] =\n            defunc_2_reduce_res_222182;\n    }\n    \n  error_5:\n    return;\n}\n__kernel void mainzisegmap_intragroup_225917(__global int *global_failure,\n                                             __local volatile\n                                             int64_t *red_arr_mem_236181_backing_aligned_0,\n                                             __local volatile\n                                             int64_t *red_arr_mem_236177_backing_aligned_1,\n                                             __local volatile\n                                             int64_t *color_232053_backing_aligned_2,\n                                             int64_t n_203490,\n                                             int64_t q_t_203494,\n                                             int64_t jump_t_203500,\n                                             int64_t partition_sizze_203577,\n                                             int64_t t_n_m_203650,\n                                             int64_t i_203670, __global\n                                             unsigned char *ext_mem_229196,\n                                             __global\n                                             unsigned char *ext_mem_229197,\n                                             __global\n                                             unsigned char *ext_mem_229460,\n                                             __global\n                                             unsigned char *ext_mem_229461,\n                                             __global unsigned char *mem_231416,\n                                             __global unsigned char *mem_231420,\n                                             __global unsigned char *mem_231430)\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_236181_bac",
                   "king_2 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_236181_backing_aligned_0;\n    __local volatile unsigned char *restrict red_arr_mem_236177_backing_1 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_236177_backing_aligned_1;\n    __local volatile unsigned char *restrict color_232053_backing_0 =\n                                   (__local volatile\n                                    unsigned char *) color_232053_backing_aligned_2;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_236165;\n    int32_t local_tid_236166;\n    int64_t group_sizze_236169;\n    int32_t wave_sizze_236168;\n    int32_t group_tid_236167;\n    \n    global_tid_236165 = get_global_id(0);\n    local_tid_236166 = get_local_id(0);\n    group_sizze_236169 = get_local_size(0);\n    wave_sizze_236168 = LOCKSTEP_WIDTH;\n    group_tid_236167 = get_group_id(0);\n    \n    int32_t phys_tid_225917 = group_tid_236167;\n    int64_t slice_236171 = q_t_203494;\n    int64_t ltid_pre_236170 = sext_i32_i64(local_tid_236166);\n    int64_t remnant_236172 = sext_i32_i64(local_tid_236166) - ltid_pre_236170;\n    int64_t slice_236173 = t_n_m_203650;\n    int64_t slice_236174 = partition_sizze_203577 * slice_236173;\n    int64_t gtid_225915 = squot64(sext_i32_i64(group_tid_236167), slice_236173);\n    int64_t remnant_236175 = sext_i32_i64(group_tid_236167) - gtid_225915 *\n            slice_236173;\n    int64_t gtid_225916 = remnant_236175;\n    int64_t remnant_236176 = remnant_236175 - gtid_225916;\n    __local unsigned char *color_232053;\n    \n    color_232053 = (__local unsigned char *) color_232053_backing_0;\n    \n    int64_t x_225920;\n    \n    x_225920 = ((__global int64_t *) ext_mem_229196)[gtid_225915];\n    \n    int64_t x_225926;\n    \n    x_225926 = ((__global int64_t *) ext_mem_229461)[gtid_225915 *\n                                                     t_n_m_20",
                   "3650 +\n                                                     gtid_225916];\n    \n    double x_225927;\n    \n    x_225927 = ((__global double *) ext_mem_229460)[gtid_225915 * t_n_m_203650 +\n                                                    gtid_225916];\n    \n    int64_t min_arg_225928 = mul64(jump_t_203500, gtid_225916);\n    int64_t min_res_225929 = smin64(i_203670, min_arg_225928);\n    int64_t defunc_0_g_res_225930 = add64((int64_t) 1, min_res_225929);\n    double defunc_2_reduce_res_225931;\n    int64_t gtid_225933 = sext_i32_i64(sext_i64_i32(ltid_pre_236170));\n    int32_t phys_tid_225934 = local_tid_236166;\n    __local unsigned char *red_arr_mem_236177;\n    \n    red_arr_mem_236177 = (__local unsigned char *) red_arr_mem_236177_backing_1;\n    \n    bool cond_225939 = sle64(x_225920, gtid_225933);\n    int64_t defunc_0_f_res_225940;\n    \n    if (cond_225939) {\n        defunc_0_f_res_225940 = (int64_t) 0;\n    } else {\n        int64_t i_225941 = add64(x_225926, gtid_225933);\n        int64_t defunc_0_add_arg_225942;\n        \n        defunc_0_add_arg_225942 = ((__global\n                                    int64_t *) ext_mem_229197)[gtid_225915 *\n                                                               n_203490 +\n                                                               i_225941];\n        \n        int64_t defunc_1_add_res_225943 = add64((int64_t) 1,\n                                                defunc_0_add_arg_225942);\n        \n        defunc_0_f_res_225940 = defunc_1_add_res_225943;\n    }\n    \n    double defunc_0_f_res_225944;\n    \n    if (cond_225939) {\n        defunc_0_f_res_225944 = 0.0;\n    } else {\n        int64_t i_225945 = add64(x_225926, gtid_225933);\n        double defunc_0_add_arg_225946;\n        \n        defunc_0_add_arg_225946 = ((__global double *) mem_231416)[gtid_225915 *\n                                                                   n_203490 +\n                                                                   i_225945];\n        defunc_0_f_re",
                   "s_225944 = defunc_0_add_arg_225946;\n    }\n    \n    int64_t binop_p_225947 = sub64(defunc_0_f_res_225940,\n                                   defunc_0_g_res_225930);\n    double defunc_0_f_res_225948 = sitofp_i64_f64(binop_p_225947);\n    double abs_res_225949 = fabs(defunc_0_f_res_225948);\n    double tmp1_225950 = abs_res_225949 / x_225927;\n    double x_225951 = tmp1_225950 * tmp1_225950;\n    double y_225952 = tmp1_225950 * x_225951;\n    double tmp2_225953 = 1.0 - y_225952;\n    double x_225954 = tmp2_225953 * tmp2_225953;\n    double tmp3_225955 = tmp2_225953 * x_225954;\n    double tmp4_225956 = defunc_0_f_res_225944 * tmp3_225955;\n    \n    ((__local double *) red_arr_mem_236177)[gtid_225933] = tmp4_225956;\n    ((__local double *) color_232053)[gtid_225933] = tmp4_225956;\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int32_t offset_236179;\n    int32_t skip_waves_236180 = 1;\n    double x_225935;\n    double x_225936;\n    \n    offset_236179 = 0;\n    // participating threads read initial accumulator\n    {\n        if (slt32(local_tid_236166, sext_i64_i32(q_t_203494))) {\n            x_225935 = ((__local\n                         double *) red_arr_mem_236177)[sext_i32_i64(local_tid_236166 +\n                                                       offset_236179)];\n        }\n    }\n    offset_236179 = 1;\n    while (slt32(offset_236179, wave_sizze_236168)) {\n        if (slt32(local_tid_236166 + offset_236179, sext_i64_i32(q_t_203494)) &&\n            ((local_tid_236166 - squot32(local_tid_236166, wave_sizze_236168) *\n              wave_sizze_236168) & (2 * offset_236179 - 1)) == 0) {\n            // read array element\n            {\n                x_225936 = ((volatile __local\n                             double *) red_arr_mem_236177)[sext_i32_i64(local_tid_236166 +\n                                                           offset_236179)];\n            }\n            // apply reduction operation\n            {\n                double defunc_1_op_res_225937 = x_225935 + x_225936;\n            ",
                   "    \n                x_225935 = defunc_1_op_res_225937;\n            }\n            // write result of operation\n            {\n                ((volatile __local\n                  double *) red_arr_mem_236177)[sext_i32_i64(local_tid_236166)] =\n                    x_225935;\n            }\n        }\n        offset_236179 *= 2;\n    }\n    while (slt32(skip_waves_236180, squot32(sext_i64_i32(q_t_203494) +\n                                            wave_sizze_236168 - 1,\n                                            wave_sizze_236168))) {\n        barrier(CLK_LOCAL_MEM_FENCE);\n        offset_236179 = skip_waves_236180 * wave_sizze_236168;\n        if (slt32(local_tid_236166 + offset_236179, sext_i64_i32(q_t_203494)) &&\n            ((local_tid_236166 - squot32(local_tid_236166, wave_sizze_236168) *\n              wave_sizze_236168) == 0 && (squot32(local_tid_236166,\n                                                  wave_sizze_236168) & (2 *\n                                                                        skip_waves_236180 -\n                                                                        1)) ==\n             0)) {\n            // read array element\n            {\n                x_225936 = ((__local\n                             double *) red_arr_mem_236177)[sext_i32_i64(local_tid_236166 +\n                                                           offset_236179)];\n            }\n            // apply reduction operation\n            {\n                double defunc_1_op_res_225937 = x_225935 + x_225936;\n                \n                x_225935 = defunc_1_op_res_225937;\n            }\n            // write result of operation\n            {\n                ((__local\n                  double *) red_arr_mem_236177)[sext_i32_i64(local_tid_236166)] =\n                    x_225935;\n            }\n        }\n        skip_waves_236180 *= 2;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    defunc_2_reduce_res_225931 = ((__local\n                                   double *) red_arr_mem_236177)[",
                   "(int64_t) 0];\n    \n    double a0_225957 = 1.0 / defunc_2_reduce_res_225931;\n    double defunc_2_reduce_res_225958;\n    int64_t gtid_225959 = sext_i32_i64(sext_i64_i32(ltid_pre_236170));\n    int32_t phys_tid_225960 = local_tid_236166;\n    __local unsigned char *red_arr_mem_236181;\n    \n    red_arr_mem_236181 = (__local unsigned char *) red_arr_mem_236181_backing_2;\n    \n    double x_225965;\n    \n    x_225965 = ((__local double *) color_232053)[gtid_225959];\n    \n    bool cond_225966 = sle64(x_225920, gtid_225959);\n    double defunc_0_f_res_225967;\n    \n    if (cond_225966) {\n        defunc_0_f_res_225967 = 0.0;\n    } else {\n        int64_t i_225968 = add64(x_225926, gtid_225959);\n        double defunc_0_add_arg_225969;\n        \n        defunc_0_add_arg_225969 = ((__global double *) mem_231420)[gtid_225915 *\n                                                                   n_203490 +\n                                                                   i_225968];\n        defunc_0_f_res_225967 = defunc_0_add_arg_225969;\n    }\n    \n    double x_225970 = a0_225957 * x_225965;\n    double defunc_9_fit_fun_res_225971 = defunc_0_f_res_225967 * x_225970;\n    \n    ((__local double *) red_arr_mem_236181)[gtid_225959] =\n        defunc_9_fit_fun_res_225971;\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int32_t offset_236183;\n    int32_t skip_waves_236184 = 1;\n    double x_225961;\n    double x_225962;\n    \n    offset_236183 = 0;\n    // participating threads read initial accumulator\n    {\n        if (slt32(local_tid_236166, sext_i64_i32(q_t_203494))) {\n            x_225961 = ((__local\n                         double *) red_arr_mem_236181)[sext_i32_i64(local_tid_236166 +\n                                                       offset_236183)];\n        }\n    }\n    offset_236183 = 1;\n    while (slt32(offset_236183, wave_sizze_236168)) {\n        if (slt32(local_tid_236166 + offset_236183, sext_i64_i32(q_t_203494)) &&\n            ((local_tid_236166 - squot32(local_tid_236166, wave_sizze_236168",
                   ") *\n              wave_sizze_236168) & (2 * offset_236183 - 1)) == 0) {\n            // read array element\n            {\n                x_225962 = ((volatile __local\n                             double *) red_arr_mem_236181)[sext_i32_i64(local_tid_236166 +\n                                                           offset_236183)];\n            }\n            // apply reduction operation\n            {\n                double defunc_1_op_res_225963 = x_225961 + x_225962;\n                \n                x_225961 = defunc_1_op_res_225963;\n            }\n            // write result of operation\n            {\n                ((volatile __local\n                  double *) red_arr_mem_236181)[sext_i32_i64(local_tid_236166)] =\n                    x_225961;\n            }\n        }\n        offset_236183 *= 2;\n    }\n    while (slt32(skip_waves_236184, squot32(sext_i64_i32(q_t_203494) +\n                                            wave_sizze_236168 - 1,\n                                            wave_sizze_236168))) {\n        barrier(CLK_LOCAL_MEM_FENCE);\n        offset_236183 = skip_waves_236184 * wave_sizze_236168;\n        if (slt32(local_tid_236166 + offset_236183, sext_i64_i32(q_t_203494)) &&\n            ((local_tid_236166 - squot32(local_tid_236166, wave_sizze_236168) *\n              wave_sizze_236168) == 0 && (squot32(local_tid_236166,\n                                                  wave_sizze_236168) & (2 *\n                                                                        skip_waves_236184 -\n                                                                        1)) ==\n             0)) {\n            // read array element\n            {\n                x_225962 = ((__local\n                             double *) red_arr_mem_236181)[sext_i32_i64(local_tid_236166 +\n                                                           offset_236183)];\n            }\n            // apply reduction operation\n            {\n                double defunc_1_op_res_225963 = x_225961 + x_2259",
                   "62;\n                \n                x_225961 = defunc_1_op_res_225963;\n            }\n            // write result of operation\n            {\n                ((__local\n                  double *) red_arr_mem_236181)[sext_i32_i64(local_tid_236166)] =\n                    x_225961;\n            }\n        }\n        skip_waves_236184 *= 2;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    defunc_2_reduce_res_225958 = ((__local\n                                   double *) red_arr_mem_236181)[(int64_t) 0];\n    if (local_tid_236166 == 0) {\n        ((__global double *) mem_231430)[gtid_225915 * t_n_m_203650 +\n                                         gtid_225916] =\n            defunc_2_reduce_res_225958;\n    }\n    \n  error_4:\n    return;\n}\n__kernel void mainzisegmap_intragroup_226230(__global int *global_failure,\n                                             __local volatile\n                                             int64_t *red_arr_mem_236227_backing_aligned_0,\n                                             __local volatile\n                                             int64_t *red_arr_mem_236225_backing_aligned_1,\n                                             __local volatile\n                                             int64_t *red_arr_mem_236221_backing_aligned_2,\n                                             __local volatile\n                                             int64_t *red_arr_mem_236219_backing_aligned_3,\n                                             __local volatile\n                                             int64_t *red_arr_mem_236217_backing_aligned_4,\n                                             __local volatile\n                                             int64_t *color_232055_backing_aligned_5,\n                                             __local volatile\n                                             int64_t *color_232054_backing_aligned_6,\n                                             int64_t n_203490,\n                                             int64_t q_t_203494,",
                   "\n                                             int64_t jump_t_203500,\n                                             int64_t partition_sizze_203577,\n                                             int64_t t_n_m_203650,\n                                             int64_t i_203670, __global\n                                             unsigned char *ext_mem_229196,\n                                             __global\n                                             unsigned char *ext_mem_229197,\n                                             __global\n                                             unsigned char *ext_mem_229460,\n                                             __global\n                                             unsigned char *ext_mem_229461,\n                                             __global unsigned char *mem_231440,\n                                             __global unsigned char *mem_231444,\n                                             __global unsigned char *mem_231457,\n                                             __global unsigned char *mem_231461)\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_236227_backing_6 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_236227_backing_aligned_0;\n    __local volatile unsigned char *restrict red_arr_mem_236225_backing_5 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_236225_backing_aligned_1;\n    __local volatile unsigned char *restrict red_arr_mem_236221_backing_4 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_236221_backing_aligned_2;\n    __local volatile unsigned char *restrict red_arr_mem_236219_backing_3 =\n                                   (__local volatile\n                                    unsigned",
                   " char *) red_arr_mem_236219_backing_aligned_3;\n    __local volatile unsigned char *restrict red_arr_mem_236217_backing_2 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_236217_backing_aligned_4;\n    __local volatile unsigned char *restrict color_232055_backing_1 =\n                                   (__local volatile\n                                    unsigned char *) color_232055_backing_aligned_5;\n    __local volatile unsigned char *restrict color_232054_backing_0 =\n                                   (__local volatile\n                                    unsigned char *) color_232054_backing_aligned_6;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_236205;\n    int32_t local_tid_236206;\n    int64_t group_sizze_236209;\n    int32_t wave_sizze_236208;\n    int32_t group_tid_236207;\n    \n    global_tid_236205 = get_global_id(0);\n    local_tid_236206 = get_local_id(0);\n    group_sizze_236209 = get_local_size(0);\n    wave_sizze_236208 = LOCKSTEP_WIDTH;\n    group_tid_236207 = get_group_id(0);\n    \n    int32_t phys_tid_226230 = group_tid_236207;\n    int64_t slice_236211 = q_t_203494;\n    int64_t ltid_pre_236210 = sext_i32_i64(local_tid_236206);\n    int64_t remnant_236212 = sext_i32_i64(local_tid_236206) - ltid_pre_236210;\n    int64_t slice_236213 = t_n_m_203650;\n    int64_t slice_236214 = partition_sizze_203577 * slice_236213;\n    int64_t gtid_226228 = squot64(sext_i32_i64(group_tid_236207), slice_236213);\n    int64_t remnant_236215 = sext_i32_i64(group_tid_236207) - gtid_226228 *\n            slice_236213;\n    int64_t gtid_226229 = remnant_236215;\n    int64_t remnant_236216 = remnant_236215 - gtid_226229;\n    __local unsigned char *color_232054;\n    \n    color_232054 = (__local unsigned char *) color_232054_backing_0;\n    \n    __local unsigned char *color_232055;\n    \n    color_232055 = (__local unsigned char *) color_232055_backing_1;\n    \n    int64_t x_226233;\n    \n    x",
                   "_226233 = ((__global int64_t *) ext_mem_229196)[gtid_226228];\n    \n    int64_t x_226239;\n    \n    x_226239 = ((__global int64_t *) ext_mem_229461)[gtid_226228 *\n                                                     t_n_m_203650 +\n                                                     gtid_226229];\n    \n    double x_226240;\n    \n    x_226240 = ((__global double *) ext_mem_229460)[gtid_226228 * t_n_m_203650 +\n                                                    gtid_226229];\n    \n    int64_t min_arg_226241 = mul64(jump_t_203500, gtid_226229);\n    int64_t min_res_226242 = smin64(i_203670, min_arg_226241);\n    int64_t defunc_0_g_res_226243 = add64((int64_t) 1, min_res_226242);\n    double defunc_2_reduce_res_226244;\n    double defunc_2_reduce_res_226245;\n    double defunc_2_reduce_res_226246;\n    int64_t gtid_226249 = sext_i32_i64(sext_i64_i32(ltid_pre_236210));\n    int32_t phys_tid_226250 = local_tid_236206;\n    __local unsigned char *red_arr_mem_236217;\n    \n    red_arr_mem_236217 = (__local unsigned char *) red_arr_mem_236217_backing_2;\n    \n    __local unsigned char *red_arr_mem_236219;\n    \n    red_arr_mem_236219 = (__local unsigned char *) red_arr_mem_236219_backing_3;\n    \n    __local unsigned char *red_arr_mem_236221;\n    \n    red_arr_mem_236221 = (__local unsigned char *) red_arr_mem_236221_backing_4;\n    \n    bool cond_226261 = sle64(x_226233, gtid_226249);\n    int64_t defunc_0_f_res_226262;\n    \n    if (cond_226261) {\n        defunc_0_f_res_226262 = (int64_t) 0;\n    } else {\n        int64_t i_226263 = add64(x_226239, gtid_226249);\n        int64_t defunc_0_add_arg_226264;\n        \n        defunc_0_add_arg_226264 = ((__global\n                                    int64_t *) ext_mem_229197)[gtid_226228 *\n                                                               n_203490 +\n                                                               i_226263];\n        \n        int64_t defunc_1_add_res_226265 = add64((int64_t) 1,\n                                                def",
                   "unc_0_add_arg_226264);\n        \n        defunc_0_f_res_226262 = defunc_1_add_res_226265;\n    }\n    \n    double defunc_0_f_res_226266;\n    \n    if (cond_226261) {\n        defunc_0_f_res_226266 = 0.0;\n    } else {\n        int64_t i_226267 = add64(x_226239, gtid_226249);\n        double defunc_0_add_arg_226268;\n        \n        defunc_0_add_arg_226268 = ((__global double *) mem_231440)[gtid_226228 *\n                                                                   n_203490 +\n                                                                   i_226267];\n        defunc_0_f_res_226266 = defunc_0_add_arg_226268;\n    }\n    \n    int64_t binop_p_226269 = sub64(defunc_0_f_res_226262,\n                                   defunc_0_g_res_226243);\n    double defunc_0_f_res_226270 = sitofp_i64_f64(binop_p_226269);\n    double abs_res_226271 = fabs(defunc_0_f_res_226270);\n    double tmp1_226272 = abs_res_226271 / x_226240;\n    double x_226273 = tmp1_226272 * tmp1_226272;\n    double y_226274 = tmp1_226272 * x_226273;\n    double tmp2_226275 = 1.0 - y_226274;\n    double x_226276 = tmp2_226275 * tmp2_226275;\n    double tmp3_226277 = tmp2_226275 * x_226276;\n    double tmp4_226278 = defunc_0_f_res_226266 * tmp3_226277;\n    double defunc_1_f_res_226279 = defunc_0_f_res_226270 * tmp4_226278;\n    double defunc_1_f_res_226280 = defunc_0_f_res_226270 *\n           defunc_1_f_res_226279;\n    \n    ((__local double *) red_arr_mem_236217)[gtid_226249] = tmp4_226278;\n    ((__local double *) red_arr_mem_236219)[gtid_226249] =\n        defunc_1_f_res_226279;\n    ((__local double *) red_arr_mem_236221)[gtid_226249] =\n        defunc_1_f_res_226280;\n    ((__local double *) color_232055)[gtid_226249] = defunc_1_f_res_226279;\n    ((__local double *) color_232054)[gtid_226249] = tmp4_226278;\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int32_t offset_236223;\n    int32_t skip_waves_236224 = 1;\n    double x_226251;\n    double x_226252;\n    double x_226253;\n    double x_226254;\n    double x_226255;\n    double x_22625",
                   "6;\n    \n    offset_236223 = 0;\n    // participating threads read initial accumulator\n    {\n        if (slt32(local_tid_236206, sext_i64_i32(q_t_203494))) {\n            x_226251 = ((__local\n                         double *) red_arr_mem_236217)[sext_i32_i64(local_tid_236206 +\n                                                       offset_236223)];\n            x_226252 = ((__local\n                         double *) red_arr_mem_236219)[sext_i32_i64(local_tid_236206 +\n                                                       offset_236223)];\n            x_226253 = ((__local\n                         double *) red_arr_mem_236221)[sext_i32_i64(local_tid_236206 +\n                                                       offset_236223)];\n        }\n    }\n    offset_236223 = 1;\n    while (slt32(offset_236223, wave_sizze_236208)) {\n        if (slt32(local_tid_236206 + offset_236223, sext_i64_i32(q_t_203494)) &&\n            ((local_tid_236206 - squot32(local_tid_236206, wave_sizze_236208) *\n              wave_sizze_236208) & (2 * offset_236223 - 1)) == 0) {\n            // read array element\n            {\n                x_226254 = ((volatile __local\n                             double *) red_arr_mem_236217)[sext_i32_i64(local_tid_236206 +\n                                                           offset_236223)];\n                x_226255 = ((volatile __local\n                             double *) red_arr_mem_236219)[sext_i32_i64(local_tid_236206 +\n                                                           offset_236223)];\n                x_226256 = ((volatile __local\n                             double *) red_arr_mem_236221)[sext_i32_i64(local_tid_236206 +\n                                                           offset_236223)];\n            }\n            // apply reduction operation\n            {\n                double defunc_1_op_res_226257 = x_226251 + x_226254;\n                double defunc_1_op_res_226258 = x_226252 + x_226255;\n                double defunc_1_op_res_226259 = x_22",
                   "6253 + x_226256;\n                \n                x_226251 = defunc_1_op_res_226257;\n                x_226252 = defunc_1_op_res_226258;\n                x_226253 = defunc_1_op_res_226259;\n            }\n            // write result of operation\n            {\n                ((volatile __local\n                  double *) red_arr_mem_236217)[sext_i32_i64(local_tid_236206)] =\n                    x_226251;\n                ((volatile __local\n                  double *) red_arr_mem_236219)[sext_i32_i64(local_tid_236206)] =\n                    x_226252;\n                ((volatile __local\n                  double *) red_arr_mem_236221)[sext_i32_i64(local_tid_236206)] =\n                    x_226253;\n            }\n        }\n        offset_236223 *= 2;\n    }\n    while (slt32(skip_waves_236224, squot32(sext_i64_i32(q_t_203494) +\n                                            wave_sizze_236208 - 1,\n                                            wave_sizze_236208))) {\n        barrier(CLK_LOCAL_MEM_FENCE);\n        offset_236223 = skip_waves_236224 * wave_sizze_236208;\n        if (slt32(local_tid_236206 + offset_236223, sext_i64_i32(q_t_203494)) &&\n            ((local_tid_236206 - squot32(local_tid_236206, wave_sizze_236208) *\n              wave_sizze_236208) == 0 && (squot32(local_tid_236206,\n                                                  wave_sizze_236208) & (2 *\n                                                                        skip_waves_236224 -\n                                                                        1)) ==\n             0)) {\n            // read array element\n            {\n                x_226254 = ((__local\n                             double *) red_arr_mem_236217)[sext_i32_i64(local_tid_236206 +\n                                                           offset_236223)];\n                x_226255 = ((__local\n                             double *) red_arr_mem_236219)[sext_i32_i64(local_tid_236206 +\n                                                           offse",
                   "t_236223)];\n                x_226256 = ((__local\n                             double *) red_arr_mem_236221)[sext_i32_i64(local_tid_236206 +\n                                                           offset_236223)];\n            }\n            // apply reduction operation\n            {\n                double defunc_1_op_res_226257 = x_226251 + x_226254;\n                double defunc_1_op_res_226258 = x_226252 + x_226255;\n                double defunc_1_op_res_226259 = x_226253 + x_226256;\n                \n                x_226251 = defunc_1_op_res_226257;\n                x_226252 = defunc_1_op_res_226258;\n                x_226253 = defunc_1_op_res_226259;\n            }\n            // write result of operation\n            {\n                ((__local\n                  double *) red_arr_mem_236217)[sext_i32_i64(local_tid_236206)] =\n                    x_226251;\n                ((__local\n                  double *) red_arr_mem_236219)[sext_i32_i64(local_tid_236206)] =\n                    x_226252;\n                ((__local\n                  double *) red_arr_mem_236221)[sext_i32_i64(local_tid_236206)] =\n                    x_226253;\n            }\n        }\n        skip_waves_236224 *= 2;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    defunc_2_reduce_res_226244 = ((__local\n                                   double *) red_arr_mem_236217)[(int64_t) 0];\n    defunc_2_reduce_res_226245 = ((__local\n                                   double *) red_arr_mem_236219)[(int64_t) 0];\n    defunc_2_reduce_res_226246 = ((__local\n                                   double *) red_arr_mem_236221)[(int64_t) 0];\n    \n    double x_226281 = defunc_2_reduce_res_226244 * defunc_2_reduce_res_226246;\n    double y_226282 = defunc_2_reduce_res_226245 * defunc_2_reduce_res_226245;\n    double y_226283 = x_226281 - y_226282;\n    double det1_226284 = 1.0 / y_226283;\n    double a11_226285 = defunc_2_reduce_res_226246 * det1_226284;\n    double x_226286 = 0.0 - defunc_2_reduce_res_226245;\n    double b11_226287 = ",
                   "det1_226284 * x_226286;\n    double c11_226288 = defunc_2_reduce_res_226244 * det1_226284;\n    double defunc_2_reduce_res_226289;\n    double defunc_2_reduce_res_226290;\n    int64_t gtid_226291 = sext_i32_i64(sext_i64_i32(ltid_pre_236210));\n    int32_t phys_tid_226292 = local_tid_236206;\n    __local unsigned char *red_arr_mem_236225;\n    \n    red_arr_mem_236225 = (__local unsigned char *) red_arr_mem_236225_backing_5;\n    \n    __local unsigned char *red_arr_mem_236227;\n    \n    red_arr_mem_236227 = (__local unsigned char *) red_arr_mem_236227_backing_6;\n    \n    double x_226300;\n    \n    x_226300 = ((__local double *) color_232054)[gtid_226291];\n    \n    double x_226301;\n    \n    x_226301 = ((__local double *) color_232055)[gtid_226291];\n    \n    bool cond_226302 = sle64(x_226233, gtid_226291);\n    double defunc_0_f_res_226303;\n    \n    if (cond_226302) {\n        defunc_0_f_res_226303 = 0.0;\n    } else {\n        int64_t i_226304 = add64(x_226239, gtid_226291);\n        double defunc_0_add_arg_226305;\n        \n        defunc_0_add_arg_226305 = ((__global double *) mem_231444)[gtid_226228 *\n                                                                   n_203490 +\n                                                                   i_226304];\n        defunc_0_f_res_226303 = defunc_0_add_arg_226305;\n    }\n    \n    double x_226306 = a11_226285 * x_226300;\n    double y_226307 = b11_226287 * x_226301;\n    double x_226308 = x_226306 + y_226307;\n    double defunc_9_fit_fun_res_226309 = defunc_0_f_res_226303 * x_226308;\n    double x_226310 = b11_226287 * x_226300;\n    double y_226311 = c11_226288 * x_226301;\n    double x_226312 = x_226310 + y_226311;\n    double defunc_9_slope_fun_res_226313 = defunc_0_f_res_226303 * x_226312;\n    \n    ((__local double *) red_arr_mem_236225)[gtid_226291] =\n        defunc_9_fit_fun_res_226309;\n    ((__local double *) red_arr_mem_236227)[gtid_226291] =\n        defunc_9_slope_fun_res_226313;\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int32_t offse",
                   "t_236229;\n    int32_t skip_waves_236230 = 1;\n    double x_226293;\n    double x_226294;\n    double x_226295;\n    double x_226296;\n    \n    offset_236229 = 0;\n    // participating threads read initial accumulator\n    {\n        if (slt32(local_tid_236206, sext_i64_i32(q_t_203494))) {\n            x_226293 = ((__local\n                         double *) red_arr_mem_236225)[sext_i32_i64(local_tid_236206 +\n                                                       offset_236229)];\n            x_226294 = ((__local\n                         double *) red_arr_mem_236227)[sext_i32_i64(local_tid_236206 +\n                                                       offset_236229)];\n        }\n    }\n    offset_236229 = 1;\n    while (slt32(offset_236229, wave_sizze_236208)) {\n        if (slt32(local_tid_236206 + offset_236229, sext_i64_i32(q_t_203494)) &&\n            ((local_tid_236206 - squot32(local_tid_236206, wave_sizze_236208) *\n              wave_sizze_236208) & (2 * offset_236229 - 1)) == 0) {\n            // read array element\n            {\n                x_226295 = ((volatile __local\n                             double *) red_arr_mem_236225)[sext_i32_i64(local_tid_236206 +\n                                                           offset_236229)];\n                x_226296 = ((volatile __local\n                             double *) red_arr_mem_236227)[sext_i32_i64(local_tid_236206 +\n                                                           offset_236229)];\n            }\n            // apply reduction operation\n            {\n                double defunc_1_op_res_226297 = x_226293 + x_226295;\n                double defunc_1_op_res_226298 = x_226294 + x_226296;\n                \n                x_226293 = defunc_1_op_res_226297;\n                x_226294 = defunc_1_op_res_226298;\n            }\n            // write result of operation\n            {\n                ((volatile __local\n                  double *) red_arr_mem_236225)[sext_i32_i64(local_tid_236206)] =\n                    x_2262",
                   "93;\n                ((volatile __local\n                  double *) red_arr_mem_236227)[sext_i32_i64(local_tid_236206)] =\n                    x_226294;\n            }\n        }\n        offset_236229 *= 2;\n    }\n    while (slt32(skip_waves_236230, squot32(sext_i64_i32(q_t_203494) +\n                                            wave_sizze_236208 - 1,\n                                            wave_sizze_236208))) {\n        barrier(CLK_LOCAL_MEM_FENCE);\n        offset_236229 = skip_waves_236230 * wave_sizze_236208;\n        if (slt32(local_tid_236206 + offset_236229, sext_i64_i32(q_t_203494)) &&\n            ((local_tid_236206 - squot32(local_tid_236206, wave_sizze_236208) *\n              wave_sizze_236208) == 0 && (squot32(local_tid_236206,\n                                                  wave_sizze_236208) & (2 *\n                                                                        skip_waves_236230 -\n                                                                        1)) ==\n             0)) {\n            // read array element\n            {\n                x_226295 = ((__local\n                             double *) red_arr_mem_236225)[sext_i32_i64(local_tid_236206 +\n                                                           offset_236229)];\n                x_226296 = ((__local\n                             double *) red_arr_mem_236227)[sext_i32_i64(local_tid_236206 +\n                                                           offset_236229)];\n            }\n            // apply reduction operation\n            {\n                double defunc_1_op_res_226297 = x_226293 + x_226295;\n                double defunc_1_op_res_226298 = x_226294 + x_226296;\n                \n                x_226293 = defunc_1_op_res_226297;\n                x_226294 = defunc_1_op_res_226298;\n            }\n            // write result of operation\n            {\n                ((__local\n                  double *) red_arr_mem_236225)[sext_i32_i64(local_tid_236206)] =\n                    x_226293;\n ",
                   "               ((__local\n                  double *) red_arr_mem_236227)[sext_i32_i64(local_tid_236206)] =\n                    x_226294;\n            }\n        }\n        skip_waves_236230 *= 2;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    defunc_2_reduce_res_226289 = ((__local\n                                   double *) red_arr_mem_236225)[(int64_t) 0];\n    defunc_2_reduce_res_226290 = ((__local\n                                   double *) red_arr_mem_236227)[(int64_t) 0];\n    if (local_tid_236206 == 0) {\n        ((__global double *) mem_231457)[gtid_226228 * t_n_m_203650 +\n                                         gtid_226229] =\n            defunc_2_reduce_res_226289;\n    }\n    if (local_tid_236206 == 0) {\n        ((__global double *) mem_231461)[gtid_226228 * t_n_m_203650 +\n                                         gtid_226229] =\n            defunc_2_reduce_res_226290;\n    }\n    \n  error_4:\n    return;\n}\n__kernel void mainzisegmap_intragroup_226634(__global int *global_failure,\n                                             __local volatile\n                                             int64_t *red_arr_mem_236277_backing_aligned_0,\n                                             __local volatile\n                                             int64_t *red_arr_mem_236275_backing_aligned_1,\n                                             __local volatile\n                                             int64_t *red_arr_mem_236271_backing_aligned_2,\n                                             __local volatile\n                                             int64_t *red_arr_mem_236269_backing_aligned_3,\n                                             __local volatile\n                                             int64_t *red_arr_mem_236267_backing_aligned_4,\n                                             __local volatile\n                                             int64_t *red_arr_mem_236265_backing_aligned_5,\n                                             __local volatile\n                      ",
                   "                       int64_t *red_arr_mem_236263_backing_aligned_6,\n                                             __local volatile\n                                             int64_t *color_232059_backing_aligned_7,\n                                             __local volatile\n                                             int64_t *color_232058_backing_aligned_8,\n                                             __local volatile\n                                             int64_t *color_232057_backing_aligned_9,\n                                             __local volatile\n                                             int64_t *color_232056_backing_aligned_10,\n                                             int64_t n_203490,\n                                             int64_t q_t_203494,\n                                             int64_t jump_t_203500,\n                                             int64_t partition_sizze_203577,\n                                             int64_t t_n_m_203650,\n                                             int64_t i_203670, __global\n                                             unsigned char *ext_mem_229196,\n                                             __global\n                                             unsigned char *ext_mem_229197,\n                                             __global\n                                             unsigned char *ext_mem_229460,\n                                             __global\n                                             unsigned char *ext_mem_229461,\n                                             __global unsigned char *mem_231471,\n                                             __global unsigned char *mem_231475,\n                                             __global unsigned char *mem_231495,\n                                             __global unsigned char *mem_231499)\n{\n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    __local volatile unsigned char *restric",
                   "t red_arr_mem_236277_backing_10 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_236277_backing_aligned_0;\n    __local volatile unsigned char *restrict red_arr_mem_236275_backing_9 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_236275_backing_aligned_1;\n    __local volatile unsigned char *restrict red_arr_mem_236271_backing_8 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_236271_backing_aligned_2;\n    __local volatile unsigned char *restrict red_arr_mem_236269_backing_7 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_236269_backing_aligned_3;\n    __local volatile unsigned char *restrict red_arr_mem_236267_backing_6 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_236267_backing_aligned_4;\n    __local volatile unsigned char *restrict red_arr_mem_236265_backing_5 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_236265_backing_aligned_5;\n    __local volatile unsigned char *restrict red_arr_mem_236263_backing_4 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_236263_backing_aligned_6;\n    __local volatile unsigned char *restrict color_232059_backing_3 =\n                                   (__local volatile\n                                    unsigned char *) color_232059_backing_aligned_7;\n    __local volatile unsigned char *restrict color_232058_backing_2 =\n                                   (__local volatile\n                                    unsigned char *) color_232058_backing_aligned_8;\n    __local volatile unsigned char *restrict color_232057_backing_1 =\n                ",
                   "                   (__local volatile\n                                    unsigned char *) color_232057_backing_aligned_9;\n    __local volatile unsigned char *restrict color_232056_backing_0 =\n                                   (__local volatile\n                                    unsigned char *) color_232056_backing_aligned_10;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_236251;\n    int32_t local_tid_236252;\n    int64_t group_sizze_236255;\n    int32_t wave_sizze_236254;\n    int32_t group_tid_236253;\n    \n    global_tid_236251 = get_global_id(0);\n    local_tid_236252 = get_local_id(0);\n    group_sizze_236255 = get_local_size(0);\n    wave_sizze_236254 = LOCKSTEP_WIDTH;\n    group_tid_236253 = get_group_id(0);\n    \n    int32_t phys_tid_226634 = group_tid_236253;\n    int64_t slice_236257 = q_t_203494;\n    int64_t ltid_pre_236256 = sext_i32_i64(local_tid_236252);\n    int64_t remnant_236258 = sext_i32_i64(local_tid_236252) - ltid_pre_236256;\n    int64_t slice_236259 = t_n_m_203650;\n    int64_t slice_236260 = partition_sizze_203577 * slice_236259;\n    int64_t gtid_226632 = squot64(sext_i32_i64(group_tid_236253), slice_236259);\n    int64_t remnant_236261 = sext_i32_i64(group_tid_236253) - gtid_226632 *\n            slice_236259;\n    int64_t gtid_226633 = remnant_236261;\n    int64_t remnant_236262 = remnant_236261 - gtid_226633;\n    __local unsigned char *color_232056;\n    \n    color_232056 = (__local unsigned char *) color_232056_backing_0;\n    \n    __local unsigned char *color_232057;\n    \n    color_232057 = (__local unsigned char *) color_232057_backing_1;\n    \n    __local unsigned char *color_232058;\n    \n    color_232058 = (__local unsigned char *) color_232058_backing_2;\n    \n    __local unsigned char *color_232059;\n    \n    color_232059 = (__local unsigned char *) color_232059_backing_3;\n    \n    int64_t x_226637;\n    \n    x_226637 = ((__global int64_t *) ext_mem_229196)[gtid_226632];\n    \n    int64_t x_226643;\n    \n    x_226643 = ((_",
                   "_global int64_t *) ext_mem_229461)[gtid_226632 *\n                                                     t_n_m_203650 +\n                                                     gtid_226633];\n    \n    double x_226644;\n    \n    x_226644 = ((__global double *) ext_mem_229460)[gtid_226632 * t_n_m_203650 +\n                                                    gtid_226633];\n    \n    int64_t min_arg_226645 = mul64(jump_t_203500, gtid_226633);\n    int64_t min_res_226646 = smin64(i_203670, min_arg_226645);\n    int64_t defunc_0_g_res_226647 = add64((int64_t) 1, min_res_226646);\n    int64_t gtid_226650 = sext_i32_i64(sext_i64_i32(ltid_pre_236256));\n    int32_t phys_tid_226651 = local_tid_236252;\n    bool cond_226653 = sle64(x_226637, gtid_226650);\n    int64_t defunc_0_f_res_226654;\n    \n    if (cond_226653) {\n        defunc_0_f_res_226654 = (int64_t) 0;\n    } else {\n        int64_t i_226655 = add64(x_226643, gtid_226650);\n        int64_t defunc_0_add_arg_226656;\n        \n        defunc_0_add_arg_226656 = ((__global\n                                    int64_t *) ext_mem_229197)[gtid_226632 *\n                                                               n_203490 +\n                                                               i_226655];\n        \n        int64_t defunc_1_add_res_226657 = add64((int64_t) 1,\n                                                defunc_0_add_arg_226656);\n        \n        defunc_0_f_res_226654 = defunc_1_add_res_226657;\n    }\n    \n    double defunc_0_f_res_226658;\n    \n    if (cond_226653) {\n        defunc_0_f_res_226658 = 0.0;\n    } else {\n        int64_t i_226659 = add64(x_226643, gtid_226650);\n        double defunc_0_add_arg_226660;\n        \n        defunc_0_add_arg_226660 = ((__global double *) mem_231471)[gtid_226632 *\n                                                                   n_203490 +\n                                                                   i_226659];\n        defunc_0_f_res_226658 = defunc_0_add_arg_226660;\n    }\n    \n    int64_t binop_p_",
                   "226661 = sub64(defunc_0_f_res_226654,\n                                   defunc_0_g_res_226647);\n    double defunc_0_f_res_226662 = sitofp_i64_f64(binop_p_226661);\n    double abs_res_226663 = fabs(defunc_0_f_res_226662);\n    double tmp1_226664 = abs_res_226663 / x_226644;\n    double x_226665 = tmp1_226664 * tmp1_226664;\n    double y_226666 = tmp1_226664 * x_226665;\n    double tmp2_226667 = 1.0 - y_226666;\n    double x_226668 = tmp2_226667 * tmp2_226667;\n    double tmp3_226669 = tmp2_226667 * x_226668;\n    double tmp4_226670 = defunc_0_f_res_226658 * tmp3_226669;\n    \n    ((__local double *) color_232059)[gtid_226650] = defunc_0_f_res_226662;\n    ((__local double *) color_232058)[gtid_226650] = tmp4_226670;\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    double defunc_2_reduce_res_226671;\n    double defunc_2_reduce_res_226672;\n    double defunc_2_reduce_res_226673;\n    double defunc_2_reduce_res_226674;\n    double defunc_2_reduce_res_226675;\n    int64_t gtid_226678 = sext_i32_i64(sext_i64_i32(ltid_pre_236256));\n    int32_t phys_tid_226679 = local_tid_236252;\n    __local unsigned char *red_arr_mem_236263;\n    \n    red_arr_mem_236263 = (__local unsigned char *) red_arr_mem_236263_backing_4;\n    \n    __local unsigned char *red_arr_mem_236265;\n    \n    red_arr_mem_236265 = (__local unsigned char *) red_arr_mem_236265_backing_5;\n    \n    __local unsigned char *red_arr_mem_236267;\n    \n    red_arr_mem_236267 = (__local unsigned char *) red_arr_mem_236267_backing_6;\n    \n    __local unsigned char *red_arr_mem_236269;\n    \n    red_arr_mem_236269 = (__local unsigned char *) red_arr_mem_236269_backing_7;\n    \n    __local unsigned char *red_arr_mem_236271;\n    \n    red_arr_mem_236271 = (__local unsigned char *) red_arr_mem_236271_backing_8;\n    \n    double x_226695;\n    \n    x_226695 = ((__local double *) color_232059)[gtid_226678];\n    \n    double x_226696;\n    \n    x_226696 = ((__local double *) color_232058)[gtid_226678];\n    \n    double defunc_1_f_res_226697 = x_226695 * x_22669",
                   "6;\n    double defunc_1_f_res_226698 = x_226695 * defunc_1_f_res_226697;\n    double defunc_1_f_res_226699 = x_226695 * defunc_1_f_res_226698;\n    double defunc_1_f_res_226700 = x_226695 * defunc_1_f_res_226699;\n    \n    ((__local double *) red_arr_mem_236263)[gtid_226678] = x_226696;\n    ((__local double *) red_arr_mem_236265)[gtid_226678] =\n        defunc_1_f_res_226697;\n    ((__local double *) red_arr_mem_236267)[gtid_226678] =\n        defunc_1_f_res_226698;\n    ((__local double *) red_arr_mem_236269)[gtid_226678] =\n        defunc_1_f_res_226699;\n    ((__local double *) red_arr_mem_236271)[gtid_226678] =\n        defunc_1_f_res_226700;\n    ((__local double *) color_232057)[gtid_226678] = defunc_1_f_res_226698;\n    ((__local double *) color_232056)[gtid_226678] = defunc_1_f_res_226697;\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int32_t offset_236273;\n    int32_t skip_waves_236274 = 1;\n    double x_226680;\n    double x_226681;\n    double x_226682;\n    double x_226683;\n    double x_226684;\n    double x_226685;\n    double x_226686;\n    double x_226687;\n    double x_226688;\n    double x_226689;\n    \n    offset_236273 = 0;\n    // participating threads read initial accumulator\n    {\n        if (slt32(local_tid_236252, sext_i64_i32(q_t_203494))) {\n            x_226680 = ((__local\n                         double *) red_arr_mem_236263)[sext_i32_i64(local_tid_236252 +\n                                                       offset_236273)];\n            x_226681 = ((__local\n                         double *) red_arr_mem_236265)[sext_i32_i64(local_tid_236252 +\n                                                       offset_236273)];\n            x_226682 = ((__local\n                         double *) red_arr_mem_236267)[sext_i32_i64(local_tid_236252 +\n                                                       offset_236273)];\n            x_226683 = ((__local\n                         double *) red_arr_mem_236269)[sext_i32_i64(local_tid_236252 +\n                                            ",
                   "           offset_236273)];\n            x_226684 = ((__local\n                         double *) red_arr_mem_236271)[sext_i32_i64(local_tid_236252 +\n                                                       offset_236273)];\n        }\n    }\n    offset_236273 = 1;\n    while (slt32(offset_236273, wave_sizze_236254)) {\n        if (slt32(local_tid_236252 + offset_236273, sext_i64_i32(q_t_203494)) &&\n            ((local_tid_236252 - squot32(local_tid_236252, wave_sizze_236254) *\n              wave_sizze_236254) & (2 * offset_236273 - 1)) == 0) {\n            // read array element\n            {\n                x_226685 = ((volatile __local\n                             double *) red_arr_mem_236263)[sext_i32_i64(local_tid_236252 +\n                                                           offset_236273)];\n                x_226686 = ((volatile __local\n                             double *) red_arr_mem_236265)[sext_i32_i64(local_tid_236252 +\n                                                           offset_236273)];\n                x_226687 = ((volatile __local\n                             double *) red_arr_mem_236267)[sext_i32_i64(local_tid_236252 +\n                                                           offset_236273)];\n                x_226688 = ((volatile __local\n                             double *) red_arr_mem_236269)[sext_i32_i64(local_tid_236252 +\n                                                           offset_236273)];\n                x_226689 = ((volatile __local\n                             double *) red_arr_mem_236271)[sext_i32_i64(local_tid_236252 +\n                                                           offset_236273)];\n            }\n            // apply reduction operation\n            {\n                double defunc_1_op_res_226690 = x_226680 + x_226685;\n                double defunc_1_op_res_226691 = x_226681 + x_226686;\n                double defunc_1_op_res_226692 = x_226682 + x_226687;\n                double defunc_1_op_res_226693 = x_226683 + x_226688;\n",
                   "                double defunc_1_op_res_226694 = x_226684 + x_226689;\n                \n                x_226680 = defunc_1_op_res_226690;\n                x_226681 = defunc_1_op_res_226691;\n                x_226682 = defunc_1_op_res_226692;\n                x_226683 = defunc_1_op_res_226693;\n                x_226684 = defunc_1_op_res_226694;\n            }\n            // write result of operation\n            {\n                ((volatile __local\n                  double *) red_arr_mem_236263)[sext_i32_i64(local_tid_236252)] =\n                    x_226680;\n                ((volatile __local\n                  double *) red_arr_mem_236265)[sext_i32_i64(local_tid_236252)] =\n                    x_226681;\n                ((volatile __local\n                  double *) red_arr_mem_236267)[sext_i32_i64(local_tid_236252)] =\n                    x_226682;\n                ((volatile __local\n                  double *) red_arr_mem_236269)[sext_i32_i64(local_tid_236252)] =\n                    x_226683;\n                ((volatile __local\n                  double *) red_arr_mem_236271)[sext_i32_i64(local_tid_236252)] =\n                    x_226684;\n            }\n        }\n        offset_236273 *= 2;\n    }\n    while (slt32(skip_waves_236274, squot32(sext_i64_i32(q_t_203494) +\n                                            wave_sizze_236254 - 1,\n                                            wave_sizze_236254))) {\n        barrier(CLK_LOCAL_MEM_FENCE);\n        offset_236273 = skip_waves_236274 * wave_sizze_236254;\n        if (slt32(local_tid_236252 + offset_236273, sext_i64_i32(q_t_203494)) &&\n            ((local_tid_236252 - squot32(local_tid_236252, wave_sizze_236254) *\n              wave_sizze_236254) == 0 && (squot32(local_tid_236252,\n                                                  wave_sizze_236254) & (2 *\n                                                                        skip_waves_236274 -\n                                                                        1)) ==\n             0)",
                   ") {\n            // read array element\n            {\n                x_226685 = ((__local\n                             double *) red_arr_mem_236263)[sext_i32_i64(local_tid_236252 +\n                                                           offset_236273)];\n                x_226686 = ((__local\n                             double *) red_arr_mem_236265)[sext_i32_i64(local_tid_236252 +\n                                                           offset_236273)];\n                x_226687 = ((__local\n                             double *) red_arr_mem_236267)[sext_i32_i64(local_tid_236252 +\n                                                           offset_236273)];\n                x_226688 = ((__local\n                             double *) red_arr_mem_236269)[sext_i32_i64(local_tid_236252 +\n                                                           offset_236273)];\n                x_226689 = ((__local\n                             double *) red_arr_mem_236271)[sext_i32_i64(local_tid_236252 +\n                                                           offset_236273)];\n            }\n            // apply reduction operation\n            {\n                double defunc_1_op_res_226690 = x_226680 + x_226685;\n                double defunc_1_op_res_226691 = x_226681 + x_226686;\n                double defunc_1_op_res_226692 = x_226682 + x_226687;\n                double defunc_1_op_res_226693 = x_226683 + x_226688;\n                double defunc_1_op_res_226694 = x_226684 + x_226689;\n                \n                x_226680 = defunc_1_op_res_226690;\n                x_226681 = defunc_1_op_res_226691;\n                x_226682 = defunc_1_op_res_226692;\n                x_226683 = defunc_1_op_res_226693;\n                x_226684 = defunc_1_op_res_226694;\n            }\n            // write result of operation\n            {\n                ((__local\n                  double *) red_arr_mem_236263)[sext_i32_i64(local_tid_236252)] =\n                    x_226680;\n                ((__local\n         ",
                   "         double *) red_arr_mem_236265)[sext_i32_i64(local_tid_236252)] =\n                    x_226681;\n                ((__local\n                  double *) red_arr_mem_236267)[sext_i32_i64(local_tid_236252)] =\n                    x_226682;\n                ((__local\n                  double *) red_arr_mem_236269)[sext_i32_i64(local_tid_236252)] =\n                    x_226683;\n                ((__local\n                  double *) red_arr_mem_236271)[sext_i32_i64(local_tid_236252)] =\n                    x_226684;\n            }\n        }\n        skip_waves_236274 *= 2;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    defunc_2_reduce_res_226671 = ((__local\n                                   double *) red_arr_mem_236263)[(int64_t) 0];\n    defunc_2_reduce_res_226672 = ((__local\n                                   double *) red_arr_mem_236265)[(int64_t) 0];\n    defunc_2_reduce_res_226673 = ((__local\n                                   double *) red_arr_mem_236267)[(int64_t) 0];\n    defunc_2_reduce_res_226674 = ((__local\n                                   double *) red_arr_mem_236269)[(int64_t) 0];\n    defunc_2_reduce_res_226675 = ((__local\n                                   double *) red_arr_mem_236271)[(int64_t) 0];\n    \n    double x_226701 = defunc_2_reduce_res_226673 * defunc_2_reduce_res_226675;\n    double y_226702 = defunc_2_reduce_res_226674 * defunc_2_reduce_res_226674;\n    double a12_226703 = x_226701 - y_226702;\n    double x_226704 = defunc_2_reduce_res_226673 * defunc_2_reduce_res_226674;\n    double y_226705 = defunc_2_reduce_res_226672 * defunc_2_reduce_res_226675;\n    double b12_226706 = x_226704 - y_226705;\n    double x_226707 = defunc_2_reduce_res_226672 * defunc_2_reduce_res_226674;\n    double y_226708 = defunc_2_reduce_res_226673 * defunc_2_reduce_res_226673;\n    double c12_226709 = x_226707 - y_226708;\n    double x_226710 = defunc_2_reduce_res_226671 * defunc_2_reduce_res_226675;\n    double b2_226711 = x_226710 - y_226708;\n    double x_226712 = defunc_2_reduce_re",
                   "s_226672 * defunc_2_reduce_res_226673;\n    double y_226713 = defunc_2_reduce_res_226671 * defunc_2_reduce_res_226674;\n    double c2_226714 = x_226712 - y_226713;\n    double x_226715 = defunc_2_reduce_res_226671 * a12_226703;\n    double y_226716 = defunc_2_reduce_res_226672 * b12_226706;\n    double x_226717 = x_226715 + y_226716;\n    double y_226718 = defunc_2_reduce_res_226673 * c12_226709;\n    double y_226719 = x_226717 + y_226718;\n    double det_226720 = 1.0 / y_226719;\n    double a12_226721 = a12_226703 * det_226720;\n    double b12_226722 = b12_226706 * det_226720;\n    double c12_226723 = c12_226709 * det_226720;\n    double b2_226724 = b2_226711 * det_226720;\n    double c2_226725 = c2_226714 * det_226720;\n    double defunc_2_reduce_res_226726;\n    double defunc_2_reduce_res_226727;\n    int64_t gtid_226728 = sext_i32_i64(sext_i64_i32(ltid_pre_236256));\n    int32_t phys_tid_226729 = local_tid_236252;\n    __local unsigned char *red_arr_mem_236275;\n    \n    red_arr_mem_236275 = (__local unsigned char *) red_arr_mem_236275_backing_9;\n    \n    __local unsigned char *red_arr_mem_236277;\n    \n    red_arr_mem_236277 = (__local\n                          unsigned char *) red_arr_mem_236277_backing_10;\n    \n    double x_226737;\n    \n    x_226737 = ((__local double *) color_232058)[gtid_226728];\n    \n    double x_226738;\n    \n    x_226738 = ((__local double *) color_232056)[gtid_226728];\n    \n    double x_226739;\n    \n    x_226739 = ((__local double *) color_232057)[gtid_226728];\n    \n    bool cond_226740 = sle64(x_226637, gtid_226728);\n    double defunc_0_f_res_226741;\n    \n    if (cond_226740) {\n        defunc_0_f_res_226741 = 0.0;\n    } else {\n        int64_t i_226742 = add64(x_226643, gtid_226728);\n        double defunc_0_add_arg_226743;\n        \n        defunc_0_add_arg_226743 = ((__global double *) mem_231475)[gtid_226632 *\n                                                                   n_203490 +\n                                                                   i_2",
                   "26742];\n        defunc_0_f_res_226741 = defunc_0_add_arg_226743;\n    }\n    \n    double x_226744 = a12_226721 * x_226737;\n    double y_226745 = b12_226722 * x_226738;\n    double x_226746 = x_226744 + y_226745;\n    double y_226747 = c12_226723 * x_226739;\n    double x_226748 = x_226746 + y_226747;\n    double defunc_9_fit_fun_res_226749 = defunc_0_f_res_226741 * x_226748;\n    double x_226750 = b12_226722 * x_226737;\n    double y_226751 = b2_226724 * x_226738;\n    double x_226752 = x_226750 + y_226751;\n    double y_226753 = c2_226725 * x_226739;\n    double x_226754 = x_226752 + y_226753;\n    double defunc_9_slope_fun_res_226755 = defunc_0_f_res_226741 * x_226754;\n    \n    ((__local double *) red_arr_mem_236275)[gtid_226728] =\n        defunc_9_fit_fun_res_226749;\n    ((__local double *) red_arr_mem_236277)[gtid_226728] =\n        defunc_9_slope_fun_res_226755;\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int32_t offset_236279;\n    int32_t skip_waves_236280 = 1;\n    double x_226730;\n    double x_226731;\n    double x_226732;\n    double x_226733;\n    \n    offset_236279 = 0;\n    // participating threads read initial accumulator\n    {\n        if (slt32(local_tid_236252, sext_i64_i32(q_t_203494))) {\n            x_226730 = ((__local\n                         double *) red_arr_mem_236275)[sext_i32_i64(local_tid_236252 +\n                                                       offset_236279)];\n            x_226731 = ((__local\n                         double *) red_arr_mem_236277)[sext_i32_i64(local_tid_236252 +\n                                                       offset_236279)];\n        }\n    }\n    offset_236279 = 1;\n    while (slt32(offset_236279, wave_sizze_236254)) {\n        if (slt32(local_tid_236252 + offset_236279, sext_i64_i32(q_t_203494)) &&\n            ((local_tid_236252 - squot32(local_tid_236252, wave_sizze_236254) *\n              wave_sizze_236254) & (2 * offset_236279 - 1)) == 0) {\n            // read array element\n            {\n                x_226732 = ((volatile __l",
                   "ocal\n                             double *) red_arr_mem_236275)[sext_i32_i64(local_tid_236252 +\n                                                           offset_236279)];\n                x_226733 = ((volatile __local\n                             double *) red_arr_mem_236277)[sext_i32_i64(local_tid_236252 +\n                                                           offset_236279)];\n            }\n            // apply reduction operation\n            {\n                double defunc_1_op_res_226734 = x_226730 + x_226732;\n                double defunc_1_op_res_226735 = x_226731 + x_226733;\n                \n                x_226730 = defunc_1_op_res_226734;\n                x_226731 = defunc_1_op_res_226735;\n            }\n            // write result of operation\n            {\n                ((volatile __local\n                  double *) red_arr_mem_236275)[sext_i32_i64(local_tid_236252)] =\n                    x_226730;\n                ((volatile __local\n                  double *) red_arr_mem_236277)[sext_i32_i64(local_tid_236252)] =\n                    x_226731;\n            }\n        }\n        offset_236279 *= 2;\n    }\n    while (slt32(skip_waves_236280, squot32(sext_i64_i32(q_t_203494) +\n                                            wave_sizze_236254 - 1,\n                                            wave_sizze_236254))) {\n        barrier(CLK_LOCAL_MEM_FENCE);\n        offset_236279 = skip_waves_236280 * wave_sizze_236254;\n        if (slt32(local_tid_236252 + offset_236279, sext_i64_i32(q_t_203494)) &&\n            ((local_tid_236252 - squot32(local_tid_236252, wave_sizze_236254) *\n              wave_sizze_236254) == 0 && (squot32(local_tid_236252,\n                                                  wave_sizze_236254) & (2 *\n                                                                        skip_waves_236280 -\n                                                                        1)) ==\n             0)) {\n            // read array element\n            {\n                x_2",
                   "26732 = ((__local\n                             double *) red_arr_mem_236275)[sext_i32_i64(local_tid_236252 +\n                                                           offset_236279)];\n                x_226733 = ((__local\n                             double *) red_arr_mem_236277)[sext_i32_i64(local_tid_236252 +\n                                                           offset_236279)];\n            }\n            // apply reduction operation\n            {\n                double defunc_1_op_res_226734 = x_226730 + x_226732;\n                double defunc_1_op_res_226735 = x_226731 + x_226733;\n                \n                x_226730 = defunc_1_op_res_226734;\n                x_226731 = defunc_1_op_res_226735;\n            }\n            // write result of operation\n            {\n                ((__local\n                  double *) red_arr_mem_236275)[sext_i32_i64(local_tid_236252)] =\n                    x_226730;\n                ((__local\n                  double *) red_arr_mem_236277)[sext_i32_i64(local_tid_236252)] =\n                    x_226731;\n            }\n        }\n        skip_waves_236280 *= 2;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    defunc_2_reduce_res_226726 = ((__local\n                                   double *) red_arr_mem_236275)[(int64_t) 0];\n    defunc_2_reduce_res_226727 = ((__local\n                                   double *) red_arr_mem_236277)[(int64_t) 0];\n    if (local_tid_236252 == 0) {\n        ((__global double *) mem_231495)[gtid_226632 * t_n_m_203650 +\n                                         gtid_226633] =\n            defunc_2_reduce_res_226726;\n    }\n    if (local_tid_236252 == 0) {\n        ((__global double *) mem_231499)[gtid_226632 * t_n_m_203650 +\n                                         gtid_226633] =\n            defunc_2_reduce_res_226727;\n    }\n    \n  error_5:\n    return;\n}\n__kernel void mainzisegmap_intragroup_226984(__global int *global_failure,\n                                             int failure_is_an_option, __global\n     ",
                   "                                        int64_t *global_failure_args,\n                                             __local volatile\n                                             int64_t *color_232061_backing_aligned_0,\n                                             __local volatile\n                                             int64_t *color_232060_backing_aligned_1,\n                                             int64_t n_203490,\n                                             int64_t partition_sizze_203577,\n                                             int64_t ext_231522, __global\n                                             unsigned char *mem_229161, __global\n                                             unsigned char *ext_mem_229197,\n                                             __global\n                                             unsigned char *ext_mem_231517,\n                                             __global\n                                             unsigned char *ext_mem_231518,\n                                             __global unsigned char *mem_231545,\n                                             __global unsigned char *mem_231549)\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_232061_backing_1 =\n                                   (__local volatile\n                                    unsigned char *) color_232061_backing_aligned_0;\n    __local volatile unsigned char *restrict color_232060_backing_0 =\n                                   (__local volatile\n                                    unsigned char *) color_232060_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_236291;\n    int32_t local_tid_236292;\n    int64_t group_sizze_236295",
                   ";\n    int32_t wave_sizze_236294;\n    int32_t group_tid_236293;\n    \n    global_tid_236291 = get_global_id(0);\n    local_tid_236292 = get_local_id(0);\n    group_sizze_236295 = get_local_size(0);\n    wave_sizze_236294 = LOCKSTEP_WIDTH;\n    group_tid_236293 = get_group_id(0);\n    \n    int32_t phys_tid_226984 = group_tid_236293;\n    int64_t slice_236297 = n_203490;\n    int64_t ltid_pre_236296 = sext_i32_i64(local_tid_236292);\n    int64_t remnant_236298 = sext_i32_i64(local_tid_236292) - ltid_pre_236296;\n    int64_t slice_236299 = partition_sizze_203577;\n    int64_t gtid_226983 = sext_i32_i64(group_tid_236293);\n    int64_t remnant_236300 = sext_i32_i64(group_tid_236293) - gtid_226983;\n    __local unsigned char *color_232060;\n    \n    color_232060 = (__local unsigned char *) color_232060_backing_0;\n    \n    __local unsigned char *color_232061;\n    \n    color_232061 = (__local unsigned char *) color_232061_backing_1;\n    \n    int64_t gtid_226994 = sext_i32_i64(sext_i64_i32(ltid_pre_236296));\n    int32_t phys_tid_226995 = local_tid_236292;\n    double x_226996;\n    \n    x_226996 = ((__global double *) mem_229161)[gtid_226983 * n_203490 +\n                                                gtid_226994];\n    \n    double x_226997;\n    \n    x_226997 = ((__global double *) ext_mem_231518)[gtid_226983 * n_203490 +\n                                                    gtid_226994];\n    \n    double x_226998;\n    \n    x_226998 = ((__global double *) ext_mem_231517)[gtid_226983 * ext_231522 +\n                                                    gtid_226994];\n    \n    double x_226999 = x_226996 - x_226997;\n    double defunc_2_f_res_227000 = x_226999 - x_226998;\n    bool isnan_res_227001;\n    \n    isnan_res_227001 = futrts_isnan64(defunc_2_f_res_227000);\n    \n    double defunc_0_f_res_227002;\n    \n    if (isnan_res_227001) {\n        defunc_0_f_res_227002 = defunc_2_f_res_227000;\n    } else {\n        double abs_res_227003 = fabs(defunc_2_f_res_227000);\n        \n        defunc_0_f_res_227002 = a",
                   "bs_res_227003;\n    }\n    ((__local double *) color_232061)[gtid_226994] = defunc_0_f_res_227002;\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int64_t gtid_227005 = sext_i32_i64(sext_i64_i32(ltid_pre_236296));\n    int32_t phys_tid_227006 = local_tid_236292;\n    int64_t x_227007;\n    \n    x_227007 = ((__global int64_t *) ext_mem_229197)[gtid_226983 * n_203490 +\n                                                     gtid_227005];\n    \n    bool cond_227008 = sle64((int64_t) 0, x_227007);\n    double defunc_0_f_res_227009;\n    \n    if (cond_227008) {\n        bool y_227010 = slt64(x_227007, n_203490);\n        bool bounds_check_227011 = cond_227008 && y_227010;\n        bool index_certs_227012;\n        \n        if (!bounds_check_227011) {\n            {\n                if (atomic_cmpxchg_i32_global(global_failure, -1, 72) == -1) {\n                    global_failure_args[0] = (int64_t) x_227007;\n                    global_failure_args[1] = (int64_t) n_203490;\n                    ;\n                }\n                local_failure = true;\n                goto error_1;\n            }\n        }\n        \n        double defunc_0_f_res_t_res_227013;\n        \n        defunc_0_f_res_t_res_227013 = ((__local\n                                        double *) color_232061)[x_227007];\n        defunc_0_f_res_227009 = defunc_0_f_res_t_res_227013;\n    } else {\n        defunc_0_f_res_227009 = INFINITY;\n    }\n    ((__local double *) color_232060)[gtid_227005] = defunc_0_f_res_227009;\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_236301;\n    \n    tmp_236301 = ((__local\n                   double *) color_232060)[sext_i32_i64(local_tid_236292)];\n    ((__global double *) mem_231545)[gtid_226983 * n_203490 +\n                                     sext_i32_i64(local_tid_236292)] =\n        tmp_236301;\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    double tmp_236302;\n    \n    tmp_236302 = ((__local\n                   d",
                   "ouble *) color_232061)[sext_i32_i64(local_tid_236292)];\n    ((__global double *) mem_231549)[gtid_226983 * n_203490 +\n                                     sext_i32_i64(local_tid_236292)] =\n        tmp_236302;\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n  error_2:\n    return;\n}\n__kernel void mainzisegmap_intragroup_227359(__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                                             __local volatile\n                                             int64_t *color_232074_backing_aligned_2,\n                                             __local volatile\n                                             int64_t *color_232073_backing_aligned_3,\n                                             __local volatile\n                                             int64_t *color_232072_backing_aligned_4,\n                                             __local volatile\n                                             int64_t *color_232071_backing_aligned_5,\n                                             int64_t n_203490,\n                                             int64_t partition_sizze_203577,\n                                             int64_t i_203670,\n                                             int32_t iters_206665, __global\n                                             unsigned char *ext_mem_231561,\n                                             __global unsigned char *mem_231721,\n                                             __global\n                                             unsigned char *color_232069,\n                                             __global\n                                             unsigned char *color_232070)\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_5 =\n                                   (__local volatile\n                                    unsigned char *) color_232076_backing_aligned_0;\n    __local volatile unsigned char *restrict color_232075_backing_4 =\n                                   (__local volatile\n                                    unsigned char *) color_232075_backing_aligned_1;\n    __local volatile unsigned char *restrict color_232074_backing_3 =\n                                   (__local volatile\n                                    unsigned char *) color_232074_backing_aligned_2;\n    __local volatile unsigned char *restrict color_232073_backing_2 =\n                                   (__local volatile\n                                    unsigned char *) color_232073_backing_aligned_3;\n    __local volatile unsigned char *restrict color_232072_backing_1 =\n                                   (__local volatile\n                                    unsigned char *) color_232072_backing_aligned_4;\n    __local volatile unsigned char *restrict color_232071_backing_0 =\n                                   (__local volatile\n                                    unsigned char *) color_232071_backing_aligned_5;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_236358;\n    int32_t local_tid_236359;\n    int64_t group_sizze_236362;\n    int32_t wave_sizze_236361;\n    int32_t group_tid_236360;\n    \n    global_tid_236358 = get_global_id(0);\n    local_tid_236359 = get_local_id(0);\n    group_sizze_236362 = get_local_size(0);\n    wave_sizze_236361 = LOCKSTEP_WIDTH;\n    group_tid_236360 = get_group_id(0);\n    \n    int32_t phys_tid_227359 = group_tid_236360;\n    int64_t slice_236364 = n_203490;\n    int64_t ltid_pre_236363 = sext_i32_i64(local_tid_236359);\n    int64_t remnant_236365 = sext_i32_i64(local_tid_236359) - ltid_pre_236363;\n    int64_t slice_236366 = partition_sizze_203577;\n    int64_t gtid_227358 = sex",
                   "t_i32_i64(group_tid_236360);\n    int64_t remnant_236367 = sext_i32_i64(group_tid_236360) - gtid_227358;\n    __local unsigned char *color_232071;\n    \n    color_232071 = (__local unsigned char *) color_232071_backing_0;\n    \n    __local unsigned char *color_232072;\n    \n    color_232072 = (__local unsigned char *) color_232072_backing_1;\n    \n    __local unsigned char *color_232073;\n    \n    color_232073 = (__local unsigned char *) color_232073_backing_2;\n    \n    __local unsigned char *color_232074;\n    \n    color_232074 = (__local unsigned char *) color_232074_backing_3;\n    \n    __local unsigned char *color_232075;\n    \n    color_232075 = (__local unsigned char *) color_232075_backing_4;\n    \n    __local unsigned char *color_232076;\n    \n    color_232076 = (__local unsigned char *) color_232076_backing_5;\n    \n    double tmp_236368;\n    \n    tmp_236368 = ((__global double *) ext_mem_231561)[gtid_227358 * n_203490 +\n                                                      sext_i32_i64(local_tid_236359)];\n    ((__global double *) color_232069)[phys_tid_227359 * n_203490 +\n                                       sext_i32_i64(local_tid_236359)] =\n        tmp_236368;\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    __global unsigned char *ext_mem_231713;\n    __global unsigned char *ext_mem_unused_231961;\n    __global unsigned char *mem_param_231684;\n    __global unsigned char *mem_param_out_231962;\n    \n    mem_param_231684 = color_232069;\n    mem_param_out_231962 = color_232070;\n    for (int32_t i_227363 = 0; i_227363 < iters_206665; i_227363++) {\n        int32_t defunc_2_radix_sort_step_arg_227365 = mul32(2, i_227363);\n        int32_t defunc_0_get_bit_arg_227366 = add32(1,\n                                                    defunc_2_radix_sort_step_arg_227365);\n        bool cond_f_res_227367 = defunc_0_get_bit_arg_227366 == 63;\n        bool cond_f_res_227368 = defunc_2_radix_sort_step_arg_227365 == 63;\n        int64_t unsign_arg_227369 = zext_i32_i64(defunc_0_get_bit_arg_22736",
                   "6);\n        int64_t unsign_arg_227370 =\n                zext_i32_i64(defunc_2_radix_sort_step_arg_227365);\n        int64_t gtid_227376 = sext_i32_i64(sext_i64_i32(ltid_pre_236363));\n        int32_t phys_tid_227377 = local_tid_236359;\n        double x_227390;\n        \n        x_227390 = ((__global double *) mem_param_231684)[phys_tid_227359 *\n                                                          n_203490 +\n                                                          gtid_227376];\n        \n        int64_t i64_arg_227391;\n        \n        i64_arg_227391 = futrts_to_bits64(x_227390);\n        \n        int64_t unsign_arg_227392 = ashr64(i64_arg_227391, unsign_arg_227369);\n        int64_t unsign_arg_227393 = (int64_t) 1 & unsign_arg_227392;\n        int32_t to_i32_res_227394 = zext_i64_i32(unsign_arg_227393);\n        int64_t unsign_arg_227395 = ashr64(i64_arg_227391, (int64_t) 63);\n        int64_t unsign_arg_227396 = (int64_t) 1 & unsign_arg_227395;\n        int32_t to_i32_res_227397 = zext_i64_i32(unsign_arg_227396);\n        bool cond_227398 = to_i32_res_227397 == 1;\n        bool x_227399 = !cond_227398;\n        bool y_227400 = cond_f_res_227367 && x_227399;\n        bool cond_227401 = cond_227398 || y_227400;\n        int32_t defunc_1_get_bit_res_227402;\n        \n        if (cond_227401) {\n            int32_t defunc_1_get_bit_res_t_res_227403 = 1 ^ to_i32_res_227394;\n            \n            defunc_1_get_bit_res_227402 = defunc_1_get_bit_res_t_res_227403;\n        } else {\n            defunc_1_get_bit_res_227402 = to_i32_res_227394;\n        }\n        \n        int32_t x_227404 = mul32(2, defunc_1_get_bit_res_227402);\n        int64_t unsign_arg_227405 = ashr64(i64_arg_227391, unsign_arg_227370);\n        int64_t unsign_arg_227406 = (int64_t) 1 & unsign_arg_227405;\n        int32_t to_i32_res_227407 = zext_i64_i32(unsign_arg_227406);\n        bool y_227408 = cond_f_res_227368 && x_227399;\n        bool cond_227409 = cond_227398 || y_227408;\n        int32_t defunc_1_get_bit_res_2274",
                   "10;\n        \n        if (cond_227409) {\n            int32_t defunc_1_get_bit_res_t_res_227411 = 1 ^ to_i32_res_227407;\n            \n            defunc_1_get_bit_res_227410 = defunc_1_get_bit_res_t_res_227411;\n        } else {\n            defunc_1_get_bit_res_227410 = to_i32_res_227407;\n        }\n        \n        int32_t defunc_0_f_res_227412 = add32(x_227404,\n                                              defunc_1_get_bit_res_227410);\n        bool cond_227413 = defunc_0_f_res_227412 == 0;\n        int64_t defunc_0_f_res_227414 = btoi_bool_i64(cond_227413);\n        int64_t defunc_0_f_res_227415;\n        int64_t defunc_0_f_res_227416;\n        int64_t defunc_0_f_res_227417;\n        \n        if (cond_227413) {\n            defunc_0_f_res_227415 = (int64_t) 0;\n            defunc_0_f_res_227416 = (int64_t) 0;\n            defunc_0_f_res_227417 = (int64_t) 0;\n        } else {\n            bool cond_227418 = defunc_0_f_res_227412 == 1;\n            int64_t defunc_0_f_res_f_res_227419 = btoi_bool_i64(cond_227418);\n            int64_t defunc_0_f_res_f_res_227420;\n            int64_t defunc_0_f_res_f_res_227421;\n            \n            if (cond_227418) {\n                defunc_0_f_res_f_res_227420 = (int64_t) 0;\n                defunc_0_f_res_f_res_227421 = (int64_t) 0;\n            } else {\n                bool cond_227422 = defunc_0_f_res_227412 == 2;\n                int64_t defunc_0_f_res_f_res_f_res_227423 =\n                        btoi_bool_i64(cond_227422);\n                bool cond_neg_227424 = !cond_227422;\n                int64_t defunc_0_f_res_f_res_f_res_227425 =\n                        btoi_bool_i64(cond_neg_227424);\n                \n                defunc_0_f_res_f_res_227420 = defunc_0_f_res_f_res_f_res_227423;\n                defunc_0_f_res_f_res_227421 = defunc_0_f_res_f_res_f_res_227425;\n            }\n            defunc_0_f_res_227415 = defunc_0_f_res_f_res_227419;\n            defunc_0_f_res_227416 = defunc_0_f_res_f_res_227420;\n            defunc_0_f_res_227417 = d",
                   "efunc_0_f_res_f_res_227421;\n        }\n        ((__local int64_t *) color_232076)[gtid_227376] = defunc_0_f_res_227414;\n        ((__local int64_t *) color_232075)[gtid_227376] = defunc_0_f_res_227415;\n        ((__local int64_t *) color_232074)[gtid_227376] = defunc_0_f_res_227416;\n        ((__local int64_t *) color_232073)[gtid_227376] = defunc_0_f_res_227417;\n        ((__local int32_t *) color_232072)[gtid_227376] = defunc_0_f_res_227412;\n        barrier(CLK_LOCAL_MEM_FENCE);\n        \n        int64_t dims_flat_236372 = n_203490;\n        int64_t x_227378;\n        int64_t x_227379;\n        int64_t x_227380;\n        int64_t x_227381;\n        int64_t x_227382;\n        int64_t x_227383;\n        int64_t x_227384;\n        int64_t x_227385;\n        int64_t x_236377;\n        int64_t x_236378;\n        int64_t x_236379;\n        int64_t x_236380;\n        int64_t x_236381;\n        int64_t x_236382;\n        int64_t x_236383;\n        int64_t x_236384;\n        bool ltid_in_bounds_236389 = slt64(sext_i32_i64(local_tid_236359),\n                                           n_203490);\n        int32_t skip_threads_236390;\n        \n        // read input for in-block scan\n        {\n            if (ltid_in_bounds_236389) {\n                x_227382 = ((volatile __local\n                             int64_t *) color_232076)[sext_i32_i64(local_tid_236359)];\n                x_227383 = ((volatile __local\n                             int64_t *) color_232075)[sext_i32_i64(local_tid_236359)];\n                x_227384 = ((volatile __local\n                             int64_t *) color_232074)[sext_i32_i64(local_tid_236359)];\n                x_227385 = ((volatile __local\n                             int64_t *) color_232073)[sext_i32_i64(local_tid_236359)];\n                if ((local_tid_236359 - squot32(local_tid_236359, 32) * 32) ==\n                    0) {\n                    x_227378 = x_227382;\n                    x_227379 = x_227383;\n                    x_227380 = x_227384;\n                    x_22",
                   "7381 = x_227385;\n                }\n            }\n        }\n        // in-block scan (hopefully no barriers needed)\n        {\n            skip_threads_236390 = 1;\n            while (slt32(skip_threads_236390, 32)) {\n                bool thread_active_236391 = sle32(skip_threads_236390,\n                                                  local_tid_236359 -\n                                                  squot32(local_tid_236359,\n                                                          32) * 32) &&\n                     ltid_in_bounds_236389;\n                \n                if (thread_active_236391) {\n                    // read operands\n                    {\n                        x_227378 = ((volatile __local\n                                     int64_t *) color_232076)[sext_i32_i64(local_tid_236359) -\n                                                              sext_i32_i64(skip_threads_236390)];\n                        x_227379 = ((volatile __local\n                                     int64_t *) color_232075)[sext_i32_i64(local_tid_236359) -\n                                                              sext_i32_i64(skip_threads_236390)];\n                        x_227380 = ((volatile __local\n                                     int64_t *) color_232074)[sext_i32_i64(local_tid_236359) -\n                                                              sext_i32_i64(skip_threads_236390)];\n                        x_227381 = ((volatile __local\n                                     int64_t *) color_232073)[sext_i32_i64(local_tid_236359) -\n                                                              sext_i32_i64(skip_threads_236390)];\n                    }\n                }\n                // perform operation\n                {\n                    bool inactive_236392 =\n                         slt64(srem64(sext_i32_i64(local_tid_236359), n_203490),\n                               sext_i32_i64(local_tid_236359) -\n                               sext_i32_i64(local_tid_236359 -\n",
                   "                               skip_threads_236390));\n                    \n                    if (thread_active_236391 && inactive_236392) {\n                        x_227378 = x_227382;\n                        x_227379 = x_227383;\n                        x_227380 = x_227384;\n                        x_227381 = x_227385;\n                    }\n                    if (thread_active_236391) {\n                        if (!inactive_236392) {\n                            int64_t defunc_1_op_res_227386 = add64(x_227378,\n                                                                   x_227382);\n                            int64_t defunc_1_op_res_227387 = add64(x_227379,\n                                                                   x_227383);\n                            int64_t defunc_1_op_res_227388 = add64(x_227380,\n                                                                   x_227384);\n                            int64_t defunc_1_op_res_227389 = add64(x_227381,\n                                                                   x_227385);\n                            \n                            x_227378 = defunc_1_op_res_227386;\n                            x_227379 = defunc_1_op_res_227387;\n                            x_227380 = defunc_1_op_res_227388;\n                            x_227381 = defunc_1_op_res_227389;\n                        }\n                    }\n                }\n                if (sle32(wave_sizze_236361, skip_threads_236390)) {\n                    barrier(CLK_LOCAL_MEM_FENCE);\n                }\n                if (thread_active_236391) {\n                    // write result\n                    {\n                        ((volatile __local\n                          int64_t *) color_232076)[sext_i32_i64(local_tid_236359)] =\n                            x_227378;\n                        x_227382 = x_227378;\n                        ((volatile __local\n                          int64_t *) color_232075)[sext_i32_i64(local_tid_236359)] =\n               ",
                   "             x_227379;\n                        x_227383 = x_227379;\n                        ((volatile __local\n                          int64_t *) color_232074)[sext_i32_i64(local_tid_236359)] =\n                            x_227380;\n                        x_227384 = x_227380;\n                        ((volatile __local\n                          int64_t *) color_232073)[sext_i32_i64(local_tid_236359)] =\n                            x_227381;\n                        x_227385 = x_227381;\n                    }\n                }\n                if (sle32(wave_sizze_236361, skip_threads_236390)) {\n                    barrier(CLK_LOCAL_MEM_FENCE);\n                }\n                skip_threads_236390 *= 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_236359 - squot32(local_tid_236359, 32) * 32) == 31 &&\n                ltid_in_bounds_236389) {\n                ((volatile __local\n                  int64_t *) color_232076)[sext_i32_i64(squot32(local_tid_236359,\n                                                                32))] =\n                    x_227378;\n                ((volatile __local\n                  int64_t *) color_232075)[sext_i32_i64(squot32(local_tid_236359,\n                                                                32))] =\n                    x_227379;\n                ((volatile __local\n                  int64_t *) color_232074)[sext_i32_i64(squot32(local_tid_236359,\n                                                                32))] =\n                    x_227380;\n                ((volatile __local\n                  int64_t *) color_232073)[sext_i32_i64(squot32(local_tid_236359,\n                                                                32))] =\n                    x_227381;\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_236393;\n            \n            // read input for in-block scan\n            {\n                if (squot32(local_tid_236359, 32) == 0 &&\n                    ltid_in_bounds_236389) {\n                    x_236381 = ((volatile __local\n                                 int64_t *) color_232076)[sext_i32_i64(local_tid_236359)];\n                    x_236382 = ((volatile __local\n                                 int64_t *) color_232075)[sext_i32_i64(local_tid_236359)];\n                    x_236383 = ((volatile __local\n                                 int64_t *) color_232074)[sext_i32_i64(local_tid_236359)];\n                    x_236384 = ((volatile __local\n                                 int64_t *) color_232073)[sext_i32_i64(local_tid_236359)];\n                    if ((local_tid_236359 - squot32(local_tid_236359, 32) *\n                         32) == 0) {\n                        x_236377 = x_236381;\n                        x_236378 = x_236382;\n                        x_236379 = x_236383;\n                        x_236380 = x_236384;\n                    }\n                }\n            }\n            // in-block scan (hopefully no barriers needed)\n            {\n                skip_threads_236393 = 1;\n                while (slt32(skip_threads_236393, 32)) {\n                    bool thread_active_236394 = sle32(skip_threads_236393,\n                                                      local_tid_236359 -\n                                                      squot32(local_tid_236359,\n                                                              32) * 32) &&\n                         (squot32(local_tid_236359, 32) == 0 &&\n                          ltid_in_bounds_236389);\n                    \n                    if (thread_active_236394) {\n                        // read operands\n                        {\n                            x_236377 = ((volatile __local\n                                         int64_t *) color_232076)[sext_i32_i64(loc",
                   "al_tid_236359) -\n                                                                  sext_i32_i64(skip_threads_236393)];\n                            x_236378 = ((volatile __local\n                                         int64_t *) color_232075)[sext_i32_i64(local_tid_236359) -\n                                                                  sext_i32_i64(skip_threads_236393)];\n                            x_236379 = ((volatile __local\n                                         int64_t *) color_232074)[sext_i32_i64(local_tid_236359) -\n                                                                  sext_i32_i64(skip_threads_236393)];\n                            x_236380 = ((volatile __local\n                                         int64_t *) color_232073)[sext_i32_i64(local_tid_236359) -\n                                                                  sext_i32_i64(skip_threads_236393)];\n                        }\n                    }\n                    // perform operation\n                    {\n                        bool inactive_236395 =\n                             slt64(srem64(sext_i32_i64(local_tid_236359 * 32 +\n                                          32 - 1), n_203490),\n                                   sext_i32_i64(local_tid_236359 * 32 + 32 -\n                                   1) - sext_i32_i64((local_tid_236359 -\n                                                      skip_threads_236393) *\n                                   32 + 32 - 1));\n                        \n                        if (thread_active_236394 && inactive_236395) {\n                            x_236377 = x_236381;\n                            x_236378 = x_236382;\n                            x_236379 = x_236383;\n                            x_236380 = x_236384;\n                        }\n                        if (thread_active_236394) {\n                            if (!inactive_236395) {\n                                int64_t defunc_1_op_res_236385 = add64(x_236377,\n                         ",
                   "                                              x_236381);\n                                int64_t defunc_1_op_res_236386 = add64(x_236378,\n                                                                       x_236382);\n                                int64_t defunc_1_op_res_236387 = add64(x_236379,\n                                                                       x_236383);\n                                int64_t defunc_1_op_res_236388 = add64(x_236380,\n                                                                       x_236384);\n                                \n                                x_236377 = defunc_1_op_res_236385;\n                                x_236378 = defunc_1_op_res_236386;\n                                x_236379 = defunc_1_op_res_236387;\n                                x_236380 = defunc_1_op_res_236388;\n                            }\n                        }\n                    }\n                    if (sle32(wave_sizze_236361, skip_threads_236393)) {\n                        barrier(CLK_LOCAL_MEM_FENCE);\n                    }\n                    if (thread_active_236394) {\n                        // write result\n                        {\n                            ((volatile __local\n                              int64_t *) color_232076)[sext_i32_i64(local_tid_236359)] =\n                                x_236377;\n                            x_236381 = x_236377;\n                            ((volatile __local\n                              int64_t *) color_232075)[sext_i32_i64(local_tid_236359)] =\n                                x_236378;\n                            x_236382 = x_236378;\n                            ((volatile __local\n                              int64_t *) color_232074)[sext_i32_i64(local_tid_236359)] =\n                                x_236379;\n                            x_236383 = x_236379;\n                            ((volatile __local\n                              int64_t *) color_232073)[sext_i32_i64(local_tid_236359",
                   ")] =\n                                x_236380;\n                            x_236384 = x_236380;\n                        }\n                    }\n                    if (sle32(wave_sizze_236361, skip_threads_236393)) {\n                        barrier(CLK_LOCAL_MEM_FENCE);\n                    }\n                    skip_threads_236393 *= 2;\n                }\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        \n        bool no_carry_in_236396 = squot32(local_tid_236359, 32) == 0 ||\n             !ltid_in_bounds_236389;\n        \n        // carry-in for every block except the first\n        {\n            // read operands\n            {\n                if (!no_carry_in_236396) {\n                    x_227382 = x_227378;\n                    x_227383 = x_227379;\n                    x_227384 = x_227380;\n                    x_227385 = x_227381;\n                    x_227378 = ((__local\n                                 int64_t *) color_232076)[sext_i32_i64(squot32(local_tid_236359,\n                                                                               32)) -\n                                                          (int64_t) 1];\n                    x_227379 = ((__local\n                                 int64_t *) color_232075)[sext_i32_i64(squot32(local_tid_236359,\n                                                                               32)) -\n                                                          (int64_t) 1];\n                    x_227380 = ((__local\n                                 int64_t *) color_232074)[sext_i32_i64(squot32(local_tid_236359,\n                                                                               32)) -\n                                                          (int64_t) 1];\n                    x_227381 = ((__local\n                                 int64_t *) color_232073)[sext_i32_i64(squot32(local_tid_236359,\n                                                                               32)) -\n                             ",
                   "                             (int64_t) 1];\n                }\n            }\n            // perform operation\n            {\n                bool inactive_236397 =\n                     slt64(srem64(sext_i32_i64(local_tid_236359), n_203490),\n                           sext_i32_i64(local_tid_236359) -\n                           sext_i32_i64(squot32(local_tid_236359, 32) * 32 -\n                           1));\n                \n                if (!no_carry_in_236396) {\n                    if (inactive_236397) {\n                        x_227378 = x_227382;\n                        x_227379 = x_227383;\n                        x_227380 = x_227384;\n                        x_227381 = x_227385;\n                    }\n                }\n                if (!no_carry_in_236396) {\n                    if (!inactive_236397) {\n                        int64_t defunc_1_op_res_227386 = add64(x_227378,\n                                                               x_227382);\n                        int64_t defunc_1_op_res_227387 = add64(x_227379,\n                                                               x_227383);\n                        int64_t defunc_1_op_res_227388 = add64(x_227380,\n                                                               x_227384);\n                        int64_t defunc_1_op_res_227389 = add64(x_227381,\n                                                               x_227385);\n                        \n                        x_227378 = defunc_1_op_res_227386;\n                        x_227379 = defunc_1_op_res_227387;\n                        x_227380 = defunc_1_op_res_227388;\n                        x_227381 = defunc_1_op_res_227389;\n                    }\n                }\n            }\n            // write final result\n            {\n                if (!no_carry_in_236396) {\n                    ((__local\n                      int64_t *) color_232076)[sext_i32_i64(local_tid_236359)] =\n                        x_227378;\n                    ((__local\n              ",
                   "        int64_t *) color_232075)[sext_i32_i64(local_tid_236359)] =\n                        x_227379;\n                    ((__local\n                      int64_t *) color_232074)[sext_i32_i64(local_tid_236359)] =\n                        x_227380;\n                    ((__local\n                      int64_t *) color_232073)[sext_i32_i64(local_tid_236359)] =\n                        x_227381;\n                }\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        // restore correct values for first block\n        {\n            if (squot32(local_tid_236359, 32) == 0 && ltid_in_bounds_236389) {\n                ((__local\n                  int64_t *) color_232076)[sext_i32_i64(local_tid_236359)] =\n                    x_227382;\n                ((__local\n                  int64_t *) color_232075)[sext_i32_i64(local_tid_236359)] =\n                    x_227383;\n                ((__local\n                  int64_t *) color_232074)[sext_i32_i64(local_tid_236359)] =\n                    x_227384;\n                ((__local\n                  int64_t *) color_232073)[sext_i32_i64(local_tid_236359)] =\n                    x_227385;\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        \n        int64_t last_res_227426;\n        \n        last_res_227426 = ((__local int64_t *) color_232076)[i_203670];\n        \n        int64_t last_res_227427;\n        \n        last_res_227427 = ((__local int64_t *) color_232075)[i_203670];\n        \n        int64_t last_res_227428;\n        \n        last_res_227428 = ((__local int64_t *) color_232074)[i_203670];\n        \n        double tmp_236398;\n        \n        tmp_236398 = ((__global double *) mem_param_231684)[phys_tid_227359 *\n                                                            n_203490 +\n                                                            sext_i32_i64(local_tid_236359)];\n        ((__local double *) color_232071)[sext_i32_i64(local_tid_236359)] =\n            tmp_236398;\n        barrier(CLK_LOCAL_MEM_FENCE);\n  ",
                   "      \n        int64_t write_i_227431 = sext_i32_i64(sext_i64_i32(ltid_pre_236363));\n        int32_t phys_tid_227432 = local_tid_236359;\n        int32_t x_227433;\n        \n        x_227433 = ((__local int32_t *) color_232072)[write_i_227431];\n        \n        double write_value_227438;\n        \n        write_value_227438 = ((__global\n                               double *) mem_param_231684)[phys_tid_227359 *\n                                                           n_203490 +\n                                                           write_i_227431];\n        \n        bool match_lit_227439 = 0 == x_227433;\n        int64_t defunc_1_f_res_227440;\n        \n        if (match_lit_227439) {\n            int64_t x_227434;\n            \n            x_227434 = ((__local int64_t *) color_232076)[write_i_227431];\n            \n            int64_t case_res_227441 = sub64(x_227434, (int64_t) 1);\n            \n            defunc_1_f_res_227440 = case_res_227441;\n        } else {\n            bool match_lit_227442 = 1 == x_227433;\n            int64_t x_227443;\n            \n            if (match_lit_227442) {\n                int64_t x_227435;\n                \n                x_227435 = ((__local int64_t *) color_232075)[write_i_227431];\n                \n                int64_t x_227444 = add64(last_res_227426, x_227435);\n                int64_t case_res_227445 = sub64(x_227444, (int64_t) 1);\n                \n                x_227443 = case_res_227445;\n            } else {\n                bool match_lit_227446 = 2 == x_227433;\n                int64_t x_227447;\n                \n                if (match_lit_227446) {\n                    int64_t x_227436;\n                    \n                    x_227436 = ((__local\n                                 int64_t *) color_232074)[write_i_227431];\n                    \n                    int64_t x_227448 = add64(last_res_227426, last_res_227427);\n                    int64_t x_227449 = add64(x_227436, x_227448);\n                    int64_t case_re",
                   "s_227450 = sub64(x_227449, (int64_t) 1);\n                    \n                    x_227447 = case_res_227450;\n                } else {\n                    int64_t x_227437;\n                    \n                    x_227437 = ((__local\n                                 int64_t *) color_232073)[write_i_227431];\n                    \n                    int64_t x_227451 = add64(last_res_227426, last_res_227427);\n                    int64_t x_227452 = add64(last_res_227428, x_227451);\n                    int64_t x_227453 = add64(x_227437, x_227452);\n                    int64_t defunc_1_f_res_res_227454 = sub64(x_227453,\n                                                              (int64_t) 1);\n                    \n                    x_227447 = defunc_1_f_res_res_227454;\n                }\n                x_227443 = x_227447;\n            }\n            defunc_1_f_res_227440 = x_227443;\n        }\n        if (sle64((int64_t) 0, defunc_1_f_res_227440) &&\n            slt64(defunc_1_f_res_227440, n_203490)) {\n            ((__local double *) color_232071)[defunc_1_f_res_227440] =\n                write_value_227438;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        \n        double tmp_236399;\n        \n        tmp_236399 = ((__local\n                       double *) color_232071)[sext_i32_i64(local_tid_236359)];\n        ((__global double *) mem_param_out_231962)[phys_tid_227359 * n_203490 +\n                                                   sext_i32_i64(local_tid_236359)] =\n            tmp_236399;\n        barrier(CLK_LOCAL_MEM_FENCE);\n        \n        __global unsigned char *mem_param_tmp_236369;\n        \n        mem_param_tmp_236369 = mem_param_out_231962;\n        \n        __global unsigned char *mem_param_out_tmp_236370;\n        \n        mem_param_out_tmp_236370 = mem_param_231684;\n        mem_param_231684 = mem_param_tmp_236369;\n        mem_param_out_231962 = mem_param_out_tmp_236370;\n    }\n    ext_mem_231713 = mem_param_231684;\n    ext_mem_unused_231961 = mem_param_out_23",
                   "1962;\n    if (local_tid_236359 == 0) {\n        for (int64_t i_236400 = 0; i_236400 < n_203490; i_236400++) {\n            double tmp_236401;\n            \n            tmp_236401 = ((__global double *) ext_mem_231713)[phys_tid_227359 *\n                                                              n_203490 +\n                                                              i_236400];\n            ((__global double *) mem_231721)[gtid_227358 * n_203490 +\n                                             i_236400] = tmp_236401;\n        }\n    }\n    \n  error_2:\n    return;\n}\n__kernel void mainzisegmap_intragroup_227815(__global int *global_failure,\n                                             __local volatile\n                                             int64_t *color_232082_backing_aligned_0,\n                                             __local volatile\n                                             int64_t *color_232081_backing_aligned_1,\n                                             __local volatile\n                                             int64_t *color_232080_backing_aligned_2,\n                                             __local volatile\n                                             int64_t *color_232079_backing_aligned_3,\n                                             __local volatile\n                                             int64_t *color_232078_backing_aligned_4,\n                                             __local volatile\n                                             int64_t *color_232077_backing_aligned_5,\n                                             int64_t n_203490,\n                                             int64_t partition_sizze_203577,\n                                             int64_t i_203670,\n                                             unsigned char cond_f_res_227801_bits,\n                                             unsigned char cond_f_res_227802_bits,\n                                             int64_t unsign_arg_227803,\n                                ",
                   "             int64_t unsign_arg_227804, __global\n                                             unsigned char *mem_param_231733,\n                                             __global unsigned char *mem_231764)\n{\n    bool cond_f_res_227801 = cond_f_res_227801_bits;\n    bool cond_f_res_227802 = cond_f_res_227802_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_232082_backing_5 =\n                                   (__local volatile\n                                    unsigned char *) color_232082_backing_aligned_0;\n    __local volatile unsigned char *restrict color_232081_backing_4 =\n                                   (__local volatile\n                                    unsigned char *) color_232081_backing_aligned_1;\n    __local volatile unsigned char *restrict color_232080_backing_3 =\n                                   (__local volatile\n                                    unsigned char *) color_232080_backing_aligned_2;\n    __local volatile unsigned char *restrict color_232079_backing_2 =\n                                   (__local volatile\n                                    unsigned char *) color_232079_backing_aligned_3;\n    __local volatile unsigned char *restrict color_232078_backing_1 =\n                                   (__local volatile\n                                    unsigned char *) color_232078_backing_aligned_4;\n    __local volatile unsigned char *restrict color_232077_backing_0 =\n                                   (__local volatile\n                                    unsigned char *) color_232077_backing_aligned_5;\n    \n    if (*global_failure >= 0)\n        return;\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    w",
                   "ave_sizze_236407 = LOCKSTEP_WIDTH;\n    group_tid_236406 = get_group_id(0);\n    \n    int32_t phys_tid_227815 = group_tid_236406;\n    int64_t slice_236410 = n_203490;\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_203577;\n    int64_t gtid_227814 = sext_i32_i64(group_tid_236406);\n    int64_t remnant_236413 = sext_i32_i64(group_tid_236406) - gtid_227814;\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    __local unsigned char *color_232079;\n    \n    color_232079 = (__local unsigned char *) color_232079_backing_2;\n    \n    __local unsigned char *color_232080;\n    \n    color_232080 = (__local unsigned char *) color_232080_backing_3;\n    \n    __local unsigned char *color_232081;\n    \n    color_232081 = (__local unsigned char *) color_232081_backing_4;\n    \n    __local unsigned char *color_232082;\n    \n    color_232082 = (__local unsigned char *) color_232082_backing_5;\n    \n    double tmp_236414;\n    \n    tmp_236414 = ((__global double *) mem_param_231733)[gtid_227814 * n_203490 +\n                                                        sext_i32_i64(local_tid_236405)];\n    ((__local double *) color_232082)[sext_i32_i64(local_tid_236405)] =\n        tmp_236414;\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int64_t gtid_227825 = sext_i32_i64(sext_i64_i32(ltid_pre_236409));\n    int32_t phys_tid_227826 = local_tid_236405;\n    double x_227839;\n    \n    x_227839 = ((__global double *) mem_param_231733)[gtid_227814 * n_203490 +\n                                                      gtid_227825];\n    \n    int64_t i64_arg_227840;\n    \n    i64_arg_227840 = futrts_to_bits64(x_227839);\n    \n    int64_t unsign_arg_227841 = ashr64(i64_arg_227840, unsign_arg_227803);\n  ",
                   "  int64_t unsign_arg_227842 = (int64_t) 1 & unsign_arg_227841;\n    int32_t to_i32_res_227843 = zext_i64_i32(unsign_arg_227842);\n    int64_t unsign_arg_227844 = ashr64(i64_arg_227840, (int64_t) 63);\n    int64_t unsign_arg_227845 = (int64_t) 1 & unsign_arg_227844;\n    int32_t to_i32_res_227846 = zext_i64_i32(unsign_arg_227845);\n    bool cond_227847 = to_i32_res_227846 == 1;\n    bool x_227848 = !cond_227847;\n    bool y_227849 = cond_f_res_227801 && x_227848;\n    bool cond_227850 = cond_227847 || y_227849;\n    int32_t defunc_1_get_bit_res_227851;\n    \n    if (cond_227850) {\n        int32_t defunc_1_get_bit_res_t_res_227852 = 1 ^ to_i32_res_227843;\n        \n        defunc_1_get_bit_res_227851 = defunc_1_get_bit_res_t_res_227852;\n    } else {\n        defunc_1_get_bit_res_227851 = to_i32_res_227843;\n    }\n    \n    int32_t x_227853 = mul32(2, defunc_1_get_bit_res_227851);\n    int64_t unsign_arg_227854 = ashr64(i64_arg_227840, unsign_arg_227804);\n    int64_t unsign_arg_227855 = (int64_t) 1 & unsign_arg_227854;\n    int32_t to_i32_res_227856 = zext_i64_i32(unsign_arg_227855);\n    bool y_227857 = cond_f_res_227802 && x_227848;\n    bool cond_227858 = cond_227847 || y_227857;\n    int32_t defunc_1_get_bit_res_227859;\n    \n    if (cond_227858) {\n        int32_t defunc_1_get_bit_res_t_res_227860 = 1 ^ to_i32_res_227856;\n        \n        defunc_1_get_bit_res_227859 = defunc_1_get_bit_res_t_res_227860;\n    } else {\n        defunc_1_get_bit_res_227859 = to_i32_res_227856;\n    }\n    \n    int32_t defunc_0_f_res_227861 = add32(x_227853,\n                                          defunc_1_get_bit_res_227859);\n    bool cond_227862 = defunc_0_f_res_227861 == 0;\n    int64_t defunc_0_f_res_227863 = btoi_bool_i64(cond_227862);\n    int64_t defunc_0_f_res_227864;\n    int64_t defunc_0_f_res_227865;\n    int64_t defunc_0_f_res_227866;\n    \n    if (cond_227862) {\n        defunc_0_f_res_227864 = (int64_t) 0;\n        defunc_0_f_res_227865 = (int64_t) 0;\n        defunc_0_f_res_227866 = (int64_t) 0;\n    }",
                   " else {\n        bool cond_227867 = defunc_0_f_res_227861 == 1;\n        int64_t defunc_0_f_res_f_res_227868 = btoi_bool_i64(cond_227867);\n        int64_t defunc_0_f_res_f_res_227869;\n        int64_t defunc_0_f_res_f_res_227870;\n        \n        if (cond_227867) {\n            defunc_0_f_res_f_res_227869 = (int64_t) 0;\n            defunc_0_f_res_f_res_227870 = (int64_t) 0;\n        } else {\n            bool cond_227871 = defunc_0_f_res_227861 == 2;\n            int64_t defunc_0_f_res_f_res_f_res_227872 =\n                    btoi_bool_i64(cond_227871);\n            bool cond_neg_227873 = !cond_227871;\n            int64_t defunc_0_f_res_f_res_f_res_227874 =\n                    btoi_bool_i64(cond_neg_227873);\n            \n            defunc_0_f_res_f_res_227869 = defunc_0_f_res_f_res_f_res_227872;\n            defunc_0_f_res_f_res_227870 = defunc_0_f_res_f_res_f_res_227874;\n        }\n        defunc_0_f_res_227864 = defunc_0_f_res_f_res_227868;\n        defunc_0_f_res_227865 = defunc_0_f_res_f_res_227869;\n        defunc_0_f_res_227866 = defunc_0_f_res_f_res_227870;\n    }\n    ((__local int64_t *) color_232081)[gtid_227825] = defunc_0_f_res_227863;\n    ((__local int64_t *) color_232080)[gtid_227825] = defunc_0_f_res_227864;\n    ((__local int64_t *) color_232079)[gtid_227825] = defunc_0_f_res_227865;\n    ((__local int64_t *) color_232078)[gtid_227825] = defunc_0_f_res_227866;\n    ((__local int32_t *) color_232077)[gtid_227825] = defunc_0_f_res_227861;\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int64_t dims_flat_236415 = n_203490;\n    int64_t x_227827;\n    int64_t x_227828;\n    int64_t x_227829;\n    int64_t x_227830;\n    int64_t x_227831;\n    int64_t x_227832;\n    int64_t x_227833;\n    int64_t x_227834;\n    int64_t x_236420;\n    int64_t x_236421;\n    int64_t x_236422;\n    int64_t x_236423;\n    int64_t x_236424;\n    int64_t x_236425;\n    int64_t x_236426;\n    int64_t x_236427;\n    bool ltid_in_bounds_236432 = slt64(sext_i32_i64(local_tid_236405),\n                                    ",
                   "   n_203490);\n    int32_t skip_threads_236433;\n    \n    // read input for in-block scan\n    {\n        if (ltid_in_bounds_236432) {\n            x_227831 = ((volatile __local\n                         int64_t *) color_232081)[sext_i32_i64(local_tid_236405)];\n            x_227832 = ((volatile __local\n                         int64_t *) color_232080)[sext_i32_i64(local_tid_236405)];\n            x_227833 = ((volatile __local\n                         int64_t *) color_232079)[sext_i32_i64(local_tid_236405)];\n            x_227834 = ((volatile __local\n                         int64_t *) color_232078)[sext_i32_i64(local_tid_236405)];\n            if ((local_tid_236405 - squot32(local_tid_236405, 32) * 32) == 0) {\n                x_227827 = x_227831;\n                x_227828 = x_227832;\n                x_227829 = x_227833;\n                x_227830 = x_227834;\n            }\n        }\n    }\n    // in-block scan (hopefully no barriers needed)\n    {\n        skip_threads_236433 = 1;\n        while (slt32(skip_threads_236433, 32)) {\n            bool thread_active_236434 = sle32(skip_threads_236433,\n                                              local_tid_236405 -\n                                              squot32(local_tid_236405, 32) *\n                                              32) && ltid_in_bounds_236432;\n            \n            if (thread_active_236434) {\n                // read operands\n                {\n                    x_227827 = ((volatile __local\n                                 int64_t *) color_232081)[sext_i32_i64(local_tid_236405) -\n                                                          sext_i32_i64(skip_threads_236433)];\n                    x_227828 = ((volatile __local\n                                 int64_t *) color_232080)[sext_i32_i64(local_tid_236405) -\n                                                          sext_i32_i64(skip_threads_236433)];\n                    x_227829 = ((volatile __local\n                                 int64_t *) color_232079)[sex",
                   "t_i32_i64(local_tid_236405) -\n                                                          sext_i32_i64(skip_threads_236433)];\n                    x_227830 = ((volatile __local\n                                 int64_t *) color_232078)[sext_i32_i64(local_tid_236405) -\n                                                          sext_i32_i64(skip_threads_236433)];\n                }\n            }\n            // perform operation\n            {\n                bool inactive_236435 =\n                     slt64(srem64(sext_i32_i64(local_tid_236405), n_203490),\n                           sext_i32_i64(local_tid_236405) -\n                           sext_i32_i64(local_tid_236405 -\n                           skip_threads_236433));\n                \n                if (thread_active_236434 && inactive_236435) {\n                    x_227827 = x_227831;\n                    x_227828 = x_227832;\n                    x_227829 = x_227833;\n                    x_227830 = x_227834;\n                }\n                if (thread_active_236434) {\n                    if (!inactive_236435) {\n                        int64_t defunc_1_op_res_227835 = add64(x_227827,\n                                                               x_227831);\n                        int64_t defunc_1_op_res_227836 = add64(x_227828,\n                                                               x_227832);\n                        int64_t defunc_1_op_res_227837 = add64(x_227829,\n                                                               x_227833);\n                        int64_t defunc_1_op_res_227838 = add64(x_227830,\n                                                               x_227834);\n                        \n                        x_227827 = defunc_1_op_res_227835;\n                        x_227828 = defunc_1_op_res_227836;\n                        x_227829 = defunc_1_op_res_227837;\n                        x_227830 = defunc_1_op_res_227838;\n                    }\n                }\n            }\n            if (sle32(wa",
                   "ve_sizze_236407, skip_threads_236433)) {\n                barrier(CLK_LOCAL_MEM_FENCE);\n            }\n            if (thread_active_236434) {\n                // write result\n                {\n                    ((volatile __local\n                      int64_t *) color_232081)[sext_i32_i64(local_tid_236405)] =\n                        x_227827;\n                    x_227831 = x_227827;\n                    ((volatile __local\n                      int64_t *) color_232080)[sext_i32_i64(local_tid_236405)] =\n                        x_227828;\n                    x_227832 = x_227828;\n                    ((volatile __local\n                      int64_t *) color_232079)[sext_i32_i64(local_tid_236405)] =\n                        x_227829;\n                    x_227833 = x_227829;\n                    ((volatile __local\n                      int64_t *) color_232078)[sext_i32_i64(local_tid_236405)] =\n                        x_227830;\n                    x_227834 = x_227830;\n                }\n            }\n            if (sle32(wave_sizze_236407, skip_threads_236433)) {\n                barrier(CLK_LOCAL_MEM_FENCE);\n            }\n            skip_threads_236433 *= 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_236405 - squot32(local_tid_236405, 32) * 32) == 31 &&\n            ltid_in_bounds_236432) {\n            ((volatile __local\n              int64_t *) color_232081)[sext_i32_i64(squot32(local_tid_236405,\n                                                            32))] = x_227827;\n            ((volatile __local\n              int64_t *) color_232080)[sext_i32_i64(squot32(local_tid_236405,\n                                                            32))] = x_227828;\n            ((volatile __local\n              int64_t *) color_232079)[sext_i32_i64(squot32(local_tid_236405,\n                                                            32))] = x_227829;\n            ((volatile __local\n        ",
                   "      int64_t *) color_232078)[sext_i32_i64(squot32(local_tid_236405,\n                                                            32))] = x_227830;\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_236436;\n        \n        // read input for in-block scan\n        {\n            if (squot32(local_tid_236405, 32) == 0 && ltid_in_bounds_236432) {\n                x_236424 = ((volatile __local\n                             int64_t *) color_232081)[sext_i32_i64(local_tid_236405)];\n                x_236425 = ((volatile __local\n                             int64_t *) color_232080)[sext_i32_i64(local_tid_236405)];\n                x_236426 = ((volatile __local\n                             int64_t *) color_232079)[sext_i32_i64(local_tid_236405)];\n                x_236427 = ((volatile __local\n                             int64_t *) color_232078)[sext_i32_i64(local_tid_236405)];\n                if ((local_tid_236405 - squot32(local_tid_236405, 32) * 32) ==\n                    0) {\n                    x_236420 = x_236424;\n                    x_236421 = x_236425;\n                    x_236422 = x_236426;\n                    x_236423 = x_236427;\n                }\n            }\n        }\n        // in-block scan (hopefully no barriers needed)\n        {\n            skip_threads_236436 = 1;\n            while (slt32(skip_threads_236436, 32)) {\n                bool thread_active_236437 = sle32(skip_threads_236436,\n                                                  local_tid_236405 -\n                                                  squot32(local_tid_236405,\n                                                          32) * 32) &&\n                     (squot32(local_tid_236405, 32) == 0 &&\n                      ltid_in_bounds_236432);\n                \n                if (thread_active_236437) {\n                    // read operands\n                    {\n                        ",
                   "x_236420 = ((volatile __local\n                                     int64_t *) color_232081)[sext_i32_i64(local_tid_236405) -\n                                                              sext_i32_i64(skip_threads_236436)];\n                        x_236421 = ((volatile __local\n                                     int64_t *) color_232080)[sext_i32_i64(local_tid_236405) -\n                                                              sext_i32_i64(skip_threads_236436)];\n                        x_236422 = ((volatile __local\n                                     int64_t *) color_232079)[sext_i32_i64(local_tid_236405) -\n                                                              sext_i32_i64(skip_threads_236436)];\n                        x_236423 = ((volatile __local\n                                     int64_t *) color_232078)[sext_i32_i64(local_tid_236405) -\n                                                              sext_i32_i64(skip_threads_236436)];\n                    }\n                }\n                // perform operation\n                {\n                    bool inactive_236438 =\n                         slt64(srem64(sext_i32_i64(local_tid_236405 * 32 + 32 -\n                                      1), n_203490),\n                               sext_i32_i64(local_tid_236405 * 32 + 32 - 1) -\n                               sext_i32_i64((local_tid_236405 -\n                                             skip_threads_236436) * 32 + 32 -\n                               1));\n                    \n                    if (thread_active_236437 && inactive_236438) {\n                        x_236420 = x_236424;\n                        x_236421 = x_236425;\n                        x_236422 = x_236426;\n                        x_236423 = x_236427;\n                    }\n                    if (thread_active_236437) {\n                        if (!inactive_236438) {\n                            int64_t defunc_1_op_res_236428 = add64(x_236420,\n                                              ",
                   "                     x_236424);\n                            int64_t defunc_1_op_res_236429 = add64(x_236421,\n                                                                   x_236425);\n                            int64_t defunc_1_op_res_236430 = add64(x_236422,\n                                                                   x_236426);\n                            int64_t defunc_1_op_res_236431 = add64(x_236423,\n                                                                   x_236427);\n                            \n                            x_236420 = defunc_1_op_res_236428;\n                            x_236421 = defunc_1_op_res_236429;\n                            x_236422 = defunc_1_op_res_236430;\n                            x_236423 = defunc_1_op_res_236431;\n                        }\n                    }\n                }\n                if (sle32(wave_sizze_236407, skip_threads_236436)) {\n                    barrier(CLK_LOCAL_MEM_FENCE);\n                }\n                if (thread_active_236437) {\n                    // write result\n                    {\n                        ((volatile __local\n                          int64_t *) color_232081)[sext_i32_i64(local_tid_236405)] =\n                            x_236420;\n                        x_236424 = x_236420;\n                        ((volatile __local\n                          int64_t *) color_232080)[sext_i32_i64(local_tid_236405)] =\n                            x_236421;\n                        x_236425 = x_236421;\n                        ((volatile __local\n                          int64_t *) color_232079)[sext_i32_i64(local_tid_236405)] =\n                            x_236422;\n                        x_236426 = x_236422;\n                        ((volatile __local\n                          int64_t *) color_232078)[sext_i32_i64(local_tid_236405)] =\n                            x_236423;\n                        x_236427 = x_236423;\n                    }\n                }\n                if (sle32(wave_si",
                   "zze_236407, skip_threads_236436)) {\n                    barrier(CLK_LOCAL_MEM_FENCE);\n                }\n                skip_threads_236436 *= 2;\n            }\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    bool no_carry_in_236439 = squot32(local_tid_236405, 32) == 0 ||\n         !ltid_in_bounds_236432;\n    \n    // carry-in for every block except the first\n    {\n        // read operands\n        {\n            if (!no_carry_in_236439) {\n                x_227831 = x_227827;\n                x_227832 = x_227828;\n                x_227833 = x_227829;\n                x_227834 = x_227830;\n                x_227827 = ((__local\n                             int64_t *) color_232081)[sext_i32_i64(squot32(local_tid_236405,\n                                                                           32)) -\n                                                      (int64_t) 1];\n                x_227828 = ((__local\n                             int64_t *) color_232080)[sext_i32_i64(squot32(local_tid_236405,\n                                                                           32)) -\n                                                      (int64_t) 1];\n                x_227829 = ((__local\n                             int64_t *) color_232079)[sext_i32_i64(squot32(local_tid_236405,\n                                                                           32)) -\n                                                      (int64_t) 1];\n                x_227830 = ((__local\n                             int64_t *) color_232078)[sext_i32_i64(squot32(local_tid_236405,\n                                                                           32)) -\n                                                      (int64_t) 1];\n            }\n        }\n        // perform operation\n        {\n            bool inactive_236440 = slt64(srem64(sext_i32_i64(local_tid_236405),\n                                                n_203490),\n                                         sext_i32_i64(local_tid_236405) -\n      ",
                   "                                   sext_i32_i64(squot32(local_tid_236405,\n                                                              32) * 32 - 1));\n            \n            if (!no_carry_in_236439) {\n                if (inactive_236440) {\n                    x_227827 = x_227831;\n                    x_227828 = x_227832;\n                    x_227829 = x_227833;\n                    x_227830 = x_227834;\n                }\n            }\n            if (!no_carry_in_236439) {\n                if (!inactive_236440) {\n                    int64_t defunc_1_op_res_227835 = add64(x_227827, x_227831);\n                    int64_t defunc_1_op_res_227836 = add64(x_227828, x_227832);\n                    int64_t defunc_1_op_res_227837 = add64(x_227829, x_227833);\n                    int64_t defunc_1_op_res_227838 = add64(x_227830, x_227834);\n                    \n                    x_227827 = defunc_1_op_res_227835;\n                    x_227828 = defunc_1_op_res_227836;\n                    x_227829 = defunc_1_op_res_227837;\n                    x_227830 = defunc_1_op_res_227838;\n                }\n            }\n        }\n        // write final result\n        {\n            if (!no_carry_in_236439) {\n                ((__local\n                  int64_t *) color_232081)[sext_i32_i64(local_tid_236405)] =\n                    x_227827;\n                ((__local\n                  int64_t *) color_232080)[sext_i32_i64(local_tid_236405)] =\n                    x_227828;\n                ((__local\n                  int64_t *) color_232079)[sext_i32_i64(local_tid_236405)] =\n                    x_227829;\n                ((__local\n                  int64_t *) color_232078)[sext_i32_i64(local_tid_236405)] =\n                    x_227830;\n            }\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    // restore correct values for first block\n    {\n        if (squot32(local_tid_236405, 32) == 0 && ltid_in_bounds_236432) {\n            ((__local int64_t *) color_232081)[sext_i32_i64(local_tid_236405)",
                   "] =\n                x_227831;\n            ((__local int64_t *) color_232080)[sext_i32_i64(local_tid_236405)] =\n                x_227832;\n            ((__local int64_t *) color_232079)[sext_i32_i64(local_tid_236405)] =\n                x_227833;\n            ((__local int64_t *) color_232078)[sext_i32_i64(local_tid_236405)] =\n                x_227834;\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int64_t last_res_227875;\n    \n    last_res_227875 = ((__local int64_t *) color_232081)[i_203670];\n    \n    int64_t last_res_227876;\n    \n    last_res_227876 = ((__local int64_t *) color_232080)[i_203670];\n    \n    int64_t last_res_227877;\n    \n    last_res_227877 = ((__local int64_t *) color_232079)[i_203670];\n    \n    int64_t write_i_227879 = sext_i32_i64(sext_i64_i32(ltid_pre_236409));\n    int32_t phys_tid_227880 = local_tid_236405;\n    int32_t x_227881;\n    \n    x_227881 = ((__local int32_t *) color_232077)[write_i_227879];\n    \n    double write_value_227886;\n    \n    write_value_227886 = ((__global double *) mem_param_231733)[gtid_227814 *\n                                                                n_203490 +\n                                                                write_i_227879];\n    \n    bool match_lit_227887 = 0 == x_227881;\n    int64_t defunc_1_f_res_227888;\n    \n    if (match_lit_227887) {\n        int64_t x_227882;\n        \n        x_227882 = ((__local int64_t *) color_232081)[write_i_227879];\n        \n        int64_t case_res_227889 = sub64(x_227882, (int64_t) 1);\n        \n        defunc_1_f_res_227888 = case_res_227889;\n    } else {\n        bool match_lit_227890 = 1 == x_227881;\n        int64_t x_227891;\n        \n        if (match_lit_227890) {\n            int64_t x_227883;\n            \n            x_227883 = ((__local int64_t *) color_232080)[write_i_227879];\n            \n            int64_t x_227892 = add64(last_res_227875, x_227883);\n            int64_t case_res_227893 = sub64(x_227892, (int64_t) 1);\n            \n            x_227891 = ca",
                   "se_res_227893;\n        } else {\n            bool match_lit_227894 = 2 == x_227881;\n            int64_t x_227895;\n            \n            if (match_lit_227894) {\n                int64_t x_227884;\n                \n                x_227884 = ((__local int64_t *) color_232079)[write_i_227879];\n                \n                int64_t x_227896 = add64(last_res_227875, last_res_227876);\n                int64_t x_227897 = add64(x_227884, x_227896);\n                int64_t case_res_227898 = sub64(x_227897, (int64_t) 1);\n                \n                x_227895 = case_res_227898;\n            } else {\n                int64_t x_227885;\n                \n                x_227885 = ((__local int64_t *) color_232078)[write_i_227879];\n                \n                int64_t x_227899 = add64(last_res_227875, last_res_227876);\n                int64_t x_227900 = add64(last_res_227877, x_227899);\n                int64_t x_227901 = add64(x_227885, x_227900);\n                int64_t defunc_1_f_res_res_227902 = sub64(x_227901,\n                                                          (int64_t) 1);\n                \n                x_227895 = defunc_1_f_res_res_227902;\n            }\n            x_227891 = x_227895;\n        }\n        defunc_1_f_res_227888 = x_227891;\n    }\n    if (sle64((int64_t) 0, defunc_1_f_res_227888) &&\n        slt64(defunc_1_f_res_227888, n_203490)) {\n        ((__local double *) color_232082)[defunc_1_f_res_227888] =\n            write_value_227886;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    double tmp_236441;\n    \n    tmp_236441 = ((__local\n                   double *) color_232082)[sext_i32_i64(local_tid_236405)];\n    ((__global double *) mem_231764)[gtid_227814 * n_203490 +\n                                     sext_i32_i64(local_tid_236405)] =\n        tmp_236441;\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n  error_2:\n    return;\n}\n__kernel void mainzisegred_large_212003(__global int *global_failure,\n                                        __local volatile\n       ",
                   "                                 int64_t *sync_arr_mem_233064_backing_aligned_0,\n                                        __local volatile\n                                        int64_t *red_arr_mem_233062_backing_aligned_1,\n                                        int64_t n_p_203492, int64_t q_s_203493,\n                                        int64_t partition_sizze_203577,\n                                        int64_t defunc_0_f_res_203631,\n                                        int64_t s_n_m_203636,\n                                        int64_t num_groups_211996,\n                                        int64_t groups_per_segment_233048,\n                                        int64_t elements_per_thread_233049,\n                                        int64_t virt_num_groups_233050,\n                                        int64_t threads_per_segment_233052,\n                                        __global unsigned char *ext_mem_229264,\n                                        __global unsigned char *ext_mem_229265,\n                                        __global unsigned char *ext_mem_229362,\n                                        __global unsigned char *ext_mem_229363,\n                                        __global unsigned char *mem_229531,\n                                        __global unsigned char *mem_229687,\n                                        __global unsigned char *mem_229697,\n                                        __global\n                                        unsigned char *segred_tmp_mem_233053,\n                                        __global\n                                        unsigned char *mainzicounter_mem_233055)\n{\n    #define segred_group_sizze_211995 (mainzisegred_group_sizze_211176)\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_233064_backing_1 =\n                                   (__local volatile\n                    ",
                   "                unsigned char *) sync_arr_mem_233064_backing_aligned_0;\n    __local volatile unsigned char *restrict red_arr_mem_233062_backing_0 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_233062_backing_aligned_1;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_233057;\n    int32_t local_tid_233058;\n    int64_t group_sizze_233061;\n    int32_t wave_sizze_233060;\n    int32_t group_tid_233059;\n    \n    global_tid_233057 = get_global_id(0);\n    local_tid_233058 = get_local_id(0);\n    group_sizze_233061 = get_local_size(0);\n    wave_sizze_233060 = LOCKSTEP_WIDTH;\n    group_tid_233059 = get_group_id(0);\n    \n    int32_t phys_tid_212003 = global_tid_233057;\n    __local unsigned char *red_arr_mem_233062;\n    \n    red_arr_mem_233062 = (__local unsigned char *) red_arr_mem_233062_backing_0;\n    \n    __local unsigned char *sync_arr_mem_233064;\n    \n    sync_arr_mem_233064 = (__local\n                           unsigned char *) sync_arr_mem_233064_backing_1;\n    \n    int32_t phys_group_id_233066;\n    \n    phys_group_id_233066 = get_group_id(0);\n    for (int32_t i_233067 = 0; i_233067 <\n         sdiv_up32(sext_i64_i32(virt_num_groups_233050) - phys_group_id_233066,\n                   sext_i64_i32(num_groups_211996)); i_233067++) {\n        int32_t virt_group_id_233068 = phys_group_id_233066 + i_233067 *\n                sext_i64_i32(num_groups_211996);\n        int32_t flat_segment_id_233069 = squot32(virt_group_id_233068,\n                                                 sext_i64_i32(groups_per_segment_233048));\n        int64_t global_tid_233070 = srem64(sext_i32_i64(virt_group_id_233068) *\n                                           segred_group_sizze_211995 +\n                                           sext_i32_i64(local_tid_233058),\n                                           segred_group_sizze_211995 *\n                                           groups_per_segment_233048);\n   ",
                   "     int64_t slice_233071 = s_n_m_203636;\n        int64_t slice_233072 = n_p_203492 * slice_233071;\n        int64_t slice_233073 = partition_sizze_203577 * slice_233072;\n        int64_t gtid_211999 = squot64(sext_i32_i64(flat_segment_id_233069),\n                                      slice_233072);\n        int64_t remnant_233074 = sext_i32_i64(flat_segment_id_233069) -\n                gtid_211999 * slice_233072;\n        int64_t gtid_212000 = squot64(remnant_233074, slice_233071);\n        int64_t remnant_233075 = remnant_233074 - gtid_212000 * slice_233071;\n        int64_t gtid_212001 = remnant_233075;\n        int64_t remnant_233076 = remnant_233075 - gtid_212001;\n        int64_t gtid_212002;\n        double x_acc_233077;\n        int64_t chunk_sizze_233078 = smin64(elements_per_thread_233049,\n                                            sdiv_up64(q_s_203493 -\n                                                      global_tid_233070,\n                                                      threads_per_segment_233052));\n        double x_212004;\n        double x_212005;\n        \n        // neutral-initialise the accumulators\n        {\n            x_acc_233077 = 0.0;\n        }\n        for (int64_t i_233082 = 0; i_233082 < chunk_sizze_233078; i_233082++) {\n            gtid_212002 = global_tid_233070 + threads_per_segment_233052 *\n                i_233082;\n            // apply map function\n            {\n                int64_t x_212015;\n                \n                x_212015 = ((__global int64_t *) ext_mem_229264)[gtid_211999 *\n                                                                 n_p_203492 +\n                                                                 gtid_212000];\n                \n                int64_t x_212019;\n                \n                x_212019 = ((__global int64_t *) ext_mem_229363)[gtid_211999 *\n                                                                 (s_n_m_203636 *\n                                                                  n_p_203",
                   "492) +\n                                                                 gtid_212000 *\n                                                                 s_n_m_203636 +\n                                                                 gtid_212001];\n                \n                double x_212020;\n                \n                x_212020 = ((__global double *) ext_mem_229362)[gtid_211999 *\n                                                                (s_n_m_203636 *\n                                                                 n_p_203492) +\n                                                                gtid_212000 *\n                                                                s_n_m_203636 +\n                                                                gtid_212001];\n                \n                int64_t defunc_0_m_fun_res_212021;\n                \n                defunc_0_m_fun_res_212021 = ((__global\n                                              int64_t *) mem_229687)[gtid_211999 *\n                                                                     (s_n_m_203636 *\n                                                                      n_p_203492) +\n                                                                     gtid_212000 *\n                                                                     s_n_m_203636 +\n                                                                     gtid_212001];\n                \n                bool cond_212023 = sle64(x_212015, gtid_212002);\n                int64_t defunc_0_f_res_212024;\n                \n                if (cond_212023) {\n                    defunc_0_f_res_212024 = (int64_t) 0;\n                } else {\n                    int64_t i_212025 = add64(gtid_212002, x_212019);\n                    int64_t defunc_0_add_arg_212026;\n                    \n                    defunc_0_add_arg_212026 = ((__global\n                                                int64_t *) ext_mem_229265)[gtid_211999 *\n                      ",
                   "                                                     (defunc_0_f_res_203631 *\n                                                                            n_p_203492) +\n                                                                           gtid_212000 *\n                                                                           defunc_0_f_res_203631 +\n                                                                           i_212025];\n                    \n                    int64_t defunc_1_add_res_212027 = add64((int64_t) 1,\n                                                            defunc_0_add_arg_212026);\n                    \n                    defunc_0_f_res_212024 = defunc_1_add_res_212027;\n                }\n                \n                double defunc_0_f_res_212028;\n                \n                if (cond_212023) {\n                    defunc_0_f_res_212028 = 0.0;\n                } else {\n                    int64_t i_212029 = add64(gtid_212002, x_212019);\n                    double defunc_0_add_arg_212030;\n                    \n                    defunc_0_add_arg_212030 = ((__global\n                                                double *) mem_229531)[gtid_211999 *\n                                                                      (defunc_0_f_res_203631 *\n                                                                       n_p_203492) +\n                                                                      gtid_212000 *\n                                                                      defunc_0_f_res_203631 +\n                                                                      i_212029];\n                    defunc_0_f_res_212028 = defunc_0_add_arg_212030;\n                }\n                \n                int64_t binop_p_212031 = sub64(defunc_0_f_res_212024,\n                                               defunc_0_m_fun_res_212021);\n                double defunc_0_f_res_212032 = sitofp_i64_f64(binop_p_212031);\n                double abs_res_",
                   "212033 = fabs(defunc_0_f_res_212032);\n                double tmp1_212034 = abs_res_212033 / x_212020;\n                double x_212035 = tmp1_212034 * tmp1_212034;\n                double y_212036 = tmp1_212034 * x_212035;\n                double tmp2_212037 = 1.0 - y_212036;\n                double x_212038 = tmp2_212037 * tmp2_212037;\n                double tmp3_212039 = tmp2_212037 * x_212038;\n                double w_j_212040 = defunc_0_f_res_212028 * tmp3_212039;\n                \n                // save map-out results\n                { }\n                // load accumulator\n                {\n                    x_212004 = x_acc_233077;\n                }\n                // load new values\n                {\n                    x_212005 = w_j_212040;\n                }\n                // apply reduction operator\n                {\n                    double defunc_1_op_res_212006 = x_212004 + x_212005;\n                    \n                    // store in accumulator\n                    {\n                        x_acc_233077 = defunc_1_op_res_212006;\n                    }\n                }\n            }\n        }\n        // to reduce current chunk, first store our result in memory\n        {\n            x_212004 = x_acc_233077;\n            ((__local\n              double *) red_arr_mem_233062)[sext_i32_i64(local_tid_233058)] =\n                x_212004;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        \n        int32_t offset_233083;\n        int32_t skip_waves_233084 = 1;\n        double x_233079;\n        double x_233080;\n        \n        offset_233083 = 0;\n        // participating threads read initial accumulator\n        {\n            if (slt32(local_tid_233058,\n                      sext_i64_i32(segred_group_sizze_211995))) {\n                x_233079 = ((__local\n                             double *) red_arr_mem_233062)[sext_i32_i64(local_tid_233058 +\n                                                           offset_233083)];\n            }\n        }\n        offset_23",
                   "3083 = 1;\n        while (slt32(offset_233083, wave_sizze_233060)) {\n            if (slt32(local_tid_233058 + offset_233083,\n                      sext_i64_i32(segred_group_sizze_211995)) &&\n                ((local_tid_233058 - squot32(local_tid_233058,\n                                             wave_sizze_233060) *\n                  wave_sizze_233060) & (2 * offset_233083 - 1)) == 0) {\n                // read array element\n                {\n                    x_233080 = ((volatile __local\n                                 double *) red_arr_mem_233062)[sext_i32_i64(local_tid_233058 +\n                                                               offset_233083)];\n                }\n                // apply reduction operation\n                {\n                    double defunc_1_op_res_233081 = x_233079 + x_233080;\n                    \n                    x_233079 = defunc_1_op_res_233081;\n                }\n                // write result of operation\n                {\n                    ((volatile __local\n                      double *) red_arr_mem_233062)[sext_i32_i64(local_tid_233058)] =\n                        x_233079;\n                }\n            }\n            offset_233083 *= 2;\n        }\n        while (slt32(skip_waves_233084,\n                     squot32(sext_i64_i32(segred_group_sizze_211995) +\n                             wave_sizze_233060 - 1, wave_sizze_233060))) {\n            barrier(CLK_LOCAL_MEM_FENCE);\n            offset_233083 = skip_waves_233084 * wave_sizze_233060;\n            if (slt32(local_tid_233058 + offset_233083,\n                      sext_i64_i32(segred_group_sizze_211995)) &&\n                ((local_tid_233058 - squot32(local_tid_233058,\n                                             wave_sizze_233060) *\n                  wave_sizze_233060) == 0 && (squot32(local_tid_233058,\n                                                      wave_sizze_233060) & (2 *\n                                                                            skip_waves",
                   "_233084 -\n                                                                            1)) ==\n                 0)) {\n                // read array element\n                {\n                    x_233080 = ((__local\n                                 double *) red_arr_mem_233062)[sext_i32_i64(local_tid_233058 +\n                                                               offset_233083)];\n                }\n                // apply reduction operation\n                {\n                    double defunc_1_op_res_233081 = x_233079 + x_233080;\n                    \n                    x_233079 = defunc_1_op_res_233081;\n                }\n                // write result of operation\n                {\n                    ((__local\n                      double *) red_arr_mem_233062)[sext_i32_i64(local_tid_233058)] =\n                        x_233079;\n                }\n            }\n            skip_waves_233084 *= 2;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        // first thread saves the result in accumulator\n        {\n            if (sext_i32_i64(local_tid_233058) == (int64_t) 0) {\n                x_acc_233077 = x_233079;\n            }\n        }\n        if (groups_per_segment_233048 == (int64_t) 1) {\n            // first thread in group saves final result to memory\n            {\n                if (local_tid_233058 == 0) {\n                    ((__global double *) mem_229697)[gtid_211999 *\n                                                     (s_n_m_203636 *\n                                                      n_p_203492) +\n                                                     gtid_212000 *\n                                                     s_n_m_203636 +\n                                                     gtid_212001] =\n                        x_acc_233077;\n                }\n            }\n        } else {\n            int32_t old_counter_233085;\n            \n            // first thread in group saves group result to global memory\n            {\n                if (loca",
                   "l_tid_233058 == 0) {\n                    ((__global\n                      double *) segred_tmp_mem_233053)[sext_i32_i64(virt_group_id_233068)] =\n                        x_acc_233077;\n                    mem_fence_global();\n                    old_counter_233085 =\n                        atomic_add_i32_global(&((volatile __global\n                                                 int *) mainzicounter_mem_233055)[sext_i32_i64(srem32(flat_segment_id_233069,\n                                                                                                      10240))],\n                                              (int) 1);\n                    ((__local bool *) sync_arr_mem_233064)[(int64_t) 0] =\n                        old_counter_233085 == groups_per_segment_233048 -\n                        (int64_t) 1;\n                }\n            }\n            barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n            \n            bool is_last_group_233086;\n            \n            is_last_group_233086 = ((__local\n                                     bool *) sync_arr_mem_233064)[(int64_t) 0];\n            if (is_last_group_233086) {\n                if (local_tid_233058 == 0) {\n                    old_counter_233085 =\n                        atomic_add_i32_global(&((volatile __global\n                                                 int *) mainzicounter_mem_233055)[sext_i32_i64(srem32(flat_segment_id_233069,\n                                                                                                      10240))],\n                                              (int) ((int64_t) 0 -\n                                                     groups_per_segment_233048));\n                }\n                // read in the per-group-results\n                {\n                    int64_t read_per_thread_233087 =\n                            sdiv_up64(groups_per_segment_233048,\n                                      segred_group_sizze_211995);\n                    \n                    x_212004 = 0.",
                   "0;\n                    for (int64_t i_233088 = 0; i_233088 <\n                         read_per_thread_233087; i_233088++) {\n                        int64_t group_res_id_233089 =\n                                sext_i32_i64(local_tid_233058) *\n                                read_per_thread_233087 + i_233088;\n                        int64_t index_of_group_res_233090 =\n                                sext_i32_i64(flat_segment_id_233069) *\n                                groups_per_segment_233048 + group_res_id_233089;\n                        \n                        if (slt64(group_res_id_233089,\n                                  groups_per_segment_233048)) {\n                            x_212005 = ((__global\n                                         double *) segred_tmp_mem_233053)[index_of_group_res_233090];\n                            \n                            double defunc_1_op_res_212006 = x_212004 + x_212005;\n                            \n                            x_212004 = defunc_1_op_res_212006;\n                        }\n                    }\n                }\n                ((__local\n                  double *) red_arr_mem_233062)[sext_i32_i64(local_tid_233058)] =\n                    x_212004;\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // reduce the per-group results\n                {\n                    int32_t offset_233091;\n                    int32_t skip_waves_233092 = 1;\n                    double x_233079;\n                    double x_233080;\n                    \n                    offset_233091 = 0;\n                    // participating threads read initial accumulator\n                    {\n                        if (slt32(local_tid_233058,\n                                  sext_i64_i32(segred_group_sizze_211995))) {\n                            x_233079 = ((__local\n                                         double *) red_arr_mem_233062)[sext_i32_i64(local_tid_233058 +\n                                                              ",
                   "         offset_233091)];\n                        }\n                    }\n                    offset_233091 = 1;\n                    while (slt32(offset_233091, wave_sizze_233060)) {\n                        if (slt32(local_tid_233058 + offset_233091,\n                                  sext_i64_i32(segred_group_sizze_211995)) &&\n                            ((local_tid_233058 - squot32(local_tid_233058,\n                                                         wave_sizze_233060) *\n                              wave_sizze_233060) & (2 * offset_233091 - 1)) ==\n                            0) {\n                            // read array element\n                            {\n                                x_233080 = ((volatile __local\n                                             double *) red_arr_mem_233062)[sext_i32_i64(local_tid_233058 +\n                                                                           offset_233091)];\n                            }\n                            // apply reduction operation\n                            {\n                                double defunc_1_op_res_233081 = x_233079 +\n                                       x_233080;\n                                \n                                x_233079 = defunc_1_op_res_233081;\n                            }\n                            // write result of operation\n                            {\n                                ((volatile __local\n                                  double *) red_arr_mem_233062)[sext_i32_i64(local_tid_233058)] =\n                                    x_233079;\n                            }\n                        }\n                        offset_233091 *= 2;\n                    }\n                    while (slt32(skip_waves_233092,\n                                 squot32(sext_i64_i32(segred_group_sizze_211995) +\n                                         wave_sizze_233060 - 1,\n                                         wave_sizze_233060))) {\n                        bar",
                   "rier(CLK_LOCAL_MEM_FENCE);\n                        offset_233091 = skip_waves_233092 * wave_sizze_233060;\n                        if (slt32(local_tid_233058 + offset_233091,\n                                  sext_i64_i32(segred_group_sizze_211995)) &&\n                            ((local_tid_233058 - squot32(local_tid_233058,\n                                                         wave_sizze_233060) *\n                              wave_sizze_233060) == 0 &&\n                             (squot32(local_tid_233058, wave_sizze_233060) &\n                              (2 * skip_waves_233092 - 1)) == 0)) {\n                            // read array element\n                            {\n                                x_233080 = ((__local\n                                             double *) red_arr_mem_233062)[sext_i32_i64(local_tid_233058 +\n                                                                           offset_233091)];\n                            }\n                            // apply reduction operation\n                            {\n                                double defunc_1_op_res_233081 = x_233079 +\n                                       x_233080;\n                                \n                                x_233079 = defunc_1_op_res_233081;\n                            }\n                            // write result of operation\n                            {\n                                ((__local\n                                  double *) red_arr_mem_233062)[sext_i32_i64(local_tid_233058)] =\n                                    x_233079;\n                            }\n                        }\n                        skip_waves_233092 *= 2;\n                    }\n                    // and back to memory with the final result\n                    {\n                        if (local_tid_233058 == 0) {\n                            ((__global double *) mem_229697)[gtid_211999 *\n                                                             (s_n_m_203636 *\n",
                   "                                                              n_p_203492) +\n                                                             gtid_212000 *\n                                                             s_n_m_203636 +\n                                                             gtid_212001] =\n                                x_233079;\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_211995\n}\n__kernel void mainzisegred_large_212077(__global int *global_failure,\n                                        __local volatile\n                                        int64_t *sync_arr_mem_233152_backing_aligned_0,\n                                        __local volatile\n                                        int64_t *red_arr_mem_233150_backing_aligned_1,\n                                        int64_t n_p_203492, int64_t q_s_203493,\n                                        int64_t partition_sizze_203577,\n                                        int64_t defunc_0_f_res_203631,\n                                        int64_t s_n_m_203636,\n                                        int64_t num_groups_212070,\n                                        int64_t groups_per_segment_233136,\n                                        int64_t elements_per_thread_233137,\n                                        int64_t virt_num_groups_233138,\n                                        int64_t threads_per_segment_233140,\n                                        __global unsigned char *ext_mem_229264,\n                                        __global unsigned char *ext_mem_229265,\n                                        __global unsigned char *ext_mem_229362,\n                                        __global unsigned char *ext_mem_229363,\n                                        __global unsigned char *mem_229526,\n                         ",
                   "               __global unsigned char *mem_229531,\n                                        __global unsigned char *mem_229703,\n                                        __global unsigned char *mem_229708,\n                                        __global unsigned char *mem_229714,\n                                        __global\n                                        unsigned char *segred_tmp_mem_233141,\n                                        __global\n                                        unsigned char *mainzicounter_mem_233143)\n{\n    #define segred_group_sizze_212069 (mainzisegred_group_sizze_211074)\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_233152_backing_1 =\n                                   (__local volatile\n                                    unsigned char *) sync_arr_mem_233152_backing_aligned_0;\n    __local volatile unsigned char *restrict red_arr_mem_233150_backing_0 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_233150_backing_aligned_1;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_233145;\n    int32_t local_tid_233146;\n    int64_t group_sizze_233149;\n    int32_t wave_sizze_233148;\n    int32_t group_tid_233147;\n    \n    global_tid_233145 = get_global_id(0);\n    local_tid_233146 = get_local_id(0);\n    group_sizze_233149 = get_local_size(0);\n    wave_sizze_233148 = LOCKSTEP_WIDTH;\n    group_tid_233147 = get_group_id(0);\n    \n    int32_t phys_tid_212077 = global_tid_233145;\n    __local unsigned char *red_arr_mem_233150;\n    \n    red_arr_mem_233150 = (__local unsigned char *) red_arr_mem_233150_backing_0;\n    \n    __local unsigned char *sync_arr_mem_233152;\n    \n    sync_arr_mem_233152 = (__local\n                           unsigned char *) sync_arr_mem_233152_backing_1;\n    \n    int32_t phys_group_id_233154;\n    \n    phys_group_id_233154 = get_gr",
                   "oup_id(0);\n    for (int32_t i_233155 = 0; i_233155 <\n         sdiv_up32(sext_i64_i32(virt_num_groups_233138) - phys_group_id_233154,\n                   sext_i64_i32(num_groups_212070)); i_233155++) {\n        int32_t virt_group_id_233156 = phys_group_id_233154 + i_233155 *\n                sext_i64_i32(num_groups_212070);\n        int32_t flat_segment_id_233157 = squot32(virt_group_id_233156,\n                                                 sext_i64_i32(groups_per_segment_233136));\n        int64_t global_tid_233158 = srem64(sext_i32_i64(virt_group_id_233156) *\n                                           segred_group_sizze_212069 +\n                                           sext_i32_i64(local_tid_233146),\n                                           segred_group_sizze_212069 *\n                                           groups_per_segment_233136);\n        int64_t slice_233159 = s_n_m_203636;\n        int64_t slice_233160 = n_p_203492 * slice_233159;\n        int64_t slice_233161 = partition_sizze_203577 * slice_233160;\n        int64_t gtid_212073 = squot64(sext_i32_i64(flat_segment_id_233157),\n                                      slice_233160);\n        int64_t remnant_233162 = sext_i32_i64(flat_segment_id_233157) -\n                gtid_212073 * slice_233160;\n        int64_t gtid_212074 = squot64(remnant_233162, slice_233159);\n        int64_t remnant_233163 = remnant_233162 - gtid_212074 * slice_233159;\n        int64_t gtid_212075 = remnant_233163;\n        int64_t remnant_233164 = remnant_233163 - gtid_212075;\n        int64_t gtid_212076;\n        double x_acc_233165;\n        int64_t chunk_sizze_233166 = smin64(elements_per_thread_233137,\n                                            sdiv_up64(q_s_203493 -\n                                                      global_tid_233158,\n                                                      threads_per_segment_233140));\n        double x_212078;\n        double x_212079;\n        \n        // neutral-initialise the accumulators\n        {\n    ",
                   "        x_acc_233165 = 0.0;\n        }\n        for (int64_t i_233170 = 0; i_233170 < chunk_sizze_233166; i_233170++) {\n            gtid_212076 = global_tid_233158 + threads_per_segment_233140 *\n                i_233170;\n            // apply map function\n            {\n                int64_t x_212092;\n                \n                x_212092 = ((__global int64_t *) ext_mem_229264)[gtid_212073 *\n                                                                 n_p_203492 +\n                                                                 gtid_212074];\n                \n                int64_t x_212097;\n                \n                x_212097 = ((__global int64_t *) ext_mem_229363)[gtid_212073 *\n                                                                 (s_n_m_203636 *\n                                                                  n_p_203492) +\n                                                                 gtid_212074 *\n                                                                 s_n_m_203636 +\n                                                                 gtid_212075];\n                \n                double x_212098;\n                \n                x_212098 = ((__global double *) ext_mem_229362)[gtid_212073 *\n                                                                (s_n_m_203636 *\n                                                                 n_p_203492) +\n                                                                gtid_212074 *\n                                                                s_n_m_203636 +\n                                                                gtid_212075];\n                \n                double a0_212099;\n                \n                a0_212099 = ((__global double *) mem_229703)[gtid_212073 *\n                                                             (s_n_m_203636 *\n                                                              n_p_203492) +\n                                                             gtid",
                   "_212074 *\n                                                             s_n_m_203636 +\n                                                             gtid_212075];\n                \n                int64_t defunc_0_m_fun_res_212100;\n                \n                defunc_0_m_fun_res_212100 = ((__global\n                                              int64_t *) mem_229708)[gtid_212073 *\n                                                                     (s_n_m_203636 *\n                                                                      n_p_203492) +\n                                                                     gtid_212074 *\n                                                                     s_n_m_203636 +\n                                                                     gtid_212075];\n                \n                bool cond_212102 = sle64(x_212092, gtid_212076);\n                int64_t defunc_0_f_res_212103;\n                \n                if (cond_212102) {\n                    defunc_0_f_res_212103 = (int64_t) 0;\n                } else {\n                    int64_t i_212104 = add64(gtid_212076, x_212097);\n                    int64_t defunc_0_add_arg_212105;\n                    \n                    defunc_0_add_arg_212105 = ((__global\n                                                int64_t *) ext_mem_229265)[gtid_212073 *\n                                                                           (defunc_0_f_res_203631 *\n                                                                            n_p_203492) +\n                                                                           gtid_212074 *\n                                                                           defunc_0_f_res_203631 +\n                                                                           i_212104];\n                    \n                    int64_t defunc_1_add_res_212106 = add64((int64_t) 1,\n                                                            defunc_0_add_arg_212105);\n ",
                   "                   \n                    defunc_0_f_res_212103 = defunc_1_add_res_212106;\n                }\n                \n                double defunc_0_f_res_212107;\n                \n                if (cond_212102) {\n                    defunc_0_f_res_212107 = 0.0;\n                } else {\n                    int64_t i_212108 = add64(gtid_212076, x_212097);\n                    double defunc_0_add_arg_212109;\n                    \n                    defunc_0_add_arg_212109 = ((__global\n                                                double *) mem_229531)[gtid_212073 *\n                                                                      (defunc_0_f_res_203631 *\n                                                                       n_p_203492) +\n                                                                      gtid_212074 *\n                                                                      defunc_0_f_res_203631 +\n                                                                      i_212108];\n                    defunc_0_f_res_212107 = defunc_0_add_arg_212109;\n                }\n                \n                int64_t binop_p_212110 = sub64(defunc_0_f_res_212103,\n                                               defunc_0_m_fun_res_212100);\n                double defunc_0_f_res_212111 = sitofp_i64_f64(binop_p_212110);\n                double abs_res_212112 = fabs(defunc_0_f_res_212111);\n                double tmp1_212113 = abs_res_212112 / x_212098;\n                double x_212114 = tmp1_212113 * tmp1_212113;\n                double y_212115 = tmp1_212113 * x_212114;\n                double tmp2_212116 = 1.0 - y_212115;\n                double x_212117 = tmp2_212116 * tmp2_212116;\n                double tmp3_212118 = tmp2_212116 * x_212117;\n                double tmp4_212119 = defunc_0_f_res_212107 * tmp3_212118;\n                double defunc_0_f_res_212120;\n                \n                if (cond_212102) {\n                    defunc_0_f_res_212120 = 0.0;\n      ",
                   "          } else {\n                    int64_t i_212121 = add64(gtid_212076, x_212097);\n                    double defunc_0_add_arg_212122;\n                    \n                    defunc_0_add_arg_212122 = ((__global\n                                                double *) mem_229526)[gtid_212073 *\n                                                                      (defunc_0_f_res_203631 *\n                                                                       n_p_203492) +\n                                                                      gtid_212074 *\n                                                                      defunc_0_f_res_203631 +\n                                                                      i_212121];\n                    defunc_0_f_res_212120 = defunc_0_add_arg_212122;\n                }\n                \n                double x_212123 = a0_212099 * tmp4_212119;\n                double defunc_9_fit_fun_res_212124 = defunc_0_f_res_212120 *\n                       x_212123;\n                \n                // save map-out results\n                { }\n                // load accumulator\n                {\n                    x_212078 = x_acc_233165;\n                }\n                // load new values\n                {\n                    x_212079 = defunc_9_fit_fun_res_212124;\n                }\n                // apply reduction operator\n                {\n                    double defunc_1_op_res_212080 = x_212078 + x_212079;\n                    \n                    // store in accumulator\n                    {\n                        x_acc_233165 = defunc_1_op_res_212080;\n                    }\n                }\n            }\n        }\n        // to reduce current chunk, first store our result in memory\n        {\n            x_212078 = x_acc_233165;\n            ((__local\n              double *) red_arr_mem_233150)[sext_i32_i64(local_tid_233146)] =\n                x_212078;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        \n        int32",
                   "_t offset_233171;\n        int32_t skip_waves_233172 = 1;\n        double x_233167;\n        double x_233168;\n        \n        offset_233171 = 0;\n        // participating threads read initial accumulator\n        {\n            if (slt32(local_tid_233146,\n                      sext_i64_i32(segred_group_sizze_212069))) {\n                x_233167 = ((__local\n                             double *) red_arr_mem_233150)[sext_i32_i64(local_tid_233146 +\n                                                           offset_233171)];\n            }\n        }\n        offset_233171 = 1;\n        while (slt32(offset_233171, wave_sizze_233148)) {\n            if (slt32(local_tid_233146 + offset_233171,\n                      sext_i64_i32(segred_group_sizze_212069)) &&\n                ((local_tid_233146 - squot32(local_tid_233146,\n                                             wave_sizze_233148) *\n                  wave_sizze_233148) & (2 * offset_233171 - 1)) == 0) {\n                // read array element\n                {\n                    x_233168 = ((volatile __local\n                                 double *) red_arr_mem_233150)[sext_i32_i64(local_tid_233146 +\n                                                               offset_233171)];\n                }\n                // apply reduction operation\n                {\n                    double defunc_1_op_res_233169 = x_233167 + x_233168;\n                    \n                    x_233167 = defunc_1_op_res_233169;\n                }\n                // write result of operation\n                {\n                    ((volatile __local\n                      double *) red_arr_mem_233150)[sext_i32_i64(local_tid_233146)] =\n                        x_233167;\n                }\n            }\n            offset_233171 *= 2;\n        }\n        while (slt32(skip_waves_233172,\n                     squot32(sext_i64_i32(segred_group_sizze_212069) +\n                             wave_sizze_233148 - 1, wave_sizze_233148))) {\n            barrier(CLK_LOCAL_MEM_FE",
                   "NCE);\n            offset_233171 = skip_waves_233172 * wave_sizze_233148;\n            if (slt32(local_tid_233146 + offset_233171,\n                      sext_i64_i32(segred_group_sizze_212069)) &&\n                ((local_tid_233146 - squot32(local_tid_233146,\n                                             wave_sizze_233148) *\n                  wave_sizze_233148) == 0 && (squot32(local_tid_233146,\n                                                      wave_sizze_233148) & (2 *\n                                                                            skip_waves_233172 -\n                                                                            1)) ==\n                 0)) {\n                // read array element\n                {\n                    x_233168 = ((__local\n                                 double *) red_arr_mem_233150)[sext_i32_i64(local_tid_233146 +\n                                                               offset_233171)];\n                }\n                // apply reduction operation\n                {\n                    double defunc_1_op_res_233169 = x_233167 + x_233168;\n                    \n                    x_233167 = defunc_1_op_res_233169;\n                }\n                // write result of operation\n                {\n                    ((__local\n                      double *) red_arr_mem_233150)[sext_i32_i64(local_tid_233146)] =\n                        x_233167;\n                }\n            }\n            skip_waves_233172 *= 2;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        // first thread saves the result in accumulator\n        {\n            if (sext_i32_i64(local_tid_233146) == (int64_t) 0) {\n                x_acc_233165 = x_233167;\n            }\n        }\n        if (groups_per_segment_233136 == (int64_t) 1) {\n            // first thread in group saves final result to memory\n            {\n                if (local_tid_233146 == 0) {\n                    ((__global double *) mem_229714)[gtid_212073 *\n                             ",
                   "                        (s_n_m_203636 *\n                                                      n_p_203492) +\n                                                     gtid_212074 *\n                                                     s_n_m_203636 +\n                                                     gtid_212075] =\n                        x_acc_233165;\n                }\n            }\n        } else {\n            int32_t old_counter_233173;\n            \n            // first thread in group saves group result to global memory\n            {\n                if (local_tid_233146 == 0) {\n                    ((__global\n                      double *) segred_tmp_mem_233141)[sext_i32_i64(virt_group_id_233156)] =\n                        x_acc_233165;\n                    mem_fence_global();\n                    old_counter_233173 =\n                        atomic_add_i32_global(&((volatile __global\n                                                 int *) mainzicounter_mem_233143)[sext_i32_i64(srem32(flat_segment_id_233157,\n                                                                                                      10240))],\n                                              (int) 1);\n                    ((__local bool *) sync_arr_mem_233152)[(int64_t) 0] =\n                        old_counter_233173 == groups_per_segment_233136 -\n                        (int64_t) 1;\n                }\n            }\n            barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n            \n            bool is_last_group_233174;\n            \n            is_last_group_233174 = ((__local\n                                     bool *) sync_arr_mem_233152)[(int64_t) 0];\n            if (is_last_group_233174) {\n                if (local_tid_233146 == 0) {\n                    old_counter_233173 =\n                        atomic_add_i32_global(&((volatile __global\n                                                 int *) mainzicounter_mem_233143)[sext_i32_i64(srem32(flat_segment_id_233157,\n                      ",
                   "                                                                                10240))],\n                                              (int) ((int64_t) 0 -\n                                                     groups_per_segment_233136));\n                }\n                // read in the per-group-results\n                {\n                    int64_t read_per_thread_233175 =\n                            sdiv_up64(groups_per_segment_233136,\n                                      segred_group_sizze_212069);\n                    \n                    x_212078 = 0.0;\n                    for (int64_t i_233176 = 0; i_233176 <\n                         read_per_thread_233175; i_233176++) {\n                        int64_t group_res_id_233177 =\n                                sext_i32_i64(local_tid_233146) *\n                                read_per_thread_233175 + i_233176;\n                        int64_t index_of_group_res_233178 =\n                                sext_i32_i64(flat_segment_id_233157) *\n                                groups_per_segment_233136 + group_res_id_233177;\n                        \n                        if (slt64(group_res_id_233177,\n                                  groups_per_segment_233136)) {\n                            x_212079 = ((__global\n                                         double *) segred_tmp_mem_233141)[index_of_group_res_233178];\n                            \n                            double defunc_1_op_res_212080 = x_212078 + x_212079;\n                            \n                            x_212078 = defunc_1_op_res_212080;\n                        }\n                    }\n                }\n                ((__local\n                  double *) red_arr_mem_233150)[sext_i32_i64(local_tid_233146)] =\n                    x_212078;\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // reduce the per-group results\n                {\n                    int32_t offset_233179;\n                    int32_t skip_waves_233180 = 1;\n        ",
                   "            double x_233167;\n                    double x_233168;\n                    \n                    offset_233179 = 0;\n                    // participating threads read initial accumulator\n                    {\n                        if (slt32(local_tid_233146,\n                                  sext_i64_i32(segred_group_sizze_212069))) {\n                            x_233167 = ((__local\n                                         double *) red_arr_mem_233150)[sext_i32_i64(local_tid_233146 +\n                                                                       offset_233179)];\n                        }\n                    }\n                    offset_233179 = 1;\n                    while (slt32(offset_233179, wave_sizze_233148)) {\n                        if (slt32(local_tid_233146 + offset_233179,\n                                  sext_i64_i32(segred_group_sizze_212069)) &&\n                            ((local_tid_233146 - squot32(local_tid_233146,\n                                                         wave_sizze_233148) *\n                              wave_sizze_233148) & (2 * offset_233179 - 1)) ==\n                            0) {\n                            // read array element\n                            {\n                                x_233168 = ((volatile __local\n                                             double *) red_arr_mem_233150)[sext_i32_i64(local_tid_233146 +\n                                                                           offset_233179)];\n                            }\n                            // apply reduction operation\n                            {\n                                double defunc_1_op_res_233169 = x_233167 +\n                                       x_233168;\n                                \n                                x_233167 = defunc_1_op_res_233169;\n                            }\n                            // write result of operation\n                            {\n                                ((volatile __",
                   "local\n                                  double *) red_arr_mem_233150)[sext_i32_i64(local_tid_233146)] =\n                                    x_233167;\n                            }\n                        }\n                        offset_233179 *= 2;\n                    }\n                    while (slt32(skip_waves_233180,\n                                 squot32(sext_i64_i32(segred_group_sizze_212069) +\n                                         wave_sizze_233148 - 1,\n                                         wave_sizze_233148))) {\n                        barrier(CLK_LOCAL_MEM_FENCE);\n                        offset_233179 = skip_waves_233180 * wave_sizze_233148;\n                        if (slt32(local_tid_233146 + offset_233179,\n                                  sext_i64_i32(segred_group_sizze_212069)) &&\n                            ((local_tid_233146 - squot32(local_tid_233146,\n                                                         wave_sizze_233148) *\n                              wave_sizze_233148) == 0 &&\n                             (squot32(local_tid_233146, wave_sizze_233148) &\n                              (2 * skip_waves_233180 - 1)) == 0)) {\n                            // read array element\n                            {\n                                x_233168 = ((__local\n                                             double *) red_arr_mem_233150)[sext_i32_i64(local_tid_233146 +\n                                                                           offset_233179)];\n                            }\n                            // apply reduction operation\n                            {\n                                double defunc_1_op_res_233169 = x_233167 +\n                                       x_233168;\n                                \n                                x_233167 = defunc_1_op_res_233169;\n                            }\n                            // write result of operation\n                            {\n                                ((__local",
                   "\n                                  double *) red_arr_mem_233150)[sext_i32_i64(local_tid_233146)] =\n                                    x_233167;\n                            }\n                        }\n                        skip_waves_233180 *= 2;\n                    }\n                    // and back to memory with the final result\n                    {\n                        if (local_tid_233146 == 0) {\n                            ((__global double *) mem_229714)[gtid_212073 *\n                                                             (s_n_m_203636 *\n                                                              n_p_203492) +\n                                                             gtid_212074 *\n                                                             s_n_m_203636 +\n                                                             gtid_212075] =\n                                x_233167;\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_212069\n}\n__kernel void mainzisegred_large_214137(__global int *global_failure,\n                                        __local volatile\n                                        int64_t *sync_arr_mem_233417_backing_aligned_0,\n                                        __local volatile\n                                        int64_t *red_arr_mem_233415_backing_aligned_1,\n                                        __local volatile\n                                        int64_t *red_arr_mem_233413_backing_aligned_2,\n                                        __local volatile\n                                        int64_t *red_arr_mem_233411_backing_aligned_3,\n                                        int64_t n_p_203492, int64_t q_s_203493,\n                                        int64_t partition_sizze_203577,\n                                        int64_t defunc_0_f_res_203631,",
                   "\n                                        int64_t s_n_m_203636,\n                                        int64_t num_groups_214128,\n                                        int64_t groups_per_segment_233393,\n                                        int64_t elements_per_thread_233394,\n                                        int64_t virt_num_groups_233395,\n                                        int64_t threads_per_segment_233397,\n                                        __global unsigned char *ext_mem_229264,\n                                        __global unsigned char *ext_mem_229265,\n                                        __global unsigned char *ext_mem_229362,\n                                        __global unsigned char *ext_mem_229363,\n                                        __global unsigned char *mem_229531,\n                                        __global unsigned char *mem_229973,\n                                        __global unsigned char *mem_229983,\n                                        __global unsigned char *mem_229988,\n                                        __global unsigned char *mem_229993,\n                                        __global\n                                        unsigned char *segred_tmp_mem_233398,\n                                        __global\n                                        unsigned char *segred_tmp_mem_233400,\n                                        __global\n                                        unsigned char *segred_tmp_mem_233402,\n                                        __global\n                                        unsigned char *mainzicounter_mem_233404)\n{\n    #define segred_group_sizze_214127 (mainzisegred_group_sizze_213093)\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_233417_backing_3 =\n                                   (__local volatile\n                                    unsigned char *) sync_arr",
                   "_mem_233417_backing_aligned_0;\n    __local volatile unsigned char *restrict red_arr_mem_233415_backing_2 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_233415_backing_aligned_1;\n    __local volatile unsigned char *restrict red_arr_mem_233413_backing_1 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_233413_backing_aligned_2;\n    __local volatile unsigned char *restrict red_arr_mem_233411_backing_0 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_233411_backing_aligned_3;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_233406;\n    int32_t local_tid_233407;\n    int64_t group_sizze_233410;\n    int32_t wave_sizze_233409;\n    int32_t group_tid_233408;\n    \n    global_tid_233406 = get_global_id(0);\n    local_tid_233407 = get_local_id(0);\n    group_sizze_233410 = get_local_size(0);\n    wave_sizze_233409 = LOCKSTEP_WIDTH;\n    group_tid_233408 = get_group_id(0);\n    \n    int32_t phys_tid_214137 = global_tid_233406;\n    __local unsigned char *red_arr_mem_233411;\n    \n    red_arr_mem_233411 = (__local unsigned char *) red_arr_mem_233411_backing_0;\n    \n    __local unsigned char *red_arr_mem_233413;\n    \n    red_arr_mem_233413 = (__local unsigned char *) red_arr_mem_233413_backing_1;\n    \n    __local unsigned char *red_arr_mem_233415;\n    \n    red_arr_mem_233415 = (__local unsigned char *) red_arr_mem_233415_backing_2;\n    \n    __local unsigned char *sync_arr_mem_233417;\n    \n    sync_arr_mem_233417 = (__local\n                           unsigned char *) sync_arr_mem_233417_backing_3;\n    \n    int32_t phys_group_id_233419;\n    \n    phys_group_id_233419 = get_group_id(0);\n    for (int32_t i_233420 = 0; i_233420 <\n         sdiv_up32(sext_i64_i32(virt_num_groups_233395) - phys_group_id_233419,\n                   sext_i64_i32(num_groups_2141",
                   "28)); i_233420++) {\n        int32_t virt_group_id_233421 = phys_group_id_233419 + i_233420 *\n                sext_i64_i32(num_groups_214128);\n        int32_t flat_segment_id_233422 = squot32(virt_group_id_233421,\n                                                 sext_i64_i32(groups_per_segment_233393));\n        int64_t global_tid_233423 = srem64(sext_i32_i64(virt_group_id_233421) *\n                                           segred_group_sizze_214127 +\n                                           sext_i32_i64(local_tid_233407),\n                                           segred_group_sizze_214127 *\n                                           groups_per_segment_233393);\n        int64_t slice_233424 = s_n_m_203636;\n        int64_t slice_233425 = n_p_203492 * slice_233424;\n        int64_t slice_233426 = partition_sizze_203577 * slice_233425;\n        int64_t gtid_214133 = squot64(sext_i32_i64(flat_segment_id_233422),\n                                      slice_233425);\n        int64_t remnant_233427 = sext_i32_i64(flat_segment_id_233422) -\n                gtid_214133 * slice_233425;\n        int64_t gtid_214134 = squot64(remnant_233427, slice_233424);\n        int64_t remnant_233428 = remnant_233427 - gtid_214134 * slice_233424;\n        int64_t gtid_214135 = remnant_233428;\n        int64_t remnant_233429 = remnant_233428 - gtid_214135;\n        int64_t gtid_214136;\n        double x_acc_233430;\n        double x_acc_233431;\n        double x_acc_233432;\n        int64_t chunk_sizze_233433 = smin64(elements_per_thread_233394,\n                                            sdiv_up64(q_s_203493 -\n                                                      global_tid_233423,\n                                                      threads_per_segment_233397));\n        double x_214138;\n        double x_214139;\n        double x_214140;\n        double x_214141;\n        double x_214142;\n        double x_214143;\n        \n        // neutral-initialise the accumulators\n        {\n            x_acc_233430 =",
                   " 0.0;\n            x_acc_233431 = 0.0;\n            x_acc_233432 = 0.0;\n        }\n        for (int64_t i_233443 = 0; i_233443 < chunk_sizze_233433; i_233443++) {\n            gtid_214136 = global_tid_233423 + threads_per_segment_233397 *\n                i_233443;\n            // apply map function\n            {\n                int64_t x_214155;\n                \n                x_214155 = ((__global int64_t *) ext_mem_229264)[gtid_214133 *\n                                                                 n_p_203492 +\n                                                                 gtid_214134];\n                \n                int64_t x_214159;\n                \n                x_214159 = ((__global int64_t *) ext_mem_229363)[gtid_214133 *\n                                                                 (s_n_m_203636 *\n                                                                  n_p_203492) +\n                                                                 gtid_214134 *\n                                                                 s_n_m_203636 +\n                                                                 gtid_214135];\n                \n                double x_214160;\n                \n                x_214160 = ((__global double *) ext_mem_229362)[gtid_214133 *\n                                                                (s_n_m_203636 *\n                                                                 n_p_203492) +\n                                                                gtid_214134 *\n                                                                s_n_m_203636 +\n                                                                gtid_214135];\n                \n                int64_t defunc_0_m_fun_res_214161;\n                \n                defunc_0_m_fun_res_214161 = ((__global\n                                              int64_t *) mem_229973)[gtid_214133 *\n                                                                     (s_n_m_203636 *\n           ",
                   "                                                           n_p_203492) +\n                                                                     gtid_214134 *\n                                                                     s_n_m_203636 +\n                                                                     gtid_214135];\n                \n                bool cond_214163 = sle64(x_214155, gtid_214136);\n                int64_t defunc_0_f_res_214164;\n                \n                if (cond_214163) {\n                    defunc_0_f_res_214164 = (int64_t) 0;\n                } else {\n                    int64_t i_214165 = add64(gtid_214136, x_214159);\n                    int64_t defunc_0_add_arg_214166;\n                    \n                    defunc_0_add_arg_214166 = ((__global\n                                                int64_t *) ext_mem_229265)[gtid_214133 *\n                                                                           (defunc_0_f_res_203631 *\n                                                                            n_p_203492) +\n                                                                           gtid_214134 *\n                                                                           defunc_0_f_res_203631 +\n                                                                           i_214165];\n                    \n                    int64_t defunc_1_add_res_214167 = add64((int64_t) 1,\n                                                            defunc_0_add_arg_214166);\n                    \n                    defunc_0_f_res_214164 = defunc_1_add_res_214167;\n                }\n                \n                double defunc_0_f_res_214168;\n                \n                if (cond_214163) {\n                    defunc_0_f_res_214168 = 0.0;\n                } else {\n                    int64_t i_214169 = add64(gtid_214136, x_214159);\n                    double defunc_0_add_arg_214170;\n                    \n                    defunc_0_add_arg_21417",
                   "0 = ((__global\n                                                double *) mem_229531)[gtid_214133 *\n                                                                      (defunc_0_f_res_203631 *\n                                                                       n_p_203492) +\n                                                                      gtid_214134 *\n                                                                      defunc_0_f_res_203631 +\n                                                                      i_214169];\n                    defunc_0_f_res_214168 = defunc_0_add_arg_214170;\n                }\n                \n                int64_t binop_p_214171 = sub64(defunc_0_f_res_214164,\n                                               defunc_0_m_fun_res_214161);\n                double defunc_0_f_res_214172 = sitofp_i64_f64(binop_p_214171);\n                double abs_res_214173 = fabs(defunc_0_f_res_214172);\n                double tmp1_214174 = abs_res_214173 / x_214160;\n                double x_214175 = tmp1_214174 * tmp1_214174;\n                double y_214176 = tmp1_214174 * x_214175;\n                double tmp2_214177 = 1.0 - y_214176;\n                double x_214178 = tmp2_214177 * tmp2_214177;\n                double tmp3_214179 = tmp2_214177 * x_214178;\n                double w_j_214180 = defunc_0_f_res_214168 * tmp3_214179;\n                double xw_j_214181 = defunc_0_f_res_214172 * w_j_214180;\n                double x2w_j_214182 = defunc_0_f_res_214172 * xw_j_214181;\n                \n                // save map-out results\n                { }\n                // load accumulator\n                {\n                    x_214138 = x_acc_233430;\n                    x_214139 = x_acc_233431;\n                    x_214140 = x_acc_233432;\n                }\n                // load new values\n                {\n                    x_214141 = w_j_214180;\n                    x_214142 = xw_j_214181;\n                    x_214143 = x2w_j_214182;\n                }",
                   "\n                // apply reduction operator\n                {\n                    double defunc_1_op_res_214144 = x_214138 + x_214141;\n                    double defunc_1_op_res_214145 = x_214139 + x_214142;\n                    double defunc_1_op_res_214146 = x_214140 + x_214143;\n                    \n                    // store in accumulator\n                    {\n                        x_acc_233430 = defunc_1_op_res_214144;\n                        x_acc_233431 = defunc_1_op_res_214145;\n                        x_acc_233432 = defunc_1_op_res_214146;\n                    }\n                }\n            }\n        }\n        // to reduce current chunk, first store our result in memory\n        {\n            x_214138 = x_acc_233430;\n            x_214139 = x_acc_233431;\n            x_214140 = x_acc_233432;\n            ((__local\n              double *) red_arr_mem_233411)[sext_i32_i64(local_tid_233407)] =\n                x_214138;\n            ((__local\n              double *) red_arr_mem_233413)[sext_i32_i64(local_tid_233407)] =\n                x_214139;\n            ((__local\n              double *) red_arr_mem_233415)[sext_i32_i64(local_tid_233407)] =\n                x_214140;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        \n        int32_t offset_233444;\n        int32_t skip_waves_233445 = 1;\n        double x_233434;\n        double x_233435;\n        double x_233436;\n        double x_233437;\n        double x_233438;\n        double x_233439;\n        \n        offset_233444 = 0;\n        // participating threads read initial accumulator\n        {\n            if (slt32(local_tid_233407,\n                      sext_i64_i32(segred_group_sizze_214127))) {\n                x_233434 = ((__local\n                             double *) red_arr_mem_233411)[sext_i32_i64(local_tid_233407 +\n                                                           offset_233444)];\n                x_233435 = ((__local\n                             double *) red_arr_mem_233413)[sext_i32_i64(local_tid_",
                   "233407 +\n                                                           offset_233444)];\n                x_233436 = ((__local\n                             double *) red_arr_mem_233415)[sext_i32_i64(local_tid_233407 +\n                                                           offset_233444)];\n            }\n        }\n        offset_233444 = 1;\n        while (slt32(offset_233444, wave_sizze_233409)) {\n            if (slt32(local_tid_233407 + offset_233444,\n                      sext_i64_i32(segred_group_sizze_214127)) &&\n                ((local_tid_233407 - squot32(local_tid_233407,\n                                             wave_sizze_233409) *\n                  wave_sizze_233409) & (2 * offset_233444 - 1)) == 0) {\n                // read array element\n                {\n                    x_233437 = ((volatile __local\n                                 double *) red_arr_mem_233411)[sext_i32_i64(local_tid_233407 +\n                                                               offset_233444)];\n                    x_233438 = ((volatile __local\n                                 double *) red_arr_mem_233413)[sext_i32_i64(local_tid_233407 +\n                                                               offset_233444)];\n                    x_233439 = ((volatile __local\n                                 double *) red_arr_mem_233415)[sext_i32_i64(local_tid_233407 +\n                                                               offset_233444)];\n                }\n                // apply reduction operation\n                {\n                    double defunc_1_op_res_233440 = x_233434 + x_233437;\n                    double defunc_1_op_res_233441 = x_233435 + x_233438;\n                    double defunc_1_op_res_233442 = x_233436 + x_233439;\n                    \n                    x_233434 = defunc_1_op_res_233440;\n                    x_233435 = defunc_1_op_res_233441;\n                    x_233436 = defunc_1_op_res_233442;\n                }\n                // write result of operation",
                   "\n                {\n                    ((volatile __local\n                      double *) red_arr_mem_233411)[sext_i32_i64(local_tid_233407)] =\n                        x_233434;\n                    ((volatile __local\n                      double *) red_arr_mem_233413)[sext_i32_i64(local_tid_233407)] =\n                        x_233435;\n                    ((volatile __local\n                      double *) red_arr_mem_233415)[sext_i32_i64(local_tid_233407)] =\n                        x_233436;\n                }\n            }\n            offset_233444 *= 2;\n        }\n        while (slt32(skip_waves_233445,\n                     squot32(sext_i64_i32(segred_group_sizze_214127) +\n                             wave_sizze_233409 - 1, wave_sizze_233409))) {\n            barrier(CLK_LOCAL_MEM_FENCE);\n            offset_233444 = skip_waves_233445 * wave_sizze_233409;\n            if (slt32(local_tid_233407 + offset_233444,\n                      sext_i64_i32(segred_group_sizze_214127)) &&\n                ((local_tid_233407 - squot32(local_tid_233407,\n                                             wave_sizze_233409) *\n                  wave_sizze_233409) == 0 && (squot32(local_tid_233407,\n                                                      wave_sizze_233409) & (2 *\n                                                                            skip_waves_233445 -\n                                                                            1)) ==\n                 0)) {\n                // read array element\n                {\n                    x_233437 = ((__local\n                                 double *) red_arr_mem_233411)[sext_i32_i64(local_tid_233407 +\n                                                               offset_233444)];\n                    x_233438 = ((__local\n                                 double *) red_arr_mem_233413)[sext_i32_i64(local_tid_233407 +\n                                                               offset_233444)];\n                    x_233439 = ((__local\n ",
                   "                                double *) red_arr_mem_233415)[sext_i32_i64(local_tid_233407 +\n                                                               offset_233444)];\n                }\n                // apply reduction operation\n                {\n                    double defunc_1_op_res_233440 = x_233434 + x_233437;\n                    double defunc_1_op_res_233441 = x_233435 + x_233438;\n                    double defunc_1_op_res_233442 = x_233436 + x_233439;\n                    \n                    x_233434 = defunc_1_op_res_233440;\n                    x_233435 = defunc_1_op_res_233441;\n                    x_233436 = defunc_1_op_res_233442;\n                }\n                // write result of operation\n                {\n                    ((__local\n                      double *) red_arr_mem_233411)[sext_i32_i64(local_tid_233407)] =\n                        x_233434;\n                    ((__local\n                      double *) red_arr_mem_233413)[sext_i32_i64(local_tid_233407)] =\n                        x_233435;\n                    ((__local\n                      double *) red_arr_mem_233415)[sext_i32_i64(local_tid_233407)] =\n                        x_233436;\n                }\n            }\n            skip_waves_233445 *= 2;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        // first thread saves the result in accumulator\n        {\n            if (sext_i32_i64(local_tid_233407) == (int64_t) 0) {\n                x_acc_233430 = x_233434;\n                x_acc_233431 = x_233435;\n                x_acc_233432 = x_233436;\n            }\n        }\n        if (groups_per_segment_233393 == (int64_t) 1) {\n            // first thread in group saves final result to memory\n            {\n                if (local_tid_233407 == 0) {\n                    ((__global double *) mem_229983)[gtid_214133 *\n                                                     (s_n_m_203636 *\n                                                      n_p_203492) +\n                              ",
                   "                       gtid_214134 *\n                                                     s_n_m_203636 +\n                                                     gtid_214135] =\n                        x_acc_233430;\n                    ((__global double *) mem_229988)[gtid_214133 *\n                                                     (s_n_m_203636 *\n                                                      n_p_203492) +\n                                                     gtid_214134 *\n                                                     s_n_m_203636 +\n                                                     gtid_214135] =\n                        x_acc_233431;\n                    ((__global double *) mem_229993)[gtid_214133 *\n                                                     (s_n_m_203636 *\n                                                      n_p_203492) +\n                                                     gtid_214134 *\n                                                     s_n_m_203636 +\n                                                     gtid_214135] =\n                        x_acc_233432;\n                }\n            }\n        } else {\n            int32_t old_counter_233446;\n            \n            // first thread in group saves group result to global memory\n            {\n                if (local_tid_233407 == 0) {\n                    ((__global\n                      double *) segred_tmp_mem_233398)[sext_i32_i64(virt_group_id_233421)] =\n                        x_acc_233430;\n                    ((__global\n                      double *) segred_tmp_mem_233400)[sext_i32_i64(virt_group_id_233421)] =\n                        x_acc_233431;\n                    ((__global\n                      double *) segred_tmp_mem_233402)[sext_i32_i64(virt_group_id_233421)] =\n                        x_acc_233432;\n                    mem_fence_global();\n                    old_counter_233446 =\n                        atomic_add_i32_global(&((volatile __global\n                               ",
                   "                  int *) mainzicounter_mem_233404)[sext_i32_i64(srem32(flat_segment_id_233422,\n                                                                                                      10240))],\n                                              (int) 1);\n                    ((__local bool *) sync_arr_mem_233417)[(int64_t) 0] =\n                        old_counter_233446 == groups_per_segment_233393 -\n                        (int64_t) 1;\n                }\n            }\n            barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n            \n            bool is_last_group_233447;\n            \n            is_last_group_233447 = ((__local\n                                     bool *) sync_arr_mem_233417)[(int64_t) 0];\n            if (is_last_group_233447) {\n                if (local_tid_233407 == 0) {\n                    old_counter_233446 =\n                        atomic_add_i32_global(&((volatile __global\n                                                 int *) mainzicounter_mem_233404)[sext_i32_i64(srem32(flat_segment_id_233422,\n                                                                                                      10240))],\n                                              (int) ((int64_t) 0 -\n                                                     groups_per_segment_233393));\n                }\n                // read in the per-group-results\n                {\n                    int64_t read_per_thread_233448 =\n                            sdiv_up64(groups_per_segment_233393,\n                                      segred_group_sizze_214127);\n                    \n                    x_214138 = 0.0;\n                    x_214139 = 0.0;\n                    x_214140 = 0.0;\n                    for (int64_t i_233449 = 0; i_233449 <\n                         read_per_thread_233448; i_233449++) {\n                        int64_t group_res_id_233450 =\n                                sext_i32_i64(local_tid_233407) *\n                                read_per_thread",
                   "_233448 + i_233449;\n                        int64_t index_of_group_res_233451 =\n                                sext_i32_i64(flat_segment_id_233422) *\n                                groups_per_segment_233393 + group_res_id_233450;\n                        \n                        if (slt64(group_res_id_233450,\n                                  groups_per_segment_233393)) {\n                            x_214141 = ((__global\n                                         double *) segred_tmp_mem_233398)[index_of_group_res_233451];\n                            x_214142 = ((__global\n                                         double *) segred_tmp_mem_233400)[index_of_group_res_233451];\n                            x_214143 = ((__global\n                                         double *) segred_tmp_mem_233402)[index_of_group_res_233451];\n                            \n                            double defunc_1_op_res_214144 = x_214138 + x_214141;\n                            double defunc_1_op_res_214145 = x_214139 + x_214142;\n                            double defunc_1_op_res_214146 = x_214140 + x_214143;\n                            \n                            x_214138 = defunc_1_op_res_214144;\n                            x_214139 = defunc_1_op_res_214145;\n                            x_214140 = defunc_1_op_res_214146;\n                        }\n                    }\n                }\n                ((__local\n                  double *) red_arr_mem_233411)[sext_i32_i64(local_tid_233407)] =\n                    x_214138;\n                ((__local\n                  double *) red_arr_mem_233413)[sext_i32_i64(local_tid_233407)] =\n                    x_214139;\n                ((__local\n                  double *) red_arr_mem_233415)[sext_i32_i64(local_tid_233407)] =\n                    x_214140;\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // reduce the per-group results\n                {\n                    int32_t offset_233452;\n                    int32_t skip_waves_2334",
                   "53 = 1;\n                    double x_233434;\n                    double x_233435;\n                    double x_233436;\n                    double x_233437;\n                    double x_233438;\n                    double x_233439;\n                    \n                    offset_233452 = 0;\n                    // participating threads read initial accumulator\n                    {\n                        if (slt32(local_tid_233407,\n                                  sext_i64_i32(segred_group_sizze_214127))) {\n                            x_233434 = ((__local\n                                         double *) red_arr_mem_233411)[sext_i32_i64(local_tid_233407 +\n                                                                       offset_233452)];\n                            x_233435 = ((__local\n                                         double *) red_arr_mem_233413)[sext_i32_i64(local_tid_233407 +\n                                                                       offset_233452)];\n                            x_233436 = ((__local\n                                         double *) red_arr_mem_233415)[sext_i32_i64(local_tid_233407 +\n                                                                       offset_233452)];\n                        }\n                    }\n                    offset_233452 = 1;\n                    while (slt32(offset_233452, wave_sizze_233409)) {\n                        if (slt32(local_tid_233407 + offset_233452,\n                                  sext_i64_i32(segred_group_sizze_214127)) &&\n                            ((local_tid_233407 - squot32(local_tid_233407,\n                                                         wave_sizze_233409) *\n                              wave_sizze_233409) & (2 * offset_233452 - 1)) ==\n                            0) {\n                            // read array element\n                            {\n                                x_233437 = ((volatile __local\n                                             double *) red",
                   "_arr_mem_233411)[sext_i32_i64(local_tid_233407 +\n                                                                           offset_233452)];\n                                x_233438 = ((volatile __local\n                                             double *) red_arr_mem_233413)[sext_i32_i64(local_tid_233407 +\n                                                                           offset_233452)];\n                                x_233439 = ((volatile __local\n                                             double *) red_arr_mem_233415)[sext_i32_i64(local_tid_233407 +\n                                                                           offset_233452)];\n                            }\n                            // apply reduction operation\n                            {\n                                double defunc_1_op_res_233440 = x_233434 +\n                                       x_233437;\n                                double defunc_1_op_res_233441 = x_233435 +\n                                       x_233438;\n                                double defunc_1_op_res_233442 = x_233436 +\n                                       x_233439;\n                                \n                                x_233434 = defunc_1_op_res_233440;\n                                x_233435 = defunc_1_op_res_233441;\n                                x_233436 = defunc_1_op_res_233442;\n                            }\n                            // write result of operation\n                            {\n                                ((volatile __local\n                                  double *) red_arr_mem_233411)[sext_i32_i64(local_tid_233407)] =\n                                    x_233434;\n                                ((volatile __local\n                                  double *) red_arr_mem_233413)[sext_i32_i64(local_tid_233407)] =\n                                    x_233435;\n                                ((volatile __local\n                                  double *) red_arr_mem_",
                   "233415)[sext_i32_i64(local_tid_233407)] =\n                                    x_233436;\n                            }\n                        }\n                        offset_233452 *= 2;\n                    }\n                    while (slt32(skip_waves_233453,\n                                 squot32(sext_i64_i32(segred_group_sizze_214127) +\n                                         wave_sizze_233409 - 1,\n                                         wave_sizze_233409))) {\n                        barrier(CLK_LOCAL_MEM_FENCE);\n                        offset_233452 = skip_waves_233453 * wave_sizze_233409;\n                        if (slt32(local_tid_233407 + offset_233452,\n                                  sext_i64_i32(segred_group_sizze_214127)) &&\n                            ((local_tid_233407 - squot32(local_tid_233407,\n                                                         wave_sizze_233409) *\n                              wave_sizze_233409) == 0 &&\n                             (squot32(local_tid_233407, wave_sizze_233409) &\n                              (2 * skip_waves_233453 - 1)) == 0)) {\n                            // read array element\n                            {\n                                x_233437 = ((__local\n                                             double *) red_arr_mem_233411)[sext_i32_i64(local_tid_233407 +\n                                                                           offset_233452)];\n                                x_233438 = ((__local\n                                             double *) red_arr_mem_233413)[sext_i32_i64(local_tid_233407 +\n                                                                           offset_233452)];\n                                x_233439 = ((__local\n                                             double *) red_arr_mem_233415)[sext_i32_i64(local_tid_233407 +\n                                                                           offset_233452)];\n                            }\n                           ",
                   " // apply reduction operation\n                            {\n                                double defunc_1_op_res_233440 = x_233434 +\n                                       x_233437;\n                                double defunc_1_op_res_233441 = x_233435 +\n                                       x_233438;\n                                double defunc_1_op_res_233442 = x_233436 +\n                                       x_233439;\n                                \n                                x_233434 = defunc_1_op_res_233440;\n                                x_233435 = defunc_1_op_res_233441;\n                                x_233436 = defunc_1_op_res_233442;\n                            }\n                            // write result of operation\n                            {\n                                ((__local\n                                  double *) red_arr_mem_233411)[sext_i32_i64(local_tid_233407)] =\n                                    x_233434;\n                                ((__local\n                                  double *) red_arr_mem_233413)[sext_i32_i64(local_tid_233407)] =\n                                    x_233435;\n                                ((__local\n                                  double *) red_arr_mem_233415)[sext_i32_i64(local_tid_233407)] =\n                                    x_233436;\n                            }\n                        }\n                        skip_waves_233453 *= 2;\n                    }\n                    // and back to memory with the final result\n                    {\n                        if (local_tid_233407 == 0) {\n                            ((__global double *) mem_229983)[gtid_214133 *\n                                                             (s_n_m_203636 *\n                                                              n_p_203492) +\n                                                             gtid_214134 *\n                                                             s_n_m_203636 +\n               ",
                   "                                              gtid_214135] =\n                                x_233434;\n                            ((__global double *) mem_229988)[gtid_214133 *\n                                                             (s_n_m_203636 *\n                                                              n_p_203492) +\n                                                             gtid_214134 *\n                                                             s_n_m_203636 +\n                                                             gtid_214135] =\n                                x_233435;\n                            ((__global double *) mem_229993)[gtid_214133 *\n                                                             (s_n_m_203636 *\n                                                              n_p_203492) +\n                                                             gtid_214134 *\n                                                             s_n_m_203636 +\n                                                             gtid_214135] =\n                                x_233436;\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_214127\n}\n__kernel void mainzisegred_large_214231(__global int *global_failure,\n                                        __local volatile\n                                        int64_t *sync_arr_mem_233523_backing_aligned_0,\n                                        __local volatile\n                                        int64_t *red_arr_mem_233521_backing_aligned_1,\n                                        __local volatile\n                                        int64_t *red_arr_mem_233519_backing_aligned_2,\n                                        int64_t n_p_203492, int64_t q_s_203493,\n                                        int64_t partition_sizze_203577,\n                        ",
                   "                int64_t defunc_0_f_res_203631,\n                                        int64_t s_n_m_203636,\n                                        int64_t num_groups_214223,\n                                        int64_t groups_per_segment_233503,\n                                        int64_t elements_per_thread_233504,\n                                        int64_t virt_num_groups_233505,\n                                        int64_t threads_per_segment_233507,\n                                        __global unsigned char *ext_mem_229264,\n                                        __global unsigned char *ext_mem_229265,\n                                        __global unsigned char *ext_mem_229362,\n                                        __global unsigned char *ext_mem_229363,\n                                        __global unsigned char *mem_229526,\n                                        __global unsigned char *mem_229531,\n                                        __global unsigned char *mem_229999,\n                                        __global unsigned char *mem_230004,\n                                        __global unsigned char *mem_230009,\n                                        __global unsigned char *mem_230014,\n                                        __global unsigned char *mem_230020,\n                                        __global unsigned char *mem_230025,\n                                        __global\n                                        unsigned char *segred_tmp_mem_233508,\n                                        __global\n                                        unsigned char *segred_tmp_mem_233510,\n                                        __global\n                                        unsigned char *mainzicounter_mem_233512)\n{\n    #define segred_group_sizze_214222 (mainzisegred_group_sizze_212960)\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_233523_backing_2 =\n                                   (__local volatile\n                                    unsigned char *) sync_arr_mem_233523_backing_aligned_0;\n    __local volatile unsigned char *restrict red_arr_mem_233521_backing_1 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_233521_backing_aligned_1;\n    __local volatile unsigned char *restrict red_arr_mem_233519_backing_0 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_233519_backing_aligned_2;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_233514;\n    int32_t local_tid_233515;\n    int64_t group_sizze_233518;\n    int32_t wave_sizze_233517;\n    int32_t group_tid_233516;\n    \n    global_tid_233514 = get_global_id(0);\n    local_tid_233515 = get_local_id(0);\n    group_sizze_233518 = get_local_size(0);\n    wave_sizze_233517 = LOCKSTEP_WIDTH;\n    group_tid_233516 = get_group_id(0);\n    \n    int32_t phys_tid_214231 = global_tid_233514;\n    __local unsigned char *red_arr_mem_233519;\n    \n    red_arr_mem_233519 = (__local unsigned char *) red_arr_mem_233519_backing_0;\n    \n    __local unsigned char *red_arr_mem_233521;\n    \n    red_arr_mem_233521 = (__local unsigned char *) red_arr_mem_233521_backing_1;\n    \n    __local unsigned char *sync_arr_mem_233523;\n    \n    sync_arr_mem_233523 = (__local\n                           unsigned char *) sync_arr_mem_233523_backing_2;\n    \n    int32_t phys_group_id_233525;\n    \n    phys_group_id_233525 = get_group_id(0);\n    for (int32_t i_233526 = 0; i_233526 <\n         sdiv_up32(sext_i64_i32(virt_num_groups_233505) - phys_group_id_233525,\n                   sext_i64_i32(num_groups_214223)); i_233526++) {\n        int32_t virt_group_id_233527 = phys_group_id_233525 + i_233526 *\n                sext_i64_i32(num_groups_214223);\n        int32_t flat_segment_id_233528 = squot32(virt_group_id_233527",
                   ",\n                                                 sext_i64_i32(groups_per_segment_233503));\n        int64_t global_tid_233529 = srem64(sext_i32_i64(virt_group_id_233527) *\n                                           segred_group_sizze_214222 +\n                                           sext_i32_i64(local_tid_233515),\n                                           segred_group_sizze_214222 *\n                                           groups_per_segment_233503);\n        int64_t slice_233530 = s_n_m_203636;\n        int64_t slice_233531 = n_p_203492 * slice_233530;\n        int64_t slice_233532 = partition_sizze_203577 * slice_233531;\n        int64_t gtid_214227 = squot64(sext_i32_i64(flat_segment_id_233528),\n                                      slice_233531);\n        int64_t remnant_233533 = sext_i32_i64(flat_segment_id_233528) -\n                gtid_214227 * slice_233531;\n        int64_t gtid_214228 = squot64(remnant_233533, slice_233530);\n        int64_t remnant_233534 = remnant_233533 - gtid_214228 * slice_233530;\n        int64_t gtid_214229 = remnant_233534;\n        int64_t remnant_233535 = remnant_233534 - gtid_214229;\n        int64_t gtid_214230;\n        double x_acc_233536;\n        double x_acc_233537;\n        int64_t chunk_sizze_233538 = smin64(elements_per_thread_233504,\n                                            sdiv_up64(q_s_203493 -\n                                                      global_tid_233529,\n                                                      threads_per_segment_233507));\n        double x_214232;\n        double x_214233;\n        double x_214234;\n        double x_214235;\n        \n        // neutral-initialise the accumulators\n        {\n            x_acc_233536 = 0.0;\n            x_acc_233537 = 0.0;\n        }\n        for (int64_t i_233545 = 0; i_233545 < chunk_sizze_233538; i_233545++) {\n            gtid_214230 = global_tid_233529 + threads_per_segment_233507 *\n                i_233545;\n            // apply map function\n            {\n             ",
                   "   int64_t x_214251;\n                \n                x_214251 = ((__global int64_t *) ext_mem_229264)[gtid_214227 *\n                                                                 n_p_203492 +\n                                                                 gtid_214228];\n                \n                int64_t x_214258;\n                \n                x_214258 = ((__global int64_t *) ext_mem_229363)[gtid_214227 *\n                                                                 (s_n_m_203636 *\n                                                                  n_p_203492) +\n                                                                 gtid_214228 *\n                                                                 s_n_m_203636 +\n                                                                 gtid_214229];\n                \n                double x_214259;\n                \n                x_214259 = ((__global double *) ext_mem_229362)[gtid_214227 *\n                                                                (s_n_m_203636 *\n                                                                 n_p_203492) +\n                                                                gtid_214228 *\n                                                                s_n_m_203636 +\n                                                                gtid_214229];\n                \n                double a11_214260;\n                \n                a11_214260 = ((__global double *) mem_229999)[gtid_214227 *\n                                                              (s_n_m_203636 *\n                                                               n_p_203492) +\n                                                              gtid_214228 *\n                                                              s_n_m_203636 +\n                                                              gtid_214229];\n                \n                double b11_214261;\n                \n                b11_214261 = ((__global dou",
                   "ble *) mem_230004)[gtid_214227 *\n                                                              (s_n_m_203636 *\n                                                               n_p_203492) +\n                                                              gtid_214228 *\n                                                              s_n_m_203636 +\n                                                              gtid_214229];\n                \n                double c11_214262;\n                \n                c11_214262 = ((__global double *) mem_230009)[gtid_214227 *\n                                                              (s_n_m_203636 *\n                                                               n_p_203492) +\n                                                              gtid_214228 *\n                                                              s_n_m_203636 +\n                                                              gtid_214229];\n                \n                int64_t defunc_0_m_fun_res_214263;\n                \n                defunc_0_m_fun_res_214263 = ((__global\n                                              int64_t *) mem_230014)[gtid_214227 *\n                                                                     (s_n_m_203636 *\n                                                                      n_p_203492) +\n                                                                     gtid_214228 *\n                                                                     s_n_m_203636 +\n                                                                     gtid_214229];\n                \n                bool cond_214265 = sle64(x_214251, gtid_214230);\n                int64_t defunc_0_f_res_214266;\n                \n                if (cond_214265) {\n                    defunc_0_f_res_214266 = (int64_t) 0;\n                } else {\n                    int64_t i_214267 = add64(gtid_214230, x_214258);\n                    int64_t defunc_0_add_arg_214268;\n                    \n      ",
                   "              defunc_0_add_arg_214268 = ((__global\n                                                int64_t *) ext_mem_229265)[gtid_214227 *\n                                                                           (defunc_0_f_res_203631 *\n                                                                            n_p_203492) +\n                                                                           gtid_214228 *\n                                                                           defunc_0_f_res_203631 +\n                                                                           i_214267];\n                    \n                    int64_t defunc_1_add_res_214269 = add64((int64_t) 1,\n                                                            defunc_0_add_arg_214268);\n                    \n                    defunc_0_f_res_214266 = defunc_1_add_res_214269;\n                }\n                \n                double defunc_0_f_res_214270;\n                \n                if (cond_214265) {\n                    defunc_0_f_res_214270 = 0.0;\n                } else {\n                    int64_t i_214271 = add64(gtid_214230, x_214258);\n                    double defunc_0_add_arg_214272;\n                    \n                    defunc_0_add_arg_214272 = ((__global\n                                                double *) mem_229531)[gtid_214227 *\n                                                                      (defunc_0_f_res_203631 *\n                                                                       n_p_203492) +\n                                                                      gtid_214228 *\n                                                                      defunc_0_f_res_203631 +\n                                                                      i_214271];\n                    defunc_0_f_res_214270 = defunc_0_add_arg_214272;\n                }\n                \n                int64_t binop_p_214273 = sub64(defunc_0_f_res_214266,\n                       ",
                   "                        defunc_0_m_fun_res_214263);\n                double defunc_0_f_res_214274 = sitofp_i64_f64(binop_p_214273);\n                double abs_res_214275 = fabs(defunc_0_f_res_214274);\n                double tmp1_214276 = abs_res_214275 / x_214259;\n                double x_214277 = tmp1_214276 * tmp1_214276;\n                double y_214278 = tmp1_214276 * x_214277;\n                double tmp2_214279 = 1.0 - y_214278;\n                double x_214280 = tmp2_214279 * tmp2_214279;\n                double tmp3_214281 = tmp2_214279 * x_214280;\n                double tmp4_214282 = defunc_0_f_res_214270 * tmp3_214281;\n                double defunc_1_f_res_214283 = defunc_0_f_res_214274 *\n                       tmp4_214282;\n                double defunc_0_f_res_214284;\n                \n                if (cond_214265) {\n                    defunc_0_f_res_214284 = 0.0;\n                } else {\n                    int64_t i_214285 = add64(gtid_214230, x_214258);\n                    double defunc_0_add_arg_214286;\n                    \n                    defunc_0_add_arg_214286 = ((__global\n                                                double *) mem_229526)[gtid_214227 *\n                                                                      (defunc_0_f_res_203631 *\n                                                                       n_p_203492) +\n                                                                      gtid_214228 *\n                                                                      defunc_0_f_res_203631 +\n                                                                      i_214285];\n                    defunc_0_f_res_214284 = defunc_0_add_arg_214286;\n                }\n                \n                double x_214287 = a11_214260 * tmp4_214282;\n                double y_214288 = b11_214261 * defunc_1_f_res_214283;\n                double x_214289 = x_214287 + y_214288;\n                double defunc_9_fit_fun_res_214290 = defunc_0_f_res_214284 *\n ",
                   "                      x_214289;\n                double x_214291 = b11_214261 * tmp4_214282;\n                double y_214292 = c11_214262 * defunc_1_f_res_214283;\n                double x_214293 = x_214291 + y_214292;\n                double defunc_9_slope_fun_res_214294 = defunc_0_f_res_214284 *\n                       x_214293;\n                \n                // save map-out results\n                { }\n                // load accumulator\n                {\n                    x_214232 = x_acc_233536;\n                    x_214233 = x_acc_233537;\n                }\n                // load new values\n                {\n                    x_214234 = defunc_9_fit_fun_res_214290;\n                    x_214235 = defunc_9_slope_fun_res_214294;\n                }\n                // apply reduction operator\n                {\n                    double defunc_1_op_res_214236 = x_214232 + x_214234;\n                    double defunc_1_op_res_214237 = x_214233 + x_214235;\n                    \n                    // store in accumulator\n                    {\n                        x_acc_233536 = defunc_1_op_res_214236;\n                        x_acc_233537 = defunc_1_op_res_214237;\n                    }\n                }\n            }\n        }\n        // to reduce current chunk, first store our result in memory\n        {\n            x_214232 = x_acc_233536;\n            x_214233 = x_acc_233537;\n            ((__local\n              double *) red_arr_mem_233519)[sext_i32_i64(local_tid_233515)] =\n                x_214232;\n            ((__local\n              double *) red_arr_mem_233521)[sext_i32_i64(local_tid_233515)] =\n                x_214233;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        \n        int32_t offset_233546;\n        int32_t skip_waves_233547 = 1;\n        double x_233539;\n        double x_233540;\n        double x_233541;\n        double x_233542;\n        \n        offset_233546 = 0;\n        // participating threads read initial accumulator\n        {\n            if (sl",
                   "t32(local_tid_233515,\n                      sext_i64_i32(segred_group_sizze_214222))) {\n                x_233539 = ((__local\n                             double *) red_arr_mem_233519)[sext_i32_i64(local_tid_233515 +\n                                                           offset_233546)];\n                x_233540 = ((__local\n                             double *) red_arr_mem_233521)[sext_i32_i64(local_tid_233515 +\n                                                           offset_233546)];\n            }\n        }\n        offset_233546 = 1;\n        while (slt32(offset_233546, wave_sizze_233517)) {\n            if (slt32(local_tid_233515 + offset_233546,\n                      sext_i64_i32(segred_group_sizze_214222)) &&\n                ((local_tid_233515 - squot32(local_tid_233515,\n                                             wave_sizze_233517) *\n                  wave_sizze_233517) & (2 * offset_233546 - 1)) == 0) {\n                // read array element\n                {\n                    x_233541 = ((volatile __local\n                                 double *) red_arr_mem_233519)[sext_i32_i64(local_tid_233515 +\n                                                               offset_233546)];\n                    x_233542 = ((volatile __local\n                                 double *) red_arr_mem_233521)[sext_i32_i64(local_tid_233515 +\n                                                               offset_233546)];\n                }\n                // apply reduction operation\n                {\n                    double defunc_1_op_res_233543 = x_233539 + x_233541;\n                    double defunc_1_op_res_233544 = x_233540 + x_233542;\n                    \n                    x_233539 = defunc_1_op_res_233543;\n                    x_233540 = defunc_1_op_res_233544;\n                }\n                // write result of operation\n                {\n                    ((volatile __local\n                      double *) red_arr_mem_233519)[sext_i32_i64(local_tid_233515)] =\n  ",
                   "                      x_233539;\n                    ((volatile __local\n                      double *) red_arr_mem_233521)[sext_i32_i64(local_tid_233515)] =\n                        x_233540;\n                }\n            }\n            offset_233546 *= 2;\n        }\n        while (slt32(skip_waves_233547,\n                     squot32(sext_i64_i32(segred_group_sizze_214222) +\n                             wave_sizze_233517 - 1, wave_sizze_233517))) {\n            barrier(CLK_LOCAL_MEM_FENCE);\n            offset_233546 = skip_waves_233547 * wave_sizze_233517;\n            if (slt32(local_tid_233515 + offset_233546,\n                      sext_i64_i32(segred_group_sizze_214222)) &&\n                ((local_tid_233515 - squot32(local_tid_233515,\n                                             wave_sizze_233517) *\n                  wave_sizze_233517) == 0 && (squot32(local_tid_233515,\n                                                      wave_sizze_233517) & (2 *\n                                                                            skip_waves_233547 -\n                                                                            1)) ==\n                 0)) {\n                // read array element\n                {\n                    x_233541 = ((__local\n                                 double *) red_arr_mem_233519)[sext_i32_i64(local_tid_233515 +\n                                                               offset_233546)];\n                    x_233542 = ((__local\n                                 double *) red_arr_mem_233521)[sext_i32_i64(local_tid_233515 +\n                                                               offset_233546)];\n                }\n                // apply reduction operation\n                {\n                    double defunc_1_op_res_233543 = x_233539 + x_233541;\n                    double defunc_1_op_res_233544 = x_233540 + x_233542;\n                    \n                    x_233539 = defunc_1_op_res_233543;\n                    x_233540 = defunc_1_op_r",
                   "es_233544;\n                }\n                // write result of operation\n                {\n                    ((__local\n                      double *) red_arr_mem_233519)[sext_i32_i64(local_tid_233515)] =\n                        x_233539;\n                    ((__local\n                      double *) red_arr_mem_233521)[sext_i32_i64(local_tid_233515)] =\n                        x_233540;\n                }\n            }\n            skip_waves_233547 *= 2;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        // first thread saves the result in accumulator\n        {\n            if (sext_i32_i64(local_tid_233515) == (int64_t) 0) {\n                x_acc_233536 = x_233539;\n                x_acc_233537 = x_233540;\n            }\n        }\n        if (groups_per_segment_233503 == (int64_t) 1) {\n            // first thread in group saves final result to memory\n            {\n                if (local_tid_233515 == 0) {\n                    ((__global double *) mem_230020)[gtid_214227 *\n                                                     (s_n_m_203636 *\n                                                      n_p_203492) +\n                                                     gtid_214228 *\n                                                     s_n_m_203636 +\n                                                     gtid_214229] =\n                        x_acc_233536;\n                    ((__global double *) mem_230025)[gtid_214227 *\n                                                     (s_n_m_203636 *\n                                                      n_p_203492) +\n                                                     gtid_214228 *\n                                                     s_n_m_203636 +\n                                                     gtid_214229] =\n                        x_acc_233537;\n                }\n            }\n        } else {\n            int32_t old_counter_233548;\n            \n            // first thread in group saves group result to global memory\n         ",
                   "   {\n                if (local_tid_233515 == 0) {\n                    ((__global\n                      double *) segred_tmp_mem_233508)[sext_i32_i64(virt_group_id_233527)] =\n                        x_acc_233536;\n                    ((__global\n                      double *) segred_tmp_mem_233510)[sext_i32_i64(virt_group_id_233527)] =\n                        x_acc_233537;\n                    mem_fence_global();\n                    old_counter_233548 =\n                        atomic_add_i32_global(&((volatile __global\n                                                 int *) mainzicounter_mem_233512)[sext_i32_i64(srem32(flat_segment_id_233528,\n                                                                                                      10240))],\n                                              (int) 1);\n                    ((__local bool *) sync_arr_mem_233523)[(int64_t) 0] =\n                        old_counter_233548 == groups_per_segment_233503 -\n                        (int64_t) 1;\n                }\n            }\n            barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n            \n            bool is_last_group_233549;\n            \n            is_last_group_233549 = ((__local\n                                     bool *) sync_arr_mem_233523)[(int64_t) 0];\n            if (is_last_group_233549) {\n                if (local_tid_233515 == 0) {\n                    old_counter_233548 =\n                        atomic_add_i32_global(&((volatile __global\n                                                 int *) mainzicounter_mem_233512)[sext_i32_i64(srem32(flat_segment_id_233528,\n                                                                                                      10240))],\n                                              (int) ((int64_t) 0 -\n                                                     groups_per_segment_233503));\n                }\n                // read in the per-group-results\n                {\n                    int64_t read_per_thread_233",
                   "550 =\n                            sdiv_up64(groups_per_segment_233503,\n                                      segred_group_sizze_214222);\n                    \n                    x_214232 = 0.0;\n                    x_214233 = 0.0;\n                    for (int64_t i_233551 = 0; i_233551 <\n                         read_per_thread_233550; i_233551++) {\n                        int64_t group_res_id_233552 =\n                                sext_i32_i64(local_tid_233515) *\n                                read_per_thread_233550 + i_233551;\n                        int64_t index_of_group_res_233553 =\n                                sext_i32_i64(flat_segment_id_233528) *\n                                groups_per_segment_233503 + group_res_id_233552;\n                        \n                        if (slt64(group_res_id_233552,\n                                  groups_per_segment_233503)) {\n                            x_214234 = ((__global\n                                         double *) segred_tmp_mem_233508)[index_of_group_res_233553];\n                            x_214235 = ((__global\n                                         double *) segred_tmp_mem_233510)[index_of_group_res_233553];\n                            \n                            double defunc_1_op_res_214236 = x_214232 + x_214234;\n                            double defunc_1_op_res_214237 = x_214233 + x_214235;\n                            \n                            x_214232 = defunc_1_op_res_214236;\n                            x_214233 = defunc_1_op_res_214237;\n                        }\n                    }\n                }\n                ((__local\n                  double *) red_arr_mem_233519)[sext_i32_i64(local_tid_233515)] =\n                    x_214232;\n                ((__local\n                  double *) red_arr_mem_233521)[sext_i32_i64(local_tid_233515)] =\n                    x_214233;\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // reduce the per-group results\n                {\n   ",
                   "                 int32_t offset_233554;\n                    int32_t skip_waves_233555 = 1;\n                    double x_233539;\n                    double x_233540;\n                    double x_233541;\n                    double x_233542;\n                    \n                    offset_233554 = 0;\n                    // participating threads read initial accumulator\n                    {\n                        if (slt32(local_tid_233515,\n                                  sext_i64_i32(segred_group_sizze_214222))) {\n                            x_233539 = ((__local\n                                         double *) red_arr_mem_233519)[sext_i32_i64(local_tid_233515 +\n                                                                       offset_233554)];\n                            x_233540 = ((__local\n                                         double *) red_arr_mem_233521)[sext_i32_i64(local_tid_233515 +\n                                                                       offset_233554)];\n                        }\n                    }\n                    offset_233554 = 1;\n                    while (slt32(offset_233554, wave_sizze_233517)) {\n                        if (slt32(local_tid_233515 + offset_233554,\n                                  sext_i64_i32(segred_group_sizze_214222)) &&\n                            ((local_tid_233515 - squot32(local_tid_233515,\n                                                         wave_sizze_233517) *\n                              wave_sizze_233517) & (2 * offset_233554 - 1)) ==\n                            0) {\n                            // read array element\n                            {\n                                x_233541 = ((volatile __local\n                                             double *) red_arr_mem_233519)[sext_i32_i64(local_tid_233515 +\n                                                                           offset_233554)];\n                                x_233542 = ((volatile __local\n                            ",
                   "                 double *) red_arr_mem_233521)[sext_i32_i64(local_tid_233515 +\n                                                                           offset_233554)];\n                            }\n                            // apply reduction operation\n                            {\n                                double defunc_1_op_res_233543 = x_233539 +\n                                       x_233541;\n                                double defunc_1_op_res_233544 = x_233540 +\n                                       x_233542;\n                                \n                                x_233539 = defunc_1_op_res_233543;\n                                x_233540 = defunc_1_op_res_233544;\n                            }\n                            // write result of operation\n                            {\n                                ((volatile __local\n                                  double *) red_arr_mem_233519)[sext_i32_i64(local_tid_233515)] =\n                                    x_233539;\n                                ((volatile __local\n                                  double *) red_arr_mem_233521)[sext_i32_i64(local_tid_233515)] =\n                                    x_233540;\n                            }\n                        }\n                        offset_233554 *= 2;\n                    }\n                    while (slt32(skip_waves_233555,\n                                 squot32(sext_i64_i32(segred_group_sizze_214222) +\n                                         wave_sizze_233517 - 1,\n                                         wave_sizze_233517))) {\n                        barrier(CLK_LOCAL_MEM_FENCE);\n                        offset_233554 = skip_waves_233555 * wave_sizze_233517;\n                        if (slt32(local_tid_233515 + offset_233554,\n                                  sext_i64_i32(segred_group_sizze_214222)) &&\n                            ((local_tid_233515 - squot32(local_tid_233515,\n                                                   ",
                   "      wave_sizze_233517) *\n                              wave_sizze_233517) == 0 &&\n                             (squot32(local_tid_233515, wave_sizze_233517) &\n                              (2 * skip_waves_233555 - 1)) == 0)) {\n                            // read array element\n                            {\n                                x_233541 = ((__local\n                                             double *) red_arr_mem_233519)[sext_i32_i64(local_tid_233515 +\n                                                                           offset_233554)];\n                                x_233542 = ((__local\n                                             double *) red_arr_mem_233521)[sext_i32_i64(local_tid_233515 +\n                                                                           offset_233554)];\n                            }\n                            // apply reduction operation\n                            {\n                                double defunc_1_op_res_233543 = x_233539 +\n                                       x_233541;\n                                double defunc_1_op_res_233544 = x_233540 +\n                                       x_233542;\n                                \n                                x_233539 = defunc_1_op_res_233543;\n                                x_233540 = defunc_1_op_res_233544;\n                            }\n                            // write result of operation\n                            {\n                                ((__local\n                                  double *) red_arr_mem_233519)[sext_i32_i64(local_tid_233515)] =\n                                    x_233539;\n                                ((__local\n                                  double *) red_arr_mem_233521)[sext_i32_i64(local_tid_233515)] =\n                                    x_233540;\n                            }\n                        }\n                        skip_waves_233555 *= 2;\n                    }\n                    // and back to memor",
                   "y with the final result\n                    {\n                        if (local_tid_233515 == 0) {\n                            ((__global double *) mem_230020)[gtid_214227 *\n                                                             (s_n_m_203636 *\n                                                              n_p_203492) +\n                                                             gtid_214228 *\n                                                             s_n_m_203636 +\n                                                             gtid_214229] =\n                                x_233539;\n                            ((__global double *) mem_230025)[gtid_214227 *\n                                                             (s_n_m_203636 *\n                                                              n_p_203492) +\n                                                             gtid_214228 *\n                                                             s_n_m_203636 +\n                                                             gtid_214229] =\n                                x_233540;\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_214222\n}\n__kernel void mainzisegred_large_216784(__global int *global_failure,\n                                        __local volatile\n                                        int64_t *sync_arr_mem_233834_backing_aligned_0,\n                                        __local volatile\n                                        int64_t *red_arr_mem_233832_backing_aligned_1,\n                                        __local volatile\n                                        int64_t *red_arr_mem_233830_backing_aligned_2,\n                                        __local volatile\n                                        int64_t *red_arr_mem_233828_backing_aligned_3,\n                                    ",
                   "    __local volatile\n                                        int64_t *red_arr_mem_233826_backing_aligned_4,\n                                        __local volatile\n                                        int64_t *red_arr_mem_233824_backing_aligned_5,\n                                        int64_t n_p_203492, int64_t q_s_203493,\n                                        int64_t partition_sizze_203577,\n                                        int64_t defunc_0_f_res_203631,\n                                        int64_t s_n_m_203636,\n                                        int64_t num_groups_216773,\n                                        int64_t groups_per_segment_233802,\n                                        int64_t elements_per_thread_233803,\n                                        int64_t virt_num_groups_233804,\n                                        int64_t threads_per_segment_233806,\n                                        __global unsigned char *ext_mem_229264,\n                                        __global unsigned char *ext_mem_229265,\n                                        __global unsigned char *ext_mem_229362,\n                                        __global unsigned char *ext_mem_229363,\n                                        __global unsigned char *mem_229531,\n                                        __global unsigned char *mem_230312,\n                                        __global unsigned char *mem_230322,\n                                        __global unsigned char *mem_230327,\n                                        __global unsigned char *mem_230332,\n                                        __global unsigned char *mem_230337,\n                                        __global unsigned char *mem_230342,\n                                        __global\n                                        unsigned char *segred_tmp_mem_233807,\n                                        __global\n                                        unsigned char *segred_tmp_mem",
                   "_233809,\n                                        __global\n                                        unsigned char *segred_tmp_mem_233811,\n                                        __global\n                                        unsigned char *segred_tmp_mem_233813,\n                                        __global\n                                        unsigned char *segred_tmp_mem_233815,\n                                        __global\n                                        unsigned char *mainzicounter_mem_233817)\n{\n    #define segred_group_sizze_216772 (mainzisegred_group_sizze_215512)\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_233834_backing_5 =\n                                   (__local volatile\n                                    unsigned char *) sync_arr_mem_233834_backing_aligned_0;\n    __local volatile unsigned char *restrict red_arr_mem_233832_backing_4 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_233832_backing_aligned_1;\n    __local volatile unsigned char *restrict red_arr_mem_233830_backing_3 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_233830_backing_aligned_2;\n    __local volatile unsigned char *restrict red_arr_mem_233828_backing_2 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_233828_backing_aligned_3;\n    __local volatile unsigned char *restrict red_arr_mem_233826_backing_1 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_233826_backing_aligned_4;\n    __local volatile unsigned char *restrict red_arr_mem_233824_backing_0 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_233824_backing_",
                   "aligned_5;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_233819;\n    int32_t local_tid_233820;\n    int64_t group_sizze_233823;\n    int32_t wave_sizze_233822;\n    int32_t group_tid_233821;\n    \n    global_tid_233819 = get_global_id(0);\n    local_tid_233820 = get_local_id(0);\n    group_sizze_233823 = get_local_size(0);\n    wave_sizze_233822 = LOCKSTEP_WIDTH;\n    group_tid_233821 = get_group_id(0);\n    \n    int32_t phys_tid_216784 = global_tid_233819;\n    __local unsigned char *red_arr_mem_233824;\n    \n    red_arr_mem_233824 = (__local unsigned char *) red_arr_mem_233824_backing_0;\n    \n    __local unsigned char *red_arr_mem_233826;\n    \n    red_arr_mem_233826 = (__local unsigned char *) red_arr_mem_233826_backing_1;\n    \n    __local unsigned char *red_arr_mem_233828;\n    \n    red_arr_mem_233828 = (__local unsigned char *) red_arr_mem_233828_backing_2;\n    \n    __local unsigned char *red_arr_mem_233830;\n    \n    red_arr_mem_233830 = (__local unsigned char *) red_arr_mem_233830_backing_3;\n    \n    __local unsigned char *red_arr_mem_233832;\n    \n    red_arr_mem_233832 = (__local unsigned char *) red_arr_mem_233832_backing_4;\n    \n    __local unsigned char *sync_arr_mem_233834;\n    \n    sync_arr_mem_233834 = (__local\n                           unsigned char *) sync_arr_mem_233834_backing_5;\n    \n    int32_t phys_group_id_233836;\n    \n    phys_group_id_233836 = get_group_id(0);\n    for (int32_t i_233837 = 0; i_233837 <\n         sdiv_up32(sext_i64_i32(virt_num_groups_233804) - phys_group_id_233836,\n                   sext_i64_i32(num_groups_216773)); i_233837++) {\n        int32_t virt_group_id_233838 = phys_group_id_233836 + i_233837 *\n                sext_i64_i32(num_groups_216773);\n        int32_t flat_segment_id_233839 = squot32(virt_group_id_233838,\n                                                 sext_i64_i32(groups_per_segment_233802));\n        int64_t global_tid_233840 = srem64(sext_i32_i64(virt_group_id_233838) *\n                    ",
                   "                       segred_group_sizze_216772 +\n                                           sext_i32_i64(local_tid_233820),\n                                           segred_group_sizze_216772 *\n                                           groups_per_segment_233802);\n        int64_t slice_233841 = s_n_m_203636;\n        int64_t slice_233842 = n_p_203492 * slice_233841;\n        int64_t slice_233843 = partition_sizze_203577 * slice_233842;\n        int64_t gtid_216780 = squot64(sext_i32_i64(flat_segment_id_233839),\n                                      slice_233842);\n        int64_t remnant_233844 = sext_i32_i64(flat_segment_id_233839) -\n                gtid_216780 * slice_233842;\n        int64_t gtid_216781 = squot64(remnant_233844, slice_233841);\n        int64_t remnant_233845 = remnant_233844 - gtid_216781 * slice_233841;\n        int64_t gtid_216782 = remnant_233845;\n        int64_t remnant_233846 = remnant_233845 - gtid_216782;\n        int64_t gtid_216783;\n        double x_acc_233847;\n        double x_acc_233848;\n        double x_acc_233849;\n        double x_acc_233850;\n        double x_acc_233851;\n        int64_t chunk_sizze_233852 = smin64(elements_per_thread_233803,\n                                            sdiv_up64(q_s_203493 -\n                                                      global_tid_233840,\n                                                      threads_per_segment_233806));\n        double x_216785;\n        double x_216786;\n        double x_216787;\n        double x_216788;\n        double x_216789;\n        double x_216790;\n        double x_216791;\n        double x_216792;\n        double x_216793;\n        double x_216794;\n        \n        // neutral-initialise the accumulators\n        {\n            x_acc_233847 = 0.0;\n            x_acc_233848 = 0.0;\n            x_acc_233849 = 0.0;\n            x_acc_233850 = 0.0;\n            x_acc_233851 = 0.0;\n        }\n        for (int64_t i_233868 = 0; i_233868 < chunk_sizze_233852; i_233868++) {\n            gtid_21678",
                   "3 = global_tid_233840 + threads_per_segment_233806 *\n                i_233868;\n            // apply map function\n            {\n                int64_t x_216808;\n                \n                x_216808 = ((__global int64_t *) ext_mem_229264)[gtid_216780 *\n                                                                 n_p_203492 +\n                                                                 gtid_216781];\n                \n                int64_t x_216812;\n                \n                x_216812 = ((__global int64_t *) ext_mem_229363)[gtid_216780 *\n                                                                 (s_n_m_203636 *\n                                                                  n_p_203492) +\n                                                                 gtid_216781 *\n                                                                 s_n_m_203636 +\n                                                                 gtid_216782];\n                \n                double x_216813;\n                \n                x_216813 = ((__global double *) ext_mem_229362)[gtid_216780 *\n                                                                (s_n_m_203636 *\n                                                                 n_p_203492) +\n                                                                gtid_216781 *\n                                                                s_n_m_203636 +\n                                                                gtid_216782];\n                \n                int64_t defunc_0_m_fun_res_216814;\n                \n                defunc_0_m_fun_res_216814 = ((__global\n                                              int64_t *) mem_230312)[gtid_216780 *\n                                                                     (s_n_m_203636 *\n                                                                      n_p_203492) +\n                                                                     gtid_216781 *\n                          ",
                   "                                           s_n_m_203636 +\n                                                                     gtid_216782];\n                \n                bool cond_216816 = sle64(x_216808, gtid_216783);\n                int64_t defunc_0_f_res_216817;\n                \n                if (cond_216816) {\n                    defunc_0_f_res_216817 = (int64_t) 0;\n                } else {\n                    int64_t i_216818 = add64(gtid_216783, x_216812);\n                    int64_t defunc_0_add_arg_216819;\n                    \n                    defunc_0_add_arg_216819 = ((__global\n                                                int64_t *) ext_mem_229265)[gtid_216780 *\n                                                                           (defunc_0_f_res_203631 *\n                                                                            n_p_203492) +\n                                                                           gtid_216781 *\n                                                                           defunc_0_f_res_203631 +\n                                                                           i_216818];\n                    \n                    int64_t defunc_1_add_res_216820 = add64((int64_t) 1,\n                                                            defunc_0_add_arg_216819);\n                    \n                    defunc_0_f_res_216817 = defunc_1_add_res_216820;\n                }\n                \n                double defunc_0_f_res_216821;\n                \n                if (cond_216816) {\n                    defunc_0_f_res_216821 = 0.0;\n                } else {\n                    int64_t i_216822 = add64(gtid_216783, x_216812);\n                    double defunc_0_add_arg_216823;\n                    \n                    defunc_0_add_arg_216823 = ((__global\n                                                double *) mem_229531)[gtid_216780 *\n                                                                      (defunc_0_f_r",
                   "es_203631 *\n                                                                       n_p_203492) +\n                                                                      gtid_216781 *\n                                                                      defunc_0_f_res_203631 +\n                                                                      i_216822];\n                    defunc_0_f_res_216821 = defunc_0_add_arg_216823;\n                }\n                \n                int64_t binop_p_216824 = sub64(defunc_0_f_res_216817,\n                                               defunc_0_m_fun_res_216814);\n                double defunc_0_f_res_216825 = sitofp_i64_f64(binop_p_216824);\n                double abs_res_216826 = fabs(defunc_0_f_res_216825);\n                double tmp1_216827 = abs_res_216826 / x_216813;\n                double x_216828 = tmp1_216827 * tmp1_216827;\n                double y_216829 = tmp1_216827 * x_216828;\n                double tmp2_216830 = 1.0 - y_216829;\n                double x_216831 = tmp2_216830 * tmp2_216830;\n                double tmp3_216832 = tmp2_216830 * x_216831;\n                double w_j_216833 = defunc_0_f_res_216821 * tmp3_216832;\n                double xw_j_216834 = defunc_0_f_res_216825 * w_j_216833;\n                double x2w_j_216835 = defunc_0_f_res_216825 * xw_j_216834;\n                double x3w_j_216836 = defunc_0_f_res_216825 * x2w_j_216835;\n                double x4w_j_216837 = defunc_0_f_res_216825 * x3w_j_216836;\n                \n                // save map-out results\n                { }\n                // load accumulator\n                {\n                    x_216785 = x_acc_233847;\n                    x_216786 = x_acc_233848;\n                    x_216787 = x_acc_233849;\n                    x_216788 = x_acc_233850;\n                    x_216789 = x_acc_233851;\n                }\n                // load new values\n                {\n                    x_216790 = w_j_216833;\n                    x_216791 = xw_j_216834;\n  ",
                   "                  x_216792 = x2w_j_216835;\n                    x_216793 = x3w_j_216836;\n                    x_216794 = x4w_j_216837;\n                }\n                // apply reduction operator\n                {\n                    double defunc_1_op_res_216795 = x_216785 + x_216790;\n                    double defunc_1_op_res_216796 = x_216786 + x_216791;\n                    double defunc_1_op_res_216797 = x_216787 + x_216792;\n                    double defunc_1_op_res_216798 = x_216788 + x_216793;\n                    double defunc_1_op_res_216799 = x_216789 + x_216794;\n                    \n                    // store in accumulator\n                    {\n                        x_acc_233847 = defunc_1_op_res_216795;\n                        x_acc_233848 = defunc_1_op_res_216796;\n                        x_acc_233849 = defunc_1_op_res_216797;\n                        x_acc_233850 = defunc_1_op_res_216798;\n                        x_acc_233851 = defunc_1_op_res_216799;\n                    }\n                }\n            }\n        }\n        // to reduce current chunk, first store our result in memory\n        {\n            x_216785 = x_acc_233847;\n            x_216786 = x_acc_233848;\n            x_216787 = x_acc_233849;\n            x_216788 = x_acc_233850;\n            x_216789 = x_acc_233851;\n            ((__local\n              double *) red_arr_mem_233824)[sext_i32_i64(local_tid_233820)] =\n                x_216785;\n            ((__local\n              double *) red_arr_mem_233826)[sext_i32_i64(local_tid_233820)] =\n                x_216786;\n            ((__local\n              double *) red_arr_mem_233828)[sext_i32_i64(local_tid_233820)] =\n                x_216787;\n            ((__local\n              double *) red_arr_mem_233830)[sext_i32_i64(local_tid_233820)] =\n                x_216788;\n            ((__local\n              double *) red_arr_mem_233832)[sext_i32_i64(local_tid_233820)] =\n                x_216789;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        \n     ",
                   "   int32_t offset_233869;\n        int32_t skip_waves_233870 = 1;\n        double x_233853;\n        double x_233854;\n        double x_233855;\n        double x_233856;\n        double x_233857;\n        double x_233858;\n        double x_233859;\n        double x_233860;\n        double x_233861;\n        double x_233862;\n        \n        offset_233869 = 0;\n        // participating threads read initial accumulator\n        {\n            if (slt32(local_tid_233820,\n                      sext_i64_i32(segred_group_sizze_216772))) {\n                x_233853 = ((__local\n                             double *) red_arr_mem_233824)[sext_i32_i64(local_tid_233820 +\n                                                           offset_233869)];\n                x_233854 = ((__local\n                             double *) red_arr_mem_233826)[sext_i32_i64(local_tid_233820 +\n                                                           offset_233869)];\n                x_233855 = ((__local\n                             double *) red_arr_mem_233828)[sext_i32_i64(local_tid_233820 +\n                                                           offset_233869)];\n                x_233856 = ((__local\n                             double *) red_arr_mem_233830)[sext_i32_i64(local_tid_233820 +\n                                                           offset_233869)];\n                x_233857 = ((__local\n                             double *) red_arr_mem_233832)[sext_i32_i64(local_tid_233820 +\n                                                           offset_233869)];\n            }\n        }\n        offset_233869 = 1;\n        while (slt32(offset_233869, wave_sizze_233822)) {\n            if (slt32(local_tid_233820 + offset_233869,\n                      sext_i64_i32(segred_group_sizze_216772)) &&\n                ((local_tid_233820 - squot32(local_tid_233820,\n                                             wave_sizze_233822) *\n                  wave_sizze_233822) & (2 * offset_233869 - 1)) == 0) {\n                // read",
                   " array element\n                {\n                    x_233858 = ((volatile __local\n                                 double *) red_arr_mem_233824)[sext_i32_i64(local_tid_233820 +\n                                                               offset_233869)];\n                    x_233859 = ((volatile __local\n                                 double *) red_arr_mem_233826)[sext_i32_i64(local_tid_233820 +\n                                                               offset_233869)];\n                    x_233860 = ((volatile __local\n                                 double *) red_arr_mem_233828)[sext_i32_i64(local_tid_233820 +\n                                                               offset_233869)];\n                    x_233861 = ((volatile __local\n                                 double *) red_arr_mem_233830)[sext_i32_i64(local_tid_233820 +\n                                                               offset_233869)];\n                    x_233862 = ((volatile __local\n                                 double *) red_arr_mem_233832)[sext_i32_i64(local_tid_233820 +\n                                                               offset_233869)];\n                }\n                // apply reduction operation\n                {\n                    double defunc_1_op_res_233863 = x_233853 + x_233858;\n                    double defunc_1_op_res_233864 = x_233854 + x_233859;\n                    double defunc_1_op_res_233865 = x_233855 + x_233860;\n                    double defunc_1_op_res_233866 = x_233856 + x_233861;\n                    double defunc_1_op_res_233867 = x_233857 + x_233862;\n                    \n                    x_233853 = defunc_1_op_res_233863;\n                    x_233854 = defunc_1_op_res_233864;\n                    x_233855 = defunc_1_op_res_233865;\n                    x_233856 = defunc_1_op_res_233866;\n                    x_233857 = defunc_1_op_res_233867;\n                }\n                // write result of operation\n                {\n                   ",
                   " ((volatile __local\n                      double *) red_arr_mem_233824)[sext_i32_i64(local_tid_233820)] =\n                        x_233853;\n                    ((volatile __local\n                      double *) red_arr_mem_233826)[sext_i32_i64(local_tid_233820)] =\n                        x_233854;\n                    ((volatile __local\n                      double *) red_arr_mem_233828)[sext_i32_i64(local_tid_233820)] =\n                        x_233855;\n                    ((volatile __local\n                      double *) red_arr_mem_233830)[sext_i32_i64(local_tid_233820)] =\n                        x_233856;\n                    ((volatile __local\n                      double *) red_arr_mem_233832)[sext_i32_i64(local_tid_233820)] =\n                        x_233857;\n                }\n            }\n            offset_233869 *= 2;\n        }\n        while (slt32(skip_waves_233870,\n                     squot32(sext_i64_i32(segred_group_sizze_216772) +\n                             wave_sizze_233822 - 1, wave_sizze_233822))) {\n            barrier(CLK_LOCAL_MEM_FENCE);\n            offset_233869 = skip_waves_233870 * wave_sizze_233822;\n            if (slt32(local_tid_233820 + offset_233869,\n                      sext_i64_i32(segred_group_sizze_216772)) &&\n                ((local_tid_233820 - squot32(local_tid_233820,\n                                             wave_sizze_233822) *\n                  wave_sizze_233822) == 0 && (squot32(local_tid_233820,\n                                                      wave_sizze_233822) & (2 *\n                                                                            skip_waves_233870 -\n                                                                            1)) ==\n                 0)) {\n                // read array element\n                {\n                    x_233858 = ((__local\n                                 double *) red_arr_mem_233824)[sext_i32_i64(local_tid_233820 +\n                                                          ",
                   "     offset_233869)];\n                    x_233859 = ((__local\n                                 double *) red_arr_mem_233826)[sext_i32_i64(local_tid_233820 +\n                                                               offset_233869)];\n                    x_233860 = ((__local\n                                 double *) red_arr_mem_233828)[sext_i32_i64(local_tid_233820 +\n                                                               offset_233869)];\n                    x_233861 = ((__local\n                                 double *) red_arr_mem_233830)[sext_i32_i64(local_tid_233820 +\n                                                               offset_233869)];\n                    x_233862 = ((__local\n                                 double *) red_arr_mem_233832)[sext_i32_i64(local_tid_233820 +\n                                                               offset_233869)];\n                }\n                // apply reduction operation\n                {\n                    double defunc_1_op_res_233863 = x_233853 + x_233858;\n                    double defunc_1_op_res_233864 = x_233854 + x_233859;\n                    double defunc_1_op_res_233865 = x_233855 + x_233860;\n                    double defunc_1_op_res_233866 = x_233856 + x_233861;\n                    double defunc_1_op_res_233867 = x_233857 + x_233862;\n                    \n                    x_233853 = defunc_1_op_res_233863;\n                    x_233854 = defunc_1_op_res_233864;\n                    x_233855 = defunc_1_op_res_233865;\n                    x_233856 = defunc_1_op_res_233866;\n                    x_233857 = defunc_1_op_res_233867;\n                }\n                // write result of operation\n                {\n                    ((__local\n                      double *) red_arr_mem_233824)[sext_i32_i64(local_tid_233820)] =\n                        x_233853;\n                    ((__local\n                      double *) red_arr_mem_233826)[sext_i32_i64(local_tid_233820)] =\n                        x",
                   "_233854;\n                    ((__local\n                      double *) red_arr_mem_233828)[sext_i32_i64(local_tid_233820)] =\n                        x_233855;\n                    ((__local\n                      double *) red_arr_mem_233830)[sext_i32_i64(local_tid_233820)] =\n                        x_233856;\n                    ((__local\n                      double *) red_arr_mem_233832)[sext_i32_i64(local_tid_233820)] =\n                        x_233857;\n                }\n            }\n            skip_waves_233870 *= 2;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        // first thread saves the result in accumulator\n        {\n            if (sext_i32_i64(local_tid_233820) == (int64_t) 0) {\n                x_acc_233847 = x_233853;\n                x_acc_233848 = x_233854;\n                x_acc_233849 = x_233855;\n                x_acc_233850 = x_233856;\n                x_acc_233851 = x_233857;\n            }\n        }\n        if (groups_per_segment_233802 == (int64_t) 1) {\n            // first thread in group saves final result to memory\n            {\n                if (local_tid_233820 == 0) {\n                    ((__global double *) mem_230322)[gtid_216780 *\n                                                     (s_n_m_203636 *\n                                                      n_p_203492) +\n                                                     gtid_216781 *\n                                                     s_n_m_203636 +\n                                                     gtid_216782] =\n                        x_acc_233847;\n                    ((__global double *) mem_230327)[gtid_216780 *\n                                                     (s_n_m_203636 *\n                                                      n_p_203492) +\n                                                     gtid_216781 *\n                                                     s_n_m_203636 +\n                                                     gtid_216782] =\n                        x_acc_23",
                   "3848;\n                    ((__global double *) mem_230332)[gtid_216780 *\n                                                     (s_n_m_203636 *\n                                                      n_p_203492) +\n                                                     gtid_216781 *\n                                                     s_n_m_203636 +\n                                                     gtid_216782] =\n                        x_acc_233849;\n                    ((__global double *) mem_230337)[gtid_216780 *\n                                                     (s_n_m_203636 *\n                                                      n_p_203492) +\n                                                     gtid_216781 *\n                                                     s_n_m_203636 +\n                                                     gtid_216782] =\n                        x_acc_233850;\n                    ((__global double *) mem_230342)[gtid_216780 *\n                                                     (s_n_m_203636 *\n                                                      n_p_203492) +\n                                                     gtid_216781 *\n                                                     s_n_m_203636 +\n                                                     gtid_216782] =\n                        x_acc_233851;\n                }\n            }\n        } else {\n            int32_t old_counter_233871;\n            \n            // first thread in group saves group result to global memory\n            {\n                if (local_tid_233820 == 0) {\n                    ((__global\n                      double *) segred_tmp_mem_233807)[sext_i32_i64(virt_group_id_233838)] =\n                        x_acc_233847;\n                    ((__global\n                      double *) segred_tmp_mem_233809)[sext_i32_i64(virt_group_id_233838)] =\n                        x_acc_233848;\n                    ((__global\n                      double *) segred_tmp_mem_233811)[sext_i32_i64(vi",
                   "rt_group_id_233838)] =\n                        x_acc_233849;\n                    ((__global\n                      double *) segred_tmp_mem_233813)[sext_i32_i64(virt_group_id_233838)] =\n                        x_acc_233850;\n                    ((__global\n                      double *) segred_tmp_mem_233815)[sext_i32_i64(virt_group_id_233838)] =\n                        x_acc_233851;\n                    mem_fence_global();\n                    old_counter_233871 =\n                        atomic_add_i32_global(&((volatile __global\n                                                 int *) mainzicounter_mem_233817)[sext_i32_i64(srem32(flat_segment_id_233839,\n                                                                                                      10240))],\n                                              (int) 1);\n                    ((__local bool *) sync_arr_mem_233834)[(int64_t) 0] =\n                        old_counter_233871 == groups_per_segment_233802 -\n                        (int64_t) 1;\n                }\n            }\n            barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n            \n            bool is_last_group_233872;\n            \n            is_last_group_233872 = ((__local\n                                     bool *) sync_arr_mem_233834)[(int64_t) 0];\n            if (is_last_group_233872) {\n                if (local_tid_233820 == 0) {\n                    old_counter_233871 =\n                        atomic_add_i32_global(&((volatile __global\n                                                 int *) mainzicounter_mem_233817)[sext_i32_i64(srem32(flat_segment_id_233839,\n                                                                                                      10240))],\n                                              (int) ((int64_t) 0 -\n                                                     groups_per_segment_233802));\n                }\n                // read in the per-group-results\n                {\n                    int64_t read_per",
                   "_thread_233873 =\n                            sdiv_up64(groups_per_segment_233802,\n                                      segred_group_sizze_216772);\n                    \n                    x_216785 = 0.0;\n                    x_216786 = 0.0;\n                    x_216787 = 0.0;\n                    x_216788 = 0.0;\n                    x_216789 = 0.0;\n                    for (int64_t i_233874 = 0; i_233874 <\n                         read_per_thread_233873; i_233874++) {\n                        int64_t group_res_id_233875 =\n                                sext_i32_i64(local_tid_233820) *\n                                read_per_thread_233873 + i_233874;\n                        int64_t index_of_group_res_233876 =\n                                sext_i32_i64(flat_segment_id_233839) *\n                                groups_per_segment_233802 + group_res_id_233875;\n                        \n                        if (slt64(group_res_id_233875,\n                                  groups_per_segment_233802)) {\n                            x_216790 = ((__global\n                                         double *) segred_tmp_mem_233807)[index_of_group_res_233876];\n                            x_216791 = ((__global\n                                         double *) segred_tmp_mem_233809)[index_of_group_res_233876];\n                            x_216792 = ((__global\n                                         double *) segred_tmp_mem_233811)[index_of_group_res_233876];\n                            x_216793 = ((__global\n                                         double *) segred_tmp_mem_233813)[index_of_group_res_233876];\n                            x_216794 = ((__global\n                                         double *) segred_tmp_mem_233815)[index_of_group_res_233876];\n                            \n                            double defunc_1_op_res_216795 = x_216785 + x_216790;\n                            double defunc_1_op_res_216796 = x_216786 + x_216791;\n                            double de",
                   "func_1_op_res_216797 = x_216787 + x_216792;\n                            double defunc_1_op_res_216798 = x_216788 + x_216793;\n                            double defunc_1_op_res_216799 = x_216789 + x_216794;\n                            \n                            x_216785 = defunc_1_op_res_216795;\n                            x_216786 = defunc_1_op_res_216796;\n                            x_216787 = defunc_1_op_res_216797;\n                            x_216788 = defunc_1_op_res_216798;\n                            x_216789 = defunc_1_op_res_216799;\n                        }\n                    }\n                }\n                ((__local\n                  double *) red_arr_mem_233824)[sext_i32_i64(local_tid_233820)] =\n                    x_216785;\n                ((__local\n                  double *) red_arr_mem_233826)[sext_i32_i64(local_tid_233820)] =\n                    x_216786;\n                ((__local\n                  double *) red_arr_mem_233828)[sext_i32_i64(local_tid_233820)] =\n                    x_216787;\n                ((__local\n                  double *) red_arr_mem_233830)[sext_i32_i64(local_tid_233820)] =\n                    x_216788;\n                ((__local\n                  double *) red_arr_mem_233832)[sext_i32_i64(local_tid_233820)] =\n                    x_216789;\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // reduce the per-group results\n                {\n                    int32_t offset_233877;\n                    int32_t skip_waves_233878 = 1;\n                    double x_233853;\n                    double x_233854;\n                    double x_233855;\n                    double x_233856;\n                    double x_233857;\n                    double x_233858;\n                    double x_233859;\n                    double x_233860;\n                    double x_233861;\n                    double x_233862;\n                    \n                    offset_233877 = 0;\n                    // participating threads read initial ",
                   "accumulator\n                    {\n                        if (slt32(local_tid_233820,\n                                  sext_i64_i32(segred_group_sizze_216772))) {\n                            x_233853 = ((__local\n                                         double *) red_arr_mem_233824)[sext_i32_i64(local_tid_233820 +\n                                                                       offset_233877)];\n                            x_233854 = ((__local\n                                         double *) red_arr_mem_233826)[sext_i32_i64(local_tid_233820 +\n                                                                       offset_233877)];\n                            x_233855 = ((__local\n                                         double *) red_arr_mem_233828)[sext_i32_i64(local_tid_233820 +\n                                                                       offset_233877)];\n                            x_233856 = ((__local\n                                         double *) red_arr_mem_233830)[sext_i32_i64(local_tid_233820 +\n                                                                       offset_233877)];\n                            x_233857 = ((__local\n                                         double *) red_arr_mem_233832)[sext_i32_i64(local_tid_233820 +\n                                                                       offset_233877)];\n                        }\n                    }\n                    offset_233877 = 1;\n                    while (slt32(offset_233877, wave_sizze_233822)) {\n                        if (slt32(local_tid_233820 + offset_233877,\n                                  sext_i64_i32(segred_group_sizze_216772)) &&\n                            ((local_tid_233820 - squot32(local_tid_233820,\n                                                         wave_sizze_233822) *\n                              wave_sizze_233822) & (2 * offset_233877 - 1)) ==\n                            0) {\n                            // read array element\n                  ",
                   "          {\n                                x_233858 = ((volatile __local\n                                             double *) red_arr_mem_233824)[sext_i32_i64(local_tid_233820 +\n                                                                           offset_233877)];\n                                x_233859 = ((volatile __local\n                                             double *) red_arr_mem_233826)[sext_i32_i64(local_tid_233820 +\n                                                                           offset_233877)];\n                                x_233860 = ((volatile __local\n                                             double *) red_arr_mem_233828)[sext_i32_i64(local_tid_233820 +\n                                                                           offset_233877)];\n                                x_233861 = ((volatile __local\n                                             double *) red_arr_mem_233830)[sext_i32_i64(local_tid_233820 +\n                                                                           offset_233877)];\n                                x_233862 = ((volatile __local\n                                             double *) red_arr_mem_233832)[sext_i32_i64(local_tid_233820 +\n                                                                           offset_233877)];\n                            }\n                            // apply reduction operation\n                            {\n                                double defunc_1_op_res_233863 = x_233853 +\n                                       x_233858;\n                                double defunc_1_op_res_233864 = x_233854 +\n                                       x_233859;\n                                double defunc_1_op_res_233865 = x_233855 +\n                                       x_233860;\n                                double defunc_1_op_res_233866 = x_233856 +\n                                       x_233861;\n                                double defunc_1_op_res_233867 = x_2338",
                   "57 +\n                                       x_233862;\n                                \n                                x_233853 = defunc_1_op_res_233863;\n                                x_233854 = defunc_1_op_res_233864;\n                                x_233855 = defunc_1_op_res_233865;\n                                x_233856 = defunc_1_op_res_233866;\n                                x_233857 = defunc_1_op_res_233867;\n                            }\n                            // write result of operation\n                            {\n                                ((volatile __local\n                                  double *) red_arr_mem_233824)[sext_i32_i64(local_tid_233820)] =\n                                    x_233853;\n                                ((volatile __local\n                                  double *) red_arr_mem_233826)[sext_i32_i64(local_tid_233820)] =\n                                    x_233854;\n                                ((volatile __local\n                                  double *) red_arr_mem_233828)[sext_i32_i64(local_tid_233820)] =\n                                    x_233855;\n                                ((volatile __local\n                                  double *) red_arr_mem_233830)[sext_i32_i64(local_tid_233820)] =\n                                    x_233856;\n                                ((volatile __local\n                                  double *) red_arr_mem_233832)[sext_i32_i64(local_tid_233820)] =\n                                    x_233857;\n                            }\n                        }\n                        offset_233877 *= 2;\n                    }\n                    while (slt32(skip_waves_233878,\n                                 squot32(sext_i64_i32(segred_group_sizze_216772) +\n                                         wave_sizze_233822 - 1,\n                                         wave_sizze_233822))) {\n                        barrier(CLK_LOCAL_MEM_FENCE);\n                        offset_233877 = skip_wa",
                   "ves_233878 * wave_sizze_233822;\n                        if (slt32(local_tid_233820 + offset_233877,\n                                  sext_i64_i32(segred_group_sizze_216772)) &&\n                            ((local_tid_233820 - squot32(local_tid_233820,\n                                                         wave_sizze_233822) *\n                              wave_sizze_233822) == 0 &&\n                             (squot32(local_tid_233820, wave_sizze_233822) &\n                              (2 * skip_waves_233878 - 1)) == 0)) {\n                            // read array element\n                            {\n                                x_233858 = ((__local\n                                             double *) red_arr_mem_233824)[sext_i32_i64(local_tid_233820 +\n                                                                           offset_233877)];\n                                x_233859 = ((__local\n                                             double *) red_arr_mem_233826)[sext_i32_i64(local_tid_233820 +\n                                                                           offset_233877)];\n                                x_233860 = ((__local\n                                             double *) red_arr_mem_233828)[sext_i32_i64(local_tid_233820 +\n                                                                           offset_233877)];\n                                x_233861 = ((__local\n                                             double *) red_arr_mem_233830)[sext_i32_i64(local_tid_233820 +\n                                                                           offset_233877)];\n                                x_233862 = ((__local\n                                             double *) red_arr_mem_233832)[sext_i32_i64(local_tid_233820 +\n                                                                           offset_233877)];\n                            }\n                            // apply reduction operation\n                            {\n          ",
                   "                      double defunc_1_op_res_233863 = x_233853 +\n                                       x_233858;\n                                double defunc_1_op_res_233864 = x_233854 +\n                                       x_233859;\n                                double defunc_1_op_res_233865 = x_233855 +\n                                       x_233860;\n                                double defunc_1_op_res_233866 = x_233856 +\n                                       x_233861;\n                                double defunc_1_op_res_233867 = x_233857 +\n                                       x_233862;\n                                \n                                x_233853 = defunc_1_op_res_233863;\n                                x_233854 = defunc_1_op_res_233864;\n                                x_233855 = defunc_1_op_res_233865;\n                                x_233856 = defunc_1_op_res_233866;\n                                x_233857 = defunc_1_op_res_233867;\n                            }\n                            // write result of operation\n                            {\n                                ((__local\n                                  double *) red_arr_mem_233824)[sext_i32_i64(local_tid_233820)] =\n                                    x_233853;\n                                ((__local\n                                  double *) red_arr_mem_233826)[sext_i32_i64(local_tid_233820)] =\n                                    x_233854;\n                                ((__local\n                                  double *) red_arr_mem_233828)[sext_i32_i64(local_tid_233820)] =\n                                    x_233855;\n                                ((__local\n                                  double *) red_arr_mem_233830)[sext_i32_i64(local_tid_233820)] =\n                                    x_233856;\n                                ((__local\n                                  double *) red_arr_mem_233832)[sext_i32_i64(local_tid_233820)] =\n                     ",
                   "               x_233857;\n                            }\n                        }\n                        skip_waves_233878 *= 2;\n                    }\n                    // and back to memory with the final result\n                    {\n                        if (local_tid_233820 == 0) {\n                            ((__global double *) mem_230322)[gtid_216780 *\n                                                             (s_n_m_203636 *\n                                                              n_p_203492) +\n                                                             gtid_216781 *\n                                                             s_n_m_203636 +\n                                                             gtid_216782] =\n                                x_233853;\n                            ((__global double *) mem_230327)[gtid_216780 *\n                                                             (s_n_m_203636 *\n                                                              n_p_203492) +\n                                                             gtid_216781 *\n                                                             s_n_m_203636 +\n                                                             gtid_216782] =\n                                x_233854;\n                            ((__global double *) mem_230332)[gtid_216780 *\n                                                             (s_n_m_203636 *\n                                                              n_p_203492) +\n                                                             gtid_216781 *\n                                                             s_n_m_203636 +\n                                                             gtid_216782] =\n                                x_233855;\n                            ((__global double *) mem_230337)[gtid_216780 *\n                                                             (s_n_m_203636 *\n                                                              n_p_2",
                   "03492) +\n                                                             gtid_216781 *\n                                                             s_n_m_203636 +\n                                                             gtid_216782] =\n                                x_233856;\n                            ((__global double *) mem_230342)[gtid_216780 *\n                                                             (s_n_m_203636 *\n                                                              n_p_203492) +\n                                                             gtid_216781 *\n                                                             s_n_m_203636 +\n                                                             gtid_216782] =\n                                x_233857;\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_216772\n}\n__kernel void mainzisegred_large_216907(__global int *global_failure,\n                                        __local volatile\n                                        int64_t *sync_arr_mem_233948_backing_aligned_0,\n                                        __local volatile\n                                        int64_t *red_arr_mem_233946_backing_aligned_1,\n                                        __local volatile\n                                        int64_t *red_arr_mem_233944_backing_aligned_2,\n                                        int64_t n_p_203492, int64_t q_s_203493,\n                                        int64_t partition_sizze_203577,\n                                        int64_t defunc_0_f_res_203631,\n                                        int64_t s_n_m_203636,\n                                        int64_t num_groups_216899,\n                                        int64_t groups_per_segment_233928,\n                                        int64_t elements_per_thread_233",
                   "929,\n                                        int64_t virt_num_groups_233930,\n                                        int64_t threads_per_segment_233932,\n                                        __global unsigned char *ext_mem_229264,\n                                        __global unsigned char *ext_mem_229265,\n                                        __global unsigned char *ext_mem_229362,\n                                        __global unsigned char *ext_mem_229363,\n                                        __global unsigned char *mem_229526,\n                                        __global unsigned char *mem_229531,\n                                        __global unsigned char *mem_230348,\n                                        __global unsigned char *mem_230353,\n                                        __global unsigned char *mem_230358,\n                                        __global unsigned char *mem_230363,\n                                        __global unsigned char *mem_230368,\n                                        __global unsigned char *mem_230373,\n                                        __global unsigned char *mem_230379,\n                                        __global unsigned char *mem_230384,\n                                        __global\n                                        unsigned char *segred_tmp_mem_233933,\n                                        __global\n                                        unsigned char *segred_tmp_mem_233935,\n                                        __global\n                                        unsigned char *mainzicounter_mem_233937)\n{\n    #define segred_group_sizze_216898 (mainzisegred_group_sizze_215343)\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_233948_backing_2 =\n                                   (__local volatile\n                                    unsigned char *) sync_arr_mem_233948_backing_ali",
                   "gned_0;\n    __local volatile unsigned char *restrict red_arr_mem_233946_backing_1 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_233946_backing_aligned_1;\n    __local volatile unsigned char *restrict red_arr_mem_233944_backing_0 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_233944_backing_aligned_2;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_233939;\n    int32_t local_tid_233940;\n    int64_t group_sizze_233943;\n    int32_t wave_sizze_233942;\n    int32_t group_tid_233941;\n    \n    global_tid_233939 = get_global_id(0);\n    local_tid_233940 = get_local_id(0);\n    group_sizze_233943 = get_local_size(0);\n    wave_sizze_233942 = LOCKSTEP_WIDTH;\n    group_tid_233941 = get_group_id(0);\n    \n    int32_t phys_tid_216907 = global_tid_233939;\n    __local unsigned char *red_arr_mem_233944;\n    \n    red_arr_mem_233944 = (__local unsigned char *) red_arr_mem_233944_backing_0;\n    \n    __local unsigned char *red_arr_mem_233946;\n    \n    red_arr_mem_233946 = (__local unsigned char *) red_arr_mem_233946_backing_1;\n    \n    __local unsigned char *sync_arr_mem_233948;\n    \n    sync_arr_mem_233948 = (__local\n                           unsigned char *) sync_arr_mem_233948_backing_2;\n    \n    int32_t phys_group_id_233950;\n    \n    phys_group_id_233950 = get_group_id(0);\n    for (int32_t i_233951 = 0; i_233951 <\n         sdiv_up32(sext_i64_i32(virt_num_groups_233930) - phys_group_id_233950,\n                   sext_i64_i32(num_groups_216899)); i_233951++) {\n        int32_t virt_group_id_233952 = phys_group_id_233950 + i_233951 *\n                sext_i64_i32(num_groups_216899);\n        int32_t flat_segment_id_233953 = squot32(virt_group_id_233952,\n                                                 sext_i64_i32(groups_per_segment_233928));\n        int64_t global_tid_233954 = srem64(sext_i32_i64(virt_group_id_233952)",
                   " *\n                                           segred_group_sizze_216898 +\n                                           sext_i32_i64(local_tid_233940),\n                                           segred_group_sizze_216898 *\n                                           groups_per_segment_233928);\n        int64_t slice_233955 = s_n_m_203636;\n        int64_t slice_233956 = n_p_203492 * slice_233955;\n        int64_t slice_233957 = partition_sizze_203577 * slice_233956;\n        int64_t gtid_216903 = squot64(sext_i32_i64(flat_segment_id_233953),\n                                      slice_233956);\n        int64_t remnant_233958 = sext_i32_i64(flat_segment_id_233953) -\n                gtid_216903 * slice_233956;\n        int64_t gtid_216904 = squot64(remnant_233958, slice_233955);\n        int64_t remnant_233959 = remnant_233958 - gtid_216904 * slice_233955;\n        int64_t gtid_216905 = remnant_233959;\n        int64_t remnant_233960 = remnant_233959 - gtid_216905;\n        int64_t gtid_216906;\n        double x_acc_233961;\n        double x_acc_233962;\n        int64_t chunk_sizze_233963 = smin64(elements_per_thread_233929,\n                                            sdiv_up64(q_s_203493 -\n                                                      global_tid_233954,\n                                                      threads_per_segment_233932));\n        double x_216908;\n        double x_216909;\n        double x_216910;\n        double x_216911;\n        \n        // neutral-initialise the accumulators\n        {\n            x_acc_233961 = 0.0;\n            x_acc_233962 = 0.0;\n        }\n        for (int64_t i_233970 = 0; i_233970 < chunk_sizze_233963; i_233970++) {\n            gtid_216906 = global_tid_233954 + threads_per_segment_233932 *\n                i_233970;\n            // apply map function\n            {\n                int64_t x_216929;\n                \n                x_216929 = ((__global int64_t *) ext_mem_229264)[gtid_216903 *\n                                                     ",
                   "            n_p_203492 +\n                                                                 gtid_216904];\n                \n                int64_t x_216938;\n                \n                x_216938 = ((__global int64_t *) ext_mem_229363)[gtid_216903 *\n                                                                 (s_n_m_203636 *\n                                                                  n_p_203492) +\n                                                                 gtid_216904 *\n                                                                 s_n_m_203636 +\n                                                                 gtid_216905];\n                \n                double x_216939;\n                \n                x_216939 = ((__global double *) ext_mem_229362)[gtid_216903 *\n                                                                (s_n_m_203636 *\n                                                                 n_p_203492) +\n                                                                gtid_216904 *\n                                                                s_n_m_203636 +\n                                                                gtid_216905];\n                \n                double a12_216940;\n                \n                a12_216940 = ((__global double *) mem_230348)[gtid_216903 *\n                                                              (s_n_m_203636 *\n                                                               n_p_203492) +\n                                                              gtid_216904 *\n                                                              s_n_m_203636 +\n                                                              gtid_216905];\n                \n                double b12_216941;\n                \n                b12_216941 = ((__global double *) mem_230353)[gtid_216903 *\n                                                              (s_n_m_203636 *\n                                                           ",
                   "    n_p_203492) +\n                                                              gtid_216904 *\n                                                              s_n_m_203636 +\n                                                              gtid_216905];\n                \n                double c12_216942;\n                \n                c12_216942 = ((__global double *) mem_230358)[gtid_216903 *\n                                                              (s_n_m_203636 *\n                                                               n_p_203492) +\n                                                              gtid_216904 *\n                                                              s_n_m_203636 +\n                                                              gtid_216905];\n                \n                double b2_216943;\n                \n                b2_216943 = ((__global double *) mem_230363)[gtid_216903 *\n                                                             (s_n_m_203636 *\n                                                              n_p_203492) +\n                                                             gtid_216904 *\n                                                             s_n_m_203636 +\n                                                             gtid_216905];\n                \n                double c2_216944;\n                \n                c2_216944 = ((__global double *) mem_230368)[gtid_216903 *\n                                                             (s_n_m_203636 *\n                                                              n_p_203492) +\n                                                             gtid_216904 *\n                                                             s_n_m_203636 +\n                                                             gtid_216905];\n                \n                int64_t defunc_0_m_fun_res_216945;\n                \n                defunc_0_m_fun_res_216945 = ((__global\n                                        ",
                   "      int64_t *) mem_230373)[gtid_216903 *\n                                                                     (s_n_m_203636 *\n                                                                      n_p_203492) +\n                                                                     gtid_216904 *\n                                                                     s_n_m_203636 +\n                                                                     gtid_216905];\n                \n                bool cond_216947 = sle64(x_216929, gtid_216906);\n                int64_t defunc_0_f_res_216948;\n                \n                if (cond_216947) {\n                    defunc_0_f_res_216948 = (int64_t) 0;\n                } else {\n                    int64_t i_216949 = add64(gtid_216906, x_216938);\n                    int64_t defunc_0_add_arg_216950;\n                    \n                    defunc_0_add_arg_216950 = ((__global\n                                                int64_t *) ext_mem_229265)[gtid_216903 *\n                                                                           (defunc_0_f_res_203631 *\n                                                                            n_p_203492) +\n                                                                           gtid_216904 *\n                                                                           defunc_0_f_res_203631 +\n                                                                           i_216949];\n                    \n                    int64_t defunc_1_add_res_216951 = add64((int64_t) 1,\n                                                            defunc_0_add_arg_216950);\n                    \n                    defunc_0_f_res_216948 = defunc_1_add_res_216951;\n                }\n                \n                double defunc_0_f_res_216952;\n                \n                if (cond_216947) {\n                    defunc_0_f_res_216952 = 0.0;\n                } else {\n                    int64_t i_216953 = add64(",
                   "gtid_216906, x_216938);\n                    double defunc_0_add_arg_216954;\n                    \n                    defunc_0_add_arg_216954 = ((__global\n                                                double *) mem_229531)[gtid_216903 *\n                                                                      (defunc_0_f_res_203631 *\n                                                                       n_p_203492) +\n                                                                      gtid_216904 *\n                                                                      defunc_0_f_res_203631 +\n                                                                      i_216953];\n                    defunc_0_f_res_216952 = defunc_0_add_arg_216954;\n                }\n                \n                int64_t binop_p_216955 = sub64(defunc_0_f_res_216948,\n                                               defunc_0_m_fun_res_216945);\n                double defunc_0_f_res_216956 = sitofp_i64_f64(binop_p_216955);\n                double abs_res_216957 = fabs(defunc_0_f_res_216956);\n                double tmp1_216958 = abs_res_216957 / x_216939;\n                double x_216959 = tmp1_216958 * tmp1_216958;\n                double y_216960 = tmp1_216958 * x_216959;\n                double tmp2_216961 = 1.0 - y_216960;\n                double x_216962 = tmp2_216961 * tmp2_216961;\n                double tmp3_216963 = tmp2_216961 * x_216962;\n                double tmp4_216964 = defunc_0_f_res_216952 * tmp3_216963;\n                double defunc_1_f_res_216965 = defunc_0_f_res_216956 *\n                       tmp4_216964;\n                double defunc_1_f_res_216966 = defunc_0_f_res_216956 *\n                       defunc_1_f_res_216965;\n                double defunc_0_f_res_216967;\n                \n                if (cond_216947) {\n                    defunc_0_f_res_216967 = 0.0;\n                } else {\n                    int64_t i_216968 = add64(gtid_216906, x_216938);\n                    double de",
                   "func_0_add_arg_216969;\n                    \n                    defunc_0_add_arg_216969 = ((__global\n                                                double *) mem_229526)[gtid_216903 *\n                                                                      (defunc_0_f_res_203631 *\n                                                                       n_p_203492) +\n                                                                      gtid_216904 *\n                                                                      defunc_0_f_res_203631 +\n                                                                      i_216968];\n                    defunc_0_f_res_216967 = defunc_0_add_arg_216969;\n                }\n                \n                double x_216970 = a12_216940 * tmp4_216964;\n                double y_216971 = b12_216941 * defunc_1_f_res_216965;\n                double x_216972 = x_216970 + y_216971;\n                double y_216973 = c12_216942 * defunc_1_f_res_216966;\n                double x_216974 = x_216972 + y_216973;\n                double defunc_9_fit_fun_res_216975 = defunc_0_f_res_216967 *\n                       x_216974;\n                double x_216976 = b12_216941 * tmp4_216964;\n                double y_216977 = b2_216943 * defunc_1_f_res_216965;\n                double x_216978 = x_216976 + y_216977;\n                double y_216979 = c2_216944 * defunc_1_f_res_216966;\n                double x_216980 = x_216978 + y_216979;\n                double defunc_9_slope_fun_res_216981 = defunc_0_f_res_216967 *\n                       x_216980;\n                \n                // save map-out results\n                { }\n                // load accumulator\n                {\n                    x_216908 = x_acc_233961;\n                    x_216909 = x_acc_233962;\n                }\n                // load new values\n                {\n                    x_216910 = defunc_9_fit_fun_res_216975;\n                    x_216911 = defunc_9_slope_fun_res_216981;\n                }\n",
                   "                // apply reduction operator\n                {\n                    double defunc_1_op_res_216912 = x_216908 + x_216910;\n                    double defunc_1_op_res_216913 = x_216909 + x_216911;\n                    \n                    // store in accumulator\n                    {\n                        x_acc_233961 = defunc_1_op_res_216912;\n                        x_acc_233962 = defunc_1_op_res_216913;\n                    }\n                }\n            }\n        }\n        // to reduce current chunk, first store our result in memory\n        {\n            x_216908 = x_acc_233961;\n            x_216909 = x_acc_233962;\n            ((__local\n              double *) red_arr_mem_233944)[sext_i32_i64(local_tid_233940)] =\n                x_216908;\n            ((__local\n              double *) red_arr_mem_233946)[sext_i32_i64(local_tid_233940)] =\n                x_216909;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        \n        int32_t offset_233971;\n        int32_t skip_waves_233972 = 1;\n        double x_233964;\n        double x_233965;\n        double x_233966;\n        double x_233967;\n        \n        offset_233971 = 0;\n        // participating threads read initial accumulator\n        {\n            if (slt32(local_tid_233940,\n                      sext_i64_i32(segred_group_sizze_216898))) {\n                x_233964 = ((__local\n                             double *) red_arr_mem_233944)[sext_i32_i64(local_tid_233940 +\n                                                           offset_233971)];\n                x_233965 = ((__local\n                             double *) red_arr_mem_233946)[sext_i32_i64(local_tid_233940 +\n                                                           offset_233971)];\n            }\n        }\n        offset_233971 = 1;\n        while (slt32(offset_233971, wave_sizze_233942)) {\n            if (slt32(local_tid_233940 + offset_233971,\n                      sext_i64_i32(segred_group_sizze_216898)) &&\n                ((local_tid_233940",
                   " - squot32(local_tid_233940,\n                                             wave_sizze_233942) *\n                  wave_sizze_233942) & (2 * offset_233971 - 1)) == 0) {\n                // read array element\n                {\n                    x_233966 = ((volatile __local\n                                 double *) red_arr_mem_233944)[sext_i32_i64(local_tid_233940 +\n                                                               offset_233971)];\n                    x_233967 = ((volatile __local\n                                 double *) red_arr_mem_233946)[sext_i32_i64(local_tid_233940 +\n                                                               offset_233971)];\n                }\n                // apply reduction operation\n                {\n                    double defunc_1_op_res_233968 = x_233964 + x_233966;\n                    double defunc_1_op_res_233969 = x_233965 + x_233967;\n                    \n                    x_233964 = defunc_1_op_res_233968;\n                    x_233965 = defunc_1_op_res_233969;\n                }\n                // write result of operation\n                {\n                    ((volatile __local\n                      double *) red_arr_mem_233944)[sext_i32_i64(local_tid_233940)] =\n                        x_233964;\n                    ((volatile __local\n                      double *) red_arr_mem_233946)[sext_i32_i64(local_tid_233940)] =\n                        x_233965;\n                }\n            }\n            offset_233971 *= 2;\n        }\n        while (slt32(skip_waves_233972,\n                     squot32(sext_i64_i32(segred_group_sizze_216898) +\n                             wave_sizze_233942 - 1, wave_sizze_233942))) {\n            barrier(CLK_LOCAL_MEM_FENCE);\n            offset_233971 = skip_waves_233972 * wave_sizze_233942;\n            if (slt32(local_tid_233940 + offset_233971,\n                      sext_i64_i32(segred_group_sizze_216898)) &&\n                ((local_tid_233940 - squot32(local_tid_233940,\n                ",
                   "                             wave_sizze_233942) *\n                  wave_sizze_233942) == 0 && (squot32(local_tid_233940,\n                                                      wave_sizze_233942) & (2 *\n                                                                            skip_waves_233972 -\n                                                                            1)) ==\n                 0)) {\n                // read array element\n                {\n                    x_233966 = ((__local\n                                 double *) red_arr_mem_233944)[sext_i32_i64(local_tid_233940 +\n                                                               offset_233971)];\n                    x_233967 = ((__local\n                                 double *) red_arr_mem_233946)[sext_i32_i64(local_tid_233940 +\n                                                               offset_233971)];\n                }\n                // apply reduction operation\n                {\n                    double defunc_1_op_res_233968 = x_233964 + x_233966;\n                    double defunc_1_op_res_233969 = x_233965 + x_233967;\n                    \n                    x_233964 = defunc_1_op_res_233968;\n                    x_233965 = defunc_1_op_res_233969;\n                }\n                // write result of operation\n                {\n                    ((__local\n                      double *) red_arr_mem_233944)[sext_i32_i64(local_tid_233940)] =\n                        x_233964;\n                    ((__local\n                      double *) red_arr_mem_233946)[sext_i32_i64(local_tid_233940)] =\n                        x_233965;\n                }\n            }\n            skip_waves_233972 *= 2;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        // first thread saves the result in accumulator\n        {\n            if (sext_i32_i64(local_tid_233940) == (int64_t) 0) {\n                x_acc_233961 = x_233964;\n                x_acc_233962 = x_233965;\n            }\n        }\n        if (grou",
                   "ps_per_segment_233928 == (int64_t) 1) {\n            // first thread in group saves final result to memory\n            {\n                if (local_tid_233940 == 0) {\n                    ((__global double *) mem_230379)[gtid_216903 *\n                                                     (s_n_m_203636 *\n                                                      n_p_203492) +\n                                                     gtid_216904 *\n                                                     s_n_m_203636 +\n                                                     gtid_216905] =\n                        x_acc_233961;\n                    ((__global double *) mem_230384)[gtid_216903 *\n                                                     (s_n_m_203636 *\n                                                      n_p_203492) +\n                                                     gtid_216904 *\n                                                     s_n_m_203636 +\n                                                     gtid_216905] =\n                        x_acc_233962;\n                }\n            }\n        } else {\n            int32_t old_counter_233973;\n            \n            // first thread in group saves group result to global memory\n            {\n                if (local_tid_233940 == 0) {\n                    ((__global\n                      double *) segred_tmp_mem_233933)[sext_i32_i64(virt_group_id_233952)] =\n                        x_acc_233961;\n                    ((__global\n                      double *) segred_tmp_mem_233935)[sext_i32_i64(virt_group_id_233952)] =\n                        x_acc_233962;\n                    mem_fence_global();\n                    old_counter_233973 =\n                        atomic_add_i32_global(&((volatile __global\n                                                 int *) mainzicounter_mem_233937)[sext_i32_i64(srem32(flat_segment_id_233953,\n                                                                                                      10240))],\n ",
                   "                                             (int) 1);\n                    ((__local bool *) sync_arr_mem_233948)[(int64_t) 0] =\n                        old_counter_233973 == groups_per_segment_233928 -\n                        (int64_t) 1;\n                }\n            }\n            barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n            \n            bool is_last_group_233974;\n            \n            is_last_group_233974 = ((__local\n                                     bool *) sync_arr_mem_233948)[(int64_t) 0];\n            if (is_last_group_233974) {\n                if (local_tid_233940 == 0) {\n                    old_counter_233973 =\n                        atomic_add_i32_global(&((volatile __global\n                                                 int *) mainzicounter_mem_233937)[sext_i32_i64(srem32(flat_segment_id_233953,\n                                                                                                      10240))],\n                                              (int) ((int64_t) 0 -\n                                                     groups_per_segment_233928));\n                }\n                // read in the per-group-results\n                {\n                    int64_t read_per_thread_233975 =\n                            sdiv_up64(groups_per_segment_233928,\n                                      segred_group_sizze_216898);\n                    \n                    x_216908 = 0.0;\n                    x_216909 = 0.0;\n                    for (int64_t i_233976 = 0; i_233976 <\n                         read_per_thread_233975; i_233976++) {\n                        int64_t group_res_id_233977 =\n                                sext_i32_i64(local_tid_233940) *\n                                read_per_thread_233975 + i_233976;\n                        int64_t index_of_group_res_233978 =\n                                sext_i32_i64(flat_segment_id_233953) *\n                                groups_per_segment_233928 + group_res_id_233977;\n            ",
                   "            \n                        if (slt64(group_res_id_233977,\n                                  groups_per_segment_233928)) {\n                            x_216910 = ((__global\n                                         double *) segred_tmp_mem_233933)[index_of_group_res_233978];\n                            x_216911 = ((__global\n                                         double *) segred_tmp_mem_233935)[index_of_group_res_233978];\n                            \n                            double defunc_1_op_res_216912 = x_216908 + x_216910;\n                            double defunc_1_op_res_216913 = x_216909 + x_216911;\n                            \n                            x_216908 = defunc_1_op_res_216912;\n                            x_216909 = defunc_1_op_res_216913;\n                        }\n                    }\n                }\n                ((__local\n                  double *) red_arr_mem_233944)[sext_i32_i64(local_tid_233940)] =\n                    x_216908;\n                ((__local\n                  double *) red_arr_mem_233946)[sext_i32_i64(local_tid_233940)] =\n                    x_216909;\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // reduce the per-group results\n                {\n                    int32_t offset_233979;\n                    int32_t skip_waves_233980 = 1;\n                    double x_233964;\n                    double x_233965;\n                    double x_233966;\n                    double x_233967;\n                    \n                    offset_233979 = 0;\n                    // participating threads read initial accumulator\n                    {\n                        if (slt32(local_tid_233940,\n                                  sext_i64_i32(segred_group_sizze_216898))) {\n                            x_233964 = ((__local\n                                         double *) red_arr_mem_233944)[sext_i32_i64(local_tid_233940 +\n                                                                       offset_233979)];\n",
                   "                            x_233965 = ((__local\n                                         double *) red_arr_mem_233946)[sext_i32_i64(local_tid_233940 +\n                                                                       offset_233979)];\n                        }\n                    }\n                    offset_233979 = 1;\n                    while (slt32(offset_233979, wave_sizze_233942)) {\n                        if (slt32(local_tid_233940 + offset_233979,\n                                  sext_i64_i32(segred_group_sizze_216898)) &&\n                            ((local_tid_233940 - squot32(local_tid_233940,\n                                                         wave_sizze_233942) *\n                              wave_sizze_233942) & (2 * offset_233979 - 1)) ==\n                            0) {\n                            // read array element\n                            {\n                                x_233966 = ((volatile __local\n                                             double *) red_arr_mem_233944)[sext_i32_i64(local_tid_233940 +\n                                                                           offset_233979)];\n                                x_233967 = ((volatile __local\n                                             double *) red_arr_mem_233946)[sext_i32_i64(local_tid_233940 +\n                                                                           offset_233979)];\n                            }\n                            // apply reduction operation\n                            {\n                                double defunc_1_op_res_233968 = x_233964 +\n                                       x_233966;\n                                double defunc_1_op_res_233969 = x_233965 +\n                                       x_233967;\n                                \n                                x_233964 = defunc_1_op_res_233968;\n                                x_233965 = defunc_1_op_res_233969;\n                            }\n                            ",
                   "// write result of operation\n                            {\n                                ((volatile __local\n                                  double *) red_arr_mem_233944)[sext_i32_i64(local_tid_233940)] =\n                                    x_233964;\n                                ((volatile __local\n                                  double *) red_arr_mem_233946)[sext_i32_i64(local_tid_233940)] =\n                                    x_233965;\n                            }\n                        }\n                        offset_233979 *= 2;\n                    }\n                    while (slt32(skip_waves_233980,\n                                 squot32(sext_i64_i32(segred_group_sizze_216898) +\n                                         wave_sizze_233942 - 1,\n                                         wave_sizze_233942))) {\n                        barrier(CLK_LOCAL_MEM_FENCE);\n                        offset_233979 = skip_waves_233980 * wave_sizze_233942;\n                        if (slt32(local_tid_233940 + offset_233979,\n                                  sext_i64_i32(segred_group_sizze_216898)) &&\n                            ((local_tid_233940 - squot32(local_tid_233940,\n                                                         wave_sizze_233942) *\n                              wave_sizze_233942) == 0 &&\n                             (squot32(local_tid_233940, wave_sizze_233942) &\n                              (2 * skip_waves_233980 - 1)) == 0)) {\n                            // read array element\n                            {\n                                x_233966 = ((__local\n                                             double *) red_arr_mem_233944)[sext_i32_i64(local_tid_233940 +\n                                                                           offset_233979)];\n                                x_233967 = ((__local\n                                             double *) red_arr_mem_233946)[sext_i32_i64(local_tid_233940 +\n                                        ",
                   "                                   offset_233979)];\n                            }\n                            // apply reduction operation\n                            {\n                                double defunc_1_op_res_233968 = x_233964 +\n                                       x_233966;\n                                double defunc_1_op_res_233969 = x_233965 +\n                                       x_233967;\n                                \n                                x_233964 = defunc_1_op_res_233968;\n                                x_233965 = defunc_1_op_res_233969;\n                            }\n                            // write result of operation\n                            {\n                                ((__local\n                                  double *) red_arr_mem_233944)[sext_i32_i64(local_tid_233940)] =\n                                    x_233964;\n                                ((__local\n                                  double *) red_arr_mem_233946)[sext_i32_i64(local_tid_233940)] =\n                                    x_233965;\n                            }\n                        }\n                        skip_waves_233980 *= 2;\n                    }\n                    // and back to memory with the final result\n                    {\n                        if (local_tid_233940 == 0) {\n                            ((__global double *) mem_230379)[gtid_216903 *\n                                                             (s_n_m_203636 *\n                                                              n_p_203492) +\n                                                             gtid_216904 *\n                                                             s_n_m_203636 +\n                                                             gtid_216905] =\n                                x_233964;\n                            ((__global double *) mem_230384)[gtid_216903 *\n                                                             (s_n_m_203636 *\n             ",
                   "                                                 n_p_203492) +\n                                                             gtid_216904 *\n                                                             s_n_m_203636 +\n                                                             gtid_216905] =\n                                x_233965;\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_216898\n}\n__kernel void mainzisegred_large_218631(__global int *global_failure,\n                                        __local volatile\n                                        int64_t *sync_arr_mem_234141_backing_aligned_0,\n                                        __local volatile\n                                        int64_t *red_arr_mem_234139_backing_aligned_1,\n                                        int64_t n_p_203492,\n                                        int64_t partition_sizze_203577,\n                                        int64_t C_len_203634,\n                                        int64_t num_groups_218626,\n                                        int64_t groups_per_segment_234125,\n                                        int64_t elements_per_thread_234126,\n                                        int64_t virt_num_groups_234127,\n                                        int64_t threads_per_segment_234129,\n                                        __global unsigned char *mem_230500,\n                                        __global unsigned char *mem_230511,\n                                        __global\n                                        unsigned char *segred_tmp_mem_234130,\n                                        __global\n                                        unsigned char *mainzicounter_mem_234132)\n{\n    #define segred_group_sizze_218625 (mainzisegred_group_sizze_218608)\n    \n    const int block_dim0 = 0;\n    con",
                   "st int block_dim1 = 1;\n    const int block_dim2 = 2;\n    __local volatile unsigned char *restrict sync_arr_mem_234141_backing_1 =\n                                   (__local volatile\n                                    unsigned char *) sync_arr_mem_234141_backing_aligned_0;\n    __local volatile unsigned char *restrict red_arr_mem_234139_backing_0 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_234139_backing_aligned_1;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_234134;\n    int32_t local_tid_234135;\n    int64_t group_sizze_234138;\n    int32_t wave_sizze_234137;\n    int32_t group_tid_234136;\n    \n    global_tid_234134 = get_global_id(0);\n    local_tid_234135 = get_local_id(0);\n    group_sizze_234138 = get_local_size(0);\n    wave_sizze_234137 = LOCKSTEP_WIDTH;\n    group_tid_234136 = get_group_id(0);\n    \n    int32_t phys_tid_218631 = global_tid_234134;\n    __local unsigned char *red_arr_mem_234139;\n    \n    red_arr_mem_234139 = (__local unsigned char *) red_arr_mem_234139_backing_0;\n    \n    __local unsigned char *sync_arr_mem_234141;\n    \n    sync_arr_mem_234141 = (__local\n                           unsigned char *) sync_arr_mem_234141_backing_1;\n    \n    int32_t phys_group_id_234143;\n    \n    phys_group_id_234143 = get_group_id(0);\n    for (int32_t i_234144 = 0; i_234144 <\n         sdiv_up32(sext_i64_i32(virt_num_groups_234127) - phys_group_id_234143,\n                   sext_i64_i32(num_groups_218626)); i_234144++) {\n        int32_t virt_group_id_234145 = phys_group_id_234143 + i_234144 *\n                sext_i64_i32(num_groups_218626);\n        int32_t flat_segment_id_234146 = squot32(virt_group_id_234145,\n                                                 sext_i64_i32(groups_per_segment_234125));\n        int64_t global_tid_234147 = srem64(sext_i32_i64(virt_group_id_234145) *\n                                           segred_group_sizze_218625 +\n                 ",
                   "                          sext_i32_i64(local_tid_234135),\n                                           segred_group_sizze_218625 *\n                                           groups_per_segment_234125);\n        int64_t slice_234148 = partition_sizze_203577;\n        int64_t gtid_218629 = sext_i32_i64(flat_segment_id_234146);\n        int64_t remnant_234149 = sext_i32_i64(flat_segment_id_234146) -\n                gtid_218629;\n        int64_t gtid_218630;\n        double x_acc_234150;\n        int64_t chunk_sizze_234151 = smin64(elements_per_thread_234126,\n                                            sdiv_up64(n_p_203492 -\n                                                      global_tid_234147,\n                                                      threads_per_segment_234129));\n        double x_218632;\n        double x_218633;\n        \n        // neutral-initialise the accumulators\n        {\n            x_acc_234150 = 0.0;\n        }\n        for (int64_t i_234155 = 0; i_234155 < chunk_sizze_234151; i_234155++) {\n            gtid_218630 = global_tid_234147 + threads_per_segment_234129 *\n                i_234155;\n            // apply map function\n            {\n                double x_218636;\n                \n                x_218636 = ((__global double *) mem_230500)[gtid_218629 *\n                                                            C_len_203634 +\n                                                            gtid_218630];\n                // save map-out results\n                { }\n                // load accumulator\n                {\n                    x_218632 = x_acc_234150;\n                }\n                // load new values\n                {\n                    x_218633 = x_218636;\n                }\n                // apply reduction operator\n                {\n                    double defunc_1_op_res_218634 = x_218632 + x_218633;\n                    \n                    // store in accumulator\n                    {\n                        x_acc_234150 = defunc_1_op_",
                   "res_218634;\n                    }\n                }\n            }\n        }\n        // to reduce current chunk, first store our result in memory\n        {\n            x_218632 = x_acc_234150;\n            ((__local\n              double *) red_arr_mem_234139)[sext_i32_i64(local_tid_234135)] =\n                x_218632;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        \n        int32_t offset_234156;\n        int32_t skip_waves_234157 = 1;\n        double x_234152;\n        double x_234153;\n        \n        offset_234156 = 0;\n        // participating threads read initial accumulator\n        {\n            if (slt32(local_tid_234135,\n                      sext_i64_i32(segred_group_sizze_218625))) {\n                x_234152 = ((__local\n                             double *) red_arr_mem_234139)[sext_i32_i64(local_tid_234135 +\n                                                           offset_234156)];\n            }\n        }\n        offset_234156 = 1;\n        while (slt32(offset_234156, wave_sizze_234137)) {\n            if (slt32(local_tid_234135 + offset_234156,\n                      sext_i64_i32(segred_group_sizze_218625)) &&\n                ((local_tid_234135 - squot32(local_tid_234135,\n                                             wave_sizze_234137) *\n                  wave_sizze_234137) & (2 * offset_234156 - 1)) == 0) {\n                // read array element\n                {\n                    x_234153 = ((volatile __local\n                                 double *) red_arr_mem_234139)[sext_i32_i64(local_tid_234135 +\n                                                               offset_234156)];\n                }\n                // apply reduction operation\n                {\n                    double defunc_1_op_res_234154 = x_234152 + x_234153;\n                    \n                    x_234152 = defunc_1_op_res_234154;\n                }\n                // write result of operation\n                {\n                    ((volatile __local\n                      double",
                   " *) red_arr_mem_234139)[sext_i32_i64(local_tid_234135)] =\n                        x_234152;\n                }\n            }\n            offset_234156 *= 2;\n        }\n        while (slt32(skip_waves_234157,\n                     squot32(sext_i64_i32(segred_group_sizze_218625) +\n                             wave_sizze_234137 - 1, wave_sizze_234137))) {\n            barrier(CLK_LOCAL_MEM_FENCE);\n            offset_234156 = skip_waves_234157 * wave_sizze_234137;\n            if (slt32(local_tid_234135 + offset_234156,\n                      sext_i64_i32(segred_group_sizze_218625)) &&\n                ((local_tid_234135 - squot32(local_tid_234135,\n                                             wave_sizze_234137) *\n                  wave_sizze_234137) == 0 && (squot32(local_tid_234135,\n                                                      wave_sizze_234137) & (2 *\n                                                                            skip_waves_234157 -\n                                                                            1)) ==\n                 0)) {\n                // read array element\n                {\n                    x_234153 = ((__local\n                                 double *) red_arr_mem_234139)[sext_i32_i64(local_tid_234135 +\n                                                               offset_234156)];\n                }\n                // apply reduction operation\n                {\n                    double defunc_1_op_res_234154 = x_234152 + x_234153;\n                    \n                    x_234152 = defunc_1_op_res_234154;\n                }\n                // write result of operation\n                {\n                    ((__local\n                      double *) red_arr_mem_234139)[sext_i32_i64(local_tid_234135)] =\n                        x_234152;\n                }\n            }\n            skip_waves_234157 *= 2;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        // first thread saves the result in accumulator\n        {\n            if (sex",
                   "t_i32_i64(local_tid_234135) == (int64_t) 0) {\n                x_acc_234150 = x_234152;\n            }\n        }\n        if (groups_per_segment_234125 == (int64_t) 1) {\n            // first thread in group saves final result to memory\n            {\n                if (local_tid_234135 == 0) {\n                    ((__global double *) mem_230511)[gtid_218629] =\n                        x_acc_234150;\n                }\n            }\n        } else {\n            int32_t old_counter_234158;\n            \n            // first thread in group saves group result to global memory\n            {\n                if (local_tid_234135 == 0) {\n                    ((__global\n                      double *) segred_tmp_mem_234130)[sext_i32_i64(virt_group_id_234145)] =\n                        x_acc_234150;\n                    mem_fence_global();\n                    old_counter_234158 =\n                        atomic_add_i32_global(&((volatile __global\n                                                 int *) mainzicounter_mem_234132)[sext_i32_i64(srem32(flat_segment_id_234146,\n                                                                                                      10240))],\n                                              (int) 1);\n                    ((__local bool *) sync_arr_mem_234141)[(int64_t) 0] =\n                        old_counter_234158 == groups_per_segment_234125 -\n                        (int64_t) 1;\n                }\n            }\n            barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n            \n            bool is_last_group_234159;\n            \n            is_last_group_234159 = ((__local\n                                     bool *) sync_arr_mem_234141)[(int64_t) 0];\n            if (is_last_group_234159) {\n                if (local_tid_234135 == 0) {\n                    old_counter_234158 =\n                        atomic_add_i32_global(&((volatile __global\n                                                 int *) mainzicounter_mem_234132)[sext_i32_i64(srem",
                   "32(flat_segment_id_234146,\n                                                                                                      10240))],\n                                              (int) ((int64_t) 0 -\n                                                     groups_per_segment_234125));\n                }\n                // read in the per-group-results\n                {\n                    int64_t read_per_thread_234160 =\n                            sdiv_up64(groups_per_segment_234125,\n                                      segred_group_sizze_218625);\n                    \n                    x_218632 = 0.0;\n                    for (int64_t i_234161 = 0; i_234161 <\n                         read_per_thread_234160; i_234161++) {\n                        int64_t group_res_id_234162 =\n                                sext_i32_i64(local_tid_234135) *\n                                read_per_thread_234160 + i_234161;\n                        int64_t index_of_group_res_234163 =\n                                sext_i32_i64(flat_segment_id_234146) *\n                                groups_per_segment_234125 + group_res_id_234162;\n                        \n                        if (slt64(group_res_id_234162,\n                                  groups_per_segment_234125)) {\n                            x_218633 = ((__global\n                                         double *) segred_tmp_mem_234130)[index_of_group_res_234163];\n                            \n                            double defunc_1_op_res_218634 = x_218632 + x_218633;\n                            \n                            x_218632 = defunc_1_op_res_218634;\n                        }\n                    }\n                }\n                ((__local\n                  double *) red_arr_mem_234139)[sext_i32_i64(local_tid_234135)] =\n                    x_218632;\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // reduce the per-group results\n                {\n                    int32_t offset_234164;\n          ",
                   "          int32_t skip_waves_234165 = 1;\n                    double x_234152;\n                    double x_234153;\n                    \n                    offset_234164 = 0;\n                    // participating threads read initial accumulator\n                    {\n                        if (slt32(local_tid_234135,\n                                  sext_i64_i32(segred_group_sizze_218625))) {\n                            x_234152 = ((__local\n                                         double *) red_arr_mem_234139)[sext_i32_i64(local_tid_234135 +\n                                                                       offset_234164)];\n                        }\n                    }\n                    offset_234164 = 1;\n                    while (slt32(offset_234164, wave_sizze_234137)) {\n                        if (slt32(local_tid_234135 + offset_234164,\n                                  sext_i64_i32(segred_group_sizze_218625)) &&\n                            ((local_tid_234135 - squot32(local_tid_234135,\n                                                         wave_sizze_234137) *\n                              wave_sizze_234137) & (2 * offset_234164 - 1)) ==\n                            0) {\n                            // read array element\n                            {\n                                x_234153 = ((volatile __local\n                                             double *) red_arr_mem_234139)[sext_i32_i64(local_tid_234135 +\n                                                                           offset_234164)];\n                            }\n                            // apply reduction operation\n                            {\n                                double defunc_1_op_res_234154 = x_234152 +\n                                       x_234153;\n                                \n                                x_234152 = defunc_1_op_res_234154;\n                            }\n                            // write result of operation\n                          ",
                   "  {\n                                ((volatile __local\n                                  double *) red_arr_mem_234139)[sext_i32_i64(local_tid_234135)] =\n                                    x_234152;\n                            }\n                        }\n                        offset_234164 *= 2;\n                    }\n                    while (slt32(skip_waves_234165,\n                                 squot32(sext_i64_i32(segred_group_sizze_218625) +\n                                         wave_sizze_234137 - 1,\n                                         wave_sizze_234137))) {\n                        barrier(CLK_LOCAL_MEM_FENCE);\n                        offset_234164 = skip_waves_234165 * wave_sizze_234137;\n                        if (slt32(local_tid_234135 + offset_234164,\n                                  sext_i64_i32(segred_group_sizze_218625)) &&\n                            ((local_tid_234135 - squot32(local_tid_234135,\n                                                         wave_sizze_234137) *\n                              wave_sizze_234137) == 0 &&\n                             (squot32(local_tid_234135, wave_sizze_234137) &\n                              (2 * skip_waves_234165 - 1)) == 0)) {\n                            // read array element\n                            {\n                                x_234153 = ((__local\n                                             double *) red_arr_mem_234139)[sext_i32_i64(local_tid_234135 +\n                                                                           offset_234164)];\n                            }\n                            // apply reduction operation\n                            {\n                                double defunc_1_op_res_234154 = x_234152 +\n                                       x_234153;\n                                \n                                x_234152 = defunc_1_op_res_234154;\n                            }\n                            // write result of operation\n                      ",
                   "      {\n                                ((__local\n                                  double *) red_arr_mem_234139)[sext_i32_i64(local_tid_234135)] =\n                                    x_234152;\n                            }\n                        }\n                        skip_waves_234165 *= 2;\n                    }\n                    // and back to memory with the final result\n                    {\n                        if (local_tid_234135 == 0) {\n                            ((__global double *) mem_230511)[gtid_218629] =\n                                x_234152;\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_218625\n}\n__kernel void mainzisegred_large_218762(__global int *global_failure,\n                                        __local volatile\n                                        int64_t *sync_arr_mem_234284_backing_aligned_0,\n                                        __local volatile\n                                        int64_t *red_arr_mem_234282_backing_aligned_1,\n                                        int64_t n_p_203492,\n                                        int64_t partition_sizze_203577,\n                                        int64_t lifted_single_ma_l_arg_204134,\n                                        int64_t num_groups_218757,\n                                        int64_t groups_per_segment_234268,\n                                        int64_t elements_per_thread_234269,\n                                        int64_t virt_num_groups_234270,\n                                        int64_t threads_per_segment_234272,\n                                        __global unsigned char *mem_230517,\n                                        __global unsigned char *mem_230528,\n                                        __global\n                                        unsigned char *segred_",
                   "tmp_mem_234273,\n                                        __global\n                                        unsigned char *mainzicounter_mem_234275)\n{\n    #define segred_group_sizze_218756 (mainzisegred_group_sizze_218739)\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_234284_backing_1 =\n                                   (__local volatile\n                                    unsigned char *) sync_arr_mem_234284_backing_aligned_0;\n    __local volatile unsigned char *restrict red_arr_mem_234282_backing_0 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_234282_backing_aligned_1;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_234277;\n    int32_t local_tid_234278;\n    int64_t group_sizze_234281;\n    int32_t wave_sizze_234280;\n    int32_t group_tid_234279;\n    \n    global_tid_234277 = get_global_id(0);\n    local_tid_234278 = get_local_id(0);\n    group_sizze_234281 = get_local_size(0);\n    wave_sizze_234280 = LOCKSTEP_WIDTH;\n    group_tid_234279 = get_group_id(0);\n    \n    int32_t phys_tid_218762 = global_tid_234277;\n    __local unsigned char *red_arr_mem_234282;\n    \n    red_arr_mem_234282 = (__local unsigned char *) red_arr_mem_234282_backing_0;\n    \n    __local unsigned char *sync_arr_mem_234284;\n    \n    sync_arr_mem_234284 = (__local\n                           unsigned char *) sync_arr_mem_234284_backing_1;\n    \n    int32_t phys_group_id_234286;\n    \n    phys_group_id_234286 = get_group_id(0);\n    for (int32_t i_234287 = 0; i_234287 <\n         sdiv_up32(sext_i64_i32(virt_num_groups_234270) - phys_group_id_234286,\n                   sext_i64_i32(num_groups_218757)); i_234287++) {\n        int32_t virt_group_id_234288 = phys_group_id_234286 + i_234287 *\n                sext_i64_i32(num_groups_218757);\n        int32_t flat_segment_id_234289 = squot32(virt_group_id_23428",
                   "8,\n                                                 sext_i64_i32(groups_per_segment_234268));\n        int64_t global_tid_234290 = srem64(sext_i32_i64(virt_group_id_234288) *\n                                           segred_group_sizze_218756 +\n                                           sext_i32_i64(local_tid_234278),\n                                           segred_group_sizze_218756 *\n                                           groups_per_segment_234268);\n        int64_t slice_234291 = partition_sizze_203577;\n        int64_t gtid_218760 = sext_i32_i64(flat_segment_id_234289);\n        int64_t remnant_234292 = sext_i32_i64(flat_segment_id_234289) -\n                gtid_218760;\n        int64_t gtid_218761;\n        double x_acc_234293;\n        int64_t chunk_sizze_234294 = smin64(elements_per_thread_234269,\n                                            sdiv_up64(n_p_203492 -\n                                                      global_tid_234290,\n                                                      threads_per_segment_234272));\n        double x_218763;\n        double x_218764;\n        \n        // neutral-initialise the accumulators\n        {\n            x_acc_234293 = 0.0;\n        }\n        for (int64_t i_234298 = 0; i_234298 < chunk_sizze_234294; i_234298++) {\n            gtid_218761 = global_tid_234290 + threads_per_segment_234272 *\n                i_234298;\n            // apply map function\n            {\n                double x_218767;\n                \n                x_218767 = ((__global double *) mem_230517)[gtid_218760 *\n                                                            lifted_single_ma_l_arg_204134 +\n                                                            gtid_218761];\n                // save map-out results\n                { }\n                // load accumulator\n                {\n                    x_218763 = x_acc_234293;\n                }\n                // load new values\n                {\n                    x_218764 = x_218767;\n            ",
                   "    }\n                // apply reduction operator\n                {\n                    double defunc_1_op_res_218765 = x_218763 + x_218764;\n                    \n                    // store in accumulator\n                    {\n                        x_acc_234293 = defunc_1_op_res_218765;\n                    }\n                }\n            }\n        }\n        // to reduce current chunk, first store our result in memory\n        {\n            x_218763 = x_acc_234293;\n            ((__local\n              double *) red_arr_mem_234282)[sext_i32_i64(local_tid_234278)] =\n                x_218763;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        \n        int32_t offset_234299;\n        int32_t skip_waves_234300 = 1;\n        double x_234295;\n        double x_234296;\n        \n        offset_234299 = 0;\n        // participating threads read initial accumulator\n        {\n            if (slt32(local_tid_234278,\n                      sext_i64_i32(segred_group_sizze_218756))) {\n                x_234295 = ((__local\n                             double *) red_arr_mem_234282)[sext_i32_i64(local_tid_234278 +\n                                                           offset_234299)];\n            }\n        }\n        offset_234299 = 1;\n        while (slt32(offset_234299, wave_sizze_234280)) {\n            if (slt32(local_tid_234278 + offset_234299,\n                      sext_i64_i32(segred_group_sizze_218756)) &&\n                ((local_tid_234278 - squot32(local_tid_234278,\n                                             wave_sizze_234280) *\n                  wave_sizze_234280) & (2 * offset_234299 - 1)) == 0) {\n                // read array element\n                {\n                    x_234296 = ((volatile __local\n                                 double *) red_arr_mem_234282)[sext_i32_i64(local_tid_234278 +\n                                                               offset_234299)];\n                }\n                // apply reduction operation\n                {\n                  ",
                   "  double defunc_1_op_res_234297 = x_234295 + x_234296;\n                    \n                    x_234295 = defunc_1_op_res_234297;\n                }\n                // write result of operation\n                {\n                    ((volatile __local\n                      double *) red_arr_mem_234282)[sext_i32_i64(local_tid_234278)] =\n                        x_234295;\n                }\n            }\n            offset_234299 *= 2;\n        }\n        while (slt32(skip_waves_234300,\n                     squot32(sext_i64_i32(segred_group_sizze_218756) +\n                             wave_sizze_234280 - 1, wave_sizze_234280))) {\n            barrier(CLK_LOCAL_MEM_FENCE);\n            offset_234299 = skip_waves_234300 * wave_sizze_234280;\n            if (slt32(local_tid_234278 + offset_234299,\n                      sext_i64_i32(segred_group_sizze_218756)) &&\n                ((local_tid_234278 - squot32(local_tid_234278,\n                                             wave_sizze_234280) *\n                  wave_sizze_234280) == 0 && (squot32(local_tid_234278,\n                                                      wave_sizze_234280) & (2 *\n                                                                            skip_waves_234300 -\n                                                                            1)) ==\n                 0)) {\n                // read array element\n                {\n                    x_234296 = ((__local\n                                 double *) red_arr_mem_234282)[sext_i32_i64(local_tid_234278 +\n                                                               offset_234299)];\n                }\n                // apply reduction operation\n                {\n                    double defunc_1_op_res_234297 = x_234295 + x_234296;\n                    \n                    x_234295 = defunc_1_op_res_234297;\n                }\n                // write result of operation\n                {\n                    ((__local\n                      double *) red_arr_me",
                   "m_234282)[sext_i32_i64(local_tid_234278)] =\n                        x_234295;\n                }\n            }\n            skip_waves_234300 *= 2;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        // first thread saves the result in accumulator\n        {\n            if (sext_i32_i64(local_tid_234278) == (int64_t) 0) {\n                x_acc_234293 = x_234295;\n            }\n        }\n        if (groups_per_segment_234268 == (int64_t) 1) {\n            // first thread in group saves final result to memory\n            {\n                if (local_tid_234278 == 0) {\n                    ((__global double *) mem_230528)[gtid_218760] =\n                        x_acc_234293;\n                }\n            }\n        } else {\n            int32_t old_counter_234301;\n            \n            // first thread in group saves group result to global memory\n            {\n                if (local_tid_234278 == 0) {\n                    ((__global\n                      double *) segred_tmp_mem_234273)[sext_i32_i64(virt_group_id_234288)] =\n                        x_acc_234293;\n                    mem_fence_global();\n                    old_counter_234301 =\n                        atomic_add_i32_global(&((volatile __global\n                                                 int *) mainzicounter_mem_234275)[sext_i32_i64(srem32(flat_segment_id_234289,\n                                                                                                      10240))],\n                                              (int) 1);\n                    ((__local bool *) sync_arr_mem_234284)[(int64_t) 0] =\n                        old_counter_234301 == groups_per_segment_234268 -\n                        (int64_t) 1;\n                }\n            }\n            barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n            \n            bool is_last_group_234302;\n            \n            is_last_group_234302 = ((__local\n                                     bool *) sync_arr_mem_234284)[(int64_t) 0];\n            i",
                   "f (is_last_group_234302) {\n                if (local_tid_234278 == 0) {\n                    old_counter_234301 =\n                        atomic_add_i32_global(&((volatile __global\n                                                 int *) mainzicounter_mem_234275)[sext_i32_i64(srem32(flat_segment_id_234289,\n                                                                                                      10240))],\n                                              (int) ((int64_t) 0 -\n                                                     groups_per_segment_234268));\n                }\n                // read in the per-group-results\n                {\n                    int64_t read_per_thread_234303 =\n                            sdiv_up64(groups_per_segment_234268,\n                                      segred_group_sizze_218756);\n                    \n                    x_218763 = 0.0;\n                    for (int64_t i_234304 = 0; i_234304 <\n                         read_per_thread_234303; i_234304++) {\n                        int64_t group_res_id_234305 =\n                                sext_i32_i64(local_tid_234278) *\n                                read_per_thread_234303 + i_234304;\n                        int64_t index_of_group_res_234306 =\n                                sext_i32_i64(flat_segment_id_234289) *\n                                groups_per_segment_234268 + group_res_id_234305;\n                        \n                        if (slt64(group_res_id_234305,\n                                  groups_per_segment_234268)) {\n                            x_218764 = ((__global\n                                         double *) segred_tmp_mem_234273)[index_of_group_res_234306];\n                            \n                            double defunc_1_op_res_218765 = x_218763 + x_218764;\n                            \n                            x_218763 = defunc_1_op_res_218765;\n                        }\n                    }\n                }\n                ((__loca",
                   "l\n                  double *) red_arr_mem_234282)[sext_i32_i64(local_tid_234278)] =\n                    x_218763;\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // reduce the per-group results\n                {\n                    int32_t offset_234307;\n                    int32_t skip_waves_234308 = 1;\n                    double x_234295;\n                    double x_234296;\n                    \n                    offset_234307 = 0;\n                    // participating threads read initial accumulator\n                    {\n                        if (slt32(local_tid_234278,\n                                  sext_i64_i32(segred_group_sizze_218756))) {\n                            x_234295 = ((__local\n                                         double *) red_arr_mem_234282)[sext_i32_i64(local_tid_234278 +\n                                                                       offset_234307)];\n                        }\n                    }\n                    offset_234307 = 1;\n                    while (slt32(offset_234307, wave_sizze_234280)) {\n                        if (slt32(local_tid_234278 + offset_234307,\n                                  sext_i64_i32(segred_group_sizze_218756)) &&\n                            ((local_tid_234278 - squot32(local_tid_234278,\n                                                         wave_sizze_234280) *\n                              wave_sizze_234280) & (2 * offset_234307 - 1)) ==\n                            0) {\n                            // read array element\n                            {\n                                x_234296 = ((volatile __local\n                                             double *) red_arr_mem_234282)[sext_i32_i64(local_tid_234278 +\n                                                                           offset_234307)];\n                            }\n                            // apply reduction operation\n                            {\n                                double defunc_1_op_res_234",
                   "297 = x_234295 +\n                                       x_234296;\n                                \n                                x_234295 = defunc_1_op_res_234297;\n                            }\n                            // write result of operation\n                            {\n                                ((volatile __local\n                                  double *) red_arr_mem_234282)[sext_i32_i64(local_tid_234278)] =\n                                    x_234295;\n                            }\n                        }\n                        offset_234307 *= 2;\n                    }\n                    while (slt32(skip_waves_234308,\n                                 squot32(sext_i64_i32(segred_group_sizze_218756) +\n                                         wave_sizze_234280 - 1,\n                                         wave_sizze_234280))) {\n                        barrier(CLK_LOCAL_MEM_FENCE);\n                        offset_234307 = skip_waves_234308 * wave_sizze_234280;\n                        if (slt32(local_tid_234278 + offset_234307,\n                                  sext_i64_i32(segred_group_sizze_218756)) &&\n                            ((local_tid_234278 - squot32(local_tid_234278,\n                                                         wave_sizze_234280) *\n                              wave_sizze_234280) == 0 &&\n                             (squot32(local_tid_234278, wave_sizze_234280) &\n                              (2 * skip_waves_234308 - 1)) == 0)) {\n                            // read array element\n                            {\n                                x_234296 = ((__local\n                                             double *) red_arr_mem_234282)[sext_i32_i64(local_tid_234278 +\n                                                                           offset_234307)];\n                            }\n                            // apply reduction operation\n                            {\n                                double defunc_1_op_res",
                   "_234297 = x_234295 +\n                                       x_234296;\n                                \n                                x_234295 = defunc_1_op_res_234297;\n                            }\n                            // write result of operation\n                            {\n                                ((__local\n                                  double *) red_arr_mem_234282)[sext_i32_i64(local_tid_234278)] =\n                                    x_234295;\n                            }\n                        }\n                        skip_waves_234308 *= 2;\n                    }\n                    // and back to memory with the final result\n                    {\n                        if (local_tid_234278 == 0) {\n                            ((__global double *) mem_230528)[gtid_218760] =\n                                x_234295;\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_218756\n}\n__kernel void mainzisegred_large_218893(__global int *global_failure,\n                                        __local volatile\n                                        int64_t *sync_arr_mem_234427_backing_aligned_0,\n                                        __local volatile\n                                        int64_t *red_arr_mem_234425_backing_aligned_1,\n                                        int64_t partition_sizze_203577,\n                                        int64_t dyn_lifted_single_ma_l_arg_204144,\n                                        int64_t num_groups_218888,\n                                        int64_t groups_per_segment_234411,\n                                        int64_t elements_per_thread_234412,\n                                        int64_t virt_num_groups_234413,\n                                        int64_t threads_per_segment_234415,\n                                        ",
                   "__global unsigned char *mem_230534,\n                                        __global unsigned char *mem_230545,\n                                        __global\n                                        unsigned char *segred_tmp_mem_234416,\n                                        __global\n                                        unsigned char *mainzicounter_mem_234418)\n{\n    #define segred_group_sizze_218887 (mainzisegred_group_sizze_218870)\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_234427_backing_1 =\n                                   (__local volatile\n                                    unsigned char *) sync_arr_mem_234427_backing_aligned_0;\n    __local volatile unsigned char *restrict red_arr_mem_234425_backing_0 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_234425_backing_aligned_1;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_234420;\n    int32_t local_tid_234421;\n    int64_t group_sizze_234424;\n    int32_t wave_sizze_234423;\n    int32_t group_tid_234422;\n    \n    global_tid_234420 = get_global_id(0);\n    local_tid_234421 = get_local_id(0);\n    group_sizze_234424 = get_local_size(0);\n    wave_sizze_234423 = LOCKSTEP_WIDTH;\n    group_tid_234422 = get_group_id(0);\n    \n    int32_t phys_tid_218893 = global_tid_234420;\n    __local unsigned char *red_arr_mem_234425;\n    \n    red_arr_mem_234425 = (__local unsigned char *) red_arr_mem_234425_backing_0;\n    \n    __local unsigned char *sync_arr_mem_234427;\n    \n    sync_arr_mem_234427 = (__local\n                           unsigned char *) sync_arr_mem_234427_backing_1;\n    \n    int32_t phys_group_id_234429;\n    \n    phys_group_id_234429 = get_group_id(0);\n    for (int32_t i_234430 = 0; i_234430 <\n         sdiv_up32(sext_i64_i32(virt_num_groups_234413) - phys_group_id_234429,\n                   sext_i64_i32(nu",
                   "m_groups_218888)); i_234430++) {\n        int32_t virt_group_id_234431 = phys_group_id_234429 + i_234430 *\n                sext_i64_i32(num_groups_218888);\n        int32_t flat_segment_id_234432 = squot32(virt_group_id_234431,\n                                                 sext_i64_i32(groups_per_segment_234411));\n        int64_t global_tid_234433 = srem64(sext_i32_i64(virt_group_id_234431) *\n                                           segred_group_sizze_218887 +\n                                           sext_i32_i64(local_tid_234421),\n                                           segred_group_sizze_218887 *\n                                           groups_per_segment_234411);\n        int64_t slice_234434 = partition_sizze_203577;\n        int64_t gtid_218891 = sext_i32_i64(flat_segment_id_234432);\n        int64_t remnant_234435 = sext_i32_i64(flat_segment_id_234432) -\n                gtid_218891;\n        int64_t gtid_218892;\n        double x_acc_234436;\n        int64_t chunk_sizze_234437 = smin64(elements_per_thread_234412,\n                                            sdiv_up64((int64_t) 3 -\n                                                      global_tid_234433,\n                                                      threads_per_segment_234415));\n        double x_218894;\n        double x_218895;\n        \n        // neutral-initialise the accumulators\n        {\n            x_acc_234436 = 0.0;\n        }\n        for (int64_t i_234441 = 0; i_234441 < chunk_sizze_234437; i_234441++) {\n            gtid_218892 = global_tid_234433 + threads_per_segment_234415 *\n                i_234441;\n            // apply map function\n            {\n                double x_218898;\n                \n                x_218898 = ((__global double *) mem_230534)[gtid_218891 *\n                                                            dyn_lifted_single_ma_l_arg_204144 +\n                                                            gtid_218892];\n                // save map-out results\n               ",
                   " { }\n                // load accumulator\n                {\n                    x_218894 = x_acc_234436;\n                }\n                // load new values\n                {\n                    x_218895 = x_218898;\n                }\n                // apply reduction operator\n                {\n                    double defunc_1_op_res_218896 = x_218894 + x_218895;\n                    \n                    // store in accumulator\n                    {\n                        x_acc_234436 = defunc_1_op_res_218896;\n                    }\n                }\n            }\n        }\n        // to reduce current chunk, first store our result in memory\n        {\n            x_218894 = x_acc_234436;\n            ((__local\n              double *) red_arr_mem_234425)[sext_i32_i64(local_tid_234421)] =\n                x_218894;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        \n        int32_t offset_234442;\n        int32_t skip_waves_234443 = 1;\n        double x_234438;\n        double x_234439;\n        \n        offset_234442 = 0;\n        // participating threads read initial accumulator\n        {\n            if (slt32(local_tid_234421,\n                      sext_i64_i32(segred_group_sizze_218887))) {\n                x_234438 = ((__local\n                             double *) red_arr_mem_234425)[sext_i32_i64(local_tid_234421 +\n                                                           offset_234442)];\n            }\n        }\n        offset_234442 = 1;\n        while (slt32(offset_234442, wave_sizze_234423)) {\n            if (slt32(local_tid_234421 + offset_234442,\n                      sext_i64_i32(segred_group_sizze_218887)) &&\n                ((local_tid_234421 - squot32(local_tid_234421,\n                                             wave_sizze_234423) *\n                  wave_sizze_234423) & (2 * offset_234442 - 1)) == 0) {\n                // read array element\n                {\n                    x_234439 = ((volatile __local\n                                 double *) red",
                   "_arr_mem_234425)[sext_i32_i64(local_tid_234421 +\n                                                               offset_234442)];\n                }\n                // apply reduction operation\n                {\n                    double defunc_1_op_res_234440 = x_234438 + x_234439;\n                    \n                    x_234438 = defunc_1_op_res_234440;\n                }\n                // write result of operation\n                {\n                    ((volatile __local\n                      double *) red_arr_mem_234425)[sext_i32_i64(local_tid_234421)] =\n                        x_234438;\n                }\n            }\n            offset_234442 *= 2;\n        }\n        while (slt32(skip_waves_234443,\n                     squot32(sext_i64_i32(segred_group_sizze_218887) +\n                             wave_sizze_234423 - 1, wave_sizze_234423))) {\n            barrier(CLK_LOCAL_MEM_FENCE);\n            offset_234442 = skip_waves_234443 * wave_sizze_234423;\n            if (slt32(local_tid_234421 + offset_234442,\n                      sext_i64_i32(segred_group_sizze_218887)) &&\n                ((local_tid_234421 - squot32(local_tid_234421,\n                                             wave_sizze_234423) *\n                  wave_sizze_234423) == 0 && (squot32(local_tid_234421,\n                                                      wave_sizze_234423) & (2 *\n                                                                            skip_waves_234443 -\n                                                                            1)) ==\n                 0)) {\n                // read array element\n                {\n                    x_234439 = ((__local\n                                 double *) red_arr_mem_234425)[sext_i32_i64(local_tid_234421 +\n                                                               offset_234442)];\n                }\n                // apply reduction operation\n                {\n                    double defunc_1_op_res_234440 = x_234438 + x_234439;\n ",
                   "                   \n                    x_234438 = defunc_1_op_res_234440;\n                }\n                // write result of operation\n                {\n                    ((__local\n                      double *) red_arr_mem_234425)[sext_i32_i64(local_tid_234421)] =\n                        x_234438;\n                }\n            }\n            skip_waves_234443 *= 2;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        // first thread saves the result in accumulator\n        {\n            if (sext_i32_i64(local_tid_234421) == (int64_t) 0) {\n                x_acc_234436 = x_234438;\n            }\n        }\n        if (groups_per_segment_234411 == (int64_t) 1) {\n            // first thread in group saves final result to memory\n            {\n                if (local_tid_234421 == 0) {\n                    ((__global double *) mem_230545)[gtid_218891] =\n                        x_acc_234436;\n                }\n            }\n        } else {\n            int32_t old_counter_234444;\n            \n            // first thread in group saves group result to global memory\n            {\n                if (local_tid_234421 == 0) {\n                    ((__global\n                      double *) segred_tmp_mem_234416)[sext_i32_i64(virt_group_id_234431)] =\n                        x_acc_234436;\n                    mem_fence_global();\n                    old_counter_234444 =\n                        atomic_add_i32_global(&((volatile __global\n                                                 int *) mainzicounter_mem_234418)[sext_i32_i64(srem32(flat_segment_id_234432,\n                                                                                                      10240))],\n                                              (int) 1);\n                    ((__local bool *) sync_arr_mem_234427)[(int64_t) 0] =\n                        old_counter_234444 == groups_per_segment_234411 -\n                        (int64_t) 1;\n                }\n            }\n            barrier(CLK_GLOBAL_MEM_FENCE",
                   " | CLK_LOCAL_MEM_FENCE);\n            \n            bool is_last_group_234445;\n            \n            is_last_group_234445 = ((__local\n                                     bool *) sync_arr_mem_234427)[(int64_t) 0];\n            if (is_last_group_234445) {\n                if (local_tid_234421 == 0) {\n                    old_counter_234444 =\n                        atomic_add_i32_global(&((volatile __global\n                                                 int *) mainzicounter_mem_234418)[sext_i32_i64(srem32(flat_segment_id_234432,\n                                                                                                      10240))],\n                                              (int) ((int64_t) 0 -\n                                                     groups_per_segment_234411));\n                }\n                // read in the per-group-results\n                {\n                    int64_t read_per_thread_234446 =\n                            sdiv_up64(groups_per_segment_234411,\n                                      segred_group_sizze_218887);\n                    \n                    x_218894 = 0.0;\n                    for (int64_t i_234447 = 0; i_234447 <\n                         read_per_thread_234446; i_234447++) {\n                        int64_t group_res_id_234448 =\n                                sext_i32_i64(local_tid_234421) *\n                                read_per_thread_234446 + i_234447;\n                        int64_t index_of_group_res_234449 =\n                                sext_i32_i64(flat_segment_id_234432) *\n                                groups_per_segment_234411 + group_res_id_234448;\n                        \n                        if (slt64(group_res_id_234448,\n                                  groups_per_segment_234411)) {\n                            x_218895 = ((__global\n                                         double *) segred_tmp_mem_234416)[index_of_group_res_234449];\n                            \n                            double ",
                   "defunc_1_op_res_218896 = x_218894 + x_218895;\n                            \n                            x_218894 = defunc_1_op_res_218896;\n                        }\n                    }\n                }\n                ((__local\n                  double *) red_arr_mem_234425)[sext_i32_i64(local_tid_234421)] =\n                    x_218894;\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // reduce the per-group results\n                {\n                    int32_t offset_234450;\n                    int32_t skip_waves_234451 = 1;\n                    double x_234438;\n                    double x_234439;\n                    \n                    offset_234450 = 0;\n                    // participating threads read initial accumulator\n                    {\n                        if (slt32(local_tid_234421,\n                                  sext_i64_i32(segred_group_sizze_218887))) {\n                            x_234438 = ((__local\n                                         double *) red_arr_mem_234425)[sext_i32_i64(local_tid_234421 +\n                                                                       offset_234450)];\n                        }\n                    }\n                    offset_234450 = 1;\n                    while (slt32(offset_234450, wave_sizze_234423)) {\n                        if (slt32(local_tid_234421 + offset_234450,\n                                  sext_i64_i32(segred_group_sizze_218887)) &&\n                            ((local_tid_234421 - squot32(local_tid_234421,\n                                                         wave_sizze_234423) *\n                              wave_sizze_234423) & (2 * offset_234450 - 1)) ==\n                            0) {\n                            // read array element\n                            {\n                                x_234439 = ((volatile __local\n                                             double *) red_arr_mem_234425)[sext_i32_i64(local_tid_234421 +\n                                       ",
                   "                                    offset_234450)];\n                            }\n                            // apply reduction operation\n                            {\n                                double defunc_1_op_res_234440 = x_234438 +\n                                       x_234439;\n                                \n                                x_234438 = defunc_1_op_res_234440;\n                            }\n                            // write result of operation\n                            {\n                                ((volatile __local\n                                  double *) red_arr_mem_234425)[sext_i32_i64(local_tid_234421)] =\n                                    x_234438;\n                            }\n                        }\n                        offset_234450 *= 2;\n                    }\n                    while (slt32(skip_waves_234451,\n                                 squot32(sext_i64_i32(segred_group_sizze_218887) +\n                                         wave_sizze_234423 - 1,\n                                         wave_sizze_234423))) {\n                        barrier(CLK_LOCAL_MEM_FENCE);\n                        offset_234450 = skip_waves_234451 * wave_sizze_234423;\n                        if (slt32(local_tid_234421 + offset_234450,\n                                  sext_i64_i32(segred_group_sizze_218887)) &&\n                            ((local_tid_234421 - squot32(local_tid_234421,\n                                                         wave_sizze_234423) *\n                              wave_sizze_234423) == 0 &&\n                             (squot32(local_tid_234421, wave_sizze_234423) &\n                              (2 * skip_waves_234451 - 1)) == 0)) {\n                            // read array element\n                            {\n                                x_234439 = ((__local\n                                             double *) red_arr_mem_234425)[sext_i32_i64(local_tid_234421 +\n                                   ",
                   "                                        offset_234450)];\n                            }\n                            // apply reduction operation\n                            {\n                                double defunc_1_op_res_234440 = x_234438 +\n                                       x_234439;\n                                \n                                x_234438 = defunc_1_op_res_234440;\n                            }\n                            // write result of operation\n                            {\n                                ((__local\n                                  double *) red_arr_mem_234425)[sext_i32_i64(local_tid_234421)] =\n                                    x_234438;\n                            }\n                        }\n                        skip_waves_234451 *= 2;\n                    }\n                    // and back to memory with the final result\n                    {\n                        if (local_tid_234421 == 0) {\n                            ((__global double *) mem_230545)[gtid_218891] =\n                                x_234438;\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_218887\n}\n__kernel void mainzisegred_large_219515(__global int *global_failure,\n                                        __local volatile\n                                        int64_t *sync_arr_mem_234606_backing_aligned_0,\n                                        __local volatile\n                                        int64_t *red_arr_mem_234604_backing_aligned_1,\n                                        int64_t n_203490, int64_t q_l_203495,\n                                        int64_t jump_t_203500,\n                                        int64_t partition_sizze_203577,\n                                        int64_t l_n_m_203643, int64_t i_203670,\n                                        ",
                   "int64_t num_groups_219509,\n                                        int64_t ctx_param_ext_229488,\n                                        int64_t ctx_param_ext_229489,\n                                        int64_t ctx_param_ext_229491,\n                                        int64_t groups_per_segment_234590,\n                                        int64_t elements_per_thread_234591,\n                                        int64_t virt_num_groups_234592,\n                                        int64_t threads_per_segment_234594,\n                                        __global unsigned char *ext_mem_229411,\n                                        __global unsigned char *ext_mem_229412,\n                                        __global\n                                        unsigned char *mem_param_229493,\n                                        __global unsigned char *mem_230596,\n                                        __global\n                                        unsigned char *segred_tmp_mem_234595,\n                                        __global\n                                        unsigned char *mainzicounter_mem_234597)\n{\n    #define segred_group_sizze_219508 (mainzisegred_group_sizze_219260)\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_234606_backing_1 =\n                                   (__local volatile\n                                    unsigned char *) sync_arr_mem_234606_backing_aligned_0;\n    __local volatile unsigned char *restrict red_arr_mem_234604_backing_0 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_234604_backing_aligned_1;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_234599;\n    int32_t local_tid_234600;\n    int64_t group_sizze_234603;\n    int32_t wave_sizze_234602;\n    int32_t group_tid_234601;\n    \n    global_tid_234599 =",
                   " get_global_id(0);\n    local_tid_234600 = get_local_id(0);\n    group_sizze_234603 = get_local_size(0);\n    wave_sizze_234602 = LOCKSTEP_WIDTH;\n    group_tid_234601 = get_group_id(0);\n    \n    int32_t phys_tid_219515 = global_tid_234599;\n    __local unsigned char *red_arr_mem_234604;\n    \n    red_arr_mem_234604 = (__local unsigned char *) red_arr_mem_234604_backing_0;\n    \n    __local unsigned char *sync_arr_mem_234606;\n    \n    sync_arr_mem_234606 = (__local\n                           unsigned char *) sync_arr_mem_234606_backing_1;\n    \n    int32_t phys_group_id_234608;\n    \n    phys_group_id_234608 = get_group_id(0);\n    for (int32_t i_234609 = 0; i_234609 <\n         sdiv_up32(sext_i64_i32(virt_num_groups_234592) - phys_group_id_234608,\n                   sext_i64_i32(num_groups_219509)); i_234609++) {\n        int32_t virt_group_id_234610 = phys_group_id_234608 + i_234609 *\n                sext_i64_i32(num_groups_219509);\n        int32_t flat_segment_id_234611 = squot32(virt_group_id_234610,\n                                                 sext_i64_i32(groups_per_segment_234590));\n        int64_t global_tid_234612 = srem64(sext_i32_i64(virt_group_id_234610) *\n                                           segred_group_sizze_219508 +\n                                           sext_i32_i64(local_tid_234600),\n                                           segred_group_sizze_219508 *\n                                           groups_per_segment_234590);\n        int64_t slice_234613 = l_n_m_203643;\n        int64_t slice_234614 = partition_sizze_203577 * slice_234613;\n        int64_t gtid_219512 = squot64(sext_i32_i64(flat_segment_id_234611),\n                                      slice_234613);\n        int64_t remnant_234615 = sext_i32_i64(flat_segment_id_234611) -\n                gtid_219512 * slice_234613;\n        int64_t gtid_219513 = remnant_234615;\n        int64_t remnant_234616 = remnant_234615 - gtid_219513;\n        int64_t gtid_219514;\n        double x_acc_234617;\n      ",
                   "  int64_t chunk_sizze_234618 = smin64(elements_per_thread_234591,\n                                            sdiv_up64(q_l_203495 -\n                                                      global_tid_234612,\n                                                      threads_per_segment_234594));\n        double x_219516;\n        double x_219517;\n        \n        // neutral-initialise the accumulators\n        {\n            x_acc_234617 = 0.0;\n        }\n        for (int64_t i_234622 = 0; i_234622 < chunk_sizze_234618; i_234622++) {\n            gtid_219514 = global_tid_234612 + threads_per_segment_234594 *\n                i_234622;\n            // apply map function\n            {\n                int64_t x_219523;\n                \n                x_219523 = ((__global int64_t *) ext_mem_229412)[gtid_219512 *\n                                                                 l_n_m_203643 +\n                                                                 gtid_219513];\n                \n                double x_219524;\n                \n                x_219524 = ((__global double *) ext_mem_229411)[gtid_219512 *\n                                                                l_n_m_203643 +\n                                                                gtid_219513];\n                \n                int64_t binop_y_228694 = mul64(jump_t_203500, gtid_219513);\n                int64_t binop_y_228695 = smin64(i_203670, binop_y_228694);\n                int64_t index_primexp_228696 = add64((int64_t) 1,\n                                                     binop_y_228695);\n                bool cond_219527 = sle64(n_203490, gtid_219514);\n                int64_t defunc_0_f_res_219528;\n                \n                if (cond_219527) {\n                    defunc_0_f_res_219528 = (int64_t) 0;\n                } else {\n                    int64_t i_219529 = add64(gtid_219514, x_219523);\n                    int64_t defunc_1_add_res_219530 = add64((int64_t) 1,\n                                        ",
                   "                    i_219529);\n                    \n                    defunc_0_f_res_219528 = defunc_1_add_res_219530;\n                }\n                \n                double defunc_0_f_res_219531;\n                \n                if (cond_219527) {\n                    defunc_0_f_res_219531 = 0.0;\n                } else {\n                    int64_t i_219532 = add64(gtid_219514, x_219523);\n                    double defunc_0_add_arg_219533;\n                    \n                    defunc_0_add_arg_219533 = ((__global\n                                                double *) mem_param_229493)[ctx_param_ext_229488 +\n                                                                            (gtid_219512 *\n                                                                             ctx_param_ext_229489 +\n                                                                             i_219532 *\n                                                                             ctx_param_ext_229491)];\n                    defunc_0_f_res_219531 = defunc_0_add_arg_219533;\n                }\n                \n                int64_t binop_p_219534 = sub64(defunc_0_f_res_219528,\n                                               index_primexp_228696);\n                double defunc_0_f_res_219535 = sitofp_i64_f64(binop_p_219534);\n                double abs_res_219536 = fabs(defunc_0_f_res_219535);\n                double tmp1_219537 = abs_res_219536 / x_219524;\n                double x_219538 = tmp1_219537 * tmp1_219537;\n                double y_219539 = tmp1_219537 * x_219538;\n                double tmp2_219540 = 1.0 - y_219539;\n                double x_219541 = tmp2_219540 * tmp2_219540;\n                double tmp3_219542 = tmp2_219540 * x_219541;\n                double w_j_219543 = defunc_0_f_res_219531 * tmp3_219542;\n                \n                // save map-out results\n                { }\n                // load accumulator\n                {\n                    x_219516 = x_acc_234",
                   "617;\n                }\n                // load new values\n                {\n                    x_219517 = w_j_219543;\n                }\n                // apply reduction operator\n                {\n                    double defunc_1_op_res_219518 = x_219516 + x_219517;\n                    \n                    // store in accumulator\n                    {\n                        x_acc_234617 = defunc_1_op_res_219518;\n                    }\n                }\n            }\n        }\n        // to reduce current chunk, first store our result in memory\n        {\n            x_219516 = x_acc_234617;\n            ((__local\n              double *) red_arr_mem_234604)[sext_i32_i64(local_tid_234600)] =\n                x_219516;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        \n        int32_t offset_234623;\n        int32_t skip_waves_234624 = 1;\n        double x_234619;\n        double x_234620;\n        \n        offset_234623 = 0;\n        // participating threads read initial accumulator\n        {\n            if (slt32(local_tid_234600,\n                      sext_i64_i32(segred_group_sizze_219508))) {\n                x_234619 = ((__local\n                             double *) red_arr_mem_234604)[sext_i32_i64(local_tid_234600 +\n                                                           offset_234623)];\n            }\n        }\n        offset_234623 = 1;\n        while (slt32(offset_234623, wave_sizze_234602)) {\n            if (slt32(local_tid_234600 + offset_234623,\n                      sext_i64_i32(segred_group_sizze_219508)) &&\n                ((local_tid_234600 - squot32(local_tid_234600,\n                                             wave_sizze_234602) *\n                  wave_sizze_234602) & (2 * offset_234623 - 1)) == 0) {\n                // read array element\n                {\n                    x_234620 = ((volatile __local\n                                 double *) red_arr_mem_234604)[sext_i32_i64(local_tid_234600 +\n                                                ",
                   "               offset_234623)];\n                }\n                // apply reduction operation\n                {\n                    double defunc_1_op_res_234621 = x_234619 + x_234620;\n                    \n                    x_234619 = defunc_1_op_res_234621;\n                }\n                // write result of operation\n                {\n                    ((volatile __local\n                      double *) red_arr_mem_234604)[sext_i32_i64(local_tid_234600)] =\n                        x_234619;\n                }\n            }\n            offset_234623 *= 2;\n        }\n        while (slt32(skip_waves_234624,\n                     squot32(sext_i64_i32(segred_group_sizze_219508) +\n                             wave_sizze_234602 - 1, wave_sizze_234602))) {\n            barrier(CLK_LOCAL_MEM_FENCE);\n            offset_234623 = skip_waves_234624 * wave_sizze_234602;\n            if (slt32(local_tid_234600 + offset_234623,\n                      sext_i64_i32(segred_group_sizze_219508)) &&\n                ((local_tid_234600 - squot32(local_tid_234600,\n                                             wave_sizze_234602) *\n                  wave_sizze_234602) == 0 && (squot32(local_tid_234600,\n                                                      wave_sizze_234602) & (2 *\n                                                                            skip_waves_234624 -\n                                                                            1)) ==\n                 0)) {\n                // read array element\n                {\n                    x_234620 = ((__local\n                                 double *) red_arr_mem_234604)[sext_i32_i64(local_tid_234600 +\n                                                               offset_234623)];\n                }\n                // apply reduction operation\n                {\n                    double defunc_1_op_res_234621 = x_234619 + x_234620;\n                    \n                    x_234619 = defunc_1_op_res_234621;\n                }\n    ",
                   "            // write result of operation\n                {\n                    ((__local\n                      double *) red_arr_mem_234604)[sext_i32_i64(local_tid_234600)] =\n                        x_234619;\n                }\n            }\n            skip_waves_234624 *= 2;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        // first thread saves the result in accumulator\n        {\n            if (sext_i32_i64(local_tid_234600) == (int64_t) 0) {\n                x_acc_234617 = x_234619;\n            }\n        }\n        if (groups_per_segment_234590 == (int64_t) 1) {\n            // first thread in group saves final result to memory\n            {\n                if (local_tid_234600 == 0) {\n                    ((__global double *) mem_230596)[gtid_219512 *\n                                                     l_n_m_203643 +\n                                                     gtid_219513] =\n                        x_acc_234617;\n                }\n            }\n        } else {\n            int32_t old_counter_234625;\n            \n            // first thread in group saves group result to global memory\n            {\n                if (local_tid_234600 == 0) {\n                    ((__global\n                      double *) segred_tmp_mem_234595)[sext_i32_i64(virt_group_id_234610)] =\n                        x_acc_234617;\n                    mem_fence_global();\n                    old_counter_234625 =\n                        atomic_add_i32_global(&((volatile __global\n                                                 int *) mainzicounter_mem_234597)[sext_i32_i64(srem32(flat_segment_id_234611,\n                                                                                                      10240))],\n                                              (int) 1);\n                    ((__local bool *) sync_arr_mem_234606)[(int64_t) 0] =\n                        old_counter_234625 == groups_per_segment_234590 -\n                        (int64_t) 1;\n                }\n            }\n  ",
                   "          barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n            \n            bool is_last_group_234626;\n            \n            is_last_group_234626 = ((__local\n                                     bool *) sync_arr_mem_234606)[(int64_t) 0];\n            if (is_last_group_234626) {\n                if (local_tid_234600 == 0) {\n                    old_counter_234625 =\n                        atomic_add_i32_global(&((volatile __global\n                                                 int *) mainzicounter_mem_234597)[sext_i32_i64(srem32(flat_segment_id_234611,\n                                                                                                      10240))],\n                                              (int) ((int64_t) 0 -\n                                                     groups_per_segment_234590));\n                }\n                // read in the per-group-results\n                {\n                    int64_t read_per_thread_234627 =\n                            sdiv_up64(groups_per_segment_234590,\n                                      segred_group_sizze_219508);\n                    \n                    x_219516 = 0.0;\n                    for (int64_t i_234628 = 0; i_234628 <\n                         read_per_thread_234627; i_234628++) {\n                        int64_t group_res_id_234629 =\n                                sext_i32_i64(local_tid_234600) *\n                                read_per_thread_234627 + i_234628;\n                        int64_t index_of_group_res_234630 =\n                                sext_i32_i64(flat_segment_id_234611) *\n                                groups_per_segment_234590 + group_res_id_234629;\n                        \n                        if (slt64(group_res_id_234629,\n                                  groups_per_segment_234590)) {\n                            x_219517 = ((__global\n                                         double *) segred_tmp_mem_234595)[index_of_group_res_234630];\n                          ",
                   "  \n                            double defunc_1_op_res_219518 = x_219516 + x_219517;\n                            \n                            x_219516 = defunc_1_op_res_219518;\n                        }\n                    }\n                }\n                ((__local\n                  double *) red_arr_mem_234604)[sext_i32_i64(local_tid_234600)] =\n                    x_219516;\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // reduce the per-group results\n                {\n                    int32_t offset_234631;\n                    int32_t skip_waves_234632 = 1;\n                    double x_234619;\n                    double x_234620;\n                    \n                    offset_234631 = 0;\n                    // participating threads read initial accumulator\n                    {\n                        if (slt32(local_tid_234600,\n                                  sext_i64_i32(segred_group_sizze_219508))) {\n                            x_234619 = ((__local\n                                         double *) red_arr_mem_234604)[sext_i32_i64(local_tid_234600 +\n                                                                       offset_234631)];\n                        }\n                    }\n                    offset_234631 = 1;\n                    while (slt32(offset_234631, wave_sizze_234602)) {\n                        if (slt32(local_tid_234600 + offset_234631,\n                                  sext_i64_i32(segred_group_sizze_219508)) &&\n                            ((local_tid_234600 - squot32(local_tid_234600,\n                                                         wave_sizze_234602) *\n                              wave_sizze_234602) & (2 * offset_234631 - 1)) ==\n                            0) {\n                            // read array element\n                            {\n                                x_234620 = ((volatile __local\n                                             double *) red_arr_mem_234604)[sext_i32_i64(local_tid_234600 +\n ",
                   "                                                                          offset_234631)];\n                            }\n                            // apply reduction operation\n                            {\n                                double defunc_1_op_res_234621 = x_234619 +\n                                       x_234620;\n                                \n                                x_234619 = defunc_1_op_res_234621;\n                            }\n                            // write result of operation\n                            {\n                                ((volatile __local\n                                  double *) red_arr_mem_234604)[sext_i32_i64(local_tid_234600)] =\n                                    x_234619;\n                            }\n                        }\n                        offset_234631 *= 2;\n                    }\n                    while (slt32(skip_waves_234632,\n                                 squot32(sext_i64_i32(segred_group_sizze_219508) +\n                                         wave_sizze_234602 - 1,\n                                         wave_sizze_234602))) {\n                        barrier(CLK_LOCAL_MEM_FENCE);\n                        offset_234631 = skip_waves_234632 * wave_sizze_234602;\n                        if (slt32(local_tid_234600 + offset_234631,\n                                  sext_i64_i32(segred_group_sizze_219508)) &&\n                            ((local_tid_234600 - squot32(local_tid_234600,\n                                                         wave_sizze_234602) *\n                              wave_sizze_234602) == 0 &&\n                             (squot32(local_tid_234600, wave_sizze_234602) &\n                              (2 * skip_waves_234632 - 1)) == 0)) {\n                            // read array element\n                            {\n                                x_234620 = ((__local\n                                             double *) red_arr_mem_234604)[sext_i32_i64(local_tid_234600",
                   " +\n                                                                           offset_234631)];\n                            }\n                            // apply reduction operation\n                            {\n                                double defunc_1_op_res_234621 = x_234619 +\n                                       x_234620;\n                                \n                                x_234619 = defunc_1_op_res_234621;\n                            }\n                            // write result of operation\n                            {\n                                ((__local\n                                  double *) red_arr_mem_234604)[sext_i32_i64(local_tid_234600)] =\n                                    x_234619;\n                            }\n                        }\n                        skip_waves_234632 *= 2;\n                    }\n                    // and back to memory with the final result\n                    {\n                        if (local_tid_234600 == 0) {\n                            ((__global double *) mem_230596)[gtid_219512 *\n                                                             l_n_m_203643 +\n                                                             gtid_219513] =\n                                x_234619;\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_219508\n}\n__kernel void mainzisegred_large_219564(__global int *global_failure,\n                                        __local volatile\n                                        int64_t *sync_arr_mem_234688_backing_aligned_0,\n                                        __local volatile\n                                        int64_t *red_arr_mem_234686_backing_aligned_1,\n                                        int64_t n_203490, int64_t q_l_203495,\n                                        int64_t jump_t_203500,\n   ",
                   "                                     int64_t partition_sizze_203577,\n                                        int64_t l_n_m_203643, int64_t i_203670,\n                                        int64_t num_groups_219558,\n                                        int64_t ctx_param_ext_229488,\n                                        int64_t ctx_param_ext_229489,\n                                        int64_t ctx_param_ext_229491,\n                                        int64_t groups_per_segment_234672,\n                                        int64_t elements_per_thread_234673,\n                                        int64_t virt_num_groups_234674,\n                                        int64_t threads_per_segment_234676,\n                                        __global unsigned char *ext_mem_229411,\n                                        __global unsigned char *ext_mem_229412,\n                                        __global\n                                        unsigned char *mem_param_229493,\n                                        __global unsigned char *mem_230551,\n                                        __global unsigned char *mem_230601,\n                                        __global unsigned char *mem_230606,\n                                        __global\n                                        unsigned char *segred_tmp_mem_234677,\n                                        __global\n                                        unsigned char *mainzicounter_mem_234679)\n{\n    #define segred_group_sizze_219557 (mainzisegred_group_sizze_219193)\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_234688_backing_1 =\n                                   (__local volatile\n                                    unsigned char *) sync_arr_mem_234688_backing_aligned_0;\n    __local volatile unsigned char *restrict red_arr_mem_234686_backing_0 =\n                                   (__loc",
                   "al volatile\n                                    unsigned char *) red_arr_mem_234686_backing_aligned_1;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_234681;\n    int32_t local_tid_234682;\n    int64_t group_sizze_234685;\n    int32_t wave_sizze_234684;\n    int32_t group_tid_234683;\n    \n    global_tid_234681 = get_global_id(0);\n    local_tid_234682 = get_local_id(0);\n    group_sizze_234685 = get_local_size(0);\n    wave_sizze_234684 = LOCKSTEP_WIDTH;\n    group_tid_234683 = get_group_id(0);\n    \n    int32_t phys_tid_219564 = global_tid_234681;\n    __local unsigned char *red_arr_mem_234686;\n    \n    red_arr_mem_234686 = (__local unsigned char *) red_arr_mem_234686_backing_0;\n    \n    __local unsigned char *sync_arr_mem_234688;\n    \n    sync_arr_mem_234688 = (__local\n                           unsigned char *) sync_arr_mem_234688_backing_1;\n    \n    int32_t phys_group_id_234690;\n    \n    phys_group_id_234690 = get_group_id(0);\n    for (int32_t i_234691 = 0; i_234691 <\n         sdiv_up32(sext_i64_i32(virt_num_groups_234674) - phys_group_id_234690,\n                   sext_i64_i32(num_groups_219558)); i_234691++) {\n        int32_t virt_group_id_234692 = phys_group_id_234690 + i_234691 *\n                sext_i64_i32(num_groups_219558);\n        int32_t flat_segment_id_234693 = squot32(virt_group_id_234692,\n                                                 sext_i64_i32(groups_per_segment_234672));\n        int64_t global_tid_234694 = srem64(sext_i32_i64(virt_group_id_234692) *\n                                           segred_group_sizze_219557 +\n                                           sext_i32_i64(local_tid_234682),\n                                           segred_group_sizze_219557 *\n                                           groups_per_segment_234672);\n        int64_t slice_234695 = l_n_m_203643;\n        int64_t slice_234696 = partition_sizze_203577 * slice_234695;\n        int64_t gtid_219561 = squot64(sext_i32_i64(flat_segment_id_234693),\n ",
                   "                                     slice_234695);\n        int64_t remnant_234697 = sext_i32_i64(flat_segment_id_234693) -\n                gtid_219561 * slice_234695;\n        int64_t gtid_219562 = remnant_234697;\n        int64_t remnant_234698 = remnant_234697 - gtid_219562;\n        int64_t gtid_219563;\n        double x_acc_234699;\n        int64_t chunk_sizze_234700 = smin64(elements_per_thread_234673,\n                                            sdiv_up64(q_l_203495 -\n                                                      global_tid_234694,\n                                                      threads_per_segment_234676));\n        double x_219565;\n        double x_219566;\n        \n        // neutral-initialise the accumulators\n        {\n            x_acc_234699 = 0.0;\n        }\n        for (int64_t i_234704 = 0; i_234704 < chunk_sizze_234700; i_234704++) {\n            gtid_219563 = global_tid_234694 + threads_per_segment_234676 *\n                i_234704;\n            // apply map function\n            {\n                int64_t x_219574;\n                \n                x_219574 = ((__global int64_t *) ext_mem_229412)[gtid_219561 *\n                                                                 l_n_m_203643 +\n                                                                 gtid_219562];\n                \n                double x_219575;\n                \n                x_219575 = ((__global double *) ext_mem_229411)[gtid_219561 *\n                                                                l_n_m_203643 +\n                                                                gtid_219562];\n                \n                int64_t binop_y_228689 = mul64(jump_t_203500, gtid_219562);\n                int64_t binop_y_228690 = smin64(i_203670, binop_y_228689);\n                int64_t index_primexp_228691 = add64((int64_t) 1,\n                                                     binop_y_228690);\n                double a0_219577;\n                \n                a0_219577 = ((__glob",
                   "al double *) mem_230601)[gtid_219561 *\n                                                             l_n_m_203643 +\n                                                             gtid_219562];\n                \n                bool cond_219579 = sle64(n_203490, gtid_219563);\n                int64_t defunc_0_f_res_219580;\n                \n                if (cond_219579) {\n                    defunc_0_f_res_219580 = (int64_t) 0;\n                } else {\n                    int64_t i_219581 = add64(gtid_219563, x_219574);\n                    int64_t defunc_1_add_res_219582 = add64((int64_t) 1,\n                                                            i_219581);\n                    \n                    defunc_0_f_res_219580 = defunc_1_add_res_219582;\n                }\n                \n                double defunc_0_f_res_219583;\n                \n                if (cond_219579) {\n                    defunc_0_f_res_219583 = 0.0;\n                } else {\n                    int64_t i_219584 = add64(gtid_219563, x_219574);\n                    double defunc_0_add_arg_219585;\n                    \n                    defunc_0_add_arg_219585 = ((__global\n                                                double *) mem_param_229493)[ctx_param_ext_229488 +\n                                                                            (gtid_219561 *\n                                                                             ctx_param_ext_229489 +\n                                                                             i_219584 *\n                                                                             ctx_param_ext_229491)];\n                    defunc_0_f_res_219583 = defunc_0_add_arg_219585;\n                }\n                \n                int64_t binop_p_219586 = sub64(defunc_0_f_res_219580,\n                                               index_primexp_228691);\n                double defunc_0_f_res_219587 = sitofp_i64_f64(binop_p_219586);\n                double abs_res_21958",
                   "8 = fabs(defunc_0_f_res_219587);\n                double tmp1_219589 = abs_res_219588 / x_219575;\n                double x_219590 = tmp1_219589 * tmp1_219589;\n                double y_219591 = tmp1_219589 * x_219590;\n                double tmp2_219592 = 1.0 - y_219591;\n                double x_219593 = tmp2_219592 * tmp2_219592;\n                double tmp3_219594 = tmp2_219592 * x_219593;\n                double tmp4_219595 = defunc_0_f_res_219583 * tmp3_219594;\n                double defunc_0_f_res_219596;\n                \n                if (cond_219579) {\n                    defunc_0_f_res_219596 = 0.0;\n                } else {\n                    int64_t i_219597 = add64(gtid_219563, x_219574);\n                    double defunc_0_add_arg_219598;\n                    \n                    defunc_0_add_arg_219598 = ((__global\n                                                double *) mem_230551)[gtid_219561 *\n                                                                      n_203490 +\n                                                                      i_219597];\n                    defunc_0_f_res_219596 = defunc_0_add_arg_219598;\n                }\n                \n                double x_219599 = a0_219577 * tmp4_219595;\n                double defunc_9_fit_fun_res_219600 = defunc_0_f_res_219596 *\n                       x_219599;\n                \n                // save map-out results\n                { }\n                // load accumulator\n                {\n                    x_219565 = x_acc_234699;\n                }\n                // load new values\n                {\n                    x_219566 = defunc_9_fit_fun_res_219600;\n                }\n                // apply reduction operator\n                {\n                    double defunc_1_op_res_219567 = x_219565 + x_219566;\n                    \n                    // store in accumulator\n                    {\n                        x_acc_234699 = defunc_1_op_res_219567;\n                    }\n             ",
                   "   }\n            }\n        }\n        // to reduce current chunk, first store our result in memory\n        {\n            x_219565 = x_acc_234699;\n            ((__local\n              double *) red_arr_mem_234686)[sext_i32_i64(local_tid_234682)] =\n                x_219565;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        \n        int32_t offset_234705;\n        int32_t skip_waves_234706 = 1;\n        double x_234701;\n        double x_234702;\n        \n        offset_234705 = 0;\n        // participating threads read initial accumulator\n        {\n            if (slt32(local_tid_234682,\n                      sext_i64_i32(segred_group_sizze_219557))) {\n                x_234701 = ((__local\n                             double *) red_arr_mem_234686)[sext_i32_i64(local_tid_234682 +\n                                                           offset_234705)];\n            }\n        }\n        offset_234705 = 1;\n        while (slt32(offset_234705, wave_sizze_234684)) {\n            if (slt32(local_tid_234682 + offset_234705,\n                      sext_i64_i32(segred_group_sizze_219557)) &&\n                ((local_tid_234682 - squot32(local_tid_234682,\n                                             wave_sizze_234684) *\n                  wave_sizze_234684) & (2 * offset_234705 - 1)) == 0) {\n                // read array element\n                {\n                    x_234702 = ((volatile __local\n                                 double *) red_arr_mem_234686)[sext_i32_i64(local_tid_234682 +\n                                                               offset_234705)];\n                }\n                // apply reduction operation\n                {\n                    double defunc_1_op_res_234703 = x_234701 + x_234702;\n                    \n                    x_234701 = defunc_1_op_res_234703;\n                }\n                // write result of operation\n                {\n                    ((volatile __local\n                      double *) red_arr_mem_234686)[sext_i32_i64(local_tid_",
                   "234682)] =\n                        x_234701;\n                }\n            }\n            offset_234705 *= 2;\n        }\n        while (slt32(skip_waves_234706,\n                     squot32(sext_i64_i32(segred_group_sizze_219557) +\n                             wave_sizze_234684 - 1, wave_sizze_234684))) {\n            barrier(CLK_LOCAL_MEM_FENCE);\n            offset_234705 = skip_waves_234706 * wave_sizze_234684;\n            if (slt32(local_tid_234682 + offset_234705,\n                      sext_i64_i32(segred_group_sizze_219557)) &&\n                ((local_tid_234682 - squot32(local_tid_234682,\n                                             wave_sizze_234684) *\n                  wave_sizze_234684) == 0 && (squot32(local_tid_234682,\n                                                      wave_sizze_234684) & (2 *\n                                                                            skip_waves_234706 -\n                                                                            1)) ==\n                 0)) {\n                // read array element\n                {\n                    x_234702 = ((__local\n                                 double *) red_arr_mem_234686)[sext_i32_i64(local_tid_234682 +\n                                                               offset_234705)];\n                }\n                // apply reduction operation\n                {\n                    double defunc_1_op_res_234703 = x_234701 + x_234702;\n                    \n                    x_234701 = defunc_1_op_res_234703;\n                }\n                // write result of operation\n                {\n                    ((__local\n                      double *) red_arr_mem_234686)[sext_i32_i64(local_tid_234682)] =\n                        x_234701;\n                }\n            }\n            skip_waves_234706 *= 2;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        // first thread saves the result in accumulator\n        {\n            if (sext_i32_i64(local_tid_234682) == (int64_t) 0) {\n ",
                   "               x_acc_234699 = x_234701;\n            }\n        }\n        if (groups_per_segment_234672 == (int64_t) 1) {\n            // first thread in group saves final result to memory\n            {\n                if (local_tid_234682 == 0) {\n                    ((__global double *) mem_230606)[gtid_219561 *\n                                                     l_n_m_203643 +\n                                                     gtid_219562] =\n                        x_acc_234699;\n                }\n            }\n        } else {\n            int32_t old_counter_234707;\n            \n            // first thread in group saves group result to global memory\n            {\n                if (local_tid_234682 == 0) {\n                    ((__global\n                      double *) segred_tmp_mem_234677)[sext_i32_i64(virt_group_id_234692)] =\n                        x_acc_234699;\n                    mem_fence_global();\n                    old_counter_234707 =\n                        atomic_add_i32_global(&((volatile __global\n                                                 int *) mainzicounter_mem_234679)[sext_i32_i64(srem32(flat_segment_id_234693,\n                                                                                                      10240))],\n                                              (int) 1);\n                    ((__local bool *) sync_arr_mem_234688)[(int64_t) 0] =\n                        old_counter_234707 == groups_per_segment_234672 -\n                        (int64_t) 1;\n                }\n            }\n            barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n            \n            bool is_last_group_234708;\n            \n            is_last_group_234708 = ((__local\n                                     bool *) sync_arr_mem_234688)[(int64_t) 0];\n            if (is_last_group_234708) {\n                if (local_tid_234682 == 0) {\n                    old_counter_234707 =\n                        atomic_add_i32_global(&((volatile __global\n           ",
                   "                                      int *) mainzicounter_mem_234679)[sext_i32_i64(srem32(flat_segment_id_234693,\n                                                                                                      10240))],\n                                              (int) ((int64_t) 0 -\n                                                     groups_per_segment_234672));\n                }\n                // read in the per-group-results\n                {\n                    int64_t read_per_thread_234709 =\n                            sdiv_up64(groups_per_segment_234672,\n                                      segred_group_sizze_219557);\n                    \n                    x_219565 = 0.0;\n                    for (int64_t i_234710 = 0; i_234710 <\n                         read_per_thread_234709; i_234710++) {\n                        int64_t group_res_id_234711 =\n                                sext_i32_i64(local_tid_234682) *\n                                read_per_thread_234709 + i_234710;\n                        int64_t index_of_group_res_234712 =\n                                sext_i32_i64(flat_segment_id_234693) *\n                                groups_per_segment_234672 + group_res_id_234711;\n                        \n                        if (slt64(group_res_id_234711,\n                                  groups_per_segment_234672)) {\n                            x_219566 = ((__global\n                                         double *) segred_tmp_mem_234677)[index_of_group_res_234712];\n                            \n                            double defunc_1_op_res_219567 = x_219565 + x_219566;\n                            \n                            x_219565 = defunc_1_op_res_219567;\n                        }\n                    }\n                }\n                ((__local\n                  double *) red_arr_mem_234686)[sext_i32_i64(local_tid_234682)] =\n                    x_219565;\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // reduce the p",
                   "er-group results\n                {\n                    int32_t offset_234713;\n                    int32_t skip_waves_234714 = 1;\n                    double x_234701;\n                    double x_234702;\n                    \n                    offset_234713 = 0;\n                    // participating threads read initial accumulator\n                    {\n                        if (slt32(local_tid_234682,\n                                  sext_i64_i32(segred_group_sizze_219557))) {\n                            x_234701 = ((__local\n                                         double *) red_arr_mem_234686)[sext_i32_i64(local_tid_234682 +\n                                                                       offset_234713)];\n                        }\n                    }\n                    offset_234713 = 1;\n                    while (slt32(offset_234713, wave_sizze_234684)) {\n                        if (slt32(local_tid_234682 + offset_234713,\n                                  sext_i64_i32(segred_group_sizze_219557)) &&\n                            ((local_tid_234682 - squot32(local_tid_234682,\n                                                         wave_sizze_234684) *\n                              wave_sizze_234684) & (2 * offset_234713 - 1)) ==\n                            0) {\n                            // read array element\n                            {\n                                x_234702 = ((volatile __local\n                                             double *) red_arr_mem_234686)[sext_i32_i64(local_tid_234682 +\n                                                                           offset_234713)];\n                            }\n                            // apply reduction operation\n                            {\n                                double defunc_1_op_res_234703 = x_234701 +\n                                       x_234702;\n                                \n                                x_234701 = defunc_1_op_res_234703;\n                         ",
                   "   }\n                            // write result of operation\n                            {\n                                ((volatile __local\n                                  double *) red_arr_mem_234686)[sext_i32_i64(local_tid_234682)] =\n                                    x_234701;\n                            }\n                        }\n                        offset_234713 *= 2;\n                    }\n                    while (slt32(skip_waves_234714,\n                                 squot32(sext_i64_i32(segred_group_sizze_219557) +\n                                         wave_sizze_234684 - 1,\n                                         wave_sizze_234684))) {\n                        barrier(CLK_LOCAL_MEM_FENCE);\n                        offset_234713 = skip_waves_234714 * wave_sizze_234684;\n                        if (slt32(local_tid_234682 + offset_234713,\n                                  sext_i64_i32(segred_group_sizze_219557)) &&\n                            ((local_tid_234682 - squot32(local_tid_234682,\n                                                         wave_sizze_234684) *\n                              wave_sizze_234684) == 0 &&\n                             (squot32(local_tid_234682, wave_sizze_234684) &\n                              (2 * skip_waves_234714 - 1)) == 0)) {\n                            // read array element\n                            {\n                                x_234702 = ((__local\n                                             double *) red_arr_mem_234686)[sext_i32_i64(local_tid_234682 +\n                                                                           offset_234713)];\n                            }\n                            // apply reduction operation\n                            {\n                                double defunc_1_op_res_234703 = x_234701 +\n                                       x_234702;\n                                \n                                x_234701 = defunc_1_op_res_234703;\n                     ",
                   "       }\n                            // write result of operation\n                            {\n                                ((__local\n                                  double *) red_arr_mem_234686)[sext_i32_i64(local_tid_234682)] =\n                                    x_234701;\n                            }\n                        }\n                        skip_waves_234714 *= 2;\n                    }\n                    // and back to memory with the final result\n                    {\n                        if (local_tid_234682 == 0) {\n                            ((__global double *) mem_230606)[gtid_219561 *\n                                                             l_n_m_203643 +\n                                                             gtid_219562] =\n                                x_234701;\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_219557\n}\n__kernel void mainzisegred_large_220344(__global int *global_failure,\n                                        __local volatile\n                                        int64_t *sync_arr_mem_234834_backing_aligned_0,\n                                        __local volatile\n                                        int64_t *red_arr_mem_234832_backing_aligned_1,\n                                        __local volatile\n                                        int64_t *red_arr_mem_234830_backing_aligned_2,\n                                        __local volatile\n                                        int64_t *red_arr_mem_234828_backing_aligned_3,\n                                        int64_t n_203490, int64_t q_l_203495,\n                                        int64_t jump_t_203500,\n                                        int64_t partition_sizze_203577,\n                                        int64_t l_n_m_203643, int64_t i_203670,\n                    ",
                   "                    int64_t num_groups_220336,\n                                        int64_t ctx_param_ext_229488,\n                                        int64_t ctx_param_ext_229489,\n                                        int64_t ctx_param_ext_229491,\n                                        int64_t groups_per_segment_234810,\n                                        int64_t elements_per_thread_234811,\n                                        int64_t virt_num_groups_234812,\n                                        int64_t threads_per_segment_234814,\n                                        __global unsigned char *ext_mem_229411,\n                                        __global unsigned char *ext_mem_229412,\n                                        __global\n                                        unsigned char *mem_param_229493,\n                                        __global unsigned char *mem_230676,\n                                        __global unsigned char *mem_230680,\n                                        __global unsigned char *mem_230684,\n                                        __global\n                                        unsigned char *segred_tmp_mem_234815,\n                                        __global\n                                        unsigned char *segred_tmp_mem_234817,\n                                        __global\n                                        unsigned char *segred_tmp_mem_234819,\n                                        __global\n                                        unsigned char *mainzicounter_mem_234821)\n{\n    #define segred_group_sizze_220335 (mainzisegred_group_sizze_220012)\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_234834_backing_3 =\n                                   (__local volatile\n                                    unsigned char *) sync_arr_mem_234834_backing_aligned_0;\n    __local volatile unsigned ch",
                   "ar *restrict red_arr_mem_234832_backing_2 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_234832_backing_aligned_1;\n    __local volatile unsigned char *restrict red_arr_mem_234830_backing_1 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_234830_backing_aligned_2;\n    __local volatile unsigned char *restrict red_arr_mem_234828_backing_0 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_234828_backing_aligned_3;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_234823;\n    int32_t local_tid_234824;\n    int64_t group_sizze_234827;\n    int32_t wave_sizze_234826;\n    int32_t group_tid_234825;\n    \n    global_tid_234823 = get_global_id(0);\n    local_tid_234824 = get_local_id(0);\n    group_sizze_234827 = get_local_size(0);\n    wave_sizze_234826 = LOCKSTEP_WIDTH;\n    group_tid_234825 = get_group_id(0);\n    \n    int32_t phys_tid_220344 = global_tid_234823;\n    __local unsigned char *red_arr_mem_234828;\n    \n    red_arr_mem_234828 = (__local unsigned char *) red_arr_mem_234828_backing_0;\n    \n    __local unsigned char *red_arr_mem_234830;\n    \n    red_arr_mem_234830 = (__local unsigned char *) red_arr_mem_234830_backing_1;\n    \n    __local unsigned char *red_arr_mem_234832;\n    \n    red_arr_mem_234832 = (__local unsigned char *) red_arr_mem_234832_backing_2;\n    \n    __local unsigned char *sync_arr_mem_234834;\n    \n    sync_arr_mem_234834 = (__local\n                           unsigned char *) sync_arr_mem_234834_backing_3;\n    \n    int32_t phys_group_id_234836;\n    \n    phys_group_id_234836 = get_group_id(0);\n    for (int32_t i_234837 = 0; i_234837 <\n         sdiv_up32(sext_i64_i32(virt_num_groups_234812) - phys_group_id_234836,\n                   sext_i64_i32(num_groups_220336)); i_234837++) {\n        int32_t virt_group_id_234838 = phys",
                   "_group_id_234836 + i_234837 *\n                sext_i64_i32(num_groups_220336);\n        int32_t flat_segment_id_234839 = squot32(virt_group_id_234838,\n                                                 sext_i64_i32(groups_per_segment_234810));\n        int64_t global_tid_234840 = srem64(sext_i32_i64(virt_group_id_234838) *\n                                           segred_group_sizze_220335 +\n                                           sext_i32_i64(local_tid_234824),\n                                           segred_group_sizze_220335 *\n                                           groups_per_segment_234810);\n        int64_t slice_234841 = l_n_m_203643;\n        int64_t slice_234842 = partition_sizze_203577 * slice_234841;\n        int64_t gtid_220341 = squot64(sext_i32_i64(flat_segment_id_234839),\n                                      slice_234841);\n        int64_t remnant_234843 = sext_i32_i64(flat_segment_id_234839) -\n                gtid_220341 * slice_234841;\n        int64_t gtid_220342 = remnant_234843;\n        int64_t remnant_234844 = remnant_234843 - gtid_220342;\n        int64_t gtid_220343;\n        double x_acc_234845;\n        double x_acc_234846;\n        double x_acc_234847;\n        int64_t chunk_sizze_234848 = smin64(elements_per_thread_234811,\n                                            sdiv_up64(q_l_203495 -\n                                                      global_tid_234840,\n                                                      threads_per_segment_234814));\n        double x_220345;\n        double x_220346;\n        double x_220347;\n        double x_220348;\n        double x_220349;\n        double x_220350;\n        \n        // neutral-initialise the accumulators\n        {\n            x_acc_234845 = 0.0;\n            x_acc_234846 = 0.0;\n            x_acc_234847 = 0.0;\n        }\n        for (int64_t i_234858 = 0; i_234858 < chunk_sizze_234848; i_234858++) {\n            gtid_220343 = global_tid_234840 + threads_per_segment_234814 *\n                i_234858;\n       ",
                   "     // apply map function\n            {\n                int64_t x_220358;\n                \n                x_220358 = ((__global int64_t *) ext_mem_229412)[gtid_220341 *\n                                                                 l_n_m_203643 +\n                                                                 gtid_220342];\n                \n                double x_220359;\n                \n                x_220359 = ((__global double *) ext_mem_229411)[gtid_220341 *\n                                                                l_n_m_203643 +\n                                                                gtid_220342];\n                \n                int64_t binop_y_228704 = mul64(jump_t_203500, gtid_220342);\n                int64_t binop_y_228705 = smin64(i_203670, binop_y_228704);\n                int64_t index_primexp_228706 = add64((int64_t) 1,\n                                                     binop_y_228705);\n                bool cond_220362 = sle64(n_203490, gtid_220343);\n                int64_t defunc_0_f_res_220363;\n                \n                if (cond_220362) {\n                    defunc_0_f_res_220363 = (int64_t) 0;\n                } else {\n                    int64_t i_220364 = add64(gtid_220343, x_220358);\n                    int64_t defunc_1_add_res_220365 = add64((int64_t) 1,\n                                                            i_220364);\n                    \n                    defunc_0_f_res_220363 = defunc_1_add_res_220365;\n                }\n                \n                double defunc_0_f_res_220366;\n                \n                if (cond_220362) {\n                    defunc_0_f_res_220366 = 0.0;\n                } else {\n                    int64_t i_220367 = add64(gtid_220343, x_220358);\n                    double defunc_0_add_arg_220368;\n                    \n                    defunc_0_add_arg_220368 = ((__global\n                                                double *) mem_param_229493)[ctx_param_ext_229488 +\n          ",
                   "                                                                  (gtid_220341 *\n                                                                             ctx_param_ext_229489 +\n                                                                             i_220367 *\n                                                                             ctx_param_ext_229491)];\n                    defunc_0_f_res_220366 = defunc_0_add_arg_220368;\n                }\n                \n                int64_t binop_p_220369 = sub64(defunc_0_f_res_220363,\n                                               index_primexp_228706);\n                double defunc_0_f_res_220370 = sitofp_i64_f64(binop_p_220369);\n                double abs_res_220371 = fabs(defunc_0_f_res_220370);\n                double tmp1_220372 = abs_res_220371 / x_220359;\n                double x_220373 = tmp1_220372 * tmp1_220372;\n                double y_220374 = tmp1_220372 * x_220373;\n                double tmp2_220375 = 1.0 - y_220374;\n                double x_220376 = tmp2_220375 * tmp2_220375;\n                double tmp3_220377 = tmp2_220375 * x_220376;\n                double w_j_220378 = defunc_0_f_res_220366 * tmp3_220377;\n                double xw_j_220379 = defunc_0_f_res_220370 * w_j_220378;\n                double x2w_j_220380 = defunc_0_f_res_220370 * xw_j_220379;\n                \n                // save map-out results\n                { }\n                // load accumulator\n                {\n                    x_220345 = x_acc_234845;\n                    x_220346 = x_acc_234846;\n                    x_220347 = x_acc_234847;\n                }\n                // load new values\n                {\n                    x_220348 = w_j_220378;\n                    x_220349 = xw_j_220379;\n                    x_220350 = x2w_j_220380;\n                }\n                // apply reduction operator\n                {\n                    double defunc_1_op_res_220351 = x_220345 + x_220348;\n                    double defunc_1_o",
                   "p_res_220352 = x_220346 + x_220349;\n                    double defunc_1_op_res_220353 = x_220347 + x_220350;\n                    \n                    // store in accumulator\n                    {\n                        x_acc_234845 = defunc_1_op_res_220351;\n                        x_acc_234846 = defunc_1_op_res_220352;\n                        x_acc_234847 = defunc_1_op_res_220353;\n                    }\n                }\n            }\n        }\n        // to reduce current chunk, first store our result in memory\n        {\n            x_220345 = x_acc_234845;\n            x_220346 = x_acc_234846;\n            x_220347 = x_acc_234847;\n            ((__local\n              double *) red_arr_mem_234828)[sext_i32_i64(local_tid_234824)] =\n                x_220345;\n            ((__local\n              double *) red_arr_mem_234830)[sext_i32_i64(local_tid_234824)] =\n                x_220346;\n            ((__local\n              double *) red_arr_mem_234832)[sext_i32_i64(local_tid_234824)] =\n                x_220347;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        \n        int32_t offset_234859;\n        int32_t skip_waves_234860 = 1;\n        double x_234849;\n        double x_234850;\n        double x_234851;\n        double x_234852;\n        double x_234853;\n        double x_234854;\n        \n        offset_234859 = 0;\n        // participating threads read initial accumulator\n        {\n            if (slt32(local_tid_234824,\n                      sext_i64_i32(segred_group_sizze_220335))) {\n                x_234849 = ((__local\n                             double *) red_arr_mem_234828)[sext_i32_i64(local_tid_234824 +\n                                                           offset_234859)];\n                x_234850 = ((__local\n                             double *) red_arr_mem_234830)[sext_i32_i64(local_tid_234824 +\n                                                           offset_234859)];\n                x_234851 = ((__local\n                             double *) red_arr_mem_",
                   "234832)[sext_i32_i64(local_tid_234824 +\n                                                           offset_234859)];\n            }\n        }\n        offset_234859 = 1;\n        while (slt32(offset_234859, wave_sizze_234826)) {\n            if (slt32(local_tid_234824 + offset_234859,\n                      sext_i64_i32(segred_group_sizze_220335)) &&\n                ((local_tid_234824 - squot32(local_tid_234824,\n                                             wave_sizze_234826) *\n                  wave_sizze_234826) & (2 * offset_234859 - 1)) == 0) {\n                // read array element\n                {\n                    x_234852 = ((volatile __local\n                                 double *) red_arr_mem_234828)[sext_i32_i64(local_tid_234824 +\n                                                               offset_234859)];\n                    x_234853 = ((volatile __local\n                                 double *) red_arr_mem_234830)[sext_i32_i64(local_tid_234824 +\n                                                               offset_234859)];\n                    x_234854 = ((volatile __local\n                                 double *) red_arr_mem_234832)[sext_i32_i64(local_tid_234824 +\n                                                               offset_234859)];\n                }\n                // apply reduction operation\n                {\n                    double defunc_1_op_res_234855 = x_234849 + x_234852;\n                    double defunc_1_op_res_234856 = x_234850 + x_234853;\n                    double defunc_1_op_res_234857 = x_234851 + x_234854;\n                    \n                    x_234849 = defunc_1_op_res_234855;\n                    x_234850 = defunc_1_op_res_234856;\n                    x_234851 = defunc_1_op_res_234857;\n                }\n                // write result of operation\n                {\n                    ((volatile __local\n                      double *) red_arr_mem_234828)[sext_i32_i64(local_tid_234824)] =\n                        x_234",
                   "849;\n                    ((volatile __local\n                      double *) red_arr_mem_234830)[sext_i32_i64(local_tid_234824)] =\n                        x_234850;\n                    ((volatile __local\n                      double *) red_arr_mem_234832)[sext_i32_i64(local_tid_234824)] =\n                        x_234851;\n                }\n            }\n            offset_234859 *= 2;\n        }\n        while (slt32(skip_waves_234860,\n                     squot32(sext_i64_i32(segred_group_sizze_220335) +\n                             wave_sizze_234826 - 1, wave_sizze_234826))) {\n            barrier(CLK_LOCAL_MEM_FENCE);\n            offset_234859 = skip_waves_234860 * wave_sizze_234826;\n            if (slt32(local_tid_234824 + offset_234859,\n                      sext_i64_i32(segred_group_sizze_220335)) &&\n                ((local_tid_234824 - squot32(local_tid_234824,\n                                             wave_sizze_234826) *\n                  wave_sizze_234826) == 0 && (squot32(local_tid_234824,\n                                                      wave_sizze_234826) & (2 *\n                                                                            skip_waves_234860 -\n                                                                            1)) ==\n                 0)) {\n                // read array element\n                {\n                    x_234852 = ((__local\n                                 double *) red_arr_mem_234828)[sext_i32_i64(local_tid_234824 +\n                                                               offset_234859)];\n                    x_234853 = ((__local\n                                 double *) red_arr_mem_234830)[sext_i32_i64(local_tid_234824 +\n                                                               offset_234859)];\n                    x_234854 = ((__local\n                                 double *) red_arr_mem_234832)[sext_i32_i64(local_tid_234824 +\n                                                               offset_234859)];",
                   "\n                }\n                // apply reduction operation\n                {\n                    double defunc_1_op_res_234855 = x_234849 + x_234852;\n                    double defunc_1_op_res_234856 = x_234850 + x_234853;\n                    double defunc_1_op_res_234857 = x_234851 + x_234854;\n                    \n                    x_234849 = defunc_1_op_res_234855;\n                    x_234850 = defunc_1_op_res_234856;\n                    x_234851 = defunc_1_op_res_234857;\n                }\n                // write result of operation\n                {\n                    ((__local\n                      double *) red_arr_mem_234828)[sext_i32_i64(local_tid_234824)] =\n                        x_234849;\n                    ((__local\n                      double *) red_arr_mem_234830)[sext_i32_i64(local_tid_234824)] =\n                        x_234850;\n                    ((__local\n                      double *) red_arr_mem_234832)[sext_i32_i64(local_tid_234824)] =\n                        x_234851;\n                }\n            }\n            skip_waves_234860 *= 2;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        // first thread saves the result in accumulator\n        {\n            if (sext_i32_i64(local_tid_234824) == (int64_t) 0) {\n                x_acc_234845 = x_234849;\n                x_acc_234846 = x_234850;\n                x_acc_234847 = x_234851;\n            }\n        }\n        if (groups_per_segment_234810 == (int64_t) 1) {\n            // first thread in group saves final result to memory\n            {\n                if (local_tid_234824 == 0) {\n                    ((__global double *) mem_230676)[gtid_220341 *\n                                                     l_n_m_203643 +\n                                                     gtid_220342] =\n                        x_acc_234845;\n                    ((__global double *) mem_230680)[gtid_220341 *\n                                                     l_n_m_203643 +\n                               ",
                   "                      gtid_220342] =\n                        x_acc_234846;\n                    ((__global double *) mem_230684)[gtid_220341 *\n                                                     l_n_m_203643 +\n                                                     gtid_220342] =\n                        x_acc_234847;\n                }\n            }\n        } else {\n            int32_t old_counter_234861;\n            \n            // first thread in group saves group result to global memory\n            {\n                if (local_tid_234824 == 0) {\n                    ((__global\n                      double *) segred_tmp_mem_234815)[sext_i32_i64(virt_group_id_234838)] =\n                        x_acc_234845;\n                    ((__global\n                      double *) segred_tmp_mem_234817)[sext_i32_i64(virt_group_id_234838)] =\n                        x_acc_234846;\n                    ((__global\n                      double *) segred_tmp_mem_234819)[sext_i32_i64(virt_group_id_234838)] =\n                        x_acc_234847;\n                    mem_fence_global();\n                    old_counter_234861 =\n                        atomic_add_i32_global(&((volatile __global\n                                                 int *) mainzicounter_mem_234821)[sext_i32_i64(srem32(flat_segment_id_234839,\n                                                                                                      10240))],\n                                              (int) 1);\n                    ((__local bool *) sync_arr_mem_234834)[(int64_t) 0] =\n                        old_counter_234861 == groups_per_segment_234810 -\n                        (int64_t) 1;\n                }\n            }\n            barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n            \n            bool is_last_group_234862;\n            \n            is_last_group_234862 = ((__local\n                                     bool *) sync_arr_mem_234834)[(int64_t) 0];\n            if (is_last_group_234862) {\n          ",
                   "      if (local_tid_234824 == 0) {\n                    old_counter_234861 =\n                        atomic_add_i32_global(&((volatile __global\n                                                 int *) mainzicounter_mem_234821)[sext_i32_i64(srem32(flat_segment_id_234839,\n                                                                                                      10240))],\n                                              (int) ((int64_t) 0 -\n                                                     groups_per_segment_234810));\n                }\n                // read in the per-group-results\n                {\n                    int64_t read_per_thread_234863 =\n                            sdiv_up64(groups_per_segment_234810,\n                                      segred_group_sizze_220335);\n                    \n                    x_220345 = 0.0;\n                    x_220346 = 0.0;\n                    x_220347 = 0.0;\n                    for (int64_t i_234864 = 0; i_234864 <\n                         read_per_thread_234863; i_234864++) {\n                        int64_t group_res_id_234865 =\n                                sext_i32_i64(local_tid_234824) *\n                                read_per_thread_234863 + i_234864;\n                        int64_t index_of_group_res_234866 =\n                                sext_i32_i64(flat_segment_id_234839) *\n                                groups_per_segment_234810 + group_res_id_234865;\n                        \n                        if (slt64(group_res_id_234865,\n                                  groups_per_segment_234810)) {\n                            x_220348 = ((__global\n                                         double *) segred_tmp_mem_234815)[index_of_group_res_234866];\n                            x_220349 = ((__global\n                                         double *) segred_tmp_mem_234817)[index_of_group_res_234866];\n                            x_220350 = ((__global\n                                         double *) segr",
                   "ed_tmp_mem_234819)[index_of_group_res_234866];\n                            \n                            double defunc_1_op_res_220351 = x_220345 + x_220348;\n                            double defunc_1_op_res_220352 = x_220346 + x_220349;\n                            double defunc_1_op_res_220353 = x_220347 + x_220350;\n                            \n                            x_220345 = defunc_1_op_res_220351;\n                            x_220346 = defunc_1_op_res_220352;\n                            x_220347 = defunc_1_op_res_220353;\n                        }\n                    }\n                }\n                ((__local\n                  double *) red_arr_mem_234828)[sext_i32_i64(local_tid_234824)] =\n                    x_220345;\n                ((__local\n                  double *) red_arr_mem_234830)[sext_i32_i64(local_tid_234824)] =\n                    x_220346;\n                ((__local\n                  double *) red_arr_mem_234832)[sext_i32_i64(local_tid_234824)] =\n                    x_220347;\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // reduce the per-group results\n                {\n                    int32_t offset_234867;\n                    int32_t skip_waves_234868 = 1;\n                    double x_234849;\n                    double x_234850;\n                    double x_234851;\n                    double x_234852;\n                    double x_234853;\n                    double x_234854;\n                    \n                    offset_234867 = 0;\n                    // participating threads read initial accumulator\n                    {\n                        if (slt32(local_tid_234824,\n                                  sext_i64_i32(segred_group_sizze_220335))) {\n                            x_234849 = ((__local\n                                         double *) red_arr_mem_234828)[sext_i32_i64(local_tid_234824 +\n                                                                       offset_234867)];\n                            x_234",
                   "850 = ((__local\n                                         double *) red_arr_mem_234830)[sext_i32_i64(local_tid_234824 +\n                                                                       offset_234867)];\n                            x_234851 = ((__local\n                                         double *) red_arr_mem_234832)[sext_i32_i64(local_tid_234824 +\n                                                                       offset_234867)];\n                        }\n                    }\n                    offset_234867 = 1;\n                    while (slt32(offset_234867, wave_sizze_234826)) {\n                        if (slt32(local_tid_234824 + offset_234867,\n                                  sext_i64_i32(segred_group_sizze_220335)) &&\n                            ((local_tid_234824 - squot32(local_tid_234824,\n                                                         wave_sizze_234826) *\n                              wave_sizze_234826) & (2 * offset_234867 - 1)) ==\n                            0) {\n                            // read array element\n                            {\n                                x_234852 = ((volatile __local\n                                             double *) red_arr_mem_234828)[sext_i32_i64(local_tid_234824 +\n                                                                           offset_234867)];\n                                x_234853 = ((volatile __local\n                                             double *) red_arr_mem_234830)[sext_i32_i64(local_tid_234824 +\n                                                                           offset_234867)];\n                                x_234854 = ((volatile __local\n                                             double *) red_arr_mem_234832)[sext_i32_i64(local_tid_234824 +\n                                                                           offset_234867)];\n                            }\n                            // apply reduction operation\n                            {\n     ",
                   "                           double defunc_1_op_res_234855 = x_234849 +\n                                       x_234852;\n                                double defunc_1_op_res_234856 = x_234850 +\n                                       x_234853;\n                                double defunc_1_op_res_234857 = x_234851 +\n                                       x_234854;\n                                \n                                x_234849 = defunc_1_op_res_234855;\n                                x_234850 = defunc_1_op_res_234856;\n                                x_234851 = defunc_1_op_res_234857;\n                            }\n                            // write result of operation\n                            {\n                                ((volatile __local\n                                  double *) red_arr_mem_234828)[sext_i32_i64(local_tid_234824)] =\n                                    x_234849;\n                                ((volatile __local\n                                  double *) red_arr_mem_234830)[sext_i32_i64(local_tid_234824)] =\n                                    x_234850;\n                                ((volatile __local\n                                  double *) red_arr_mem_234832)[sext_i32_i64(local_tid_234824)] =\n                                    x_234851;\n                            }\n                        }\n                        offset_234867 *= 2;\n                    }\n                    while (slt32(skip_waves_234868,\n                                 squot32(sext_i64_i32(segred_group_sizze_220335) +\n                                         wave_sizze_234826 - 1,\n                                         wave_sizze_234826))) {\n                        barrier(CLK_LOCAL_MEM_FENCE);\n                        offset_234867 = skip_waves_234868 * wave_sizze_234826;\n                        if (slt32(local_tid_234824 + offset_234867,\n                                  sext_i64_i32(segred_group_sizze_220335)) &&\n                            ((loc",
                   "al_tid_234824 - squot32(local_tid_234824,\n                                                         wave_sizze_234826) *\n                              wave_sizze_234826) == 0 &&\n                             (squot32(local_tid_234824, wave_sizze_234826) &\n                              (2 * skip_waves_234868 - 1)) == 0)) {\n                            // read array element\n                            {\n                                x_234852 = ((__local\n                                             double *) red_arr_mem_234828)[sext_i32_i64(local_tid_234824 +\n                                                                           offset_234867)];\n                                x_234853 = ((__local\n                                             double *) red_arr_mem_234830)[sext_i32_i64(local_tid_234824 +\n                                                                           offset_234867)];\n                                x_234854 = ((__local\n                                             double *) red_arr_mem_234832)[sext_i32_i64(local_tid_234824 +\n                                                                           offset_234867)];\n                            }\n                            // apply reduction operation\n                            {\n                                double defunc_1_op_res_234855 = x_234849 +\n                                       x_234852;\n                                double defunc_1_op_res_234856 = x_234850 +\n                                       x_234853;\n                                double defunc_1_op_res_234857 = x_234851 +\n                                       x_234854;\n                                \n                                x_234849 = defunc_1_op_res_234855;\n                                x_234850 = defunc_1_op_res_234856;\n                                x_234851 = defunc_1_op_res_234857;\n                            }\n                            // write result of operation\n                            {\n  ",
                   "                              ((__local\n                                  double *) red_arr_mem_234828)[sext_i32_i64(local_tid_234824)] =\n                                    x_234849;\n                                ((__local\n                                  double *) red_arr_mem_234830)[sext_i32_i64(local_tid_234824)] =\n                                    x_234850;\n                                ((__local\n                                  double *) red_arr_mem_234832)[sext_i32_i64(local_tid_234824)] =\n                                    x_234851;\n                            }\n                        }\n                        skip_waves_234868 *= 2;\n                    }\n                    // and back to memory with the final result\n                    {\n                        if (local_tid_234824 == 0) {\n                            ((__global double *) mem_230676)[gtid_220341 *\n                                                             l_n_m_203643 +\n                                                             gtid_220342] =\n                                x_234849;\n                            ((__global double *) mem_230680)[gtid_220341 *\n                                                             l_n_m_203643 +\n                                                             gtid_220342] =\n                                x_234850;\n                            ((__global double *) mem_230684)[gtid_220341 *\n                                                             l_n_m_203643 +\n                                                             gtid_220342] =\n                                x_234851;\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_220335\n}\n__kernel void mainzisegred_large_220413(__global int *global_failure,\n                                        __local volatile\n                     ",
                   "                   int64_t *sync_arr_mem_234934_backing_aligned_0,\n                                        __local volatile\n                                        int64_t *red_arr_mem_234932_backing_aligned_1,\n                                        __local volatile\n                                        int64_t *red_arr_mem_234930_backing_aligned_2,\n                                        int64_t n_203490, int64_t q_l_203495,\n                                        int64_t jump_t_203500,\n                                        int64_t partition_sizze_203577,\n                                        int64_t l_n_m_203643, int64_t i_203670,\n                                        int64_t num_groups_220406,\n                                        int64_t ctx_param_ext_229488,\n                                        int64_t ctx_param_ext_229489,\n                                        int64_t ctx_param_ext_229491,\n                                        int64_t groups_per_segment_234914,\n                                        int64_t elements_per_thread_234915,\n                                        int64_t virt_num_groups_234916,\n                                        int64_t threads_per_segment_234918,\n                                        __global unsigned char *ext_mem_229411,\n                                        __global unsigned char *ext_mem_229412,\n                                        __global\n                                        unsigned char *mem_param_229493,\n                                        __global unsigned char *mem_230551,\n                                        __global unsigned char *mem_230689,\n                                        __global unsigned char *mem_230693,\n                                        __global unsigned char *mem_230697,\n                                        __global unsigned char *mem_230702,\n                                        __global unsigned char *mem_230706,\n                                      ",
                   "  __global\n                                        unsigned char *segred_tmp_mem_234919,\n                                        __global\n                                        unsigned char *segred_tmp_mem_234921,\n                                        __global\n                                        unsigned char *mainzicounter_mem_234923)\n{\n    #define segred_group_sizze_220405 (mainzisegred_group_sizze_219918)\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_234934_backing_2 =\n                                   (__local volatile\n                                    unsigned char *) sync_arr_mem_234934_backing_aligned_0;\n    __local volatile unsigned char *restrict red_arr_mem_234932_backing_1 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_234932_backing_aligned_1;\n    __local volatile unsigned char *restrict red_arr_mem_234930_backing_0 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_234930_backing_aligned_2;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_234925;\n    int32_t local_tid_234926;\n    int64_t group_sizze_234929;\n    int32_t wave_sizze_234928;\n    int32_t group_tid_234927;\n    \n    global_tid_234925 = get_global_id(0);\n    local_tid_234926 = get_local_id(0);\n    group_sizze_234929 = get_local_size(0);\n    wave_sizze_234928 = LOCKSTEP_WIDTH;\n    group_tid_234927 = get_group_id(0);\n    \n    int32_t phys_tid_220413 = global_tid_234925;\n    __local unsigned char *red_arr_mem_234930;\n    \n    red_arr_mem_234930 = (__local unsigned char *) red_arr_mem_234930_backing_0;\n    \n    __local unsigned char *red_arr_mem_234932;\n    \n    red_arr_mem_234932 = (__local unsigned char *) red_arr_mem_234932_backing_1;\n    \n    __local unsigned char *sync_arr_mem_234934;\n    \n    sync_arr_mem_23",
                   "4934 = (__local\n                           unsigned char *) sync_arr_mem_234934_backing_2;\n    \n    int32_t phys_group_id_234936;\n    \n    phys_group_id_234936 = get_group_id(0);\n    for (int32_t i_234937 = 0; i_234937 <\n         sdiv_up32(sext_i64_i32(virt_num_groups_234916) - phys_group_id_234936,\n                   sext_i64_i32(num_groups_220406)); i_234937++) {\n        int32_t virt_group_id_234938 = phys_group_id_234936 + i_234937 *\n                sext_i64_i32(num_groups_220406);\n        int32_t flat_segment_id_234939 = squot32(virt_group_id_234938,\n                                                 sext_i64_i32(groups_per_segment_234914));\n        int64_t global_tid_234940 = srem64(sext_i32_i64(virt_group_id_234938) *\n                                           segred_group_sizze_220405 +\n                                           sext_i32_i64(local_tid_234926),\n                                           segred_group_sizze_220405 *\n                                           groups_per_segment_234914);\n        int64_t slice_234941 = l_n_m_203643;\n        int64_t slice_234942 = partition_sizze_203577 * slice_234941;\n        int64_t gtid_220410 = squot64(sext_i32_i64(flat_segment_id_234939),\n                                      slice_234941);\n        int64_t remnant_234943 = sext_i32_i64(flat_segment_id_234939) -\n                gtid_220410 * slice_234941;\n        int64_t gtid_220411 = remnant_234943;\n        int64_t remnant_234944 = remnant_234943 - gtid_220411;\n        int64_t gtid_220412;\n        double x_acc_234945;\n        double x_acc_234946;\n        int64_t chunk_sizze_234947 = smin64(elements_per_thread_234915,\n                                            sdiv_up64(q_l_203495 -\n                                                      global_tid_234940,\n                                                      threads_per_segment_234918));\n        double x_220414;\n        double x_220415;\n        double x_220416;\n        double x_220417;\n        \n        // neutral-",
                   "initialise the accumulators\n        {\n            x_acc_234945 = 0.0;\n            x_acc_234946 = 0.0;\n        }\n        for (int64_t i_234954 = 0; i_234954 < chunk_sizze_234947; i_234954++) {\n            gtid_220412 = global_tid_234940 + threads_per_segment_234918 *\n                i_234954;\n            // apply map function\n            {\n                int64_t x_220428;\n                \n                x_220428 = ((__global int64_t *) ext_mem_229412)[gtid_220410 *\n                                                                 l_n_m_203643 +\n                                                                 gtid_220411];\n                \n                double x_220429;\n                \n                x_220429 = ((__global double *) ext_mem_229411)[gtid_220410 *\n                                                                l_n_m_203643 +\n                                                                gtid_220411];\n                \n                int64_t binop_y_228699 = mul64(jump_t_203500, gtid_220411);\n                int64_t binop_y_228700 = smin64(i_203670, binop_y_228699);\n                int64_t index_primexp_228701 = add64((int64_t) 1,\n                                                     binop_y_228700);\n                double a11_220431;\n                \n                a11_220431 = ((__global double *) mem_230689)[gtid_220410 *\n                                                              l_n_m_203643 +\n                                                              gtid_220411];\n                \n                double b11_220432;\n                \n                b11_220432 = ((__global double *) mem_230693)[gtid_220410 *\n                                                              l_n_m_203643 +\n                                                              gtid_220411];\n                \n                double c11_220433;\n                \n                c11_220433 = ((__global double *) mem_230697)[gtid_220410 *\n                                        ",
                   "                      l_n_m_203643 +\n                                                              gtid_220411];\n                \n                bool cond_220435 = sle64(n_203490, gtid_220412);\n                int64_t defunc_0_f_res_220436;\n                \n                if (cond_220435) {\n                    defunc_0_f_res_220436 = (int64_t) 0;\n                } else {\n                    int64_t i_220437 = add64(gtid_220412, x_220428);\n                    int64_t defunc_1_add_res_220438 = add64((int64_t) 1,\n                                                            i_220437);\n                    \n                    defunc_0_f_res_220436 = defunc_1_add_res_220438;\n                }\n                \n                double defunc_0_f_res_220439;\n                \n                if (cond_220435) {\n                    defunc_0_f_res_220439 = 0.0;\n                } else {\n                    int64_t i_220440 = add64(gtid_220412, x_220428);\n                    double defunc_0_add_arg_220441;\n                    \n                    defunc_0_add_arg_220441 = ((__global\n                                                double *) mem_param_229493)[ctx_param_ext_229488 +\n                                                                            (gtid_220410 *\n                                                                             ctx_param_ext_229489 +\n                                                                             i_220440 *\n                                                                             ctx_param_ext_229491)];\n                    defunc_0_f_res_220439 = defunc_0_add_arg_220441;\n                }\n                \n                int64_t binop_p_220442 = sub64(defunc_0_f_res_220436,\n                                               index_primexp_228701);\n                double defunc_0_f_res_220443 = sitofp_i64_f64(binop_p_220442);\n                double abs_res_220444 = fabs(defunc_0_f_res_220443);\n                double tmp1_220445 = abs_res",
                   "_220444 / x_220429;\n                double x_220446 = tmp1_220445 * tmp1_220445;\n                double y_220447 = tmp1_220445 * x_220446;\n                double tmp2_220448 = 1.0 - y_220447;\n                double x_220449 = tmp2_220448 * tmp2_220448;\n                double tmp3_220450 = tmp2_220448 * x_220449;\n                double tmp4_220451 = defunc_0_f_res_220439 * tmp3_220450;\n                double defunc_1_f_res_220452 = defunc_0_f_res_220443 *\n                       tmp4_220451;\n                double defunc_0_f_res_220453;\n                \n                if (cond_220435) {\n                    defunc_0_f_res_220453 = 0.0;\n                } else {\n                    int64_t i_220454 = add64(gtid_220412, x_220428);\n                    double defunc_0_add_arg_220455;\n                    \n                    defunc_0_add_arg_220455 = ((__global\n                                                double *) mem_230551)[gtid_220410 *\n                                                                      n_203490 +\n                                                                      i_220454];\n                    defunc_0_f_res_220453 = defunc_0_add_arg_220455;\n                }\n                \n                double x_220456 = a11_220431 * tmp4_220451;\n                double y_220457 = b11_220432 * defunc_1_f_res_220452;\n                double x_220458 = x_220456 + y_220457;\n                double defunc_9_fit_fun_res_220459 = defunc_0_f_res_220453 *\n                       x_220458;\n                double x_220460 = b11_220432 * tmp4_220451;\n                double y_220461 = c11_220433 * defunc_1_f_res_220452;\n                double x_220462 = x_220460 + y_220461;\n                double defunc_9_slope_fun_res_220463 = defunc_0_f_res_220453 *\n                       x_220462;\n                \n                // save map-out results\n                { }\n                // load accumulator\n                {\n                    x_220414 = x_acc_234945;\n                ",
                   "    x_220415 = x_acc_234946;\n                }\n                // load new values\n                {\n                    x_220416 = defunc_9_fit_fun_res_220459;\n                    x_220417 = defunc_9_slope_fun_res_220463;\n                }\n                // apply reduction operator\n                {\n                    double defunc_1_op_res_220418 = x_220414 + x_220416;\n                    double defunc_1_op_res_220419 = x_220415 + x_220417;\n                    \n                    // store in accumulator\n                    {\n                        x_acc_234945 = defunc_1_op_res_220418;\n                        x_acc_234946 = defunc_1_op_res_220419;\n                    }\n                }\n            }\n        }\n        // to reduce current chunk, first store our result in memory\n        {\n            x_220414 = x_acc_234945;\n            x_220415 = x_acc_234946;\n            ((__local\n              double *) red_arr_mem_234930)[sext_i32_i64(local_tid_234926)] =\n                x_220414;\n            ((__local\n              double *) red_arr_mem_234932)[sext_i32_i64(local_tid_234926)] =\n                x_220415;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        \n        int32_t offset_234955;\n        int32_t skip_waves_234956 = 1;\n        double x_234948;\n        double x_234949;\n        double x_234950;\n        double x_234951;\n        \n        offset_234955 = 0;\n        // participating threads read initial accumulator\n        {\n            if (slt32(local_tid_234926,\n                      sext_i64_i32(segred_group_sizze_220405))) {\n                x_234948 = ((__local\n                             double *) red_arr_mem_234930)[sext_i32_i64(local_tid_234926 +\n                                                           offset_234955)];\n                x_234949 = ((__local\n                             double *) red_arr_mem_234932)[sext_i32_i64(local_tid_234926 +\n                                                           offset_234955)];\n            }\n        }\n ",
                   "       offset_234955 = 1;\n        while (slt32(offset_234955, wave_sizze_234928)) {\n            if (slt32(local_tid_234926 + offset_234955,\n                      sext_i64_i32(segred_group_sizze_220405)) &&\n                ((local_tid_234926 - squot32(local_tid_234926,\n                                             wave_sizze_234928) *\n                  wave_sizze_234928) & (2 * offset_234955 - 1)) == 0) {\n                // read array element\n                {\n                    x_234950 = ((volatile __local\n                                 double *) red_arr_mem_234930)[sext_i32_i64(local_tid_234926 +\n                                                               offset_234955)];\n                    x_234951 = ((volatile __local\n                                 double *) red_arr_mem_234932)[sext_i32_i64(local_tid_234926 +\n                                                               offset_234955)];\n                }\n                // apply reduction operation\n                {\n                    double defunc_1_op_res_234952 = x_234948 + x_234950;\n                    double defunc_1_op_res_234953 = x_234949 + x_234951;\n                    \n                    x_234948 = defunc_1_op_res_234952;\n                    x_234949 = defunc_1_op_res_234953;\n                }\n                // write result of operation\n                {\n                    ((volatile __local\n                      double *) red_arr_mem_234930)[sext_i32_i64(local_tid_234926)] =\n                        x_234948;\n                    ((volatile __local\n                      double *) red_arr_mem_234932)[sext_i32_i64(local_tid_234926)] =\n                        x_234949;\n                }\n            }\n            offset_234955 *= 2;\n        }\n        while (slt32(skip_waves_234956,\n                     squot32(sext_i64_i32(segred_group_sizze_220405) +\n                             wave_sizze_234928 - 1, wave_sizze_234928))) {\n            barrier(CLK_LOCAL_MEM_FENCE);\n            offset_234955 = ",
                   "skip_waves_234956 * wave_sizze_234928;\n            if (slt32(local_tid_234926 + offset_234955,\n                      sext_i64_i32(segred_group_sizze_220405)) &&\n                ((local_tid_234926 - squot32(local_tid_234926,\n                                             wave_sizze_234928) *\n                  wave_sizze_234928) == 0 && (squot32(local_tid_234926,\n                                                      wave_sizze_234928) & (2 *\n                                                                            skip_waves_234956 -\n                                                                            1)) ==\n                 0)) {\n                // read array element\n                {\n                    x_234950 = ((__local\n                                 double *) red_arr_mem_234930)[sext_i32_i64(local_tid_234926 +\n                                                               offset_234955)];\n                    x_234951 = ((__local\n                                 double *) red_arr_mem_234932)[sext_i32_i64(local_tid_234926 +\n                                                               offset_234955)];\n                }\n                // apply reduction operation\n                {\n                    double defunc_1_op_res_234952 = x_234948 + x_234950;\n                    double defunc_1_op_res_234953 = x_234949 + x_234951;\n                    \n                    x_234948 = defunc_1_op_res_234952;\n                    x_234949 = defunc_1_op_res_234953;\n                }\n                // write result of operation\n                {\n                    ((__local\n                      double *) red_arr_mem_234930)[sext_i32_i64(local_tid_234926)] =\n                        x_234948;\n                    ((__local\n                      double *) red_arr_mem_234932)[sext_i32_i64(local_tid_234926)] =\n                        x_234949;\n                }\n            }\n            skip_waves_234956 *= 2;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        // fi",
                   "rst thread saves the result in accumulator\n        {\n            if (sext_i32_i64(local_tid_234926) == (int64_t) 0) {\n                x_acc_234945 = x_234948;\n                x_acc_234946 = x_234949;\n            }\n        }\n        if (groups_per_segment_234914 == (int64_t) 1) {\n            // first thread in group saves final result to memory\n            {\n                if (local_tid_234926 == 0) {\n                    ((__global double *) mem_230702)[gtid_220410 *\n                                                     l_n_m_203643 +\n                                                     gtid_220411] =\n                        x_acc_234945;\n                    ((__global double *) mem_230706)[gtid_220410 *\n                                                     l_n_m_203643 +\n                                                     gtid_220411] =\n                        x_acc_234946;\n                }\n            }\n        } else {\n            int32_t old_counter_234957;\n            \n            // first thread in group saves group result to global memory\n            {\n                if (local_tid_234926 == 0) {\n                    ((__global\n                      double *) segred_tmp_mem_234919)[sext_i32_i64(virt_group_id_234938)] =\n                        x_acc_234945;\n                    ((__global\n                      double *) segred_tmp_mem_234921)[sext_i32_i64(virt_group_id_234938)] =\n                        x_acc_234946;\n                    mem_fence_global();\n                    old_counter_234957 =\n                        atomic_add_i32_global(&((volatile __global\n                                                 int *) mainzicounter_mem_234923)[sext_i32_i64(srem32(flat_segment_id_234939,\n                                                                                                      10240))],\n                                              (int) 1);\n                    ((__local bool *) sync_arr_mem_234934)[(int64_t) 0] =\n                        old_counter_234",
                   "957 == groups_per_segment_234914 -\n                        (int64_t) 1;\n                }\n            }\n            barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n            \n            bool is_last_group_234958;\n            \n            is_last_group_234958 = ((__local\n                                     bool *) sync_arr_mem_234934)[(int64_t) 0];\n            if (is_last_group_234958) {\n                if (local_tid_234926 == 0) {\n                    old_counter_234957 =\n                        atomic_add_i32_global(&((volatile __global\n                                                 int *) mainzicounter_mem_234923)[sext_i32_i64(srem32(flat_segment_id_234939,\n                                                                                                      10240))],\n                                              (int) ((int64_t) 0 -\n                                                     groups_per_segment_234914));\n                }\n                // read in the per-group-results\n                {\n                    int64_t read_per_thread_234959 =\n                            sdiv_up64(groups_per_segment_234914,\n                                      segred_group_sizze_220405);\n                    \n                    x_220414 = 0.0;\n                    x_220415 = 0.0;\n                    for (int64_t i_234960 = 0; i_234960 <\n                         read_per_thread_234959; i_234960++) {\n                        int64_t group_res_id_234961 =\n                                sext_i32_i64(local_tid_234926) *\n                                read_per_thread_234959 + i_234960;\n                        int64_t index_of_group_res_234962 =\n                                sext_i32_i64(flat_segment_id_234939) *\n                                groups_per_segment_234914 + group_res_id_234961;\n                        \n                        if (slt64(group_res_id_234961,\n                                  groups_per_segment_234914)) {\n                            x_220416",
                   " = ((__global\n                                         double *) segred_tmp_mem_234919)[index_of_group_res_234962];\n                            x_220417 = ((__global\n                                         double *) segred_tmp_mem_234921)[index_of_group_res_234962];\n                            \n                            double defunc_1_op_res_220418 = x_220414 + x_220416;\n                            double defunc_1_op_res_220419 = x_220415 + x_220417;\n                            \n                            x_220414 = defunc_1_op_res_220418;\n                            x_220415 = defunc_1_op_res_220419;\n                        }\n                    }\n                }\n                ((__local\n                  double *) red_arr_mem_234930)[sext_i32_i64(local_tid_234926)] =\n                    x_220414;\n                ((__local\n                  double *) red_arr_mem_234932)[sext_i32_i64(local_tid_234926)] =\n                    x_220415;\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // reduce the per-group results\n                {\n                    int32_t offset_234963;\n                    int32_t skip_waves_234964 = 1;\n                    double x_234948;\n                    double x_234949;\n                    double x_234950;\n                    double x_234951;\n                    \n                    offset_234963 = 0;\n                    // participating threads read initial accumulator\n                    {\n                        if (slt32(local_tid_234926,\n                                  sext_i64_i32(segred_group_sizze_220405))) {\n                            x_234948 = ((__local\n                                         double *) red_arr_mem_234930)[sext_i32_i64(local_tid_234926 +\n                                                                       offset_234963)];\n                            x_234949 = ((__local\n                                         double *) red_arr_mem_234932)[sext_i32_i64(local_tid_234926 +\n                ",
                   "                                                       offset_234963)];\n                        }\n                    }\n                    offset_234963 = 1;\n                    while (slt32(offset_234963, wave_sizze_234928)) {\n                        if (slt32(local_tid_234926 + offset_234963,\n                                  sext_i64_i32(segred_group_sizze_220405)) &&\n                            ((local_tid_234926 - squot32(local_tid_234926,\n                                                         wave_sizze_234928) *\n                              wave_sizze_234928) & (2 * offset_234963 - 1)) ==\n                            0) {\n                            // read array element\n                            {\n                                x_234950 = ((volatile __local\n                                             double *) red_arr_mem_234930)[sext_i32_i64(local_tid_234926 +\n                                                                           offset_234963)];\n                                x_234951 = ((volatile __local\n                                             double *) red_arr_mem_234932)[sext_i32_i64(local_tid_234926 +\n                                                                           offset_234963)];\n                            }\n                            // apply reduction operation\n                            {\n                                double defunc_1_op_res_234952 = x_234948 +\n                                       x_234950;\n                                double defunc_1_op_res_234953 = x_234949 +\n                                       x_234951;\n                                \n                                x_234948 = defunc_1_op_res_234952;\n                                x_234949 = defunc_1_op_res_234953;\n                            }\n                            // write result of operation\n                            {\n                                ((volatile __local\n                                  double *) red_arr_mem_23",
                   "4930)[sext_i32_i64(local_tid_234926)] =\n                                    x_234948;\n                                ((volatile __local\n                                  double *) red_arr_mem_234932)[sext_i32_i64(local_tid_234926)] =\n                                    x_234949;\n                            }\n                        }\n                        offset_234963 *= 2;\n                    }\n                    while (slt32(skip_waves_234964,\n                                 squot32(sext_i64_i32(segred_group_sizze_220405) +\n                                         wave_sizze_234928 - 1,\n                                         wave_sizze_234928))) {\n                        barrier(CLK_LOCAL_MEM_FENCE);\n                        offset_234963 = skip_waves_234964 * wave_sizze_234928;\n                        if (slt32(local_tid_234926 + offset_234963,\n                                  sext_i64_i32(segred_group_sizze_220405)) &&\n                            ((local_tid_234926 - squot32(local_tid_234926,\n                                                         wave_sizze_234928) *\n                              wave_sizze_234928) == 0 &&\n                             (squot32(local_tid_234926, wave_sizze_234928) &\n                              (2 * skip_waves_234964 - 1)) == 0)) {\n                            // read array element\n                            {\n                                x_234950 = ((__local\n                                             double *) red_arr_mem_234930)[sext_i32_i64(local_tid_234926 +\n                                                                           offset_234963)];\n                                x_234951 = ((__local\n                                             double *) red_arr_mem_234932)[sext_i32_i64(local_tid_234926 +\n                                                                           offset_234963)];\n                            }\n                            // apply reduction operation\n                            {",
                   "\n                                double defunc_1_op_res_234952 = x_234948 +\n                                       x_234950;\n                                double defunc_1_op_res_234953 = x_234949 +\n                                       x_234951;\n                                \n                                x_234948 = defunc_1_op_res_234952;\n                                x_234949 = defunc_1_op_res_234953;\n                            }\n                            // write result of operation\n                            {\n                                ((__local\n                                  double *) red_arr_mem_234930)[sext_i32_i64(local_tid_234926)] =\n                                    x_234948;\n                                ((__local\n                                  double *) red_arr_mem_234932)[sext_i32_i64(local_tid_234926)] =\n                                    x_234949;\n                            }\n                        }\n                        skip_waves_234964 *= 2;\n                    }\n                    // and back to memory with the final result\n                    {\n                        if (local_tid_234926 == 0) {\n                            ((__global double *) mem_230702)[gtid_220410 *\n                                                             l_n_m_203643 +\n                                                             gtid_220411] =\n                                x_234948;\n                            ((__global double *) mem_230706)[gtid_220410 *\n                                                             l_n_m_203643 +\n                                                             gtid_220411] =\n                                x_234949;\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_220405\n}\n__kernel void mainzisegred_large_221423(__global int *global_failure",
                   ",\n                                        __local volatile\n                                        int64_t *sync_arr_mem_235108_backing_aligned_0,\n                                        __local volatile\n                                        int64_t *red_arr_mem_235106_backing_aligned_1,\n                                        __local volatile\n                                        int64_t *red_arr_mem_235104_backing_aligned_2,\n                                        __local volatile\n                                        int64_t *red_arr_mem_235102_backing_aligned_3,\n                                        __local volatile\n                                        int64_t *red_arr_mem_235100_backing_aligned_4,\n                                        __local volatile\n                                        int64_t *red_arr_mem_235098_backing_aligned_5,\n                                        int64_t n_203490, int64_t q_l_203495,\n                                        int64_t jump_t_203500,\n                                        int64_t partition_sizze_203577,\n                                        int64_t l_n_m_203643, int64_t i_203670,\n                                        int64_t num_groups_221413,\n                                        int64_t ctx_param_ext_229488,\n                                        int64_t ctx_param_ext_229489,\n                                        int64_t ctx_param_ext_229491,\n                                        int64_t groups_per_segment_235076,\n                                        int64_t elements_per_thread_235077,\n                                        int64_t virt_num_groups_235078,\n                                        int64_t threads_per_segment_235080,\n                                        __global unsigned char *ext_mem_229411,\n                                        __global unsigned char *ext_mem_229412,\n                                        __global\n                                        unsigned char *",
                   "mem_param_229493,\n                                        __global unsigned char *mem_230783,\n                                        __global unsigned char *mem_230787,\n                                        __global unsigned char *mem_230791,\n                                        __global unsigned char *mem_230795,\n                                        __global unsigned char *mem_230799,\n                                        __global\n                                        unsigned char *segred_tmp_mem_235081,\n                                        __global\n                                        unsigned char *segred_tmp_mem_235083,\n                                        __global\n                                        unsigned char *segred_tmp_mem_235085,\n                                        __global\n                                        unsigned char *segred_tmp_mem_235087,\n                                        __global\n                                        unsigned char *segred_tmp_mem_235089,\n                                        __global\n                                        unsigned char *mainzicounter_mem_235091)\n{\n    #define segred_group_sizze_221412 (mainzisegred_group_sizze_221009)\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_235108_backing_5 =\n                                   (__local volatile\n                                    unsigned char *) sync_arr_mem_235108_backing_aligned_0;\n    __local volatile unsigned char *restrict red_arr_mem_235106_backing_4 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_235106_backing_aligned_1;\n    __local volatile unsigned char *restrict red_arr_mem_235104_backing_3 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_235104_backing_aligned_2;\n    __",
                   "local volatile unsigned char *restrict red_arr_mem_235102_backing_2 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_235102_backing_aligned_3;\n    __local volatile unsigned char *restrict red_arr_mem_235100_backing_1 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_235100_backing_aligned_4;\n    __local volatile unsigned char *restrict red_arr_mem_235098_backing_0 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_235098_backing_aligned_5;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_235093;\n    int32_t local_tid_235094;\n    int64_t group_sizze_235097;\n    int32_t wave_sizze_235096;\n    int32_t group_tid_235095;\n    \n    global_tid_235093 = get_global_id(0);\n    local_tid_235094 = get_local_id(0);\n    group_sizze_235097 = get_local_size(0);\n    wave_sizze_235096 = LOCKSTEP_WIDTH;\n    group_tid_235095 = get_group_id(0);\n    \n    int32_t phys_tid_221423 = global_tid_235093;\n    __local unsigned char *red_arr_mem_235098;\n    \n    red_arr_mem_235098 = (__local unsigned char *) red_arr_mem_235098_backing_0;\n    \n    __local unsigned char *red_arr_mem_235100;\n    \n    red_arr_mem_235100 = (__local unsigned char *) red_arr_mem_235100_backing_1;\n    \n    __local unsigned char *red_arr_mem_235102;\n    \n    red_arr_mem_235102 = (__local unsigned char *) red_arr_mem_235102_backing_2;\n    \n    __local unsigned char *red_arr_mem_235104;\n    \n    red_arr_mem_235104 = (__local unsigned char *) red_arr_mem_235104_backing_3;\n    \n    __local unsigned char *red_arr_mem_235106;\n    \n    red_arr_mem_235106 = (__local unsigned char *) red_arr_mem_235106_backing_4;\n    \n    __local unsigned char *sync_arr_mem_235108;\n    \n    sync_arr_mem_235108 = (__local\n                           unsigned char *) sync_arr_mem_235108_backing_5;\n    \n    int32_t p",
                   "hys_group_id_235110;\n    \n    phys_group_id_235110 = get_group_id(0);\n    for (int32_t i_235111 = 0; i_235111 <\n         sdiv_up32(sext_i64_i32(virt_num_groups_235078) - phys_group_id_235110,\n                   sext_i64_i32(num_groups_221413)); i_235111++) {\n        int32_t virt_group_id_235112 = phys_group_id_235110 + i_235111 *\n                sext_i64_i32(num_groups_221413);\n        int32_t flat_segment_id_235113 = squot32(virt_group_id_235112,\n                                                 sext_i64_i32(groups_per_segment_235076));\n        int64_t global_tid_235114 = srem64(sext_i32_i64(virt_group_id_235112) *\n                                           segred_group_sizze_221412 +\n                                           sext_i32_i64(local_tid_235094),\n                                           segred_group_sizze_221412 *\n                                           groups_per_segment_235076);\n        int64_t slice_235115 = l_n_m_203643;\n        int64_t slice_235116 = partition_sizze_203577 * slice_235115;\n        int64_t gtid_221420 = squot64(sext_i32_i64(flat_segment_id_235113),\n                                      slice_235115);\n        int64_t remnant_235117 = sext_i32_i64(flat_segment_id_235113) -\n                gtid_221420 * slice_235115;\n        int64_t gtid_221421 = remnant_235117;\n        int64_t remnant_235118 = remnant_235117 - gtid_221421;\n        int64_t gtid_221422;\n        double x_acc_235119;\n        double x_acc_235120;\n        double x_acc_235121;\n        double x_acc_235122;\n        double x_acc_235123;\n        int64_t chunk_sizze_235124 = smin64(elements_per_thread_235077,\n                                            sdiv_up64(q_l_203495 -\n                                                      global_tid_235114,\n                                                      threads_per_segment_235080));\n        double x_221424;\n        double x_221425;\n        double x_221426;\n        double x_221427;\n        double x_221428;\n        double x_221429;\n",
                   "        double x_221430;\n        double x_221431;\n        double x_221432;\n        double x_221433;\n        \n        // neutral-initialise the accumulators\n        {\n            x_acc_235119 = 0.0;\n            x_acc_235120 = 0.0;\n            x_acc_235121 = 0.0;\n            x_acc_235122 = 0.0;\n            x_acc_235123 = 0.0;\n        }\n        for (int64_t i_235140 = 0; i_235140 < chunk_sizze_235124; i_235140++) {\n            gtid_221422 = global_tid_235114 + threads_per_segment_235080 *\n                i_235140;\n            // apply map function\n            {\n                int64_t x_221443;\n                \n                x_221443 = ((__global int64_t *) ext_mem_229412)[gtid_221420 *\n                                                                 l_n_m_203643 +\n                                                                 gtid_221421];\n                \n                double x_221444;\n                \n                x_221444 = ((__global double *) ext_mem_229411)[gtid_221420 *\n                                                                l_n_m_203643 +\n                                                                gtid_221421];\n                \n                int64_t binop_y_228714 = mul64(jump_t_203500, gtid_221421);\n                int64_t binop_y_228715 = smin64(i_203670, binop_y_228714);\n                int64_t index_primexp_228716 = add64((int64_t) 1,\n                                                     binop_y_228715);\n                bool cond_221447 = sle64(n_203490, gtid_221422);\n                int64_t defunc_0_f_res_221448;\n                \n                if (cond_221447) {\n                    defunc_0_f_res_221448 = (int64_t) 0;\n                } else {\n                    int64_t i_221449 = add64(gtid_221422, x_221443);\n                    int64_t defunc_1_add_res_221450 = add64((int64_t) 1,\n                                                            i_221449);\n                    \n                    defunc_0_f_res_221448 = defunc_1_add_res",
                   "_221450;\n                }\n                \n                double defunc_0_f_res_221451;\n                \n                if (cond_221447) {\n                    defunc_0_f_res_221451 = 0.0;\n                } else {\n                    int64_t i_221452 = add64(gtid_221422, x_221443);\n                    double defunc_0_add_arg_221453;\n                    \n                    defunc_0_add_arg_221453 = ((__global\n                                                double *) mem_param_229493)[ctx_param_ext_229488 +\n                                                                            (gtid_221420 *\n                                                                             ctx_param_ext_229489 +\n                                                                             i_221452 *\n                                                                             ctx_param_ext_229491)];\n                    defunc_0_f_res_221451 = defunc_0_add_arg_221453;\n                }\n                \n                int64_t binop_p_221454 = sub64(defunc_0_f_res_221448,\n                                               index_primexp_228716);\n                double defunc_0_f_res_221455 = sitofp_i64_f64(binop_p_221454);\n                double abs_res_221456 = fabs(defunc_0_f_res_221455);\n                double tmp1_221457 = abs_res_221456 / x_221444;\n                double x_221458 = tmp1_221457 * tmp1_221457;\n                double y_221459 = tmp1_221457 * x_221458;\n                double tmp2_221460 = 1.0 - y_221459;\n                double x_221461 = tmp2_221460 * tmp2_221460;\n                double tmp3_221462 = tmp2_221460 * x_221461;\n                double w_j_221463 = defunc_0_f_res_221451 * tmp3_221462;\n                double xw_j_221464 = defunc_0_f_res_221455 * w_j_221463;\n                double x2w_j_221465 = defunc_0_f_res_221455 * xw_j_221464;\n                double x3w_j_221466 = defunc_0_f_res_221455 * x2w_j_221465;\n                double x4w_j_221467 = defunc_0_f_res_221455",
                   " * x3w_j_221466;\n                \n                // save map-out results\n                { }\n                // load accumulator\n                {\n                    x_221424 = x_acc_235119;\n                    x_221425 = x_acc_235120;\n                    x_221426 = x_acc_235121;\n                    x_221427 = x_acc_235122;\n                    x_221428 = x_acc_235123;\n                }\n                // load new values\n                {\n                    x_221429 = w_j_221463;\n                    x_221430 = xw_j_221464;\n                    x_221431 = x2w_j_221465;\n                    x_221432 = x3w_j_221466;\n                    x_221433 = x4w_j_221467;\n                }\n                // apply reduction operator\n                {\n                    double defunc_1_op_res_221434 = x_221424 + x_221429;\n                    double defunc_1_op_res_221435 = x_221425 + x_221430;\n                    double defunc_1_op_res_221436 = x_221426 + x_221431;\n                    double defunc_1_op_res_221437 = x_221427 + x_221432;\n                    double defunc_1_op_res_221438 = x_221428 + x_221433;\n                    \n                    // store in accumulator\n                    {\n                        x_acc_235119 = defunc_1_op_res_221434;\n                        x_acc_235120 = defunc_1_op_res_221435;\n                        x_acc_235121 = defunc_1_op_res_221436;\n                        x_acc_235122 = defunc_1_op_res_221437;\n                        x_acc_235123 = defunc_1_op_res_221438;\n                    }\n                }\n            }\n        }\n        // to reduce current chunk, first store our result in memory\n        {\n            x_221424 = x_acc_235119;\n            x_221425 = x_acc_235120;\n            x_221426 = x_acc_235121;\n            x_221427 = x_acc_235122;\n            x_221428 = x_acc_235123;\n            ((__local\n              double *) red_arr_mem_235098)[sext_i32_i64(local_tid_235094)] =\n                x_221424;\n            ((__local\n           ",
                   "   double *) red_arr_mem_235100)[sext_i32_i64(local_tid_235094)] =\n                x_221425;\n            ((__local\n              double *) red_arr_mem_235102)[sext_i32_i64(local_tid_235094)] =\n                x_221426;\n            ((__local\n              double *) red_arr_mem_235104)[sext_i32_i64(local_tid_235094)] =\n                x_221427;\n            ((__local\n              double *) red_arr_mem_235106)[sext_i32_i64(local_tid_235094)] =\n                x_221428;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        \n        int32_t offset_235141;\n        int32_t skip_waves_235142 = 1;\n        double x_235125;\n        double x_235126;\n        double x_235127;\n        double x_235128;\n        double x_235129;\n        double x_235130;\n        double x_235131;\n        double x_235132;\n        double x_235133;\n        double x_235134;\n        \n        offset_235141 = 0;\n        // participating threads read initial accumulator\n        {\n            if (slt32(local_tid_235094,\n                      sext_i64_i32(segred_group_sizze_221412))) {\n                x_235125 = ((__local\n                             double *) red_arr_mem_235098)[sext_i32_i64(local_tid_235094 +\n                                                           offset_235141)];\n                x_235126 = ((__local\n                             double *) red_arr_mem_235100)[sext_i32_i64(local_tid_235094 +\n                                                           offset_235141)];\n                x_235127 = ((__local\n                             double *) red_arr_mem_235102)[sext_i32_i64(local_tid_235094 +\n                                                           offset_235141)];\n                x_235128 = ((__local\n                             double *) red_arr_mem_235104)[sext_i32_i64(local_tid_235094 +\n                                                           offset_235141)];\n                x_235129 = ((__local\n                             double *) red_arr_mem_235106)[sext_i32_i64(local_tid_235094 ",
                   "+\n                                                           offset_235141)];\n            }\n        }\n        offset_235141 = 1;\n        while (slt32(offset_235141, wave_sizze_235096)) {\n            if (slt32(local_tid_235094 + offset_235141,\n                      sext_i64_i32(segred_group_sizze_221412)) &&\n                ((local_tid_235094 - squot32(local_tid_235094,\n                                             wave_sizze_235096) *\n                  wave_sizze_235096) & (2 * offset_235141 - 1)) == 0) {\n                // read array element\n                {\n                    x_235130 = ((volatile __local\n                                 double *) red_arr_mem_235098)[sext_i32_i64(local_tid_235094 +\n                                                               offset_235141)];\n                    x_235131 = ((volatile __local\n                                 double *) red_arr_mem_235100)[sext_i32_i64(local_tid_235094 +\n                                                               offset_235141)];\n                    x_235132 = ((volatile __local\n                                 double *) red_arr_mem_235102)[sext_i32_i64(local_tid_235094 +\n                                                               offset_235141)];\n                    x_235133 = ((volatile __local\n                                 double *) red_arr_mem_235104)[sext_i32_i64(local_tid_235094 +\n                                                               offset_235141)];\n                    x_235134 = ((volatile __local\n                                 double *) red_arr_mem_235106)[sext_i32_i64(local_tid_235094 +\n                                                               offset_235141)];\n                }\n                // apply reduction operation\n                {\n                    double defunc_1_op_res_235135 = x_235125 + x_235130;\n                    double defunc_1_op_res_235136 = x_235126 + x_235131;\n                    double defunc_1_op_res_235137 = x_235127 + x_235132;\n         ",
                   "           double defunc_1_op_res_235138 = x_235128 + x_235133;\n                    double defunc_1_op_res_235139 = x_235129 + x_235134;\n                    \n                    x_235125 = defunc_1_op_res_235135;\n                    x_235126 = defunc_1_op_res_235136;\n                    x_235127 = defunc_1_op_res_235137;\n                    x_235128 = defunc_1_op_res_235138;\n                    x_235129 = defunc_1_op_res_235139;\n                }\n                // write result of operation\n                {\n                    ((volatile __local\n                      double *) red_arr_mem_235098)[sext_i32_i64(local_tid_235094)] =\n                        x_235125;\n                    ((volatile __local\n                      double *) red_arr_mem_235100)[sext_i32_i64(local_tid_235094)] =\n                        x_235126;\n                    ((volatile __local\n                      double *) red_arr_mem_235102)[sext_i32_i64(local_tid_235094)] =\n                        x_235127;\n                    ((volatile __local\n                      double *) red_arr_mem_235104)[sext_i32_i64(local_tid_235094)] =\n                        x_235128;\n                    ((volatile __local\n                      double *) red_arr_mem_235106)[sext_i32_i64(local_tid_235094)] =\n                        x_235129;\n                }\n            }\n            offset_235141 *= 2;\n        }\n        while (slt32(skip_waves_235142,\n                     squot32(sext_i64_i32(segred_group_sizze_221412) +\n                             wave_sizze_235096 - 1, wave_sizze_235096))) {\n            barrier(CLK_LOCAL_MEM_FENCE);\n            offset_235141 = skip_waves_235142 * wave_sizze_235096;\n            if (slt32(local_tid_235094 + offset_235141,\n                      sext_i64_i32(segred_group_sizze_221412)) &&\n                ((local_tid_235094 - squot32(local_tid_235094,\n                                             wave_sizze_235096) *\n                  wave_sizze_235096) == 0 && (squot32(local_tid_235094,",
                   "\n                                                      wave_sizze_235096) & (2 *\n                                                                            skip_waves_235142 -\n                                                                            1)) ==\n                 0)) {\n                // read array element\n                {\n                    x_235130 = ((__local\n                                 double *) red_arr_mem_235098)[sext_i32_i64(local_tid_235094 +\n                                                               offset_235141)];\n                    x_235131 = ((__local\n                                 double *) red_arr_mem_235100)[sext_i32_i64(local_tid_235094 +\n                                                               offset_235141)];\n                    x_235132 = ((__local\n                                 double *) red_arr_mem_235102)[sext_i32_i64(local_tid_235094 +\n                                                               offset_235141)];\n                    x_235133 = ((__local\n                                 double *) red_arr_mem_235104)[sext_i32_i64(local_tid_235094 +\n                                                               offset_235141)];\n                    x_235134 = ((__local\n                                 double *) red_arr_mem_235106)[sext_i32_i64(local_tid_235094 +\n                                                               offset_235141)];\n                }\n                // apply reduction operation\n                {\n                    double defunc_1_op_res_235135 = x_235125 + x_235130;\n                    double defunc_1_op_res_235136 = x_235126 + x_235131;\n                    double defunc_1_op_res_235137 = x_235127 + x_235132;\n                    double defunc_1_op_res_235138 = x_235128 + x_235133;\n                    double defunc_1_op_res_235139 = x_235129 + x_235134;\n                    \n                    x_235125 = defunc_1_op_res_235135;\n                    x_235126 = defunc_1_op_res_235136;\n    ",
                   "                x_235127 = defunc_1_op_res_235137;\n                    x_235128 = defunc_1_op_res_235138;\n                    x_235129 = defunc_1_op_res_235139;\n                }\n                // write result of operation\n                {\n                    ((__local\n                      double *) red_arr_mem_235098)[sext_i32_i64(local_tid_235094)] =\n                        x_235125;\n                    ((__local\n                      double *) red_arr_mem_235100)[sext_i32_i64(local_tid_235094)] =\n                        x_235126;\n                    ((__local\n                      double *) red_arr_mem_235102)[sext_i32_i64(local_tid_235094)] =\n                        x_235127;\n                    ((__local\n                      double *) red_arr_mem_235104)[sext_i32_i64(local_tid_235094)] =\n                        x_235128;\n                    ((__local\n                      double *) red_arr_mem_235106)[sext_i32_i64(local_tid_235094)] =\n                        x_235129;\n                }\n            }\n            skip_waves_235142 *= 2;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        // first thread saves the result in accumulator\n        {\n            if (sext_i32_i64(local_tid_235094) == (int64_t) 0) {\n                x_acc_235119 = x_235125;\n                x_acc_235120 = x_235126;\n                x_acc_235121 = x_235127;\n                x_acc_235122 = x_235128;\n                x_acc_235123 = x_235129;\n            }\n        }\n        if (groups_per_segment_235076 == (int64_t) 1) {\n            // first thread in group saves final result to memory\n            {\n                if (local_tid_235094 == 0) {\n                    ((__global double *) mem_230783)[gtid_221420 *\n                                                     l_n_m_203643 +\n                                                     gtid_221421] =\n                        x_acc_235119;\n                    ((__global double *) mem_230787)[gtid_221420 *\n                                           ",
                   "          l_n_m_203643 +\n                                                     gtid_221421] =\n                        x_acc_235120;\n                    ((__global double *) mem_230791)[gtid_221420 *\n                                                     l_n_m_203643 +\n                                                     gtid_221421] =\n                        x_acc_235121;\n                    ((__global double *) mem_230795)[gtid_221420 *\n                                                     l_n_m_203643 +\n                                                     gtid_221421] =\n                        x_acc_235122;\n                    ((__global double *) mem_230799)[gtid_221420 *\n                                                     l_n_m_203643 +\n                                                     gtid_221421] =\n                        x_acc_235123;\n                }\n            }\n        } else {\n            int32_t old_counter_235143;\n            \n            // first thread in group saves group result to global memory\n            {\n                if (local_tid_235094 == 0) {\n                    ((__global\n                      double *) segred_tmp_mem_235081)[sext_i32_i64(virt_group_id_235112)] =\n                        x_acc_235119;\n                    ((__global\n                      double *) segred_tmp_mem_235083)[sext_i32_i64(virt_group_id_235112)] =\n                        x_acc_235120;\n                    ((__global\n                      double *) segred_tmp_mem_235085)[sext_i32_i64(virt_group_id_235112)] =\n                        x_acc_235121;\n                    ((__global\n                      double *) segred_tmp_mem_235087)[sext_i32_i64(virt_group_id_235112)] =\n                        x_acc_235122;\n                    ((__global\n                      double *) segred_tmp_mem_235089)[sext_i32_i64(virt_group_id_235112)] =\n                        x_acc_235123;\n                    mem_fence_global();\n                    old_counter_235143 =\n                     ",
                   "   atomic_add_i32_global(&((volatile __global\n                                                 int *) mainzicounter_mem_235091)[sext_i32_i64(srem32(flat_segment_id_235113,\n                                                                                                      10240))],\n                                              (int) 1);\n                    ((__local bool *) sync_arr_mem_235108)[(int64_t) 0] =\n                        old_counter_235143 == groups_per_segment_235076 -\n                        (int64_t) 1;\n                }\n            }\n            barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n            \n            bool is_last_group_235144;\n            \n            is_last_group_235144 = ((__local\n                                     bool *) sync_arr_mem_235108)[(int64_t) 0];\n            if (is_last_group_235144) {\n                if (local_tid_235094 == 0) {\n                    old_counter_235143 =\n                        atomic_add_i32_global(&((volatile __global\n                                                 int *) mainzicounter_mem_235091)[sext_i32_i64(srem32(flat_segment_id_235113,\n                                                                                                      10240))],\n                                              (int) ((int64_t) 0 -\n                                                     groups_per_segment_235076));\n                }\n                // read in the per-group-results\n                {\n                    int64_t read_per_thread_235145 =\n                            sdiv_up64(groups_per_segment_235076,\n                                      segred_group_sizze_221412);\n                    \n                    x_221424 = 0.0;\n                    x_221425 = 0.0;\n                    x_221426 = 0.0;\n                    x_221427 = 0.0;\n                    x_221428 = 0.0;\n                    for (int64_t i_235146 = 0; i_235146 <\n                         read_per_thread_235145; i_235146++) {\n                 ",
                   "       int64_t group_res_id_235147 =\n                                sext_i32_i64(local_tid_235094) *\n                                read_per_thread_235145 + i_235146;\n                        int64_t index_of_group_res_235148 =\n                                sext_i32_i64(flat_segment_id_235113) *\n                                groups_per_segment_235076 + group_res_id_235147;\n                        \n                        if (slt64(group_res_id_235147,\n                                  groups_per_segment_235076)) {\n                            x_221429 = ((__global\n                                         double *) segred_tmp_mem_235081)[index_of_group_res_235148];\n                            x_221430 = ((__global\n                                         double *) segred_tmp_mem_235083)[index_of_group_res_235148];\n                            x_221431 = ((__global\n                                         double *) segred_tmp_mem_235085)[index_of_group_res_235148];\n                            x_221432 = ((__global\n                                         double *) segred_tmp_mem_235087)[index_of_group_res_235148];\n                            x_221433 = ((__global\n                                         double *) segred_tmp_mem_235089)[index_of_group_res_235148];\n                            \n                            double defunc_1_op_res_221434 = x_221424 + x_221429;\n                            double defunc_1_op_res_221435 = x_221425 + x_221430;\n                            double defunc_1_op_res_221436 = x_221426 + x_221431;\n                            double defunc_1_op_res_221437 = x_221427 + x_221432;\n                            double defunc_1_op_res_221438 = x_221428 + x_221433;\n                            \n                            x_221424 = defunc_1_op_res_221434;\n                            x_221425 = defunc_1_op_res_221435;\n                            x_221426 = defunc_1_op_res_221436;\n                            x_221427 = defunc_1_op_res_221437;\n",
                   "                            x_221428 = defunc_1_op_res_221438;\n                        }\n                    }\n                }\n                ((__local\n                  double *) red_arr_mem_235098)[sext_i32_i64(local_tid_235094)] =\n                    x_221424;\n                ((__local\n                  double *) red_arr_mem_235100)[sext_i32_i64(local_tid_235094)] =\n                    x_221425;\n                ((__local\n                  double *) red_arr_mem_235102)[sext_i32_i64(local_tid_235094)] =\n                    x_221426;\n                ((__local\n                  double *) red_arr_mem_235104)[sext_i32_i64(local_tid_235094)] =\n                    x_221427;\n                ((__local\n                  double *) red_arr_mem_235106)[sext_i32_i64(local_tid_235094)] =\n                    x_221428;\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // reduce the per-group results\n                {\n                    int32_t offset_235149;\n                    int32_t skip_waves_235150 = 1;\n                    double x_235125;\n                    double x_235126;\n                    double x_235127;\n                    double x_235128;\n                    double x_235129;\n                    double x_235130;\n                    double x_235131;\n                    double x_235132;\n                    double x_235133;\n                    double x_235134;\n                    \n                    offset_235149 = 0;\n                    // participating threads read initial accumulator\n                    {\n                        if (slt32(local_tid_235094,\n                                  sext_i64_i32(segred_group_sizze_221412))) {\n                            x_235125 = ((__local\n                                         double *) red_arr_mem_235098)[sext_i32_i64(local_tid_235094 +\n                                                                       offset_235149)];\n                            x_235126 = ((__local\n                                  ",
                   "       double *) red_arr_mem_235100)[sext_i32_i64(local_tid_235094 +\n                                                                       offset_235149)];\n                            x_235127 = ((__local\n                                         double *) red_arr_mem_235102)[sext_i32_i64(local_tid_235094 +\n                                                                       offset_235149)];\n                            x_235128 = ((__local\n                                         double *) red_arr_mem_235104)[sext_i32_i64(local_tid_235094 +\n                                                                       offset_235149)];\n                            x_235129 = ((__local\n                                         double *) red_arr_mem_235106)[sext_i32_i64(local_tid_235094 +\n                                                                       offset_235149)];\n                        }\n                    }\n                    offset_235149 = 1;\n                    while (slt32(offset_235149, wave_sizze_235096)) {\n                        if (slt32(local_tid_235094 + offset_235149,\n                                  sext_i64_i32(segred_group_sizze_221412)) &&\n                            ((local_tid_235094 - squot32(local_tid_235094,\n                                                         wave_sizze_235096) *\n                              wave_sizze_235096) & (2 * offset_235149 - 1)) ==\n                            0) {\n                            // read array element\n                            {\n                                x_235130 = ((volatile __local\n                                             double *) red_arr_mem_235098)[sext_i32_i64(local_tid_235094 +\n                                                                           offset_235149)];\n                                x_235131 = ((volatile __local\n                                             double *) red_arr_mem_235100)[sext_i32_i64(local_tid_235094 +\n                                             ",
                   "                              offset_235149)];\n                                x_235132 = ((volatile __local\n                                             double *) red_arr_mem_235102)[sext_i32_i64(local_tid_235094 +\n                                                                           offset_235149)];\n                                x_235133 = ((volatile __local\n                                             double *) red_arr_mem_235104)[sext_i32_i64(local_tid_235094 +\n                                                                           offset_235149)];\n                                x_235134 = ((volatile __local\n                                             double *) red_arr_mem_235106)[sext_i32_i64(local_tid_235094 +\n                                                                           offset_235149)];\n                            }\n                            // apply reduction operation\n                            {\n                                double defunc_1_op_res_235135 = x_235125 +\n                                       x_235130;\n                                double defunc_1_op_res_235136 = x_235126 +\n                                       x_235131;\n                                double defunc_1_op_res_235137 = x_235127 +\n                                       x_235132;\n                                double defunc_1_op_res_235138 = x_235128 +\n                                       x_235133;\n                                double defunc_1_op_res_235139 = x_235129 +\n                                       x_235134;\n                                \n                                x_235125 = defunc_1_op_res_235135;\n                                x_235126 = defunc_1_op_res_235136;\n                                x_235127 = defunc_1_op_res_235137;\n                                x_235128 = defunc_1_op_res_235138;\n                                x_235129 = defunc_1_op_res_235139;\n                            }\n                            // writ",
                   "e result of operation\n                            {\n                                ((volatile __local\n                                  double *) red_arr_mem_235098)[sext_i32_i64(local_tid_235094)] =\n                                    x_235125;\n                                ((volatile __local\n                                  double *) red_arr_mem_235100)[sext_i32_i64(local_tid_235094)] =\n                                    x_235126;\n                                ((volatile __local\n                                  double *) red_arr_mem_235102)[sext_i32_i64(local_tid_235094)] =\n                                    x_235127;\n                                ((volatile __local\n                                  double *) red_arr_mem_235104)[sext_i32_i64(local_tid_235094)] =\n                                    x_235128;\n                                ((volatile __local\n                                  double *) red_arr_mem_235106)[sext_i32_i64(local_tid_235094)] =\n                                    x_235129;\n                            }\n                        }\n                        offset_235149 *= 2;\n                    }\n                    while (slt32(skip_waves_235150,\n                                 squot32(sext_i64_i32(segred_group_sizze_221412) +\n                                         wave_sizze_235096 - 1,\n                                         wave_sizze_235096))) {\n                        barrier(CLK_LOCAL_MEM_FENCE);\n                        offset_235149 = skip_waves_235150 * wave_sizze_235096;\n                        if (slt32(local_tid_235094 + offset_235149,\n                                  sext_i64_i32(segred_group_sizze_221412)) &&\n                            ((local_tid_235094 - squot32(local_tid_235094,\n                                                         wave_sizze_235096) *\n                              wave_sizze_235096) == 0 &&\n                             (squot32(local_tid_235094, wave_sizze_235096) &\n                      ",
                   "        (2 * skip_waves_235150 - 1)) == 0)) {\n                            // read array element\n                            {\n                                x_235130 = ((__local\n                                             double *) red_arr_mem_235098)[sext_i32_i64(local_tid_235094 +\n                                                                           offset_235149)];\n                                x_235131 = ((__local\n                                             double *) red_arr_mem_235100)[sext_i32_i64(local_tid_235094 +\n                                                                           offset_235149)];\n                                x_235132 = ((__local\n                                             double *) red_arr_mem_235102)[sext_i32_i64(local_tid_235094 +\n                                                                           offset_235149)];\n                                x_235133 = ((__local\n                                             double *) red_arr_mem_235104)[sext_i32_i64(local_tid_235094 +\n                                                                           offset_235149)];\n                                x_235134 = ((__local\n                                             double *) red_arr_mem_235106)[sext_i32_i64(local_tid_235094 +\n                                                                           offset_235149)];\n                            }\n                            // apply reduction operation\n                            {\n                                double defunc_1_op_res_235135 = x_235125 +\n                                       x_235130;\n                                double defunc_1_op_res_235136 = x_235126 +\n                                       x_235131;\n                                double defunc_1_op_res_235137 = x_235127 +\n                                       x_235132;\n                                double defunc_1_op_res_235138 = x_235128 +\n                                       x_235133;\n ",
                   "                               double defunc_1_op_res_235139 = x_235129 +\n                                       x_235134;\n                                \n                                x_235125 = defunc_1_op_res_235135;\n                                x_235126 = defunc_1_op_res_235136;\n                                x_235127 = defunc_1_op_res_235137;\n                                x_235128 = defunc_1_op_res_235138;\n                                x_235129 = defunc_1_op_res_235139;\n                            }\n                            // write result of operation\n                            {\n                                ((__local\n                                  double *) red_arr_mem_235098)[sext_i32_i64(local_tid_235094)] =\n                                    x_235125;\n                                ((__local\n                                  double *) red_arr_mem_235100)[sext_i32_i64(local_tid_235094)] =\n                                    x_235126;\n                                ((__local\n                                  double *) red_arr_mem_235102)[sext_i32_i64(local_tid_235094)] =\n                                    x_235127;\n                                ((__local\n                                  double *) red_arr_mem_235104)[sext_i32_i64(local_tid_235094)] =\n                                    x_235128;\n                                ((__local\n                                  double *) red_arr_mem_235106)[sext_i32_i64(local_tid_235094)] =\n                                    x_235129;\n                            }\n                        }\n                        skip_waves_235150 *= 2;\n                    }\n                    // and back to memory with the final result\n                    {\n                        if (local_tid_235094 == 0) {\n                            ((__global double *) mem_230783)[gtid_221420 *\n                                                             l_n_m_203643 +\n                                              ",
                   "               gtid_221421] =\n                                x_235125;\n                            ((__global double *) mem_230787)[gtid_221420 *\n                                                             l_n_m_203643 +\n                                                             gtid_221421] =\n                                x_235126;\n                            ((__global double *) mem_230791)[gtid_221420 *\n                                                             l_n_m_203643 +\n                                                             gtid_221421] =\n                                x_235127;\n                            ((__global double *) mem_230795)[gtid_221420 *\n                                                             l_n_m_203643 +\n                                                             gtid_221421] =\n                                x_235128;\n                            ((__global double *) mem_230799)[gtid_221420 *\n                                                             l_n_m_203643 +\n                                                             gtid_221421] =\n                                x_235129;\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_221412\n}\n__kernel void mainzisegred_large_221521(__global int *global_failure,\n                                        __local volatile\n                                        int64_t *sync_arr_mem_235216_backing_aligned_0,\n                                        __local volatile\n                                        int64_t *red_arr_mem_235214_backing_aligned_1,\n                                        __local volatile\n                                        int64_t *red_arr_mem_235212_backing_aligned_2,\n                                        int64_t n_203490, int64_t q_l_203495,\n                                        int64_t",
                   " jump_t_203500,\n                                        int64_t partition_sizze_203577,\n                                        int64_t l_n_m_203643, int64_t i_203670,\n                                        int64_t num_groups_221514,\n                                        int64_t ctx_param_ext_229488,\n                                        int64_t ctx_param_ext_229489,\n                                        int64_t ctx_param_ext_229491,\n                                        int64_t groups_per_segment_235196,\n                                        int64_t elements_per_thread_235197,\n                                        int64_t virt_num_groups_235198,\n                                        int64_t threads_per_segment_235200,\n                                        __global unsigned char *ext_mem_229411,\n                                        __global unsigned char *ext_mem_229412,\n                                        __global\n                                        unsigned char *mem_param_229493,\n                                        __global unsigned char *mem_230551,\n                                        __global unsigned char *mem_230804,\n                                        __global unsigned char *mem_230808,\n                                        __global unsigned char *mem_230812,\n                                        __global unsigned char *mem_230816,\n                                        __global unsigned char *mem_230820,\n                                        __global unsigned char *mem_230825,\n                                        __global unsigned char *mem_230829,\n                                        __global\n                                        unsigned char *segred_tmp_mem_235201,\n                                        __global\n                                        unsigned char *segred_tmp_mem_235203,\n                                        __global\n                                        unsigned char *mainzico",
                   "unter_mem_235205)\n{\n    #define segred_group_sizze_221513 (mainzisegred_group_sizze_220883)\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_235216_backing_2 =\n                                   (__local volatile\n                                    unsigned char *) sync_arr_mem_235216_backing_aligned_0;\n    __local volatile unsigned char *restrict red_arr_mem_235214_backing_1 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_235214_backing_aligned_1;\n    __local volatile unsigned char *restrict red_arr_mem_235212_backing_0 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_235212_backing_aligned_2;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_235207;\n    int32_t local_tid_235208;\n    int64_t group_sizze_235211;\n    int32_t wave_sizze_235210;\n    int32_t group_tid_235209;\n    \n    global_tid_235207 = get_global_id(0);\n    local_tid_235208 = get_local_id(0);\n    group_sizze_235211 = get_local_size(0);\n    wave_sizze_235210 = LOCKSTEP_WIDTH;\n    group_tid_235209 = get_group_id(0);\n    \n    int32_t phys_tid_221521 = global_tid_235207;\n    __local unsigned char *red_arr_mem_235212;\n    \n    red_arr_mem_235212 = (__local unsigned char *) red_arr_mem_235212_backing_0;\n    \n    __local unsigned char *red_arr_mem_235214;\n    \n    red_arr_mem_235214 = (__local unsigned char *) red_arr_mem_235214_backing_1;\n    \n    __local unsigned char *sync_arr_mem_235216;\n    \n    sync_arr_mem_235216 = (__local\n                           unsigned char *) sync_arr_mem_235216_backing_2;\n    \n    int32_t phys_group_id_235218;\n    \n    phys_group_id_235218 = get_group_id(0);\n    for (int32_t i_235219 = 0; i_235219 <\n         sdiv_up32(sext_i64_i32(virt_num_groups_235198) - phys_group_id_235218,\n                   sext_i64",
                   "_i32(num_groups_221514)); i_235219++) {\n        int32_t virt_group_id_235220 = phys_group_id_235218 + i_235219 *\n                sext_i64_i32(num_groups_221514);\n        int32_t flat_segment_id_235221 = squot32(virt_group_id_235220,\n                                                 sext_i64_i32(groups_per_segment_235196));\n        int64_t global_tid_235222 = srem64(sext_i32_i64(virt_group_id_235220) *\n                                           segred_group_sizze_221513 +\n                                           sext_i32_i64(local_tid_235208),\n                                           segred_group_sizze_221513 *\n                                           groups_per_segment_235196);\n        int64_t slice_235223 = l_n_m_203643;\n        int64_t slice_235224 = partition_sizze_203577 * slice_235223;\n        int64_t gtid_221518 = squot64(sext_i32_i64(flat_segment_id_235221),\n                                      slice_235223);\n        int64_t remnant_235225 = sext_i32_i64(flat_segment_id_235221) -\n                gtid_221518 * slice_235223;\n        int64_t gtid_221519 = remnant_235225;\n        int64_t remnant_235226 = remnant_235225 - gtid_221519;\n        int64_t gtid_221520;\n        double x_acc_235227;\n        double x_acc_235228;\n        int64_t chunk_sizze_235229 = smin64(elements_per_thread_235197,\n                                            sdiv_up64(q_l_203495 -\n                                                      global_tid_235222,\n                                                      threads_per_segment_235200));\n        double x_221522;\n        double x_221523;\n        double x_221524;\n        double x_221525;\n        \n        // neutral-initialise the accumulators\n        {\n            x_acc_235227 = 0.0;\n            x_acc_235228 = 0.0;\n        }\n        for (int64_t i_235236 = 0; i_235236 < chunk_sizze_235229; i_235236++) {\n            gtid_221520 = global_tid_235222 + threads_per_segment_235200 *\n                i_235236;\n            // apply map function\n ",
                   "           {\n                int64_t x_221538;\n                \n                x_221538 = ((__global int64_t *) ext_mem_229412)[gtid_221518 *\n                                                                 l_n_m_203643 +\n                                                                 gtid_221519];\n                \n                double x_221539;\n                \n                x_221539 = ((__global double *) ext_mem_229411)[gtid_221518 *\n                                                                l_n_m_203643 +\n                                                                gtid_221519];\n                \n                int64_t binop_y_228709 = mul64(jump_t_203500, gtid_221519);\n                int64_t binop_y_228710 = smin64(i_203670, binop_y_228709);\n                int64_t index_primexp_228711 = add64((int64_t) 1,\n                                                     binop_y_228710);\n                double a12_221541;\n                \n                a12_221541 = ((__global double *) mem_230804)[gtid_221518 *\n                                                              l_n_m_203643 +\n                                                              gtid_221519];\n                \n                double b12_221542;\n                \n                b12_221542 = ((__global double *) mem_230808)[gtid_221518 *\n                                                              l_n_m_203643 +\n                                                              gtid_221519];\n                \n                double c12_221543;\n                \n                c12_221543 = ((__global double *) mem_230812)[gtid_221518 *\n                                                              l_n_m_203643 +\n                                                              gtid_221519];\n                \n                double b2_221544;\n                \n                b2_221544 = ((__global double *) mem_230816)[gtid_221518 *\n                                                             l_n_m_20364",
                   "3 +\n                                                             gtid_221519];\n                \n                double c2_221545;\n                \n                c2_221545 = ((__global double *) mem_230820)[gtid_221518 *\n                                                             l_n_m_203643 +\n                                                             gtid_221519];\n                \n                bool cond_221547 = sle64(n_203490, gtid_221520);\n                int64_t defunc_0_f_res_221548;\n                \n                if (cond_221547) {\n                    defunc_0_f_res_221548 = (int64_t) 0;\n                } else {\n                    int64_t i_221549 = add64(gtid_221520, x_221538);\n                    int64_t defunc_1_add_res_221550 = add64((int64_t) 1,\n                                                            i_221549);\n                    \n                    defunc_0_f_res_221548 = defunc_1_add_res_221550;\n                }\n                \n                double defunc_0_f_res_221551;\n                \n                if (cond_221547) {\n                    defunc_0_f_res_221551 = 0.0;\n                } else {\n                    int64_t i_221552 = add64(gtid_221520, x_221538);\n                    double defunc_0_add_arg_221553;\n                    \n                    defunc_0_add_arg_221553 = ((__global\n                                                double *) mem_param_229493)[ctx_param_ext_229488 +\n                                                                            (gtid_221518 *\n                                                                             ctx_param_ext_229489 +\n                                                                             i_221552 *\n                                                                             ctx_param_ext_229491)];\n                    defunc_0_f_res_221551 = defunc_0_add_arg_221553;\n                }\n                \n                int64_t binop_p_221554 = sub64(defunc_0_f_res_221548,\n  ",
                   "                                             index_primexp_228711);\n                double defunc_0_f_res_221555 = sitofp_i64_f64(binop_p_221554);\n                double abs_res_221556 = fabs(defunc_0_f_res_221555);\n                double tmp1_221557 = abs_res_221556 / x_221539;\n                double x_221558 = tmp1_221557 * tmp1_221557;\n                double y_221559 = tmp1_221557 * x_221558;\n                double tmp2_221560 = 1.0 - y_221559;\n                double x_221561 = tmp2_221560 * tmp2_221560;\n                double tmp3_221562 = tmp2_221560 * x_221561;\n                double tmp4_221563 = defunc_0_f_res_221551 * tmp3_221562;\n                double defunc_1_f_res_221564 = defunc_0_f_res_221555 *\n                       tmp4_221563;\n                double defunc_1_f_res_221565 = defunc_0_f_res_221555 *\n                       defunc_1_f_res_221564;\n                double defunc_0_f_res_221566;\n                \n                if (cond_221547) {\n                    defunc_0_f_res_221566 = 0.0;\n                } else {\n                    int64_t i_221567 = add64(gtid_221520, x_221538);\n                    double defunc_0_add_arg_221568;\n                    \n                    defunc_0_add_arg_221568 = ((__global\n                                                double *) mem_230551)[gtid_221518 *\n                                                                      n_203490 +\n                                                                      i_221567];\n                    defunc_0_f_res_221566 = defunc_0_add_arg_221568;\n                }\n                \n                double x_221569 = a12_221541 * tmp4_221563;\n                double y_221570 = b12_221542 * defunc_1_f_res_221564;\n                double x_221571 = x_221569 + y_221570;\n                double y_221572 = c12_221543 * defunc_1_f_res_221565;\n                double x_221573 = x_221571 + y_221572;\n                double defunc_9_fit_fun_res_221574 = defunc_0_f_res_221566 *\n                    ",
                   "   x_221573;\n                double x_221575 = b12_221542 * tmp4_221563;\n                double y_221576 = b2_221544 * defunc_1_f_res_221564;\n                double x_221577 = x_221575 + y_221576;\n                double y_221578 = c2_221545 * defunc_1_f_res_221565;\n                double x_221579 = x_221577 + y_221578;\n                double defunc_9_slope_fun_res_221580 = defunc_0_f_res_221566 *\n                       x_221579;\n                \n                // save map-out results\n                { }\n                // load accumulator\n                {\n                    x_221522 = x_acc_235227;\n                    x_221523 = x_acc_235228;\n                }\n                // load new values\n                {\n                    x_221524 = defunc_9_fit_fun_res_221574;\n                    x_221525 = defunc_9_slope_fun_res_221580;\n                }\n                // apply reduction operator\n                {\n                    double defunc_1_op_res_221526 = x_221522 + x_221524;\n                    double defunc_1_op_res_221527 = x_221523 + x_221525;\n                    \n                    // store in accumulator\n                    {\n                        x_acc_235227 = defunc_1_op_res_221526;\n                        x_acc_235228 = defunc_1_op_res_221527;\n                    }\n                }\n            }\n        }\n        // to reduce current chunk, first store our result in memory\n        {\n            x_221522 = x_acc_235227;\n            x_221523 = x_acc_235228;\n            ((__local\n              double *) red_arr_mem_235212)[sext_i32_i64(local_tid_235208)] =\n                x_221522;\n            ((__local\n              double *) red_arr_mem_235214)[sext_i32_i64(local_tid_235208)] =\n                x_221523;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        \n        int32_t offset_235237;\n        int32_t skip_waves_235238 = 1;\n        double x_235230;\n        double x_235231;\n        double x_235232;\n        double x_235233;\n        \n        o",
                   "ffset_235237 = 0;\n        // participating threads read initial accumulator\n        {\n            if (slt32(local_tid_235208,\n                      sext_i64_i32(segred_group_sizze_221513))) {\n                x_235230 = ((__local\n                             double *) red_arr_mem_235212)[sext_i32_i64(local_tid_235208 +\n                                                           offset_235237)];\n                x_235231 = ((__local\n                             double *) red_arr_mem_235214)[sext_i32_i64(local_tid_235208 +\n                                                           offset_235237)];\n            }\n        }\n        offset_235237 = 1;\n        while (slt32(offset_235237, wave_sizze_235210)) {\n            if (slt32(local_tid_235208 + offset_235237,\n                      sext_i64_i32(segred_group_sizze_221513)) &&\n                ((local_tid_235208 - squot32(local_tid_235208,\n                                             wave_sizze_235210) *\n                  wave_sizze_235210) & (2 * offset_235237 - 1)) == 0) {\n                // read array element\n                {\n                    x_235232 = ((volatile __local\n                                 double *) red_arr_mem_235212)[sext_i32_i64(local_tid_235208 +\n                                                               offset_235237)];\n                    x_235233 = ((volatile __local\n                                 double *) red_arr_mem_235214)[sext_i32_i64(local_tid_235208 +\n                                                               offset_235237)];\n                }\n                // apply reduction operation\n                {\n                    double defunc_1_op_res_235234 = x_235230 + x_235232;\n                    double defunc_1_op_res_235235 = x_235231 + x_235233;\n                    \n                    x_235230 = defunc_1_op_res_235234;\n                    x_235231 = defunc_1_op_res_235235;\n                }\n                // write result of operation\n                {\n                    ((v",
                   "olatile __local\n                      double *) red_arr_mem_235212)[sext_i32_i64(local_tid_235208)] =\n                        x_235230;\n                    ((volatile __local\n                      double *) red_arr_mem_235214)[sext_i32_i64(local_tid_235208)] =\n                        x_235231;\n                }\n            }\n            offset_235237 *= 2;\n        }\n        while (slt32(skip_waves_235238,\n                     squot32(sext_i64_i32(segred_group_sizze_221513) +\n                             wave_sizze_235210 - 1, wave_sizze_235210))) {\n            barrier(CLK_LOCAL_MEM_FENCE);\n            offset_235237 = skip_waves_235238 * wave_sizze_235210;\n            if (slt32(local_tid_235208 + offset_235237,\n                      sext_i64_i32(segred_group_sizze_221513)) &&\n                ((local_tid_235208 - squot32(local_tid_235208,\n                                             wave_sizze_235210) *\n                  wave_sizze_235210) == 0 && (squot32(local_tid_235208,\n                                                      wave_sizze_235210) & (2 *\n                                                                            skip_waves_235238 -\n                                                                            1)) ==\n                 0)) {\n                // read array element\n                {\n                    x_235232 = ((__local\n                                 double *) red_arr_mem_235212)[sext_i32_i64(local_tid_235208 +\n                                                               offset_235237)];\n                    x_235233 = ((__local\n                                 double *) red_arr_mem_235214)[sext_i32_i64(local_tid_235208 +\n                                                               offset_235237)];\n                }\n                // apply reduction operation\n                {\n                    double defunc_1_op_res_235234 = x_235230 + x_235232;\n                    double defunc_1_op_res_235235 = x_235231 + x_235233;\n                ",
                   "    \n                    x_235230 = defunc_1_op_res_235234;\n                    x_235231 = defunc_1_op_res_235235;\n                }\n                // write result of operation\n                {\n                    ((__local\n                      double *) red_arr_mem_235212)[sext_i32_i64(local_tid_235208)] =\n                        x_235230;\n                    ((__local\n                      double *) red_arr_mem_235214)[sext_i32_i64(local_tid_235208)] =\n                        x_235231;\n                }\n            }\n            skip_waves_235238 *= 2;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        // first thread saves the result in accumulator\n        {\n            if (sext_i32_i64(local_tid_235208) == (int64_t) 0) {\n                x_acc_235227 = x_235230;\n                x_acc_235228 = x_235231;\n            }\n        }\n        if (groups_per_segment_235196 == (int64_t) 1) {\n            // first thread in group saves final result to memory\n            {\n                if (local_tid_235208 == 0) {\n                    ((__global double *) mem_230825)[gtid_221518 *\n                                                     l_n_m_203643 +\n                                                     gtid_221519] =\n                        x_acc_235227;\n                    ((__global double *) mem_230829)[gtid_221518 *\n                                                     l_n_m_203643 +\n                                                     gtid_221519] =\n                        x_acc_235228;\n                }\n            }\n        } else {\n            int32_t old_counter_235239;\n            \n            // first thread in group saves group result to global memory\n            {\n                if (local_tid_235208 == 0) {\n                    ((__global\n                      double *) segred_tmp_mem_235201)[sext_i32_i64(virt_group_id_235220)] =\n                        x_acc_235227;\n                    ((__global\n                      double *) segred_tmp_mem_235203)[sext_i",
                   "32_i64(virt_group_id_235220)] =\n                        x_acc_235228;\n                    mem_fence_global();\n                    old_counter_235239 =\n                        atomic_add_i32_global(&((volatile __global\n                                                 int *) mainzicounter_mem_235205)[sext_i32_i64(srem32(flat_segment_id_235221,\n                                                                                                      10240))],\n                                              (int) 1);\n                    ((__local bool *) sync_arr_mem_235216)[(int64_t) 0] =\n                        old_counter_235239 == groups_per_segment_235196 -\n                        (int64_t) 1;\n                }\n            }\n            barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n            \n            bool is_last_group_235240;\n            \n            is_last_group_235240 = ((__local\n                                     bool *) sync_arr_mem_235216)[(int64_t) 0];\n            if (is_last_group_235240) {\n                if (local_tid_235208 == 0) {\n                    old_counter_235239 =\n                        atomic_add_i32_global(&((volatile __global\n                                                 int *) mainzicounter_mem_235205)[sext_i32_i64(srem32(flat_segment_id_235221,\n                                                                                                      10240))],\n                                              (int) ((int64_t) 0 -\n                                                     groups_per_segment_235196));\n                }\n                // read in the per-group-results\n                {\n                    int64_t read_per_thread_235241 =\n                            sdiv_up64(groups_per_segment_235196,\n                                      segred_group_sizze_221513);\n                    \n                    x_221522 = 0.0;\n                    x_221523 = 0.0;\n                    for (int64_t i_235242 = 0; i_235242 <\n                ",
                   "         read_per_thread_235241; i_235242++) {\n                        int64_t group_res_id_235243 =\n                                sext_i32_i64(local_tid_235208) *\n                                read_per_thread_235241 + i_235242;\n                        int64_t index_of_group_res_235244 =\n                                sext_i32_i64(flat_segment_id_235221) *\n                                groups_per_segment_235196 + group_res_id_235243;\n                        \n                        if (slt64(group_res_id_235243,\n                                  groups_per_segment_235196)) {\n                            x_221524 = ((__global\n                                         double *) segred_tmp_mem_235201)[index_of_group_res_235244];\n                            x_221525 = ((__global\n                                         double *) segred_tmp_mem_235203)[index_of_group_res_235244];\n                            \n                            double defunc_1_op_res_221526 = x_221522 + x_221524;\n                            double defunc_1_op_res_221527 = x_221523 + x_221525;\n                            \n                            x_221522 = defunc_1_op_res_221526;\n                            x_221523 = defunc_1_op_res_221527;\n                        }\n                    }\n                }\n                ((__local\n                  double *) red_arr_mem_235212)[sext_i32_i64(local_tid_235208)] =\n                    x_221522;\n                ((__local\n                  double *) red_arr_mem_235214)[sext_i32_i64(local_tid_235208)] =\n                    x_221523;\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // reduce the per-group results\n                {\n                    int32_t offset_235245;\n                    int32_t skip_waves_235246 = 1;\n                    double x_235230;\n                    double x_235231;\n                    double x_235232;\n                    double x_235233;\n                    \n                    offset_235245 = 0;\n     ",
                   "               // participating threads read initial accumulator\n                    {\n                        if (slt32(local_tid_235208,\n                                  sext_i64_i32(segred_group_sizze_221513))) {\n                            x_235230 = ((__local\n                                         double *) red_arr_mem_235212)[sext_i32_i64(local_tid_235208 +\n                                                                       offset_235245)];\n                            x_235231 = ((__local\n                                         double *) red_arr_mem_235214)[sext_i32_i64(local_tid_235208 +\n                                                                       offset_235245)];\n                        }\n                    }\n                    offset_235245 = 1;\n                    while (slt32(offset_235245, wave_sizze_235210)) {\n                        if (slt32(local_tid_235208 + offset_235245,\n                                  sext_i64_i32(segred_group_sizze_221513)) &&\n                            ((local_tid_235208 - squot32(local_tid_235208,\n                                                         wave_sizze_235210) *\n                              wave_sizze_235210) & (2 * offset_235245 - 1)) ==\n                            0) {\n                            // read array element\n                            {\n                                x_235232 = ((volatile __local\n                                             double *) red_arr_mem_235212)[sext_i32_i64(local_tid_235208 +\n                                                                           offset_235245)];\n                                x_235233 = ((volatile __local\n                                             double *) red_arr_mem_235214)[sext_i32_i64(local_tid_235208 +\n                                                                           offset_235245)];\n                            }\n                            // apply reduction operation\n                            {\n                ",
                   "                double defunc_1_op_res_235234 = x_235230 +\n                                       x_235232;\n                                double defunc_1_op_res_235235 = x_235231 +\n                                       x_235233;\n                                \n                                x_235230 = defunc_1_op_res_235234;\n                                x_235231 = defunc_1_op_res_235235;\n                            }\n                            // write result of operation\n                            {\n                                ((volatile __local\n                                  double *) red_arr_mem_235212)[sext_i32_i64(local_tid_235208)] =\n                                    x_235230;\n                                ((volatile __local\n                                  double *) red_arr_mem_235214)[sext_i32_i64(local_tid_235208)] =\n                                    x_235231;\n                            }\n                        }\n                        offset_235245 *= 2;\n                    }\n                    while (slt32(skip_waves_235246,\n                                 squot32(sext_i64_i32(segred_group_sizze_221513) +\n                                         wave_sizze_235210 - 1,\n                                         wave_sizze_235210))) {\n                        barrier(CLK_LOCAL_MEM_FENCE);\n                        offset_235245 = skip_waves_235246 * wave_sizze_235210;\n                        if (slt32(local_tid_235208 + offset_235245,\n                                  sext_i64_i32(segred_group_sizze_221513)) &&\n                            ((local_tid_235208 - squot32(local_tid_235208,\n                                                         wave_sizze_235210) *\n                              wave_sizze_235210) == 0 &&\n                             (squot32(local_tid_235208, wave_sizze_235210) &\n                              (2 * skip_waves_235246 - 1)) == 0)) {\n                            // read array element\n                         ",
                   "   {\n                                x_235232 = ((__local\n                                             double *) red_arr_mem_235212)[sext_i32_i64(local_tid_235208 +\n                                                                           offset_235245)];\n                                x_235233 = ((__local\n                                             double *) red_arr_mem_235214)[sext_i32_i64(local_tid_235208 +\n                                                                           offset_235245)];\n                            }\n                            // apply reduction operation\n                            {\n                                double defunc_1_op_res_235234 = x_235230 +\n                                       x_235232;\n                                double defunc_1_op_res_235235 = x_235231 +\n                                       x_235233;\n                                \n                                x_235230 = defunc_1_op_res_235234;\n                                x_235231 = defunc_1_op_res_235235;\n                            }\n                            // write result of operation\n                            {\n                                ((__local\n                                  double *) red_arr_mem_235212)[sext_i32_i64(local_tid_235208)] =\n                                    x_235230;\n                                ((__local\n                                  double *) red_arr_mem_235214)[sext_i32_i64(local_tid_235208)] =\n                                    x_235231;\n                            }\n                        }\n                        skip_waves_235246 *= 2;\n                    }\n                    // and back to memory with the final result\n                    {\n                        if (local_tid_235208 == 0) {\n                            ((__global double *) mem_230825)[gtid_221518 *\n                                                             l_n_m_203643 +\n                                                      ",
                   "       gtid_221519] =\n                                x_235230;\n                            ((__global double *) mem_230829)[gtid_221518 *\n                                                             l_n_m_203643 +\n                                                             gtid_221519] =\n                                x_235231;\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_221513\n}\n__kernel void mainzisegred_large_223197(__global int *global_failure,\n                                        __local volatile\n                                        int64_t *sync_arr_mem_235456_backing_aligned_0,\n                                        __local volatile\n                                        int64_t *red_arr_mem_235454_backing_aligned_1,\n                                        int64_t n_203490, int64_t q_t_203494,\n                                        int64_t jump_t_203500,\n                                        int64_t partition_sizze_203577,\n                                        int64_t t_n_m_203650, int64_t i_203670,\n                                        int64_t num_groups_223191,\n                                        int64_t groups_per_segment_235440,\n                                        int64_t elements_per_thread_235441,\n                                        int64_t virt_num_groups_235442,\n                                        int64_t threads_per_segment_235444,\n                                        __global unsigned char *ext_mem_229196,\n                                        __global unsigned char *ext_mem_229197,\n                                        __global unsigned char *ext_mem_229460,\n                                        __global unsigned char *ext_mem_229461,\n                                        __global unsigned char *mem_231013,\n                             ",
                   "           __global unsigned char *mem_231027,\n                                        __global\n                                        unsigned char *segred_tmp_mem_235445,\n                                        __global\n                                        unsigned char *mainzicounter_mem_235447)\n{\n    #define segred_group_sizze_223190 (mainzisegred_group_sizze_222794)\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_235456_backing_1 =\n                                   (__local volatile\n                                    unsigned char *) sync_arr_mem_235456_backing_aligned_0;\n    __local volatile unsigned char *restrict red_arr_mem_235454_backing_0 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_235454_backing_aligned_1;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_235449;\n    int32_t local_tid_235450;\n    int64_t group_sizze_235453;\n    int32_t wave_sizze_235452;\n    int32_t group_tid_235451;\n    \n    global_tid_235449 = get_global_id(0);\n    local_tid_235450 = get_local_id(0);\n    group_sizze_235453 = get_local_size(0);\n    wave_sizze_235452 = LOCKSTEP_WIDTH;\n    group_tid_235451 = get_group_id(0);\n    \n    int32_t phys_tid_223197 = global_tid_235449;\n    __local unsigned char *red_arr_mem_235454;\n    \n    red_arr_mem_235454 = (__local unsigned char *) red_arr_mem_235454_backing_0;\n    \n    __local unsigned char *sync_arr_mem_235456;\n    \n    sync_arr_mem_235456 = (__local\n                           unsigned char *) sync_arr_mem_235456_backing_1;\n    \n    int32_t phys_group_id_235458;\n    \n    phys_group_id_235458 = get_group_id(0);\n    for (int32_t i_235459 = 0; i_235459 <\n         sdiv_up32(sext_i64_i32(virt_num_groups_235442) - phys_group_id_235458,\n                   sext_i64_i32(num_groups_223191)); i_235459++) {\n        int32_t virt_group_id_23",
                   "5460 = phys_group_id_235458 + i_235459 *\n                sext_i64_i32(num_groups_223191);\n        int32_t flat_segment_id_235461 = squot32(virt_group_id_235460,\n                                                 sext_i64_i32(groups_per_segment_235440));\n        int64_t global_tid_235462 = srem64(sext_i32_i64(virt_group_id_235460) *\n                                           segred_group_sizze_223190 +\n                                           sext_i32_i64(local_tid_235450),\n                                           segred_group_sizze_223190 *\n                                           groups_per_segment_235440);\n        int64_t slice_235463 = t_n_m_203650;\n        int64_t slice_235464 = partition_sizze_203577 * slice_235463;\n        int64_t gtid_223194 = squot64(sext_i32_i64(flat_segment_id_235461),\n                                      slice_235463);\n        int64_t remnant_235465 = sext_i32_i64(flat_segment_id_235461) -\n                gtid_223194 * slice_235463;\n        int64_t gtid_223195 = remnant_235465;\n        int64_t remnant_235466 = remnant_235465 - gtid_223195;\n        int64_t gtid_223196;\n        double x_acc_235467;\n        int64_t chunk_sizze_235468 = smin64(elements_per_thread_235441,\n                                            sdiv_up64(q_t_203494 -\n                                                      global_tid_235462,\n                                                      threads_per_segment_235444));\n        double x_223198;\n        double x_223199;\n        \n        // neutral-initialise the accumulators\n        {\n            x_acc_235467 = 0.0;\n        }\n        for (int64_t i_235472 = 0; i_235472 < chunk_sizze_235468; i_235472++) {\n            gtid_223196 = global_tid_235462 + threads_per_segment_235444 *\n                i_235472;\n            // apply map function\n            {\n                int64_t x_223202;\n                \n                x_223202 = ((__global int64_t *) ext_mem_229196)[gtid_223194];\n                \n                int64_t",
                   " x_223207;\n                \n                x_223207 = ((__global int64_t *) ext_mem_229461)[gtid_223194 *\n                                                                 t_n_m_203650 +\n                                                                 gtid_223195];\n                \n                double x_223208;\n                \n                x_223208 = ((__global double *) ext_mem_229460)[gtid_223194 *\n                                                                t_n_m_203650 +\n                                                                gtid_223195];\n                \n                int64_t binop_y_228664 = mul64(jump_t_203500, gtid_223195);\n                int64_t binop_y_228665 = smin64(i_203670, binop_y_228664);\n                int64_t index_primexp_228666 = add64((int64_t) 1,\n                                                     binop_y_228665);\n                bool cond_223211 = sle64(x_223202, gtid_223196);\n                int64_t defunc_0_f_res_223212;\n                \n                if (cond_223211) {\n                    defunc_0_f_res_223212 = (int64_t) 0;\n                } else {\n                    int64_t i_223213 = add64(gtid_223196, x_223207);\n                    int64_t defunc_0_add_arg_223214;\n                    \n                    defunc_0_add_arg_223214 = ((__global\n                                                int64_t *) ext_mem_229197)[gtid_223194 *\n                                                                           n_203490 +\n                                                                           i_223213];\n                    \n                    int64_t defunc_1_add_res_223215 = add64((int64_t) 1,\n                                                            defunc_0_add_arg_223214);\n                    \n                    defunc_0_f_res_223212 = defunc_1_add_res_223215;\n                }\n                \n                double defunc_0_f_res_223216;\n                \n                if (cond_223211) {\n                  ",
                   "  defunc_0_f_res_223216 = 0.0;\n                } else {\n                    int64_t i_223217 = add64(gtid_223196, x_223207);\n                    double defunc_0_add_arg_223218;\n                    \n                    defunc_0_add_arg_223218 = ((__global\n                                                double *) mem_231013)[gtid_223194 *\n                                                                      n_203490 +\n                                                                      i_223217];\n                    defunc_0_f_res_223216 = defunc_0_add_arg_223218;\n                }\n                \n                int64_t binop_p_223219 = sub64(defunc_0_f_res_223212,\n                                               index_primexp_228666);\n                double defunc_0_f_res_223220 = sitofp_i64_f64(binop_p_223219);\n                double abs_res_223221 = fabs(defunc_0_f_res_223220);\n                double tmp1_223222 = abs_res_223221 / x_223208;\n                double x_223223 = tmp1_223222 * tmp1_223222;\n                double y_223224 = tmp1_223222 * x_223223;\n                double tmp2_223225 = 1.0 - y_223224;\n                double x_223226 = tmp2_223225 * tmp2_223225;\n                double tmp3_223227 = tmp2_223225 * x_223226;\n                double w_j_223228 = defunc_0_f_res_223216 * tmp3_223227;\n                \n                // save map-out results\n                { }\n                // load accumulator\n                {\n                    x_223198 = x_acc_235467;\n                }\n                // load new values\n                {\n                    x_223199 = w_j_223228;\n                }\n                // apply reduction operator\n                {\n                    double defunc_1_op_res_223200 = x_223198 + x_223199;\n                    \n                    // store in accumulator\n                    {\n                        x_acc_235467 = defunc_1_op_res_223200;\n                    }\n                }\n            }\n        }\n        // to reduc",
                   "e current chunk, first store our result in memory\n        {\n            x_223198 = x_acc_235467;\n            ((__local\n              double *) red_arr_mem_235454)[sext_i32_i64(local_tid_235450)] =\n                x_223198;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        \n        int32_t offset_235473;\n        int32_t skip_waves_235474 = 1;\n        double x_235469;\n        double x_235470;\n        \n        offset_235473 = 0;\n        // participating threads read initial accumulator\n        {\n            if (slt32(local_tid_235450,\n                      sext_i64_i32(segred_group_sizze_223190))) {\n                x_235469 = ((__local\n                             double *) red_arr_mem_235454)[sext_i32_i64(local_tid_235450 +\n                                                           offset_235473)];\n            }\n        }\n        offset_235473 = 1;\n        while (slt32(offset_235473, wave_sizze_235452)) {\n            if (slt32(local_tid_235450 + offset_235473,\n                      sext_i64_i32(segred_group_sizze_223190)) &&\n                ((local_tid_235450 - squot32(local_tid_235450,\n                                             wave_sizze_235452) *\n                  wave_sizze_235452) & (2 * offset_235473 - 1)) == 0) {\n                // read array element\n                {\n                    x_235470 = ((volatile __local\n                                 double *) red_arr_mem_235454)[sext_i32_i64(local_tid_235450 +\n                                                               offset_235473)];\n                }\n                // apply reduction operation\n                {\n                    double defunc_1_op_res_235471 = x_235469 + x_235470;\n                    \n                    x_235469 = defunc_1_op_res_235471;\n                }\n                // write result of operation\n                {\n                    ((volatile __local\n                      double *) red_arr_mem_235454)[sext_i32_i64(local_tid_235450)] =\n                        x_235469;\n   ",
                   "             }\n            }\n            offset_235473 *= 2;\n        }\n        while (slt32(skip_waves_235474,\n                     squot32(sext_i64_i32(segred_group_sizze_223190) +\n                             wave_sizze_235452 - 1, wave_sizze_235452))) {\n            barrier(CLK_LOCAL_MEM_FENCE);\n            offset_235473 = skip_waves_235474 * wave_sizze_235452;\n            if (slt32(local_tid_235450 + offset_235473,\n                      sext_i64_i32(segred_group_sizze_223190)) &&\n                ((local_tid_235450 - squot32(local_tid_235450,\n                                             wave_sizze_235452) *\n                  wave_sizze_235452) == 0 && (squot32(local_tid_235450,\n                                                      wave_sizze_235452) & (2 *\n                                                                            skip_waves_235474 -\n                                                                            1)) ==\n                 0)) {\n                // read array element\n                {\n                    x_235470 = ((__local\n                                 double *) red_arr_mem_235454)[sext_i32_i64(local_tid_235450 +\n                                                               offset_235473)];\n                }\n                // apply reduction operation\n                {\n                    double defunc_1_op_res_235471 = x_235469 + x_235470;\n                    \n                    x_235469 = defunc_1_op_res_235471;\n                }\n                // write result of operation\n                {\n                    ((__local\n                      double *) red_arr_mem_235454)[sext_i32_i64(local_tid_235450)] =\n                        x_235469;\n                }\n            }\n            skip_waves_235474 *= 2;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        // first thread saves the result in accumulator\n        {\n            if (sext_i32_i64(local_tid_235450) == (int64_t) 0) {\n                x_acc_235467 = x_235469;\n        ",
                   "    }\n        }\n        if (groups_per_segment_235440 == (int64_t) 1) {\n            // first thread in group saves final result to memory\n            {\n                if (local_tid_235450 == 0) {\n                    ((__global double *) mem_231027)[gtid_223194 *\n                                                     t_n_m_203650 +\n                                                     gtid_223195] =\n                        x_acc_235467;\n                }\n            }\n        } else {\n            int32_t old_counter_235475;\n            \n            // first thread in group saves group result to global memory\n            {\n                if (local_tid_235450 == 0) {\n                    ((__global\n                      double *) segred_tmp_mem_235445)[sext_i32_i64(virt_group_id_235460)] =\n                        x_acc_235467;\n                    mem_fence_global();\n                    old_counter_235475 =\n                        atomic_add_i32_global(&((volatile __global\n                                                 int *) mainzicounter_mem_235447)[sext_i32_i64(srem32(flat_segment_id_235461,\n                                                                                                      10240))],\n                                              (int) 1);\n                    ((__local bool *) sync_arr_mem_235456)[(int64_t) 0] =\n                        old_counter_235475 == groups_per_segment_235440 -\n                        (int64_t) 1;\n                }\n            }\n            barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n            \n            bool is_last_group_235476;\n            \n            is_last_group_235476 = ((__local\n                                     bool *) sync_arr_mem_235456)[(int64_t) 0];\n            if (is_last_group_235476) {\n                if (local_tid_235450 == 0) {\n                    old_counter_235475 =\n                        atomic_add_i32_global(&((volatile __global\n                                                 int *) mai",
                   "nzicounter_mem_235447)[sext_i32_i64(srem32(flat_segment_id_235461,\n                                                                                                      10240))],\n                                              (int) ((int64_t) 0 -\n                                                     groups_per_segment_235440));\n                }\n                // read in the per-group-results\n                {\n                    int64_t read_per_thread_235477 =\n                            sdiv_up64(groups_per_segment_235440,\n                                      segred_group_sizze_223190);\n                    \n                    x_223198 = 0.0;\n                    for (int64_t i_235478 = 0; i_235478 <\n                         read_per_thread_235477; i_235478++) {\n                        int64_t group_res_id_235479 =\n                                sext_i32_i64(local_tid_235450) *\n                                read_per_thread_235477 + i_235478;\n                        int64_t index_of_group_res_235480 =\n                                sext_i32_i64(flat_segment_id_235461) *\n                                groups_per_segment_235440 + group_res_id_235479;\n                        \n                        if (slt64(group_res_id_235479,\n                                  groups_per_segment_235440)) {\n                            x_223199 = ((__global\n                                         double *) segred_tmp_mem_235445)[index_of_group_res_235480];\n                            \n                            double defunc_1_op_res_223200 = x_223198 + x_223199;\n                            \n                            x_223198 = defunc_1_op_res_223200;\n                        }\n                    }\n                }\n                ((__local\n                  double *) red_arr_mem_235454)[sext_i32_i64(local_tid_235450)] =\n                    x_223198;\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // reduce the per-group results\n                {\n             ",
                   "       int32_t offset_235481;\n                    int32_t skip_waves_235482 = 1;\n                    double x_235469;\n                    double x_235470;\n                    \n                    offset_235481 = 0;\n                    // participating threads read initial accumulator\n                    {\n                        if (slt32(local_tid_235450,\n                                  sext_i64_i32(segred_group_sizze_223190))) {\n                            x_235469 = ((__local\n                                         double *) red_arr_mem_235454)[sext_i32_i64(local_tid_235450 +\n                                                                       offset_235481)];\n                        }\n                    }\n                    offset_235481 = 1;\n                    while (slt32(offset_235481, wave_sizze_235452)) {\n                        if (slt32(local_tid_235450 + offset_235481,\n                                  sext_i64_i32(segred_group_sizze_223190)) &&\n                            ((local_tid_235450 - squot32(local_tid_235450,\n                                                         wave_sizze_235452) *\n                              wave_sizze_235452) & (2 * offset_235481 - 1)) ==\n                            0) {\n                            // read array element\n                            {\n                                x_235470 = ((volatile __local\n                                             double *) red_arr_mem_235454)[sext_i32_i64(local_tid_235450 +\n                                                                           offset_235481)];\n                            }\n                            // apply reduction operation\n                            {\n                                double defunc_1_op_res_235471 = x_235469 +\n                                       x_235470;\n                                \n                                x_235469 = defunc_1_op_res_235471;\n                            }\n                            // write result",
                   " of operation\n                            {\n                                ((volatile __local\n                                  double *) red_arr_mem_235454)[sext_i32_i64(local_tid_235450)] =\n                                    x_235469;\n                            }\n                        }\n                        offset_235481 *= 2;\n                    }\n                    while (slt32(skip_waves_235482,\n                                 squot32(sext_i64_i32(segred_group_sizze_223190) +\n                                         wave_sizze_235452 - 1,\n                                         wave_sizze_235452))) {\n                        barrier(CLK_LOCAL_MEM_FENCE);\n                        offset_235481 = skip_waves_235482 * wave_sizze_235452;\n                        if (slt32(local_tid_235450 + offset_235481,\n                                  sext_i64_i32(segred_group_sizze_223190)) &&\n                            ((local_tid_235450 - squot32(local_tid_235450,\n                                                         wave_sizze_235452) *\n                              wave_sizze_235452) == 0 &&\n                             (squot32(local_tid_235450, wave_sizze_235452) &\n                              (2 * skip_waves_235482 - 1)) == 0)) {\n                            // read array element\n                            {\n                                x_235470 = ((__local\n                                             double *) red_arr_mem_235454)[sext_i32_i64(local_tid_235450 +\n                                                                           offset_235481)];\n                            }\n                            // apply reduction operation\n                            {\n                                double defunc_1_op_res_235471 = x_235469 +\n                                       x_235470;\n                                \n                                x_235469 = defunc_1_op_res_235471;\n                            }\n                            // write re",
                   "sult of operation\n                            {\n                                ((__local\n                                  double *) red_arr_mem_235454)[sext_i32_i64(local_tid_235450)] =\n                                    x_235469;\n                            }\n                        }\n                        skip_waves_235482 *= 2;\n                    }\n                    // and back to memory with the final result\n                    {\n                        if (local_tid_235450 == 0) {\n                            ((__global double *) mem_231027)[gtid_223194 *\n                                                             t_n_m_203650 +\n                                                             gtid_223195] =\n                                x_235469;\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_223190\n}\n__kernel void mainzisegred_large_223249(__global int *global_failure,\n                                        __local volatile\n                                        int64_t *sync_arr_mem_235538_backing_aligned_0,\n                                        __local volatile\n                                        int64_t *red_arr_mem_235536_backing_aligned_1,\n                                        int64_t n_203490, int64_t q_t_203494,\n                                        int64_t jump_t_203500,\n                                        int64_t partition_sizze_203577,\n                                        int64_t t_n_m_203650, int64_t i_203670,\n                                        int64_t num_groups_223243,\n                                        int64_t groups_per_segment_235522,\n                                        int64_t elements_per_thread_235523,\n                                        int64_t virt_num_groups_235524,\n                                        int64_t threads_per_segmen",
                   "t_235526,\n                                        __global unsigned char *ext_mem_229196,\n                                        __global unsigned char *ext_mem_229197,\n                                        __global unsigned char *ext_mem_229460,\n                                        __global unsigned char *ext_mem_229461,\n                                        __global unsigned char *mem_231013,\n                                        __global unsigned char *mem_231017,\n                                        __global unsigned char *mem_231032,\n                                        __global unsigned char *mem_231037,\n                                        __global\n                                        unsigned char *segred_tmp_mem_235527,\n                                        __global\n                                        unsigned char *mainzicounter_mem_235529)\n{\n    #define segred_group_sizze_223242 (mainzisegred_group_sizze_222724)\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_235538_backing_1 =\n                                   (__local volatile\n                                    unsigned char *) sync_arr_mem_235538_backing_aligned_0;\n    __local volatile unsigned char *restrict red_arr_mem_235536_backing_0 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_235536_backing_aligned_1;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_235531;\n    int32_t local_tid_235532;\n    int64_t group_sizze_235535;\n    int32_t wave_sizze_235534;\n    int32_t group_tid_235533;\n    \n    global_tid_235531 = get_global_id(0);\n    local_tid_235532 = get_local_id(0);\n    group_sizze_235535 = get_local_size(0);\n    wave_sizze_235534 = LOCKSTEP_WIDTH;\n    group_tid_235533 = get_group_id(0);\n    \n    int32_t phys_tid_223249 = global_tid_235531;\n    __local unsigned ch",
                   "ar *red_arr_mem_235536;\n    \n    red_arr_mem_235536 = (__local unsigned char *) red_arr_mem_235536_backing_0;\n    \n    __local unsigned char *sync_arr_mem_235538;\n    \n    sync_arr_mem_235538 = (__local\n                           unsigned char *) sync_arr_mem_235538_backing_1;\n    \n    int32_t phys_group_id_235540;\n    \n    phys_group_id_235540 = get_group_id(0);\n    for (int32_t i_235541 = 0; i_235541 <\n         sdiv_up32(sext_i64_i32(virt_num_groups_235524) - phys_group_id_235540,\n                   sext_i64_i32(num_groups_223243)); i_235541++) {\n        int32_t virt_group_id_235542 = phys_group_id_235540 + i_235541 *\n                sext_i64_i32(num_groups_223243);\n        int32_t flat_segment_id_235543 = squot32(virt_group_id_235542,\n                                                 sext_i64_i32(groups_per_segment_235522));\n        int64_t global_tid_235544 = srem64(sext_i32_i64(virt_group_id_235542) *\n                                           segred_group_sizze_223242 +\n                                           sext_i32_i64(local_tid_235532),\n                                           segred_group_sizze_223242 *\n                                           groups_per_segment_235522);\n        int64_t slice_235545 = t_n_m_203650;\n        int64_t slice_235546 = partition_sizze_203577 * slice_235545;\n        int64_t gtid_223246 = squot64(sext_i32_i64(flat_segment_id_235543),\n                                      slice_235545);\n        int64_t remnant_235547 = sext_i32_i64(flat_segment_id_235543) -\n                gtid_223246 * slice_235545;\n        int64_t gtid_223247 = remnant_235547;\n        int64_t remnant_235548 = remnant_235547 - gtid_223247;\n        int64_t gtid_223248;\n        double x_acc_235549;\n        int64_t chunk_sizze_235550 = smin64(elements_per_thread_235523,\n                                            sdiv_up64(q_t_203494 -\n                                                      global_tid_235544,\n                                                      ",
                   "threads_per_segment_235526));\n        double x_223250;\n        double x_223251;\n        \n        // neutral-initialise the accumulators\n        {\n            x_acc_235549 = 0.0;\n        }\n        for (int64_t i_235554 = 0; i_235554 < chunk_sizze_235550; i_235554++) {\n            gtid_223248 = global_tid_235544 + threads_per_segment_235526 *\n                i_235554;\n            // apply map function\n            {\n                int64_t x_223254;\n                \n                x_223254 = ((__global int64_t *) ext_mem_229196)[gtid_223246];\n                \n                int64_t x_223261;\n                \n                x_223261 = ((__global int64_t *) ext_mem_229461)[gtid_223246 *\n                                                                 t_n_m_203650 +\n                                                                 gtid_223247];\n                \n                double x_223262;\n                \n                x_223262 = ((__global double *) ext_mem_229460)[gtid_223246 *\n                                                                t_n_m_203650 +\n                                                                gtid_223247];\n                \n                int64_t binop_y_228659 = mul64(jump_t_203500, gtid_223247);\n                int64_t binop_y_228660 = smin64(i_203670, binop_y_228659);\n                int64_t index_primexp_228661 = add64((int64_t) 1,\n                                                     binop_y_228660);\n                double a0_223264;\n                \n                a0_223264 = ((__global double *) mem_231032)[gtid_223246 *\n                                                             t_n_m_203650 +\n                                                             gtid_223247];\n                \n                bool cond_223266 = sle64(x_223254, gtid_223248);\n                int64_t defunc_0_f_res_223267;\n                \n                if (cond_223266) {\n                    defunc_0_f_res_223267 = (int64_t) 0;\n                } else {\n ",
                   "                   int64_t i_223268 = add64(gtid_223248, x_223261);\n                    int64_t defunc_0_add_arg_223269;\n                    \n                    defunc_0_add_arg_223269 = ((__global\n                                                int64_t *) ext_mem_229197)[gtid_223246 *\n                                                                           n_203490 +\n                                                                           i_223268];\n                    \n                    int64_t defunc_1_add_res_223270 = add64((int64_t) 1,\n                                                            defunc_0_add_arg_223269);\n                    \n                    defunc_0_f_res_223267 = defunc_1_add_res_223270;\n                }\n                \n                double defunc_0_f_res_223271;\n                \n                if (cond_223266) {\n                    defunc_0_f_res_223271 = 0.0;\n                } else {\n                    int64_t i_223272 = add64(gtid_223248, x_223261);\n                    double defunc_0_add_arg_223273;\n                    \n                    defunc_0_add_arg_223273 = ((__global\n                                                double *) mem_231013)[gtid_223246 *\n                                                                      n_203490 +\n                                                                      i_223272];\n                    defunc_0_f_res_223271 = defunc_0_add_arg_223273;\n                }\n                \n                int64_t binop_p_223274 = sub64(defunc_0_f_res_223267,\n                                               index_primexp_228661);\n                double defunc_0_f_res_223275 = sitofp_i64_f64(binop_p_223274);\n                double abs_res_223276 = fabs(defunc_0_f_res_223275);\n                double tmp1_223277 = abs_res_223276 / x_223262;\n                double x_223278 = tmp1_223277 * tmp1_223277;\n                double y_223279 = tmp1_223277 * x_223278;\n                double tmp2_223280 = 1.0 - ",
                   "y_223279;\n                double x_223281 = tmp2_223280 * tmp2_223280;\n                double tmp3_223282 = tmp2_223280 * x_223281;\n                double tmp4_223283 = defunc_0_f_res_223271 * tmp3_223282;\n                double defunc_0_f_res_223284;\n                \n                if (cond_223266) {\n                    defunc_0_f_res_223284 = 0.0;\n                } else {\n                    int64_t i_223285 = add64(gtid_223248, x_223261);\n                    double defunc_0_add_arg_223286;\n                    \n                    defunc_0_add_arg_223286 = ((__global\n                                                double *) mem_231017)[gtid_223246 *\n                                                                      n_203490 +\n                                                                      i_223285];\n                    defunc_0_f_res_223284 = defunc_0_add_arg_223286;\n                }\n                \n                double x_223287 = a0_223264 * tmp4_223283;\n                double defunc_9_fit_fun_res_223288 = defunc_0_f_res_223284 *\n                       x_223287;\n                \n                // save map-out results\n                { }\n                // load accumulator\n                {\n                    x_223250 = x_acc_235549;\n                }\n                // load new values\n                {\n                    x_223251 = defunc_9_fit_fun_res_223288;\n                }\n                // apply reduction operator\n                {\n                    double defunc_1_op_res_223252 = x_223250 + x_223251;\n                    \n                    // store in accumulator\n                    {\n                        x_acc_235549 = defunc_1_op_res_223252;\n                    }\n                }\n            }\n        }\n        // to reduce current chunk, first store our result in memory\n        {\n            x_223250 = x_acc_235549;\n            ((__local\n              double *) red_arr_mem_235536)[sext_i32_i64(local_tid_235532)] =\n              ",
                   "  x_223250;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        \n        int32_t offset_235555;\n        int32_t skip_waves_235556 = 1;\n        double x_235551;\n        double x_235552;\n        \n        offset_235555 = 0;\n        // participating threads read initial accumulator\n        {\n            if (slt32(local_tid_235532,\n                      sext_i64_i32(segred_group_sizze_223242))) {\n                x_235551 = ((__local\n                             double *) red_arr_mem_235536)[sext_i32_i64(local_tid_235532 +\n                                                           offset_235555)];\n            }\n        }\n        offset_235555 = 1;\n        while (slt32(offset_235555, wave_sizze_235534)) {\n            if (slt32(local_tid_235532 + offset_235555,\n                      sext_i64_i32(segred_group_sizze_223242)) &&\n                ((local_tid_235532 - squot32(local_tid_235532,\n                                             wave_sizze_235534) *\n                  wave_sizze_235534) & (2 * offset_235555 - 1)) == 0) {\n                // read array element\n                {\n                    x_235552 = ((volatile __local\n                                 double *) red_arr_mem_235536)[sext_i32_i64(local_tid_235532 +\n                                                               offset_235555)];\n                }\n                // apply reduction operation\n                {\n                    double defunc_1_op_res_235553 = x_235551 + x_235552;\n                    \n                    x_235551 = defunc_1_op_res_235553;\n                }\n                // write result of operation\n                {\n                    ((volatile __local\n                      double *) red_arr_mem_235536)[sext_i32_i64(local_tid_235532)] =\n                        x_235551;\n                }\n            }\n            offset_235555 *= 2;\n        }\n        while (slt32(skip_waves_235556,\n                     squot32(sext_i64_i32(segred_group_sizze_223242) +\n                             ",
                   "wave_sizze_235534 - 1, wave_sizze_235534))) {\n            barrier(CLK_LOCAL_MEM_FENCE);\n            offset_235555 = skip_waves_235556 * wave_sizze_235534;\n            if (slt32(local_tid_235532 + offset_235555,\n                      sext_i64_i32(segred_group_sizze_223242)) &&\n                ((local_tid_235532 - squot32(local_tid_235532,\n                                             wave_sizze_235534) *\n                  wave_sizze_235534) == 0 && (squot32(local_tid_235532,\n                                                      wave_sizze_235534) & (2 *\n                                                                            skip_waves_235556 -\n                                                                            1)) ==\n                 0)) {\n                // read array element\n                {\n                    x_235552 = ((__local\n                                 double *) red_arr_mem_235536)[sext_i32_i64(local_tid_235532 +\n                                                               offset_235555)];\n                }\n                // apply reduction operation\n                {\n                    double defunc_1_op_res_235553 = x_235551 + x_235552;\n                    \n                    x_235551 = defunc_1_op_res_235553;\n                }\n                // write result of operation\n                {\n                    ((__local\n                      double *) red_arr_mem_235536)[sext_i32_i64(local_tid_235532)] =\n                        x_235551;\n                }\n            }\n            skip_waves_235556 *= 2;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        // first thread saves the result in accumulator\n        {\n            if (sext_i32_i64(local_tid_235532) == (int64_t) 0) {\n                x_acc_235549 = x_235551;\n            }\n        }\n        if (groups_per_segment_235522 == (int64_t) 1) {\n            // first thread in group saves final result to memory\n            {\n                if (local_tid_235532 == 0) {\n              ",
                   "      ((__global double *) mem_231037)[gtid_223246 *\n                                                     t_n_m_203650 +\n                                                     gtid_223247] =\n                        x_acc_235549;\n                }\n            }\n        } else {\n            int32_t old_counter_235557;\n            \n            // first thread in group saves group result to global memory\n            {\n                if (local_tid_235532 == 0) {\n                    ((__global\n                      double *) segred_tmp_mem_235527)[sext_i32_i64(virt_group_id_235542)] =\n                        x_acc_235549;\n                    mem_fence_global();\n                    old_counter_235557 =\n                        atomic_add_i32_global(&((volatile __global\n                                                 int *) mainzicounter_mem_235529)[sext_i32_i64(srem32(flat_segment_id_235543,\n                                                                                                      10240))],\n                                              (int) 1);\n                    ((__local bool *) sync_arr_mem_235538)[(int64_t) 0] =\n                        old_counter_235557 == groups_per_segment_235522 -\n                        (int64_t) 1;\n                }\n            }\n            barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n            \n            bool is_last_group_235558;\n            \n            is_last_group_235558 = ((__local\n                                     bool *) sync_arr_mem_235538)[(int64_t) 0];\n            if (is_last_group_235558) {\n                if (local_tid_235532 == 0) {\n                    old_counter_235557 =\n                        atomic_add_i32_global(&((volatile __global\n                                                 int *) mainzicounter_mem_235529)[sext_i32_i64(srem32(flat_segment_id_235543,\n                                                                                                      10240))],\n                                ",
                   "              (int) ((int64_t) 0 -\n                                                     groups_per_segment_235522));\n                }\n                // read in the per-group-results\n                {\n                    int64_t read_per_thread_235559 =\n                            sdiv_up64(groups_per_segment_235522,\n                                      segred_group_sizze_223242);\n                    \n                    x_223250 = 0.0;\n                    for (int64_t i_235560 = 0; i_235560 <\n                         read_per_thread_235559; i_235560++) {\n                        int64_t group_res_id_235561 =\n                                sext_i32_i64(local_tid_235532) *\n                                read_per_thread_235559 + i_235560;\n                        int64_t index_of_group_res_235562 =\n                                sext_i32_i64(flat_segment_id_235543) *\n                                groups_per_segment_235522 + group_res_id_235561;\n                        \n                        if (slt64(group_res_id_235561,\n                                  groups_per_segment_235522)) {\n                            x_223251 = ((__global\n                                         double *) segred_tmp_mem_235527)[index_of_group_res_235562];\n                            \n                            double defunc_1_op_res_223252 = x_223250 + x_223251;\n                            \n                            x_223250 = defunc_1_op_res_223252;\n                        }\n                    }\n                }\n                ((__local\n                  double *) red_arr_mem_235536)[sext_i32_i64(local_tid_235532)] =\n                    x_223250;\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // reduce the per-group results\n                {\n                    int32_t offset_235563;\n                    int32_t skip_waves_235564 = 1;\n                    double x_235551;\n                    double x_235552;\n                    \n                    offset_235563 =",
                   " 0;\n                    // participating threads read initial accumulator\n                    {\n                        if (slt32(local_tid_235532,\n                                  sext_i64_i32(segred_group_sizze_223242))) {\n                            x_235551 = ((__local\n                                         double *) red_arr_mem_235536)[sext_i32_i64(local_tid_235532 +\n                                                                       offset_235563)];\n                        }\n                    }\n                    offset_235563 = 1;\n                    while (slt32(offset_235563, wave_sizze_235534)) {\n                        if (slt32(local_tid_235532 + offset_235563,\n                                  sext_i64_i32(segred_group_sizze_223242)) &&\n                            ((local_tid_235532 - squot32(local_tid_235532,\n                                                         wave_sizze_235534) *\n                              wave_sizze_235534) & (2 * offset_235563 - 1)) ==\n                            0) {\n                            // read array element\n                            {\n                                x_235552 = ((volatile __local\n                                             double *) red_arr_mem_235536)[sext_i32_i64(local_tid_235532 +\n                                                                           offset_235563)];\n                            }\n                            // apply reduction operation\n                            {\n                                double defunc_1_op_res_235553 = x_235551 +\n                                       x_235552;\n                                \n                                x_235551 = defunc_1_op_res_235553;\n                            }\n                            // write result of operation\n                            {\n                                ((volatile __local\n                                  double *) red_arr_mem_235536)[sext_i32_i64(local_tid_235532)] =\n                  ",
                   "                  x_235551;\n                            }\n                        }\n                        offset_235563 *= 2;\n                    }\n                    while (slt32(skip_waves_235564,\n                                 squot32(sext_i64_i32(segred_group_sizze_223242) +\n                                         wave_sizze_235534 - 1,\n                                         wave_sizze_235534))) {\n                        barrier(CLK_LOCAL_MEM_FENCE);\n                        offset_235563 = skip_waves_235564 * wave_sizze_235534;\n                        if (slt32(local_tid_235532 + offset_235563,\n                                  sext_i64_i32(segred_group_sizze_223242)) &&\n                            ((local_tid_235532 - squot32(local_tid_235532,\n                                                         wave_sizze_235534) *\n                              wave_sizze_235534) == 0 &&\n                             (squot32(local_tid_235532, wave_sizze_235534) &\n                              (2 * skip_waves_235564 - 1)) == 0)) {\n                            // read array element\n                            {\n                                x_235552 = ((__local\n                                             double *) red_arr_mem_235536)[sext_i32_i64(local_tid_235532 +\n                                                                           offset_235563)];\n                            }\n                            // apply reduction operation\n                            {\n                                double defunc_1_op_res_235553 = x_235551 +\n                                       x_235552;\n                                \n                                x_235551 = defunc_1_op_res_235553;\n                            }\n                            // write result of operation\n                            {\n                                ((__local\n                                  double *) red_arr_mem_235536)[sext_i32_i64(local_tid_235532)] =\n                       ",
                   "             x_235551;\n                            }\n                        }\n                        skip_waves_235564 *= 2;\n                    }\n                    // and back to memory with the final result\n                    {\n                        if (local_tid_235532 == 0) {\n                            ((__global double *) mem_231037)[gtid_223246 *\n                                                             t_n_m_203650 +\n                                                             gtid_223247] =\n                                x_235551;\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_223242\n}\n__kernel void mainzisegred_large_224235(__global int *global_failure,\n                                        __local volatile\n                                        int64_t *sync_arr_mem_235707_backing_aligned_0,\n                                        __local volatile\n                                        int64_t *red_arr_mem_235705_backing_aligned_1,\n                                        __local volatile\n                                        int64_t *red_arr_mem_235703_backing_aligned_2,\n                                        __local volatile\n                                        int64_t *red_arr_mem_235701_backing_aligned_3,\n                                        int64_t n_203490, int64_t q_t_203494,\n                                        int64_t jump_t_203500,\n                                        int64_t partition_sizze_203577,\n                                        int64_t t_n_m_203650, int64_t i_203670,\n                                        int64_t num_groups_224227,\n                                        int64_t groups_per_segment_235683,\n                                        int64_t elements_per_thread_235684,\n                                        int64_t virt_num_grou",
                   "ps_235685,\n                                        int64_t threads_per_segment_235687,\n                                        __global unsigned char *ext_mem_229196,\n                                        __global unsigned char *ext_mem_229197,\n                                        __global unsigned char *ext_mem_229460,\n                                        __global unsigned char *ext_mem_229461,\n                                        __global unsigned char *mem_231151,\n                                        __global unsigned char *mem_231169,\n                                        __global unsigned char *mem_231173,\n                                        __global unsigned char *mem_231177,\n                                        __global\n                                        unsigned char *segred_tmp_mem_235688,\n                                        __global\n                                        unsigned char *segred_tmp_mem_235690,\n                                        __global\n                                        unsigned char *segred_tmp_mem_235692,\n                                        __global\n                                        unsigned char *mainzicounter_mem_235694)\n{\n    #define segred_group_sizze_224226 (mainzisegred_group_sizze_223755)\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_235707_backing_3 =\n                                   (__local volatile\n                                    unsigned char *) sync_arr_mem_235707_backing_aligned_0;\n    __local volatile unsigned char *restrict red_arr_mem_235705_backing_2 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_235705_backing_aligned_1;\n    __local volatile unsigned char *restrict red_arr_mem_235703_backing_1 =\n                                   (__local volatile\n                                    un",
                   "signed char *) red_arr_mem_235703_backing_aligned_2;\n    __local volatile unsigned char *restrict red_arr_mem_235701_backing_0 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_235701_backing_aligned_3;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_235696;\n    int32_t local_tid_235697;\n    int64_t group_sizze_235700;\n    int32_t wave_sizze_235699;\n    int32_t group_tid_235698;\n    \n    global_tid_235696 = get_global_id(0);\n    local_tid_235697 = get_local_id(0);\n    group_sizze_235700 = get_local_size(0);\n    wave_sizze_235699 = LOCKSTEP_WIDTH;\n    group_tid_235698 = get_group_id(0);\n    \n    int32_t phys_tid_224235 = global_tid_235696;\n    __local unsigned char *red_arr_mem_235701;\n    \n    red_arr_mem_235701 = (__local unsigned char *) red_arr_mem_235701_backing_0;\n    \n    __local unsigned char *red_arr_mem_235703;\n    \n    red_arr_mem_235703 = (__local unsigned char *) red_arr_mem_235703_backing_1;\n    \n    __local unsigned char *red_arr_mem_235705;\n    \n    red_arr_mem_235705 = (__local unsigned char *) red_arr_mem_235705_backing_2;\n    \n    __local unsigned char *sync_arr_mem_235707;\n    \n    sync_arr_mem_235707 = (__local\n                           unsigned char *) sync_arr_mem_235707_backing_3;\n    \n    int32_t phys_group_id_235709;\n    \n    phys_group_id_235709 = get_group_id(0);\n    for (int32_t i_235710 = 0; i_235710 <\n         sdiv_up32(sext_i64_i32(virt_num_groups_235685) - phys_group_id_235709,\n                   sext_i64_i32(num_groups_224227)); i_235710++) {\n        int32_t virt_group_id_235711 = phys_group_id_235709 + i_235710 *\n                sext_i64_i32(num_groups_224227);\n        int32_t flat_segment_id_235712 = squot32(virt_group_id_235711,\n                                                 sext_i64_i32(groups_per_segment_235683));\n        int64_t global_tid_235713 = srem64(sext_i32_i64(virt_group_id_235711) *\n                                  ",
                   "         segred_group_sizze_224226 +\n                                           sext_i32_i64(local_tid_235697),\n                                           segred_group_sizze_224226 *\n                                           groups_per_segment_235683);\n        int64_t slice_235714 = t_n_m_203650;\n        int64_t slice_235715 = partition_sizze_203577 * slice_235714;\n        int64_t gtid_224232 = squot64(sext_i32_i64(flat_segment_id_235712),\n                                      slice_235714);\n        int64_t remnant_235716 = sext_i32_i64(flat_segment_id_235712) -\n                gtid_224232 * slice_235714;\n        int64_t gtid_224233 = remnant_235716;\n        int64_t remnant_235717 = remnant_235716 - gtid_224233;\n        int64_t gtid_224234;\n        double x_acc_235718;\n        double x_acc_235719;\n        double x_acc_235720;\n        int64_t chunk_sizze_235721 = smin64(elements_per_thread_235684,\n                                            sdiv_up64(q_t_203494 -\n                                                      global_tid_235713,\n                                                      threads_per_segment_235687));\n        double x_224236;\n        double x_224237;\n        double x_224238;\n        double x_224239;\n        double x_224240;\n        double x_224241;\n        \n        // neutral-initialise the accumulators\n        {\n            x_acc_235718 = 0.0;\n            x_acc_235719 = 0.0;\n            x_acc_235720 = 0.0;\n        }\n        for (int64_t i_235731 = 0; i_235731 < chunk_sizze_235721; i_235731++) {\n            gtid_224234 = global_tid_235713 + threads_per_segment_235687 *\n                i_235731;\n            // apply map function\n            {\n                int64_t x_224246;\n                \n                x_224246 = ((__global int64_t *) ext_mem_229196)[gtid_224232];\n                \n                int64_t x_224251;\n                \n                x_224251 = ((__global int64_t *) ext_mem_229461)[gtid_224232 *\n                                     ",
                   "                            t_n_m_203650 +\n                                                                 gtid_224233];\n                \n                double x_224252;\n                \n                x_224252 = ((__global double *) ext_mem_229460)[gtid_224232 *\n                                                                t_n_m_203650 +\n                                                                gtid_224233];\n                \n                int64_t binop_y_228674 = mul64(jump_t_203500, gtid_224233);\n                int64_t binop_y_228675 = smin64(i_203670, binop_y_228674);\n                int64_t index_primexp_228676 = add64((int64_t) 1,\n                                                     binop_y_228675);\n                bool cond_224255 = sle64(x_224246, gtid_224234);\n                int64_t defunc_0_f_res_224256;\n                \n                if (cond_224255) {\n                    defunc_0_f_res_224256 = (int64_t) 0;\n                } else {\n                    int64_t i_224257 = add64(gtid_224234, x_224251);\n                    int64_t defunc_0_add_arg_224258;\n                    \n                    defunc_0_add_arg_224258 = ((__global\n                                                int64_t *) ext_mem_229197)[gtid_224232 *\n                                                                           n_203490 +\n                                                                           i_224257];\n                    \n                    int64_t defunc_1_add_res_224259 = add64((int64_t) 1,\n                                                            defunc_0_add_arg_224258);\n                    \n                    defunc_0_f_res_224256 = defunc_1_add_res_224259;\n                }\n                \n                double defunc_0_f_res_224260;\n                \n                if (cond_224255) {\n                    defunc_0_f_res_224260 = 0.0;\n                } else {\n                    int64_t i_224261 = add64(gtid_224234, x_224251);\n                   ",
                   " double defunc_0_add_arg_224262;\n                    \n                    defunc_0_add_arg_224262 = ((__global\n                                                double *) mem_231151)[gtid_224232 *\n                                                                      n_203490 +\n                                                                      i_224261];\n                    defunc_0_f_res_224260 = defunc_0_add_arg_224262;\n                }\n                \n                int64_t binop_p_224263 = sub64(defunc_0_f_res_224256,\n                                               index_primexp_228676);\n                double defunc_0_f_res_224264 = sitofp_i64_f64(binop_p_224263);\n                double abs_res_224265 = fabs(defunc_0_f_res_224264);\n                double tmp1_224266 = abs_res_224265 / x_224252;\n                double x_224267 = tmp1_224266 * tmp1_224266;\n                double y_224268 = tmp1_224266 * x_224267;\n                double tmp2_224269 = 1.0 - y_224268;\n                double x_224270 = tmp2_224269 * tmp2_224269;\n                double tmp3_224271 = tmp2_224269 * x_224270;\n                double w_j_224272 = defunc_0_f_res_224260 * tmp3_224271;\n                double xw_j_224273 = defunc_0_f_res_224264 * w_j_224272;\n                double x2w_j_224274 = defunc_0_f_res_224264 * xw_j_224273;\n                \n                // save map-out results\n                { }\n                // load accumulator\n                {\n                    x_224236 = x_acc_235718;\n                    x_224237 = x_acc_235719;\n                    x_224238 = x_acc_235720;\n                }\n                // load new values\n                {\n                    x_224239 = w_j_224272;\n                    x_224240 = xw_j_224273;\n                    x_224241 = x2w_j_224274;\n                }\n                // apply reduction operator\n                {\n                    double defunc_1_op_res_224242 = x_224236 + x_224239;\n                    double defunc_1_op_res_224243 ",
                   "= x_224237 + x_224240;\n                    double defunc_1_op_res_224244 = x_224238 + x_224241;\n                    \n                    // store in accumulator\n                    {\n                        x_acc_235718 = defunc_1_op_res_224242;\n                        x_acc_235719 = defunc_1_op_res_224243;\n                        x_acc_235720 = defunc_1_op_res_224244;\n                    }\n                }\n            }\n        }\n        // to reduce current chunk, first store our result in memory\n        {\n            x_224236 = x_acc_235718;\n            x_224237 = x_acc_235719;\n            x_224238 = x_acc_235720;\n            ((__local\n              double *) red_arr_mem_235701)[sext_i32_i64(local_tid_235697)] =\n                x_224236;\n            ((__local\n              double *) red_arr_mem_235703)[sext_i32_i64(local_tid_235697)] =\n                x_224237;\n            ((__local\n              double *) red_arr_mem_235705)[sext_i32_i64(local_tid_235697)] =\n                x_224238;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        \n        int32_t offset_235732;\n        int32_t skip_waves_235733 = 1;\n        double x_235722;\n        double x_235723;\n        double x_235724;\n        double x_235725;\n        double x_235726;\n        double x_235727;\n        \n        offset_235732 = 0;\n        // participating threads read initial accumulator\n        {\n            if (slt32(local_tid_235697,\n                      sext_i64_i32(segred_group_sizze_224226))) {\n                x_235722 = ((__local\n                             double *) red_arr_mem_235701)[sext_i32_i64(local_tid_235697 +\n                                                           offset_235732)];\n                x_235723 = ((__local\n                             double *) red_arr_mem_235703)[sext_i32_i64(local_tid_235697 +\n                                                           offset_235732)];\n                x_235724 = ((__local\n                             double *) red_arr_mem_235705)[sext_",
                   "i32_i64(local_tid_235697 +\n                                                           offset_235732)];\n            }\n        }\n        offset_235732 = 1;\n        while (slt32(offset_235732, wave_sizze_235699)) {\n            if (slt32(local_tid_235697 + offset_235732,\n                      sext_i64_i32(segred_group_sizze_224226)) &&\n                ((local_tid_235697 - squot32(local_tid_235697,\n                                             wave_sizze_235699) *\n                  wave_sizze_235699) & (2 * offset_235732 - 1)) == 0) {\n                // read array element\n                {\n                    x_235725 = ((volatile __local\n                                 double *) red_arr_mem_235701)[sext_i32_i64(local_tid_235697 +\n                                                               offset_235732)];\n                    x_235726 = ((volatile __local\n                                 double *) red_arr_mem_235703)[sext_i32_i64(local_tid_235697 +\n                                                               offset_235732)];\n                    x_235727 = ((volatile __local\n                                 double *) red_arr_mem_235705)[sext_i32_i64(local_tid_235697 +\n                                                               offset_235732)];\n                }\n                // apply reduction operation\n                {\n                    double defunc_1_op_res_235728 = x_235722 + x_235725;\n                    double defunc_1_op_res_235729 = x_235723 + x_235726;\n                    double defunc_1_op_res_235730 = x_235724 + x_235727;\n                    \n                    x_235722 = defunc_1_op_res_235728;\n                    x_235723 = defunc_1_op_res_235729;\n                    x_235724 = defunc_1_op_res_235730;\n                }\n                // write result of operation\n                {\n                    ((volatile __local\n                      double *) red_arr_mem_235701)[sext_i32_i64(local_tid_235697)] =\n                        x_235722;\n        ",
                   "            ((volatile __local\n                      double *) red_arr_mem_235703)[sext_i32_i64(local_tid_235697)] =\n                        x_235723;\n                    ((volatile __local\n                      double *) red_arr_mem_235705)[sext_i32_i64(local_tid_235697)] =\n                        x_235724;\n                }\n            }\n            offset_235732 *= 2;\n        }\n        while (slt32(skip_waves_235733,\n                     squot32(sext_i64_i32(segred_group_sizze_224226) +\n                             wave_sizze_235699 - 1, wave_sizze_235699))) {\n            barrier(CLK_LOCAL_MEM_FENCE);\n            offset_235732 = skip_waves_235733 * wave_sizze_235699;\n            if (slt32(local_tid_235697 + offset_235732,\n                      sext_i64_i32(segred_group_sizze_224226)) &&\n                ((local_tid_235697 - squot32(local_tid_235697,\n                                             wave_sizze_235699) *\n                  wave_sizze_235699) == 0 && (squot32(local_tid_235697,\n                                                      wave_sizze_235699) & (2 *\n                                                                            skip_waves_235733 -\n                                                                            1)) ==\n                 0)) {\n                // read array element\n                {\n                    x_235725 = ((__local\n                                 double *) red_arr_mem_235701)[sext_i32_i64(local_tid_235697 +\n                                                               offset_235732)];\n                    x_235726 = ((__local\n                                 double *) red_arr_mem_235703)[sext_i32_i64(local_tid_235697 +\n                                                               offset_235732)];\n                    x_235727 = ((__local\n                                 double *) red_arr_mem_235705)[sext_i32_i64(local_tid_235697 +\n                                                               offset_235732)];\n            ",
                   "    }\n                // apply reduction operation\n                {\n                    double defunc_1_op_res_235728 = x_235722 + x_235725;\n                    double defunc_1_op_res_235729 = x_235723 + x_235726;\n                    double defunc_1_op_res_235730 = x_235724 + x_235727;\n                    \n                    x_235722 = defunc_1_op_res_235728;\n                    x_235723 = defunc_1_op_res_235729;\n                    x_235724 = defunc_1_op_res_235730;\n                }\n                // write result of operation\n                {\n                    ((__local\n                      double *) red_arr_mem_235701)[sext_i32_i64(local_tid_235697)] =\n                        x_235722;\n                    ((__local\n                      double *) red_arr_mem_235703)[sext_i32_i64(local_tid_235697)] =\n                        x_235723;\n                    ((__local\n                      double *) red_arr_mem_235705)[sext_i32_i64(local_tid_235697)] =\n                        x_235724;\n                }\n            }\n            skip_waves_235733 *= 2;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        // first thread saves the result in accumulator\n        {\n            if (sext_i32_i64(local_tid_235697) == (int64_t) 0) {\n                x_acc_235718 = x_235722;\n                x_acc_235719 = x_235723;\n                x_acc_235720 = x_235724;\n            }\n        }\n        if (groups_per_segment_235683 == (int64_t) 1) {\n            // first thread in group saves final result to memory\n            {\n                if (local_tid_235697 == 0) {\n                    ((__global double *) mem_231169)[gtid_224232 *\n                                                     t_n_m_203650 +\n                                                     gtid_224233] =\n                        x_acc_235718;\n                    ((__global double *) mem_231173)[gtid_224232 *\n                                                     t_n_m_203650 +\n                                            ",
                   "         gtid_224233] =\n                        x_acc_235719;\n                    ((__global double *) mem_231177)[gtid_224232 *\n                                                     t_n_m_203650 +\n                                                     gtid_224233] =\n                        x_acc_235720;\n                }\n            }\n        } else {\n            int32_t old_counter_235734;\n            \n            // first thread in group saves group result to global memory\n            {\n                if (local_tid_235697 == 0) {\n                    ((__global\n                      double *) segred_tmp_mem_235688)[sext_i32_i64(virt_group_id_235711)] =\n                        x_acc_235718;\n                    ((__global\n                      double *) segred_tmp_mem_235690)[sext_i32_i64(virt_group_id_235711)] =\n                        x_acc_235719;\n                    ((__global\n                      double *) segred_tmp_mem_235692)[sext_i32_i64(virt_group_id_235711)] =\n                        x_acc_235720;\n                    mem_fence_global();\n                    old_counter_235734 =\n                        atomic_add_i32_global(&((volatile __global\n                                                 int *) mainzicounter_mem_235694)[sext_i32_i64(srem32(flat_segment_id_235712,\n                                                                                                      10240))],\n                                              (int) 1);\n                    ((__local bool *) sync_arr_mem_235707)[(int64_t) 0] =\n                        old_counter_235734 == groups_per_segment_235683 -\n                        (int64_t) 1;\n                }\n            }\n            barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n            \n            bool is_last_group_235735;\n            \n            is_last_group_235735 = ((__local\n                                     bool *) sync_arr_mem_235707)[(int64_t) 0];\n            if (is_last_group_235735) {\n                if (loc",
                   "al_tid_235697 == 0) {\n                    old_counter_235734 =\n                        atomic_add_i32_global(&((volatile __global\n                                                 int *) mainzicounter_mem_235694)[sext_i32_i64(srem32(flat_segment_id_235712,\n                                                                                                      10240))],\n                                              (int) ((int64_t) 0 -\n                                                     groups_per_segment_235683));\n                }\n                // read in the per-group-results\n                {\n                    int64_t read_per_thread_235736 =\n                            sdiv_up64(groups_per_segment_235683,\n                                      segred_group_sizze_224226);\n                    \n                    x_224236 = 0.0;\n                    x_224237 = 0.0;\n                    x_224238 = 0.0;\n                    for (int64_t i_235737 = 0; i_235737 <\n                         read_per_thread_235736; i_235737++) {\n                        int64_t group_res_id_235738 =\n                                sext_i32_i64(local_tid_235697) *\n                                read_per_thread_235736 + i_235737;\n                        int64_t index_of_group_res_235739 =\n                                sext_i32_i64(flat_segment_id_235712) *\n                                groups_per_segment_235683 + group_res_id_235738;\n                        \n                        if (slt64(group_res_id_235738,\n                                  groups_per_segment_235683)) {\n                            x_224239 = ((__global\n                                         double *) segred_tmp_mem_235688)[index_of_group_res_235739];\n                            x_224240 = ((__global\n                                         double *) segred_tmp_mem_235690)[index_of_group_res_235739];\n                            x_224241 = ((__global\n                                         double *) segred_tmp_mem_23",
                   "5692)[index_of_group_res_235739];\n                            \n                            double defunc_1_op_res_224242 = x_224236 + x_224239;\n                            double defunc_1_op_res_224243 = x_224237 + x_224240;\n                            double defunc_1_op_res_224244 = x_224238 + x_224241;\n                            \n                            x_224236 = defunc_1_op_res_224242;\n                            x_224237 = defunc_1_op_res_224243;\n                            x_224238 = defunc_1_op_res_224244;\n                        }\n                    }\n                }\n                ((__local\n                  double *) red_arr_mem_235701)[sext_i32_i64(local_tid_235697)] =\n                    x_224236;\n                ((__local\n                  double *) red_arr_mem_235703)[sext_i32_i64(local_tid_235697)] =\n                    x_224237;\n                ((__local\n                  double *) red_arr_mem_235705)[sext_i32_i64(local_tid_235697)] =\n                    x_224238;\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // reduce the per-group results\n                {\n                    int32_t offset_235740;\n                    int32_t skip_waves_235741 = 1;\n                    double x_235722;\n                    double x_235723;\n                    double x_235724;\n                    double x_235725;\n                    double x_235726;\n                    double x_235727;\n                    \n                    offset_235740 = 0;\n                    // participating threads read initial accumulator\n                    {\n                        if (slt32(local_tid_235697,\n                                  sext_i64_i32(segred_group_sizze_224226))) {\n                            x_235722 = ((__local\n                                         double *) red_arr_mem_235701)[sext_i32_i64(local_tid_235697 +\n                                                                       offset_235740)];\n                            x_235723 = ((__loc",
                   "al\n                                         double *) red_arr_mem_235703)[sext_i32_i64(local_tid_235697 +\n                                                                       offset_235740)];\n                            x_235724 = ((__local\n                                         double *) red_arr_mem_235705)[sext_i32_i64(local_tid_235697 +\n                                                                       offset_235740)];\n                        }\n                    }\n                    offset_235740 = 1;\n                    while (slt32(offset_235740, wave_sizze_235699)) {\n                        if (slt32(local_tid_235697 + offset_235740,\n                                  sext_i64_i32(segred_group_sizze_224226)) &&\n                            ((local_tid_235697 - squot32(local_tid_235697,\n                                                         wave_sizze_235699) *\n                              wave_sizze_235699) & (2 * offset_235740 - 1)) ==\n                            0) {\n                            // read array element\n                            {\n                                x_235725 = ((volatile __local\n                                             double *) red_arr_mem_235701)[sext_i32_i64(local_tid_235697 +\n                                                                           offset_235740)];\n                                x_235726 = ((volatile __local\n                                             double *) red_arr_mem_235703)[sext_i32_i64(local_tid_235697 +\n                                                                           offset_235740)];\n                                x_235727 = ((volatile __local\n                                             double *) red_arr_mem_235705)[sext_i32_i64(local_tid_235697 +\n                                                                           offset_235740)];\n                            }\n                            // apply reduction operation\n                            {\n                  ",
                   "              double defunc_1_op_res_235728 = x_235722 +\n                                       x_235725;\n                                double defunc_1_op_res_235729 = x_235723 +\n                                       x_235726;\n                                double defunc_1_op_res_235730 = x_235724 +\n                                       x_235727;\n                                \n                                x_235722 = defunc_1_op_res_235728;\n                                x_235723 = defunc_1_op_res_235729;\n                                x_235724 = defunc_1_op_res_235730;\n                            }\n                            // write result of operation\n                            {\n                                ((volatile __local\n                                  double *) red_arr_mem_235701)[sext_i32_i64(local_tid_235697)] =\n                                    x_235722;\n                                ((volatile __local\n                                  double *) red_arr_mem_235703)[sext_i32_i64(local_tid_235697)] =\n                                    x_235723;\n                                ((volatile __local\n                                  double *) red_arr_mem_235705)[sext_i32_i64(local_tid_235697)] =\n                                    x_235724;\n                            }\n                        }\n                        offset_235740 *= 2;\n                    }\n                    while (slt32(skip_waves_235741,\n                                 squot32(sext_i64_i32(segred_group_sizze_224226) +\n                                         wave_sizze_235699 - 1,\n                                         wave_sizze_235699))) {\n                        barrier(CLK_LOCAL_MEM_FENCE);\n                        offset_235740 = skip_waves_235741 * wave_sizze_235699;\n                        if (slt32(local_tid_235697 + offset_235740,\n                                  sext_i64_i32(segred_group_sizze_224226)) &&\n                            ((local_tid_235697",
                   " - squot32(local_tid_235697,\n                                                         wave_sizze_235699) *\n                              wave_sizze_235699) == 0 &&\n                             (squot32(local_tid_235697, wave_sizze_235699) &\n                              (2 * skip_waves_235741 - 1)) == 0)) {\n                            // read array element\n                            {\n                                x_235725 = ((__local\n                                             double *) red_arr_mem_235701)[sext_i32_i64(local_tid_235697 +\n                                                                           offset_235740)];\n                                x_235726 = ((__local\n                                             double *) red_arr_mem_235703)[sext_i32_i64(local_tid_235697 +\n                                                                           offset_235740)];\n                                x_235727 = ((__local\n                                             double *) red_arr_mem_235705)[sext_i32_i64(local_tid_235697 +\n                                                                           offset_235740)];\n                            }\n                            // apply reduction operation\n                            {\n                                double defunc_1_op_res_235728 = x_235722 +\n                                       x_235725;\n                                double defunc_1_op_res_235729 = x_235723 +\n                                       x_235726;\n                                double defunc_1_op_res_235730 = x_235724 +\n                                       x_235727;\n                                \n                                x_235722 = defunc_1_op_res_235728;\n                                x_235723 = defunc_1_op_res_235729;\n                                x_235724 = defunc_1_op_res_235730;\n                            }\n                            // write result of operation\n                            {\n               ",
                   "                 ((__local\n                                  double *) red_arr_mem_235701)[sext_i32_i64(local_tid_235697)] =\n                                    x_235722;\n                                ((__local\n                                  double *) red_arr_mem_235703)[sext_i32_i64(local_tid_235697)] =\n                                    x_235723;\n                                ((__local\n                                  double *) red_arr_mem_235705)[sext_i32_i64(local_tid_235697)] =\n                                    x_235724;\n                            }\n                        }\n                        skip_waves_235741 *= 2;\n                    }\n                    // and back to memory with the final result\n                    {\n                        if (local_tid_235697 == 0) {\n                            ((__global double *) mem_231169)[gtid_224232 *\n                                                             t_n_m_203650 +\n                                                             gtid_224233] =\n                                x_235722;\n                            ((__global double *) mem_231173)[gtid_224232 *\n                                                             t_n_m_203650 +\n                                                             gtid_224233] =\n                                x_235723;\n                            ((__global double *) mem_231177)[gtid_224232 *\n                                                             t_n_m_203650 +\n                                                             gtid_224233] =\n                                x_235724;\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_224226\n}\n__kernel void mainzisegred_large_224307(__global int *global_failure,\n                                        __local volatile\n                                  ",
                   "      int64_t *sync_arr_mem_235807_backing_aligned_0,\n                                        __local volatile\n                                        int64_t *red_arr_mem_235805_backing_aligned_1,\n                                        __local volatile\n                                        int64_t *red_arr_mem_235803_backing_aligned_2,\n                                        int64_t n_203490, int64_t q_t_203494,\n                                        int64_t jump_t_203500,\n                                        int64_t partition_sizze_203577,\n                                        int64_t t_n_m_203650, int64_t i_203670,\n                                        int64_t num_groups_224300,\n                                        int64_t groups_per_segment_235787,\n                                        int64_t elements_per_thread_235788,\n                                        int64_t virt_num_groups_235789,\n                                        int64_t threads_per_segment_235791,\n                                        __global unsigned char *ext_mem_229196,\n                                        __global unsigned char *ext_mem_229197,\n                                        __global unsigned char *ext_mem_229460,\n                                        __global unsigned char *ext_mem_229461,\n                                        __global unsigned char *mem_231151,\n                                        __global unsigned char *mem_231155,\n                                        __global unsigned char *mem_231182,\n                                        __global unsigned char *mem_231186,\n                                        __global unsigned char *mem_231190,\n                                        __global unsigned char *mem_231195,\n                                        __global unsigned char *mem_231199,\n                                        __global\n                                        unsigned char *segred_tmp_mem_235792,\n                    ",
                   "                    __global\n                                        unsigned char *segred_tmp_mem_235794,\n                                        __global\n                                        unsigned char *mainzicounter_mem_235796)\n{\n    #define segred_group_sizze_224299 (mainzisegred_group_sizze_223658)\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_235807_backing_2 =\n                                   (__local volatile\n                                    unsigned char *) sync_arr_mem_235807_backing_aligned_0;\n    __local volatile unsigned char *restrict red_arr_mem_235805_backing_1 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_235805_backing_aligned_1;\n    __local volatile unsigned char *restrict red_arr_mem_235803_backing_0 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_235803_backing_aligned_2;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_235798;\n    int32_t local_tid_235799;\n    int64_t group_sizze_235802;\n    int32_t wave_sizze_235801;\n    int32_t group_tid_235800;\n    \n    global_tid_235798 = get_global_id(0);\n    local_tid_235799 = get_local_id(0);\n    group_sizze_235802 = get_local_size(0);\n    wave_sizze_235801 = LOCKSTEP_WIDTH;\n    group_tid_235800 = get_group_id(0);\n    \n    int32_t phys_tid_224307 = global_tid_235798;\n    __local unsigned char *red_arr_mem_235803;\n    \n    red_arr_mem_235803 = (__local unsigned char *) red_arr_mem_235803_backing_0;\n    \n    __local unsigned char *red_arr_mem_235805;\n    \n    red_arr_mem_235805 = (__local unsigned char *) red_arr_mem_235805_backing_1;\n    \n    __local unsigned char *sync_arr_mem_235807;\n    \n    sync_arr_mem_235807 = (__local\n                           unsigned char *) sync_arr_mem_235807_backing_2;\n    \n    int32_t p",
                   "hys_group_id_235809;\n    \n    phys_group_id_235809 = get_group_id(0);\n    for (int32_t i_235810 = 0; i_235810 <\n         sdiv_up32(sext_i64_i32(virt_num_groups_235789) - phys_group_id_235809,\n                   sext_i64_i32(num_groups_224300)); i_235810++) {\n        int32_t virt_group_id_235811 = phys_group_id_235809 + i_235810 *\n                sext_i64_i32(num_groups_224300);\n        int32_t flat_segment_id_235812 = squot32(virt_group_id_235811,\n                                                 sext_i64_i32(groups_per_segment_235787));\n        int64_t global_tid_235813 = srem64(sext_i32_i64(virt_group_id_235811) *\n                                           segred_group_sizze_224299 +\n                                           sext_i32_i64(local_tid_235799),\n                                           segred_group_sizze_224299 *\n                                           groups_per_segment_235787);\n        int64_t slice_235814 = t_n_m_203650;\n        int64_t slice_235815 = partition_sizze_203577 * slice_235814;\n        int64_t gtid_224304 = squot64(sext_i32_i64(flat_segment_id_235812),\n                                      slice_235814);\n        int64_t remnant_235816 = sext_i32_i64(flat_segment_id_235812) -\n                gtid_224304 * slice_235814;\n        int64_t gtid_224305 = remnant_235816;\n        int64_t remnant_235817 = remnant_235816 - gtid_224305;\n        int64_t gtid_224306;\n        double x_acc_235818;\n        double x_acc_235819;\n        int64_t chunk_sizze_235820 = smin64(elements_per_thread_235788,\n                                            sdiv_up64(q_t_203494 -\n                                                      global_tid_235813,\n                                                      threads_per_segment_235791));\n        double x_224308;\n        double x_224309;\n        double x_224310;\n        double x_224311;\n        \n        // neutral-initialise the accumulators\n        {\n            x_acc_235818 = 0.0;\n            x_acc_235819 = 0.0;\n       ",
                   " }\n        for (int64_t i_235827 = 0; i_235827 < chunk_sizze_235820; i_235827++) {\n            gtid_224306 = global_tid_235813 + threads_per_segment_235791 *\n                i_235827;\n            // apply map function\n            {\n                int64_t x_224315;\n                \n                x_224315 = ((__global int64_t *) ext_mem_229196)[gtid_224304];\n                \n                int64_t x_224324;\n                \n                x_224324 = ((__global int64_t *) ext_mem_229461)[gtid_224304 *\n                                                                 t_n_m_203650 +\n                                                                 gtid_224305];\n                \n                double x_224325;\n                \n                x_224325 = ((__global double *) ext_mem_229460)[gtid_224304 *\n                                                                t_n_m_203650 +\n                                                                gtid_224305];\n                \n                int64_t binop_y_228669 = mul64(jump_t_203500, gtid_224305);\n                int64_t binop_y_228670 = smin64(i_203670, binop_y_228669);\n                int64_t index_primexp_228671 = add64((int64_t) 1,\n                                                     binop_y_228670);\n                double a11_224327;\n                \n                a11_224327 = ((__global double *) mem_231182)[gtid_224304 *\n                                                              t_n_m_203650 +\n                                                              gtid_224305];\n                \n                double b11_224328;\n                \n                b11_224328 = ((__global double *) mem_231186)[gtid_224304 *\n                                                              t_n_m_203650 +\n                                                              gtid_224305];\n                \n                double c11_224329;\n                \n                c11_224329 = ((__global double *) mem_231190)[gtid_224304 *\n  ",
                   "                                                            t_n_m_203650 +\n                                                              gtid_224305];\n                \n                bool cond_224331 = sle64(x_224315, gtid_224306);\n                int64_t defunc_0_f_res_224332;\n                \n                if (cond_224331) {\n                    defunc_0_f_res_224332 = (int64_t) 0;\n                } else {\n                    int64_t i_224333 = add64(gtid_224306, x_224324);\n                    int64_t defunc_0_add_arg_224334;\n                    \n                    defunc_0_add_arg_224334 = ((__global\n                                                int64_t *) ext_mem_229197)[gtid_224304 *\n                                                                           n_203490 +\n                                                                           i_224333];\n                    \n                    int64_t defunc_1_add_res_224335 = add64((int64_t) 1,\n                                                            defunc_0_add_arg_224334);\n                    \n                    defunc_0_f_res_224332 = defunc_1_add_res_224335;\n                }\n                \n                double defunc_0_f_res_224336;\n                \n                if (cond_224331) {\n                    defunc_0_f_res_224336 = 0.0;\n                } else {\n                    int64_t i_224337 = add64(gtid_224306, x_224324);\n                    double defunc_0_add_arg_224338;\n                    \n                    defunc_0_add_arg_224338 = ((__global\n                                                double *) mem_231151)[gtid_224304 *\n                                                                      n_203490 +\n                                                                      i_224337];\n                    defunc_0_f_res_224336 = defunc_0_add_arg_224338;\n                }\n                \n                int64_t binop_p_224339 = sub64(defunc_0_f_res_224332,\n                             ",
                   "                  index_primexp_228671);\n                double defunc_0_f_res_224340 = sitofp_i64_f64(binop_p_224339);\n                double abs_res_224341 = fabs(defunc_0_f_res_224340);\n                double tmp1_224342 = abs_res_224341 / x_224325;\n                double x_224343 = tmp1_224342 * tmp1_224342;\n                double y_224344 = tmp1_224342 * x_224343;\n                double tmp2_224345 = 1.0 - y_224344;\n                double x_224346 = tmp2_224345 * tmp2_224345;\n                double tmp3_224347 = tmp2_224345 * x_224346;\n                double tmp4_224348 = defunc_0_f_res_224336 * tmp3_224347;\n                double defunc_1_f_res_224349 = defunc_0_f_res_224340 *\n                       tmp4_224348;\n                double defunc_0_f_res_224350;\n                \n                if (cond_224331) {\n                    defunc_0_f_res_224350 = 0.0;\n                } else {\n                    int64_t i_224351 = add64(gtid_224306, x_224324);\n                    double defunc_0_add_arg_224352;\n                    \n                    defunc_0_add_arg_224352 = ((__global\n                                                double *) mem_231155)[gtid_224304 *\n                                                                      n_203490 +\n                                                                      i_224351];\n                    defunc_0_f_res_224350 = defunc_0_add_arg_224352;\n                }\n                \n                double x_224353 = a11_224327 * tmp4_224348;\n                double y_224354 = b11_224328 * defunc_1_f_res_224349;\n                double x_224355 = x_224353 + y_224354;\n                double defunc_9_fit_fun_res_224356 = defunc_0_f_res_224350 *\n                       x_224355;\n                double x_224357 = b11_224328 * tmp4_224348;\n                double y_224358 = c11_224329 * defunc_1_f_res_224349;\n                double x_224359 = x_224357 + y_224358;\n                double defunc_9_slope_fun_res_224360 = defunc_0_f_res_2",
                   "24350 *\n                       x_224359;\n                \n                // save map-out results\n                { }\n                // load accumulator\n                {\n                    x_224308 = x_acc_235818;\n                    x_224309 = x_acc_235819;\n                }\n                // load new values\n                {\n                    x_224310 = defunc_9_fit_fun_res_224356;\n                    x_224311 = defunc_9_slope_fun_res_224360;\n                }\n                // apply reduction operator\n                {\n                    double defunc_1_op_res_224312 = x_224308 + x_224310;\n                    double defunc_1_op_res_224313 = x_224309 + x_224311;\n                    \n                    // store in accumulator\n                    {\n                        x_acc_235818 = defunc_1_op_res_224312;\n                        x_acc_235819 = defunc_1_op_res_224313;\n                    }\n                }\n            }\n        }\n        // to reduce current chunk, first store our result in memory\n        {\n            x_224308 = x_acc_235818;\n            x_224309 = x_acc_235819;\n            ((__local\n              double *) red_arr_mem_235803)[sext_i32_i64(local_tid_235799)] =\n                x_224308;\n            ((__local\n              double *) red_arr_mem_235805)[sext_i32_i64(local_tid_235799)] =\n                x_224309;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        \n        int32_t offset_235828;\n        int32_t skip_waves_235829 = 1;\n        double x_235821;\n        double x_235822;\n        double x_235823;\n        double x_235824;\n        \n        offset_235828 = 0;\n        // participating threads read initial accumulator\n        {\n            if (slt32(local_tid_235799,\n                      sext_i64_i32(segred_group_sizze_224299))) {\n                x_235821 = ((__local\n                             double *) red_arr_mem_235803)[sext_i32_i64(local_tid_235799 +\n                                                           offset_235828",
                   ")];\n                x_235822 = ((__local\n                             double *) red_arr_mem_235805)[sext_i32_i64(local_tid_235799 +\n                                                           offset_235828)];\n            }\n        }\n        offset_235828 = 1;\n        while (slt32(offset_235828, wave_sizze_235801)) {\n            if (slt32(local_tid_235799 + offset_235828,\n                      sext_i64_i32(segred_group_sizze_224299)) &&\n                ((local_tid_235799 - squot32(local_tid_235799,\n                                             wave_sizze_235801) *\n                  wave_sizze_235801) & (2 * offset_235828 - 1)) == 0) {\n                // read array element\n                {\n                    x_235823 = ((volatile __local\n                                 double *) red_arr_mem_235803)[sext_i32_i64(local_tid_235799 +\n                                                               offset_235828)];\n                    x_235824 = ((volatile __local\n                                 double *) red_arr_mem_235805)[sext_i32_i64(local_tid_235799 +\n                                                               offset_235828)];\n                }\n                // apply reduction operation\n                {\n                    double defunc_1_op_res_235825 = x_235821 + x_235823;\n                    double defunc_1_op_res_235826 = x_235822 + x_235824;\n                    \n                    x_235821 = defunc_1_op_res_235825;\n                    x_235822 = defunc_1_op_res_235826;\n                }\n                // write result of operation\n                {\n                    ((volatile __local\n                      double *) red_arr_mem_235803)[sext_i32_i64(local_tid_235799)] =\n                        x_235821;\n                    ((volatile __local\n                      double *) red_arr_mem_235805)[sext_i32_i64(local_tid_235799)] =\n                        x_235822;\n                }\n            }\n            offset_235828 *= 2;\n        }\n        while (slt32(sk",
                   "ip_waves_235829,\n                     squot32(sext_i64_i32(segred_group_sizze_224299) +\n                             wave_sizze_235801 - 1, wave_sizze_235801))) {\n            barrier(CLK_LOCAL_MEM_FENCE);\n            offset_235828 = skip_waves_235829 * wave_sizze_235801;\n            if (slt32(local_tid_235799 + offset_235828,\n                      sext_i64_i32(segred_group_sizze_224299)) &&\n                ((local_tid_235799 - squot32(local_tid_235799,\n                                             wave_sizze_235801) *\n                  wave_sizze_235801) == 0 && (squot32(local_tid_235799,\n                                                      wave_sizze_235801) & (2 *\n                                                                            skip_waves_235829 -\n                                                                            1)) ==\n                 0)) {\n                // read array element\n                {\n                    x_235823 = ((__local\n                                 double *) red_arr_mem_235803)[sext_i32_i64(local_tid_235799 +\n                                                               offset_235828)];\n                    x_235824 = ((__local\n                                 double *) red_arr_mem_235805)[sext_i32_i64(local_tid_235799 +\n                                                               offset_235828)];\n                }\n                // apply reduction operation\n                {\n                    double defunc_1_op_res_235825 = x_235821 + x_235823;\n                    double defunc_1_op_res_235826 = x_235822 + x_235824;\n                    \n                    x_235821 = defunc_1_op_res_235825;\n                    x_235822 = defunc_1_op_res_235826;\n                }\n                // write result of operation\n                {\n                    ((__local\n                      double *) red_arr_mem_235803)[sext_i32_i64(local_tid_235799)] =\n                        x_235821;\n                    ((__local\n                ",
                   "      double *) red_arr_mem_235805)[sext_i32_i64(local_tid_235799)] =\n                        x_235822;\n                }\n            }\n            skip_waves_235829 *= 2;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        // first thread saves the result in accumulator\n        {\n            if (sext_i32_i64(local_tid_235799) == (int64_t) 0) {\n                x_acc_235818 = x_235821;\n                x_acc_235819 = x_235822;\n            }\n        }\n        if (groups_per_segment_235787 == (int64_t) 1) {\n            // first thread in group saves final result to memory\n            {\n                if (local_tid_235799 == 0) {\n                    ((__global double *) mem_231195)[gtid_224304 *\n                                                     t_n_m_203650 +\n                                                     gtid_224305] =\n                        x_acc_235818;\n                    ((__global double *) mem_231199)[gtid_224304 *\n                                                     t_n_m_203650 +\n                                                     gtid_224305] =\n                        x_acc_235819;\n                }\n            }\n        } else {\n            int32_t old_counter_235830;\n            \n            // first thread in group saves group result to global memory\n            {\n                if (local_tid_235799 == 0) {\n                    ((__global\n                      double *) segred_tmp_mem_235792)[sext_i32_i64(virt_group_id_235811)] =\n                        x_acc_235818;\n                    ((__global\n                      double *) segred_tmp_mem_235794)[sext_i32_i64(virt_group_id_235811)] =\n                        x_acc_235819;\n                    mem_fence_global();\n                    old_counter_235830 =\n                        atomic_add_i32_global(&((volatile __global\n                                                 int *) mainzicounter_mem_235796)[sext_i32_i64(srem32(flat_segment_id_235812,\n                                                ",
                   "                                                      10240))],\n                                              (int) 1);\n                    ((__local bool *) sync_arr_mem_235807)[(int64_t) 0] =\n                        old_counter_235830 == groups_per_segment_235787 -\n                        (int64_t) 1;\n                }\n            }\n            barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n            \n            bool is_last_group_235831;\n            \n            is_last_group_235831 = ((__local\n                                     bool *) sync_arr_mem_235807)[(int64_t) 0];\n            if (is_last_group_235831) {\n                if (local_tid_235799 == 0) {\n                    old_counter_235830 =\n                        atomic_add_i32_global(&((volatile __global\n                                                 int *) mainzicounter_mem_235796)[sext_i32_i64(srem32(flat_segment_id_235812,\n                                                                                                      10240))],\n                                              (int) ((int64_t) 0 -\n                                                     groups_per_segment_235787));\n                }\n                // read in the per-group-results\n                {\n                    int64_t read_per_thread_235832 =\n                            sdiv_up64(groups_per_segment_235787,\n                                      segred_group_sizze_224299);\n                    \n                    x_224308 = 0.0;\n                    x_224309 = 0.0;\n                    for (int64_t i_235833 = 0; i_235833 <\n                         read_per_thread_235832; i_235833++) {\n                        int64_t group_res_id_235834 =\n                                sext_i32_i64(local_tid_235799) *\n                                read_per_thread_235832 + i_235833;\n                        int64_t index_of_group_res_235835 =\n                                sext_i32_i64(flat_segment_id_235812) *\n                            ",
                   "    groups_per_segment_235787 + group_res_id_235834;\n                        \n                        if (slt64(group_res_id_235834,\n                                  groups_per_segment_235787)) {\n                            x_224310 = ((__global\n                                         double *) segred_tmp_mem_235792)[index_of_group_res_235835];\n                            x_224311 = ((__global\n                                         double *) segred_tmp_mem_235794)[index_of_group_res_235835];\n                            \n                            double defunc_1_op_res_224312 = x_224308 + x_224310;\n                            double defunc_1_op_res_224313 = x_224309 + x_224311;\n                            \n                            x_224308 = defunc_1_op_res_224312;\n                            x_224309 = defunc_1_op_res_224313;\n                        }\n                    }\n                }\n                ((__local\n                  double *) red_arr_mem_235803)[sext_i32_i64(local_tid_235799)] =\n                    x_224308;\n                ((__local\n                  double *) red_arr_mem_235805)[sext_i32_i64(local_tid_235799)] =\n                    x_224309;\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // reduce the per-group results\n                {\n                    int32_t offset_235836;\n                    int32_t skip_waves_235837 = 1;\n                    double x_235821;\n                    double x_235822;\n                    double x_235823;\n                    double x_235824;\n                    \n                    offset_235836 = 0;\n                    // participating threads read initial accumulator\n                    {\n                        if (slt32(local_tid_235799,\n                                  sext_i64_i32(segred_group_sizze_224299))) {\n                            x_235821 = ((__local\n                                         double *) red_arr_mem_235803)[sext_i32_i64(local_tid_235799 +\n                       ",
                   "                                                offset_235836)];\n                            x_235822 = ((__local\n                                         double *) red_arr_mem_235805)[sext_i32_i64(local_tid_235799 +\n                                                                       offset_235836)];\n                        }\n                    }\n                    offset_235836 = 1;\n                    while (slt32(offset_235836, wave_sizze_235801)) {\n                        if (slt32(local_tid_235799 + offset_235836,\n                                  sext_i64_i32(segred_group_sizze_224299)) &&\n                            ((local_tid_235799 - squot32(local_tid_235799,\n                                                         wave_sizze_235801) *\n                              wave_sizze_235801) & (2 * offset_235836 - 1)) ==\n                            0) {\n                            // read array element\n                            {\n                                x_235823 = ((volatile __local\n                                             double *) red_arr_mem_235803)[sext_i32_i64(local_tid_235799 +\n                                                                           offset_235836)];\n                                x_235824 = ((volatile __local\n                                             double *) red_arr_mem_235805)[sext_i32_i64(local_tid_235799 +\n                                                                           offset_235836)];\n                            }\n                            // apply reduction operation\n                            {\n                                double defunc_1_op_res_235825 = x_235821 +\n                                       x_235823;\n                                double defunc_1_op_res_235826 = x_235822 +\n                                       x_235824;\n                                \n                                x_235821 = defunc_1_op_res_235825;\n                                x_235822 = defunc_1_op_res_2",
                   "35826;\n                            }\n                            // write result of operation\n                            {\n                                ((volatile __local\n                                  double *) red_arr_mem_235803)[sext_i32_i64(local_tid_235799)] =\n                                    x_235821;\n                                ((volatile __local\n                                  double *) red_arr_mem_235805)[sext_i32_i64(local_tid_235799)] =\n                                    x_235822;\n                            }\n                        }\n                        offset_235836 *= 2;\n                    }\n                    while (slt32(skip_waves_235837,\n                                 squot32(sext_i64_i32(segred_group_sizze_224299) +\n                                         wave_sizze_235801 - 1,\n                                         wave_sizze_235801))) {\n                        barrier(CLK_LOCAL_MEM_FENCE);\n                        offset_235836 = skip_waves_235837 * wave_sizze_235801;\n                        if (slt32(local_tid_235799 + offset_235836,\n                                  sext_i64_i32(segred_group_sizze_224299)) &&\n                            ((local_tid_235799 - squot32(local_tid_235799,\n                                                         wave_sizze_235801) *\n                              wave_sizze_235801) == 0 &&\n                             (squot32(local_tid_235799, wave_sizze_235801) &\n                              (2 * skip_waves_235837 - 1)) == 0)) {\n                            // read array element\n                            {\n                                x_235823 = ((__local\n                                             double *) red_arr_mem_235803)[sext_i32_i64(local_tid_235799 +\n                                                                           offset_235836)];\n                                x_235824 = ((__local\n                                             double *) red_arr_mem_235805)[sext_i3",
                   "2_i64(local_tid_235799 +\n                                                                           offset_235836)];\n                            }\n                            // apply reduction operation\n                            {\n                                double defunc_1_op_res_235825 = x_235821 +\n                                       x_235823;\n                                double defunc_1_op_res_235826 = x_235822 +\n                                       x_235824;\n                                \n                                x_235821 = defunc_1_op_res_235825;\n                                x_235822 = defunc_1_op_res_235826;\n                            }\n                            // write result of operation\n                            {\n                                ((__local\n                                  double *) red_arr_mem_235803)[sext_i32_i64(local_tid_235799)] =\n                                    x_235821;\n                                ((__local\n                                  double *) red_arr_mem_235805)[sext_i32_i64(local_tid_235799)] =\n                                    x_235822;\n                            }\n                        }\n                        skip_waves_235837 *= 2;\n                    }\n                    // and back to memory with the final result\n                    {\n                        if (local_tid_235799 == 0) {\n                            ((__global double *) mem_231195)[gtid_224304 *\n                                                             t_n_m_203650 +\n                                                             gtid_224305] =\n                                x_235821;\n                            ((__global double *) mem_231199)[gtid_224304 *\n                                                             t_n_m_203650 +\n                                                             gtid_224305] =\n                                x_235822;\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_224299\n}\n__kernel void mainzisegred_large_225523(__global int *global_failure,\n                                        __local volatile\n                                        int64_t *sync_arr_mem_236004_backing_aligned_0,\n                                        __local volatile\n                                        int64_t *red_arr_mem_236002_backing_aligned_1,\n                                        __local volatile\n                                        int64_t *red_arr_mem_236000_backing_aligned_2,\n                                        __local volatile\n                                        int64_t *red_arr_mem_235998_backing_aligned_3,\n                                        __local volatile\n                                        int64_t *red_arr_mem_235996_backing_aligned_4,\n                                        __local volatile\n                                        int64_t *red_arr_mem_235994_backing_aligned_5,\n                                        int64_t n_203490, int64_t q_t_203494,\n                                        int64_t jump_t_203500,\n                                        int64_t partition_sizze_203577,\n                                        int64_t t_n_m_203650, int64_t i_203670,\n                                        int64_t num_groups_225513,\n                                        int64_t groups_per_segment_235972,\n                                        int64_t elements_per_thread_235973,\n                                        int64_t virt_num_groups_235974,\n                                        int64_t threads_per_segment_235976,\n                                        __global unsigned char *ext_mem_229196,\n                                        __global unsigned char *ext_mem_229197,\n                                        __global unsigned char *ext_mem_229460,\n ",
                   "                                       __global unsigned char *ext_mem_229461,\n                                        __global unsigned char *mem_231320,\n                                        __global unsigned char *mem_231338,\n                                        __global unsigned char *mem_231342,\n                                        __global unsigned char *mem_231346,\n                                        __global unsigned char *mem_231350,\n                                        __global unsigned char *mem_231354,\n                                        __global\n                                        unsigned char *segred_tmp_mem_235977,\n                                        __global\n                                        unsigned char *segred_tmp_mem_235979,\n                                        __global\n                                        unsigned char *segred_tmp_mem_235981,\n                                        __global\n                                        unsigned char *segred_tmp_mem_235983,\n                                        __global\n                                        unsigned char *segred_tmp_mem_235985,\n                                        __global\n                                        unsigned char *mainzicounter_mem_235987)\n{\n    #define segred_group_sizze_225512 (mainzisegred_group_sizze_224961)\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_236004_backing_5 =\n                                   (__local volatile\n                                    unsigned char *) sync_arr_mem_236004_backing_aligned_0;\n    __local volatile unsigned char *restrict red_arr_mem_236002_backing_4 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_236002_backing_aligned_1;\n    __local volatile unsigned char *restrict red_arr_mem_236000_backing_3 =\n             ",
                   "                      (__local volatile\n                                    unsigned char *) red_arr_mem_236000_backing_aligned_2;\n    __local volatile unsigned char *restrict red_arr_mem_235998_backing_2 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_235998_backing_aligned_3;\n    __local volatile unsigned char *restrict red_arr_mem_235996_backing_1 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_235996_backing_aligned_4;\n    __local volatile unsigned char *restrict red_arr_mem_235994_backing_0 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_235994_backing_aligned_5;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_235989;\n    int32_t local_tid_235990;\n    int64_t group_sizze_235993;\n    int32_t wave_sizze_235992;\n    int32_t group_tid_235991;\n    \n    global_tid_235989 = get_global_id(0);\n    local_tid_235990 = get_local_id(0);\n    group_sizze_235993 = get_local_size(0);\n    wave_sizze_235992 = LOCKSTEP_WIDTH;\n    group_tid_235991 = get_group_id(0);\n    \n    int32_t phys_tid_225523 = global_tid_235989;\n    __local unsigned char *red_arr_mem_235994;\n    \n    red_arr_mem_235994 = (__local unsigned char *) red_arr_mem_235994_backing_0;\n    \n    __local unsigned char *red_arr_mem_235996;\n    \n    red_arr_mem_235996 = (__local unsigned char *) red_arr_mem_235996_backing_1;\n    \n    __local unsigned char *red_arr_mem_235998;\n    \n    red_arr_mem_235998 = (__local unsigned char *) red_arr_mem_235998_backing_2;\n    \n    __local unsigned char *red_arr_mem_236000;\n    \n    red_arr_mem_236000 = (__local unsigned char *) red_arr_mem_236000_backing_3;\n    \n    __local unsigned char *red_arr_mem_236002;\n    \n    red_arr_mem_236002 = (__local unsigned char *) red_arr_mem_236002_backing_4;\n    \n    __local unsigned char *sync_arr_mem_2360",
                   "04;\n    \n    sync_arr_mem_236004 = (__local\n                           unsigned char *) sync_arr_mem_236004_backing_5;\n    \n    int32_t phys_group_id_236006;\n    \n    phys_group_id_236006 = get_group_id(0);\n    for (int32_t i_236007 = 0; i_236007 <\n         sdiv_up32(sext_i64_i32(virt_num_groups_235974) - phys_group_id_236006,\n                   sext_i64_i32(num_groups_225513)); i_236007++) {\n        int32_t virt_group_id_236008 = phys_group_id_236006 + i_236007 *\n                sext_i64_i32(num_groups_225513);\n        int32_t flat_segment_id_236009 = squot32(virt_group_id_236008,\n                                                 sext_i64_i32(groups_per_segment_235972));\n        int64_t global_tid_236010 = srem64(sext_i32_i64(virt_group_id_236008) *\n                                           segred_group_sizze_225512 +\n                                           sext_i32_i64(local_tid_235990),\n                                           segred_group_sizze_225512 *\n                                           groups_per_segment_235972);\n        int64_t slice_236011 = t_n_m_203650;\n        int64_t slice_236012 = partition_sizze_203577 * slice_236011;\n        int64_t gtid_225520 = squot64(sext_i32_i64(flat_segment_id_236009),\n                                      slice_236011);\n        int64_t remnant_236013 = sext_i32_i64(flat_segment_id_236009) -\n                gtid_225520 * slice_236011;\n        int64_t gtid_225521 = remnant_236013;\n        int64_t remnant_236014 = remnant_236013 - gtid_225521;\n        int64_t gtid_225522;\n        double x_acc_236015;\n        double x_acc_236016;\n        double x_acc_236017;\n        double x_acc_236018;\n        double x_acc_236019;\n        int64_t chunk_sizze_236020 = smin64(elements_per_thread_235973,\n                                            sdiv_up64(q_t_203494 -\n                                                      global_tid_236010,\n                                                      threads_per_segment_235976));\n        doubl",
                   "e x_225524;\n        double x_225525;\n        double x_225526;\n        double x_225527;\n        double x_225528;\n        double x_225529;\n        double x_225530;\n        double x_225531;\n        double x_225532;\n        double x_225533;\n        \n        // neutral-initialise the accumulators\n        {\n            x_acc_236015 = 0.0;\n            x_acc_236016 = 0.0;\n            x_acc_236017 = 0.0;\n            x_acc_236018 = 0.0;\n            x_acc_236019 = 0.0;\n        }\n        for (int64_t i_236036 = 0; i_236036 < chunk_sizze_236020; i_236036++) {\n            gtid_225522 = global_tid_236010 + threads_per_segment_235976 *\n                i_236036;\n            // apply map function\n            {\n                int64_t x_225540;\n                \n                x_225540 = ((__global int64_t *) ext_mem_229196)[gtid_225520];\n                \n                int64_t x_225545;\n                \n                x_225545 = ((__global int64_t *) ext_mem_229461)[gtid_225520 *\n                                                                 t_n_m_203650 +\n                                                                 gtid_225521];\n                \n                double x_225546;\n                \n                x_225546 = ((__global double *) ext_mem_229460)[gtid_225520 *\n                                                                t_n_m_203650 +\n                                                                gtid_225521];\n                \n                int64_t binop_y_228684 = mul64(jump_t_203500, gtid_225521);\n                int64_t binop_y_228685 = smin64(i_203670, binop_y_228684);\n                int64_t index_primexp_228686 = add64((int64_t) 1,\n                                                     binop_y_228685);\n                bool cond_225549 = sle64(x_225540, gtid_225522);\n                int64_t defunc_0_f_res_225550;\n                \n                if (cond_225549) {\n                    defunc_0_f_res_225550 = (int64_t) 0;\n                } else {\n          ",
                   "          int64_t i_225551 = add64(gtid_225522, x_225545);\n                    int64_t defunc_0_add_arg_225552;\n                    \n                    defunc_0_add_arg_225552 = ((__global\n                                                int64_t *) ext_mem_229197)[gtid_225520 *\n                                                                           n_203490 +\n                                                                           i_225551];\n                    \n                    int64_t defunc_1_add_res_225553 = add64((int64_t) 1,\n                                                            defunc_0_add_arg_225552);\n                    \n                    defunc_0_f_res_225550 = defunc_1_add_res_225553;\n                }\n                \n                double defunc_0_f_res_225554;\n                \n                if (cond_225549) {\n                    defunc_0_f_res_225554 = 0.0;\n                } else {\n                    int64_t i_225555 = add64(gtid_225522, x_225545);\n                    double defunc_0_add_arg_225556;\n                    \n                    defunc_0_add_arg_225556 = ((__global\n                                                double *) mem_231320)[gtid_225520 *\n                                                                      n_203490 +\n                                                                      i_225555];\n                    defunc_0_f_res_225554 = defunc_0_add_arg_225556;\n                }\n                \n                int64_t binop_p_225557 = sub64(defunc_0_f_res_225550,\n                                               index_primexp_228686);\n                double defunc_0_f_res_225558 = sitofp_i64_f64(binop_p_225557);\n                double abs_res_225559 = fabs(defunc_0_f_res_225558);\n                double tmp1_225560 = abs_res_225559 / x_225546;\n                double x_225561 = tmp1_225560 * tmp1_225560;\n                double y_225562 = tmp1_225560 * x_225561;\n                double tmp2_225563 = 1.0 - y_225562;",
                   "\n                double x_225564 = tmp2_225563 * tmp2_225563;\n                double tmp3_225565 = tmp2_225563 * x_225564;\n                double w_j_225566 = defunc_0_f_res_225554 * tmp3_225565;\n                double xw_j_225567 = defunc_0_f_res_225558 * w_j_225566;\n                double x2w_j_225568 = defunc_0_f_res_225558 * xw_j_225567;\n                double x3w_j_225569 = defunc_0_f_res_225558 * x2w_j_225568;\n                double x4w_j_225570 = defunc_0_f_res_225558 * x3w_j_225569;\n                \n                // save map-out results\n                { }\n                // load accumulator\n                {\n                    x_225524 = x_acc_236015;\n                    x_225525 = x_acc_236016;\n                    x_225526 = x_acc_236017;\n                    x_225527 = x_acc_236018;\n                    x_225528 = x_acc_236019;\n                }\n                // load new values\n                {\n                    x_225529 = w_j_225566;\n                    x_225530 = xw_j_225567;\n                    x_225531 = x2w_j_225568;\n                    x_225532 = x3w_j_225569;\n                    x_225533 = x4w_j_225570;\n                }\n                // apply reduction operator\n                {\n                    double defunc_1_op_res_225534 = x_225524 + x_225529;\n                    double defunc_1_op_res_225535 = x_225525 + x_225530;\n                    double defunc_1_op_res_225536 = x_225526 + x_225531;\n                    double defunc_1_op_res_225537 = x_225527 + x_225532;\n                    double defunc_1_op_res_225538 = x_225528 + x_225533;\n                    \n                    // store in accumulator\n                    {\n                        x_acc_236015 = defunc_1_op_res_225534;\n                        x_acc_236016 = defunc_1_op_res_225535;\n                        x_acc_236017 = defunc_1_op_res_225536;\n                        x_acc_236018 = defunc_1_op_res_225537;\n                        x_acc_236019 = defunc_1_op_res_225538;\n        ",
                   "            }\n                }\n            }\n        }\n        // to reduce current chunk, first store our result in memory\n        {\n            x_225524 = x_acc_236015;\n            x_225525 = x_acc_236016;\n            x_225526 = x_acc_236017;\n            x_225527 = x_acc_236018;\n            x_225528 = x_acc_236019;\n            ((__local\n              double *) red_arr_mem_235994)[sext_i32_i64(local_tid_235990)] =\n                x_225524;\n            ((__local\n              double *) red_arr_mem_235996)[sext_i32_i64(local_tid_235990)] =\n                x_225525;\n            ((__local\n              double *) red_arr_mem_235998)[sext_i32_i64(local_tid_235990)] =\n                x_225526;\n            ((__local\n              double *) red_arr_mem_236000)[sext_i32_i64(local_tid_235990)] =\n                x_225527;\n            ((__local\n              double *) red_arr_mem_236002)[sext_i32_i64(local_tid_235990)] =\n                x_225528;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        \n        int32_t offset_236037;\n        int32_t skip_waves_236038 = 1;\n        double x_236021;\n        double x_236022;\n        double x_236023;\n        double x_236024;\n        double x_236025;\n        double x_236026;\n        double x_236027;\n        double x_236028;\n        double x_236029;\n        double x_236030;\n        \n        offset_236037 = 0;\n        // participating threads read initial accumulator\n        {\n            if (slt32(local_tid_235990,\n                      sext_i64_i32(segred_group_sizze_225512))) {\n                x_236021 = ((__local\n                             double *) red_arr_mem_235994)[sext_i32_i64(local_tid_235990 +\n                                                           offset_236037)];\n                x_236022 = ((__local\n                             double *) red_arr_mem_235996)[sext_i32_i64(local_tid_235990 +\n                                                           offset_236037)];\n                x_236023 = ((__local\n                  ",
                   "           double *) red_arr_mem_235998)[sext_i32_i64(local_tid_235990 +\n                                                           offset_236037)];\n                x_236024 = ((__local\n                             double *) red_arr_mem_236000)[sext_i32_i64(local_tid_235990 +\n                                                           offset_236037)];\n                x_236025 = ((__local\n                             double *) red_arr_mem_236002)[sext_i32_i64(local_tid_235990 +\n                                                           offset_236037)];\n            }\n        }\n        offset_236037 = 1;\n        while (slt32(offset_236037, wave_sizze_235992)) {\n            if (slt32(local_tid_235990 + offset_236037,\n                      sext_i64_i32(segred_group_sizze_225512)) &&\n                ((local_tid_235990 - squot32(local_tid_235990,\n                                             wave_sizze_235992) *\n                  wave_sizze_235992) & (2 * offset_236037 - 1)) == 0) {\n                // read array element\n                {\n                    x_236026 = ((volatile __local\n                                 double *) red_arr_mem_235994)[sext_i32_i64(local_tid_235990 +\n                                                               offset_236037)];\n                    x_236027 = ((volatile __local\n                                 double *) red_arr_mem_235996)[sext_i32_i64(local_tid_235990 +\n                                                               offset_236037)];\n                    x_236028 = ((volatile __local\n                                 double *) red_arr_mem_235998)[sext_i32_i64(local_tid_235990 +\n                                                               offset_236037)];\n                    x_236029 = ((volatile __local\n                                 double *) red_arr_mem_236000)[sext_i32_i64(local_tid_235990 +\n                                                               offset_236037)];\n                    x_236030 = ((volatile __local\n     ",
                   "                            double *) red_arr_mem_236002)[sext_i32_i64(local_tid_235990 +\n                                                               offset_236037)];\n                }\n                // apply reduction operation\n                {\n                    double defunc_1_op_res_236031 = x_236021 + x_236026;\n                    double defunc_1_op_res_236032 = x_236022 + x_236027;\n                    double defunc_1_op_res_236033 = x_236023 + x_236028;\n                    double defunc_1_op_res_236034 = x_236024 + x_236029;\n                    double defunc_1_op_res_236035 = x_236025 + x_236030;\n                    \n                    x_236021 = defunc_1_op_res_236031;\n                    x_236022 = defunc_1_op_res_236032;\n                    x_236023 = defunc_1_op_res_236033;\n                    x_236024 = defunc_1_op_res_236034;\n                    x_236025 = defunc_1_op_res_236035;\n                }\n                // write result of operation\n                {\n                    ((volatile __local\n                      double *) red_arr_mem_235994)[sext_i32_i64(local_tid_235990)] =\n                        x_236021;\n                    ((volatile __local\n                      double *) red_arr_mem_235996)[sext_i32_i64(local_tid_235990)] =\n                        x_236022;\n                    ((volatile __local\n                      double *) red_arr_mem_235998)[sext_i32_i64(local_tid_235990)] =\n                        x_236023;\n                    ((volatile __local\n                      double *) red_arr_mem_236000)[sext_i32_i64(local_tid_235990)] =\n                        x_236024;\n                    ((volatile __local\n                      double *) red_arr_mem_236002)[sext_i32_i64(local_tid_235990)] =\n                        x_236025;\n                }\n            }\n            offset_236037 *= 2;\n        }\n        while (slt32(skip_waves_236038,\n                     squot32(sext_i64_i32(segred_group_sizze_225512) +\n                           ",
                   "  wave_sizze_235992 - 1, wave_sizze_235992))) {\n            barrier(CLK_LOCAL_MEM_FENCE);\n            offset_236037 = skip_waves_236038 * wave_sizze_235992;\n            if (slt32(local_tid_235990 + offset_236037,\n                      sext_i64_i32(segred_group_sizze_225512)) &&\n                ((local_tid_235990 - squot32(local_tid_235990,\n                                             wave_sizze_235992) *\n                  wave_sizze_235992) == 0 && (squot32(local_tid_235990,\n                                                      wave_sizze_235992) & (2 *\n                                                                            skip_waves_236038 -\n                                                                            1)) ==\n                 0)) {\n                // read array element\n                {\n                    x_236026 = ((__local\n                                 double *) red_arr_mem_235994)[sext_i32_i64(local_tid_235990 +\n                                                               offset_236037)];\n                    x_236027 = ((__local\n                                 double *) red_arr_mem_235996)[sext_i32_i64(local_tid_235990 +\n                                                               offset_236037)];\n                    x_236028 = ((__local\n                                 double *) red_arr_mem_235998)[sext_i32_i64(local_tid_235990 +\n                                                               offset_236037)];\n                    x_236029 = ((__local\n                                 double *) red_arr_mem_236000)[sext_i32_i64(local_tid_235990 +\n                                                               offset_236037)];\n                    x_236030 = ((__local\n                                 double *) red_arr_mem_236002)[sext_i32_i64(local_tid_235990 +\n                                                               offset_236037)];\n                }\n                // apply reduction operation\n                {\n                    d",
                   "ouble defunc_1_op_res_236031 = x_236021 + x_236026;\n                    double defunc_1_op_res_236032 = x_236022 + x_236027;\n                    double defunc_1_op_res_236033 = x_236023 + x_236028;\n                    double defunc_1_op_res_236034 = x_236024 + x_236029;\n                    double defunc_1_op_res_236035 = x_236025 + x_236030;\n                    \n                    x_236021 = defunc_1_op_res_236031;\n                    x_236022 = defunc_1_op_res_236032;\n                    x_236023 = defunc_1_op_res_236033;\n                    x_236024 = defunc_1_op_res_236034;\n                    x_236025 = defunc_1_op_res_236035;\n                }\n                // write result of operation\n                {\n                    ((__local\n                      double *) red_arr_mem_235994)[sext_i32_i64(local_tid_235990)] =\n                        x_236021;\n                    ((__local\n                      double *) red_arr_mem_235996)[sext_i32_i64(local_tid_235990)] =\n                        x_236022;\n                    ((__local\n                      double *) red_arr_mem_235998)[sext_i32_i64(local_tid_235990)] =\n                        x_236023;\n                    ((__local\n                      double *) red_arr_mem_236000)[sext_i32_i64(local_tid_235990)] =\n                        x_236024;\n                    ((__local\n                      double *) red_arr_mem_236002)[sext_i32_i64(local_tid_235990)] =\n                        x_236025;\n                }\n            }\n            skip_waves_236038 *= 2;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        // first thread saves the result in accumulator\n        {\n            if (sext_i32_i64(local_tid_235990) == (int64_t) 0) {\n                x_acc_236015 = x_236021;\n                x_acc_236016 = x_236022;\n                x_acc_236017 = x_236023;\n                x_acc_236018 = x_236024;\n                x_acc_236019 = x_236025;\n            }\n        }\n        if (groups_per_segment_235972 == (int64_t) 1)",
                   " {\n            // first thread in group saves final result to memory\n            {\n                if (local_tid_235990 == 0) {\n                    ((__global double *) mem_231338)[gtid_225520 *\n                                                     t_n_m_203650 +\n                                                     gtid_225521] =\n                        x_acc_236015;\n                    ((__global double *) mem_231342)[gtid_225520 *\n                                                     t_n_m_203650 +\n                                                     gtid_225521] =\n                        x_acc_236016;\n                    ((__global double *) mem_231346)[gtid_225520 *\n                                                     t_n_m_203650 +\n                                                     gtid_225521] =\n                        x_acc_236017;\n                    ((__global double *) mem_231350)[gtid_225520 *\n                                                     t_n_m_203650 +\n                                                     gtid_225521] =\n                        x_acc_236018;\n                    ((__global double *) mem_231354)[gtid_225520 *\n                                                     t_n_m_203650 +\n                                                     gtid_225521] =\n                        x_acc_236019;\n                }\n            }\n        } else {\n            int32_t old_counter_236039;\n            \n            // first thread in group saves group result to global memory\n            {\n                if (local_tid_235990 == 0) {\n                    ((__global\n                      double *) segred_tmp_mem_235977)[sext_i32_i64(virt_group_id_236008)] =\n                        x_acc_236015;\n                    ((__global\n                      double *) segred_tmp_mem_235979)[sext_i32_i64(virt_group_id_236008)] =\n                        x_acc_236016;\n                    ((__global\n                      double *) segred_tmp_mem_235981)[sext_i32_i64(virt_group",
                   "_id_236008)] =\n                        x_acc_236017;\n                    ((__global\n                      double *) segred_tmp_mem_235983)[sext_i32_i64(virt_group_id_236008)] =\n                        x_acc_236018;\n                    ((__global\n                      double *) segred_tmp_mem_235985)[sext_i32_i64(virt_group_id_236008)] =\n                        x_acc_236019;\n                    mem_fence_global();\n                    old_counter_236039 =\n                        atomic_add_i32_global(&((volatile __global\n                                                 int *) mainzicounter_mem_235987)[sext_i32_i64(srem32(flat_segment_id_236009,\n                                                                                                      10240))],\n                                              (int) 1);\n                    ((__local bool *) sync_arr_mem_236004)[(int64_t) 0] =\n                        old_counter_236039 == groups_per_segment_235972 -\n                        (int64_t) 1;\n                }\n            }\n            barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n            \n            bool is_last_group_236040;\n            \n            is_last_group_236040 = ((__local\n                                     bool *) sync_arr_mem_236004)[(int64_t) 0];\n            if (is_last_group_236040) {\n                if (local_tid_235990 == 0) {\n                    old_counter_236039 =\n                        atomic_add_i32_global(&((volatile __global\n                                                 int *) mainzicounter_mem_235987)[sext_i32_i64(srem32(flat_segment_id_236009,\n                                                                                                      10240))],\n                                              (int) ((int64_t) 0 -\n                                                     groups_per_segment_235972));\n                }\n                // read in the per-group-results\n                {\n                    int64_t read_per_thread_",
                   "236041 =\n                            sdiv_up64(groups_per_segment_235972,\n                                      segred_group_sizze_225512);\n                    \n                    x_225524 = 0.0;\n                    x_225525 = 0.0;\n                    x_225526 = 0.0;\n                    x_225527 = 0.0;\n                    x_225528 = 0.0;\n                    for (int64_t i_236042 = 0; i_236042 <\n                         read_per_thread_236041; i_236042++) {\n                        int64_t group_res_id_236043 =\n                                sext_i32_i64(local_tid_235990) *\n                                read_per_thread_236041 + i_236042;\n                        int64_t index_of_group_res_236044 =\n                                sext_i32_i64(flat_segment_id_236009) *\n                                groups_per_segment_235972 + group_res_id_236043;\n                        \n                        if (slt64(group_res_id_236043,\n                                  groups_per_segment_235972)) {\n                            x_225529 = ((__global\n                                         double *) segred_tmp_mem_235977)[index_of_group_res_236044];\n                            x_225530 = ((__global\n                                         double *) segred_tmp_mem_235979)[index_of_group_res_236044];\n                            x_225531 = ((__global\n                                         double *) segred_tmp_mem_235981)[index_of_group_res_236044];\n                            x_225532 = ((__global\n                                         double *) segred_tmp_mem_235983)[index_of_group_res_236044];\n                            x_225533 = ((__global\n                                         double *) segred_tmp_mem_235985)[index_of_group_res_236044];\n                            \n                            double defunc_1_op_res_225534 = x_225524 + x_225529;\n                            double defunc_1_op_res_225535 = x_225525 + x_225530;\n                            double defunc_1_o",
                   "p_res_225536 = x_225526 + x_225531;\n                            double defunc_1_op_res_225537 = x_225527 + x_225532;\n                            double defunc_1_op_res_225538 = x_225528 + x_225533;\n                            \n                            x_225524 = defunc_1_op_res_225534;\n                            x_225525 = defunc_1_op_res_225535;\n                            x_225526 = defunc_1_op_res_225536;\n                            x_225527 = defunc_1_op_res_225537;\n                            x_225528 = defunc_1_op_res_225538;\n                        }\n                    }\n                }\n                ((__local\n                  double *) red_arr_mem_235994)[sext_i32_i64(local_tid_235990)] =\n                    x_225524;\n                ((__local\n                  double *) red_arr_mem_235996)[sext_i32_i64(local_tid_235990)] =\n                    x_225525;\n                ((__local\n                  double *) red_arr_mem_235998)[sext_i32_i64(local_tid_235990)] =\n                    x_225526;\n                ((__local\n                  double *) red_arr_mem_236000)[sext_i32_i64(local_tid_235990)] =\n                    x_225527;\n                ((__local\n                  double *) red_arr_mem_236002)[sext_i32_i64(local_tid_235990)] =\n                    x_225528;\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // reduce the per-group results\n                {\n                    int32_t offset_236045;\n                    int32_t skip_waves_236046 = 1;\n                    double x_236021;\n                    double x_236022;\n                    double x_236023;\n                    double x_236024;\n                    double x_236025;\n                    double x_236026;\n                    double x_236027;\n                    double x_236028;\n                    double x_236029;\n                    double x_236030;\n                    \n                    offset_236045 = 0;\n                    // participating threads read initial accumula",
                   "tor\n                    {\n                        if (slt32(local_tid_235990,\n                                  sext_i64_i32(segred_group_sizze_225512))) {\n                            x_236021 = ((__local\n                                         double *) red_arr_mem_235994)[sext_i32_i64(local_tid_235990 +\n                                                                       offset_236045)];\n                            x_236022 = ((__local\n                                         double *) red_arr_mem_235996)[sext_i32_i64(local_tid_235990 +\n                                                                       offset_236045)];\n                            x_236023 = ((__local\n                                         double *) red_arr_mem_235998)[sext_i32_i64(local_tid_235990 +\n                                                                       offset_236045)];\n                            x_236024 = ((__local\n                                         double *) red_arr_mem_236000)[sext_i32_i64(local_tid_235990 +\n                                                                       offset_236045)];\n                            x_236025 = ((__local\n                                         double *) red_arr_mem_236002)[sext_i32_i64(local_tid_235990 +\n                                                                       offset_236045)];\n                        }\n                    }\n                    offset_236045 = 1;\n                    while (slt32(offset_236045, wave_sizze_235992)) {\n                        if (slt32(local_tid_235990 + offset_236045,\n                                  sext_i64_i32(segred_group_sizze_225512)) &&\n                            ((local_tid_235990 - squot32(local_tid_235990,\n                                                         wave_sizze_235992) *\n                              wave_sizze_235992) & (2 * offset_236045 - 1)) ==\n                            0) {\n                            // read array element\n                          ",
                   "  {\n                                x_236026 = ((volatile __local\n                                             double *) red_arr_mem_235994)[sext_i32_i64(local_tid_235990 +\n                                                                           offset_236045)];\n                                x_236027 = ((volatile __local\n                                             double *) red_arr_mem_235996)[sext_i32_i64(local_tid_235990 +\n                                                                           offset_236045)];\n                                x_236028 = ((volatile __local\n                                             double *) red_arr_mem_235998)[sext_i32_i64(local_tid_235990 +\n                                                                           offset_236045)];\n                                x_236029 = ((volatile __local\n                                             double *) red_arr_mem_236000)[sext_i32_i64(local_tid_235990 +\n                                                                           offset_236045)];\n                                x_236030 = ((volatile __local\n                                             double *) red_arr_mem_236002)[sext_i32_i64(local_tid_235990 +\n                                                                           offset_236045)];\n                            }\n                            // apply reduction operation\n                            {\n                                double defunc_1_op_res_236031 = x_236021 +\n                                       x_236026;\n                                double defunc_1_op_res_236032 = x_236022 +\n                                       x_236027;\n                                double defunc_1_op_res_236033 = x_236023 +\n                                       x_236028;\n                                double defunc_1_op_res_236034 = x_236024 +\n                                       x_236029;\n                                double defunc_1_op_res_236035 = x_236025 +\n   ",
                   "                                    x_236030;\n                                \n                                x_236021 = defunc_1_op_res_236031;\n                                x_236022 = defunc_1_op_res_236032;\n                                x_236023 = defunc_1_op_res_236033;\n                                x_236024 = defunc_1_op_res_236034;\n                                x_236025 = defunc_1_op_res_236035;\n                            }\n                            // write result of operation\n                            {\n                                ((volatile __local\n                                  double *) red_arr_mem_235994)[sext_i32_i64(local_tid_235990)] =\n                                    x_236021;\n                                ((volatile __local\n                                  double *) red_arr_mem_235996)[sext_i32_i64(local_tid_235990)] =\n                                    x_236022;\n                                ((volatile __local\n                                  double *) red_arr_mem_235998)[sext_i32_i64(local_tid_235990)] =\n                                    x_236023;\n                                ((volatile __local\n                                  double *) red_arr_mem_236000)[sext_i32_i64(local_tid_235990)] =\n                                    x_236024;\n                                ((volatile __local\n                                  double *) red_arr_mem_236002)[sext_i32_i64(local_tid_235990)] =\n                                    x_236025;\n                            }\n                        }\n                        offset_236045 *= 2;\n                    }\n                    while (slt32(skip_waves_236046,\n                                 squot32(sext_i64_i32(segred_group_sizze_225512) +\n                                         wave_sizze_235992 - 1,\n                                         wave_sizze_235992))) {\n                        barrier(CLK_LOCAL_MEM_FENCE);\n                        offset_236045 = skip_waves_2360",
                   "46 * wave_sizze_235992;\n                        if (slt32(local_tid_235990 + offset_236045,\n                                  sext_i64_i32(segred_group_sizze_225512)) &&\n                            ((local_tid_235990 - squot32(local_tid_235990,\n                                                         wave_sizze_235992) *\n                              wave_sizze_235992) == 0 &&\n                             (squot32(local_tid_235990, wave_sizze_235992) &\n                              (2 * skip_waves_236046 - 1)) == 0)) {\n                            // read array element\n                            {\n                                x_236026 = ((__local\n                                             double *) red_arr_mem_235994)[sext_i32_i64(local_tid_235990 +\n                                                                           offset_236045)];\n                                x_236027 = ((__local\n                                             double *) red_arr_mem_235996)[sext_i32_i64(local_tid_235990 +\n                                                                           offset_236045)];\n                                x_236028 = ((__local\n                                             double *) red_arr_mem_235998)[sext_i32_i64(local_tid_235990 +\n                                                                           offset_236045)];\n                                x_236029 = ((__local\n                                             double *) red_arr_mem_236000)[sext_i32_i64(local_tid_235990 +\n                                                                           offset_236045)];\n                                x_236030 = ((__local\n                                             double *) red_arr_mem_236002)[sext_i32_i64(local_tid_235990 +\n                                                                           offset_236045)];\n                            }\n                            // apply reduction operation\n                            {\n                  ",
                   "              double defunc_1_op_res_236031 = x_236021 +\n                                       x_236026;\n                                double defunc_1_op_res_236032 = x_236022 +\n                                       x_236027;\n                                double defunc_1_op_res_236033 = x_236023 +\n                                       x_236028;\n                                double defunc_1_op_res_236034 = x_236024 +\n                                       x_236029;\n                                double defunc_1_op_res_236035 = x_236025 +\n                                       x_236030;\n                                \n                                x_236021 = defunc_1_op_res_236031;\n                                x_236022 = defunc_1_op_res_236032;\n                                x_236023 = defunc_1_op_res_236033;\n                                x_236024 = defunc_1_op_res_236034;\n                                x_236025 = defunc_1_op_res_236035;\n                            }\n                            // write result of operation\n                            {\n                                ((__local\n                                  double *) red_arr_mem_235994)[sext_i32_i64(local_tid_235990)] =\n                                    x_236021;\n                                ((__local\n                                  double *) red_arr_mem_235996)[sext_i32_i64(local_tid_235990)] =\n                                    x_236022;\n                                ((__local\n                                  double *) red_arr_mem_235998)[sext_i32_i64(local_tid_235990)] =\n                                    x_236023;\n                                ((__local\n                                  double *) red_arr_mem_236000)[sext_i32_i64(local_tid_235990)] =\n                                    x_236024;\n                                ((__local\n                                  double *) red_arr_mem_236002)[sext_i32_i64(local_tid_235990)] =\n                             ",
                   "       x_236025;\n                            }\n                        }\n                        skip_waves_236046 *= 2;\n                    }\n                    // and back to memory with the final result\n                    {\n                        if (local_tid_235990 == 0) {\n                            ((__global double *) mem_231338)[gtid_225520 *\n                                                             t_n_m_203650 +\n                                                             gtid_225521] =\n                                x_236021;\n                            ((__global double *) mem_231342)[gtid_225520 *\n                                                             t_n_m_203650 +\n                                                             gtid_225521] =\n                                x_236022;\n                            ((__global double *) mem_231346)[gtid_225520 *\n                                                             t_n_m_203650 +\n                                                             gtid_225521] =\n                                x_236023;\n                            ((__global double *) mem_231350)[gtid_225520 *\n                                                             t_n_m_203650 +\n                                                             gtid_225521] =\n                                x_236024;\n                            ((__global double *) mem_231354)[gtid_225520 *\n                                                             t_n_m_203650 +\n                                                             gtid_225521] =\n                                x_236025;\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_225512\n}\n__kernel void mainzisegred_large_225624(__global int *global_failure,\n                                        __local volatile\n                      ",
                   "                  int64_t *sync_arr_mem_236112_backing_aligned_0,\n                                        __local volatile\n                                        int64_t *red_arr_mem_236110_backing_aligned_1,\n                                        __local volatile\n                                        int64_t *red_arr_mem_236108_backing_aligned_2,\n                                        int64_t n_203490, int64_t q_t_203494,\n                                        int64_t jump_t_203500,\n                                        int64_t partition_sizze_203577,\n                                        int64_t t_n_m_203650, int64_t i_203670,\n                                        int64_t num_groups_225617,\n                                        int64_t groups_per_segment_236092,\n                                        int64_t elements_per_thread_236093,\n                                        int64_t virt_num_groups_236094,\n                                        int64_t threads_per_segment_236096,\n                                        __global unsigned char *ext_mem_229196,\n                                        __global unsigned char *ext_mem_229197,\n                                        __global unsigned char *ext_mem_229460,\n                                        __global unsigned char *ext_mem_229461,\n                                        __global unsigned char *mem_231320,\n                                        __global unsigned char *mem_231324,\n                                        __global unsigned char *mem_231359,\n                                        __global unsigned char *mem_231363,\n                                        __global unsigned char *mem_231367,\n                                        __global unsigned char *mem_231371,\n                                        __global unsigned char *mem_231375,\n                                        __global unsigned char *mem_231380,\n                                        __global unsigned c",
                   "har *mem_231384,\n                                        __global\n                                        unsigned char *segred_tmp_mem_236097,\n                                        __global\n                                        unsigned char *segred_tmp_mem_236099,\n                                        __global\n                                        unsigned char *mainzicounter_mem_236101)\n{\n    #define segred_group_sizze_225616 (mainzisegred_group_sizze_224832)\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_236112_backing_2 =\n                                   (__local volatile\n                                    unsigned char *) sync_arr_mem_236112_backing_aligned_0;\n    __local volatile unsigned char *restrict red_arr_mem_236110_backing_1 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_236110_backing_aligned_1;\n    __local volatile unsigned char *restrict red_arr_mem_236108_backing_0 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_236108_backing_aligned_2;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_236103;\n    int32_t local_tid_236104;\n    int64_t group_sizze_236107;\n    int32_t wave_sizze_236106;\n    int32_t group_tid_236105;\n    \n    global_tid_236103 = get_global_id(0);\n    local_tid_236104 = get_local_id(0);\n    group_sizze_236107 = get_local_size(0);\n    wave_sizze_236106 = LOCKSTEP_WIDTH;\n    group_tid_236105 = get_group_id(0);\n    \n    int32_t phys_tid_225624 = global_tid_236103;\n    __local unsigned char *red_arr_mem_236108;\n    \n    red_arr_mem_236108 = (__local unsigned char *) red_arr_mem_236108_backing_0;\n    \n    __local unsigned char *red_arr_mem_236110;\n    \n    red_arr_mem_236110 = (__local unsigned char *) red_arr_mem_236110_backing_1;\n    \n    __local unsig",
                   "ned char *sync_arr_mem_236112;\n    \n    sync_arr_mem_236112 = (__local\n                           unsigned char *) sync_arr_mem_236112_backing_2;\n    \n    int32_t phys_group_id_236114;\n    \n    phys_group_id_236114 = get_group_id(0);\n    for (int32_t i_236115 = 0; i_236115 <\n         sdiv_up32(sext_i64_i32(virt_num_groups_236094) - phys_group_id_236114,\n                   sext_i64_i32(num_groups_225617)); i_236115++) {\n        int32_t virt_group_id_236116 = phys_group_id_236114 + i_236115 *\n                sext_i64_i32(num_groups_225617);\n        int32_t flat_segment_id_236117 = squot32(virt_group_id_236116,\n                                                 sext_i64_i32(groups_per_segment_236092));\n        int64_t global_tid_236118 = srem64(sext_i32_i64(virt_group_id_236116) *\n                                           segred_group_sizze_225616 +\n                                           sext_i32_i64(local_tid_236104),\n                                           segred_group_sizze_225616 *\n                                           groups_per_segment_236092);\n        int64_t slice_236119 = t_n_m_203650;\n        int64_t slice_236120 = partition_sizze_203577 * slice_236119;\n        int64_t gtid_225621 = squot64(sext_i32_i64(flat_segment_id_236117),\n                                      slice_236119);\n        int64_t remnant_236121 = sext_i32_i64(flat_segment_id_236117) -\n                gtid_225621 * slice_236119;\n        int64_t gtid_225622 = remnant_236121;\n        int64_t remnant_236122 = remnant_236121 - gtid_225622;\n        int64_t gtid_225623;\n        double x_acc_236123;\n        double x_acc_236124;\n        int64_t chunk_sizze_236125 = smin64(elements_per_thread_236093,\n                                            sdiv_up64(q_t_203494 -\n                                                      global_tid_236118,\n                                                      threads_per_segment_236096));\n        double x_225625;\n        double x_225626;\n        double x_225627",
                   ";\n        double x_225628;\n        \n        // neutral-initialise the accumulators\n        {\n            x_acc_236123 = 0.0;\n            x_acc_236124 = 0.0;\n        }\n        for (int64_t i_236132 = 0; i_236132 < chunk_sizze_236125; i_236132++) {\n            gtid_225623 = global_tid_236118 + threads_per_segment_236096 *\n                i_236132;\n            // apply map function\n            {\n                int64_t x_225632;\n                \n                x_225632 = ((__global int64_t *) ext_mem_229196)[gtid_225621];\n                \n                int64_t x_225643;\n                \n                x_225643 = ((__global int64_t *) ext_mem_229461)[gtid_225621 *\n                                                                 t_n_m_203650 +\n                                                                 gtid_225622];\n                \n                double x_225644;\n                \n                x_225644 = ((__global double *) ext_mem_229460)[gtid_225621 *\n                                                                t_n_m_203650 +\n                                                                gtid_225622];\n                \n                int64_t binop_y_228679 = mul64(jump_t_203500, gtid_225622);\n                int64_t binop_y_228680 = smin64(i_203670, binop_y_228679);\n                int64_t index_primexp_228681 = add64((int64_t) 1,\n                                                     binop_y_228680);\n                double a12_225646;\n                \n                a12_225646 = ((__global double *) mem_231359)[gtid_225621 *\n                                                              t_n_m_203650 +\n                                                              gtid_225622];\n                \n                double b12_225647;\n                \n                b12_225647 = ((__global double *) mem_231363)[gtid_225621 *\n                                                              t_n_m_203650 +\n                                                           ",
                   "   gtid_225622];\n                \n                double c12_225648;\n                \n                c12_225648 = ((__global double *) mem_231367)[gtid_225621 *\n                                                              t_n_m_203650 +\n                                                              gtid_225622];\n                \n                double b2_225649;\n                \n                b2_225649 = ((__global double *) mem_231371)[gtid_225621 *\n                                                             t_n_m_203650 +\n                                                             gtid_225622];\n                \n                double c2_225650;\n                \n                c2_225650 = ((__global double *) mem_231375)[gtid_225621 *\n                                                             t_n_m_203650 +\n                                                             gtid_225622];\n                \n                bool cond_225652 = sle64(x_225632, gtid_225623);\n                int64_t defunc_0_f_res_225653;\n                \n                if (cond_225652) {\n                    defunc_0_f_res_225653 = (int64_t) 0;\n                } else {\n                    int64_t i_225654 = add64(gtid_225623, x_225643);\n                    int64_t defunc_0_add_arg_225655;\n                    \n                    defunc_0_add_arg_225655 = ((__global\n                                                int64_t *) ext_mem_229197)[gtid_225621 *\n                                                                           n_203490 +\n                                                                           i_225654];\n                    \n                    int64_t defunc_1_add_res_225656 = add64((int64_t) 1,\n                                                            defunc_0_add_arg_225655);\n                    \n                    defunc_0_f_res_225653 = defunc_1_add_res_225656;\n                }\n                \n                double defunc_0_f_res_225657;\n                \n     ",
                   "           if (cond_225652) {\n                    defunc_0_f_res_225657 = 0.0;\n                } else {\n                    int64_t i_225658 = add64(gtid_225623, x_225643);\n                    double defunc_0_add_arg_225659;\n                    \n                    defunc_0_add_arg_225659 = ((__global\n                                                double *) mem_231320)[gtid_225621 *\n                                                                      n_203490 +\n                                                                      i_225658];\n                    defunc_0_f_res_225657 = defunc_0_add_arg_225659;\n                }\n                \n                int64_t binop_p_225660 = sub64(defunc_0_f_res_225653,\n                                               index_primexp_228681);\n                double defunc_0_f_res_225661 = sitofp_i64_f64(binop_p_225660);\n                double abs_res_225662 = fabs(defunc_0_f_res_225661);\n                double tmp1_225663 = abs_res_225662 / x_225644;\n                double x_225664 = tmp1_225663 * tmp1_225663;\n                double y_225665 = tmp1_225663 * x_225664;\n                double tmp2_225666 = 1.0 - y_225665;\n                double x_225667 = tmp2_225666 * tmp2_225666;\n                double tmp3_225668 = tmp2_225666 * x_225667;\n                double tmp4_225669 = defunc_0_f_res_225657 * tmp3_225668;\n                double defunc_1_f_res_225670 = defunc_0_f_res_225661 *\n                       tmp4_225669;\n                double defunc_1_f_res_225671 = defunc_0_f_res_225661 *\n                       defunc_1_f_res_225670;\n                double defunc_0_f_res_225672;\n                \n                if (cond_225652) {\n                    defunc_0_f_res_225672 = 0.0;\n                } else {\n                    int64_t i_225673 = add64(gtid_225623, x_225643);\n                    double defunc_0_add_arg_225674;\n                    \n                    defunc_0_add_arg_225674 = ((__global\n                                ",
                   "                double *) mem_231324)[gtid_225621 *\n                                                                      n_203490 +\n                                                                      i_225673];\n                    defunc_0_f_res_225672 = defunc_0_add_arg_225674;\n                }\n                \n                double x_225675 = a12_225646 * tmp4_225669;\n                double y_225676 = b12_225647 * defunc_1_f_res_225670;\n                double x_225677 = x_225675 + y_225676;\n                double y_225678 = c12_225648 * defunc_1_f_res_225671;\n                double x_225679 = x_225677 + y_225678;\n                double defunc_9_fit_fun_res_225680 = defunc_0_f_res_225672 *\n                       x_225679;\n                double x_225681 = b12_225647 * tmp4_225669;\n                double y_225682 = b2_225649 * defunc_1_f_res_225670;\n                double x_225683 = x_225681 + y_225682;\n                double y_225684 = c2_225650 * defunc_1_f_res_225671;\n                double x_225685 = x_225683 + y_225684;\n                double defunc_9_slope_fun_res_225686 = defunc_0_f_res_225672 *\n                       x_225685;\n                \n                // save map-out results\n                { }\n                // load accumulator\n                {\n                    x_225625 = x_acc_236123;\n                    x_225626 = x_acc_236124;\n                }\n                // load new values\n                {\n                    x_225627 = defunc_9_fit_fun_res_225680;\n                    x_225628 = defunc_9_slope_fun_res_225686;\n                }\n                // apply reduction operator\n                {\n                    double defunc_1_op_res_225629 = x_225625 + x_225627;\n                    double defunc_1_op_res_225630 = x_225626 + x_225628;\n                    \n                    // store in accumulator\n                    {\n                        x_acc_236123 = defunc_1_op_res_225629;\n                        x_acc_236124 = defunc_1_op_r",
                   "es_225630;\n                    }\n                }\n            }\n        }\n        // to reduce current chunk, first store our result in memory\n        {\n            x_225625 = x_acc_236123;\n            x_225626 = x_acc_236124;\n            ((__local\n              double *) red_arr_mem_236108)[sext_i32_i64(local_tid_236104)] =\n                x_225625;\n            ((__local\n              double *) red_arr_mem_236110)[sext_i32_i64(local_tid_236104)] =\n                x_225626;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        \n        int32_t offset_236133;\n        int32_t skip_waves_236134 = 1;\n        double x_236126;\n        double x_236127;\n        double x_236128;\n        double x_236129;\n        \n        offset_236133 = 0;\n        // participating threads read initial accumulator\n        {\n            if (slt32(local_tid_236104,\n                      sext_i64_i32(segred_group_sizze_225616))) {\n                x_236126 = ((__local\n                             double *) red_arr_mem_236108)[sext_i32_i64(local_tid_236104 +\n                                                           offset_236133)];\n                x_236127 = ((__local\n                             double *) red_arr_mem_236110)[sext_i32_i64(local_tid_236104 +\n                                                           offset_236133)];\n            }\n        }\n        offset_236133 = 1;\n        while (slt32(offset_236133, wave_sizze_236106)) {\n            if (slt32(local_tid_236104 + offset_236133,\n                      sext_i64_i32(segred_group_sizze_225616)) &&\n                ((local_tid_236104 - squot32(local_tid_236104,\n                                             wave_sizze_236106) *\n                  wave_sizze_236106) & (2 * offset_236133 - 1)) == 0) {\n                // read array element\n                {\n                    x_236128 = ((volatile __local\n                                 double *) red_arr_mem_236108)[sext_i32_i64(local_tid_236104 +\n                                          ",
                   "                     offset_236133)];\n                    x_236129 = ((volatile __local\n                                 double *) red_arr_mem_236110)[sext_i32_i64(local_tid_236104 +\n                                                               offset_236133)];\n                }\n                // apply reduction operation\n                {\n                    double defunc_1_op_res_236130 = x_236126 + x_236128;\n                    double defunc_1_op_res_236131 = x_236127 + x_236129;\n                    \n                    x_236126 = defunc_1_op_res_236130;\n                    x_236127 = defunc_1_op_res_236131;\n                }\n                // write result of operation\n                {\n                    ((volatile __local\n                      double *) red_arr_mem_236108)[sext_i32_i64(local_tid_236104)] =\n                        x_236126;\n                    ((volatile __local\n                      double *) red_arr_mem_236110)[sext_i32_i64(local_tid_236104)] =\n                        x_236127;\n                }\n            }\n            offset_236133 *= 2;\n        }\n        while (slt32(skip_waves_236134,\n                     squot32(sext_i64_i32(segred_group_sizze_225616) +\n                             wave_sizze_236106 - 1, wave_sizze_236106))) {\n            barrier(CLK_LOCAL_MEM_FENCE);\n            offset_236133 = skip_waves_236134 * wave_sizze_236106;\n            if (slt32(local_tid_236104 + offset_236133,\n                      sext_i64_i32(segred_group_sizze_225616)) &&\n                ((local_tid_236104 - squot32(local_tid_236104,\n                                             wave_sizze_236106) *\n                  wave_sizze_236106) == 0 && (squot32(local_tid_236104,\n                                                      wave_sizze_236106) & (2 *\n                                                                            skip_waves_236134 -\n                                                                            1)) ==\n                 0)) {\n      ",
                   "          // read array element\n                {\n                    x_236128 = ((__local\n                                 double *) red_arr_mem_236108)[sext_i32_i64(local_tid_236104 +\n                                                               offset_236133)];\n                    x_236129 = ((__local\n                                 double *) red_arr_mem_236110)[sext_i32_i64(local_tid_236104 +\n                                                               offset_236133)];\n                }\n                // apply reduction operation\n                {\n                    double defunc_1_op_res_236130 = x_236126 + x_236128;\n                    double defunc_1_op_res_236131 = x_236127 + x_236129;\n                    \n                    x_236126 = defunc_1_op_res_236130;\n                    x_236127 = defunc_1_op_res_236131;\n                }\n                // write result of operation\n                {\n                    ((__local\n                      double *) red_arr_mem_236108)[sext_i32_i64(local_tid_236104)] =\n                        x_236126;\n                    ((__local\n                      double *) red_arr_mem_236110)[sext_i32_i64(local_tid_236104)] =\n                        x_236127;\n                }\n            }\n            skip_waves_236134 *= 2;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        // first thread saves the result in accumulator\n        {\n            if (sext_i32_i64(local_tid_236104) == (int64_t) 0) {\n                x_acc_236123 = x_236126;\n                x_acc_236124 = x_236127;\n            }\n        }\n        if (groups_per_segment_236092 == (int64_t) 1) {\n            // first thread in group saves final result to memory\n            {\n                if (local_tid_236104 == 0) {\n                    ((__global double *) mem_231380)[gtid_225621 *\n                                                     t_n_m_203650 +\n                                                     gtid_225622] =\n                        x_acc_236123;\n    ",
                   "                ((__global double *) mem_231384)[gtid_225621 *\n                                                     t_n_m_203650 +\n                                                     gtid_225622] =\n                        x_acc_236124;\n                }\n            }\n        } else {\n            int32_t old_counter_236135;\n            \n            // first thread in group saves group result to global memory\n            {\n                if (local_tid_236104 == 0) {\n                    ((__global\n                      double *) segred_tmp_mem_236097)[sext_i32_i64(virt_group_id_236116)] =\n                        x_acc_236123;\n                    ((__global\n                      double *) segred_tmp_mem_236099)[sext_i32_i64(virt_group_id_236116)] =\n                        x_acc_236124;\n                    mem_fence_global();\n                    old_counter_236135 =\n                        atomic_add_i32_global(&((volatile __global\n                                                 int *) mainzicounter_mem_236101)[sext_i32_i64(srem32(flat_segment_id_236117,\n                                                                                                      10240))],\n                                              (int) 1);\n                    ((__local bool *) sync_arr_mem_236112)[(int64_t) 0] =\n                        old_counter_236135 == groups_per_segment_236092 -\n                        (int64_t) 1;\n                }\n            }\n            barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n            \n            bool is_last_group_236136;\n            \n            is_last_group_236136 = ((__local\n                                     bool *) sync_arr_mem_236112)[(int64_t) 0];\n            if (is_last_group_236136) {\n                if (local_tid_236104 == 0) {\n                    old_counter_236135 =\n                        atomic_add_i32_global(&((volatile __global\n                                                 int *) mainzicounter_mem_236101)[sext_i32_i64(sre",
                   "m32(flat_segment_id_236117,\n                                                                                                      10240))],\n                                              (int) ((int64_t) 0 -\n                                                     groups_per_segment_236092));\n                }\n                // read in the per-group-results\n                {\n                    int64_t read_per_thread_236137 =\n                            sdiv_up64(groups_per_segment_236092,\n                                      segred_group_sizze_225616);\n                    \n                    x_225625 = 0.0;\n                    x_225626 = 0.0;\n                    for (int64_t i_236138 = 0; i_236138 <\n                         read_per_thread_236137; i_236138++) {\n                        int64_t group_res_id_236139 =\n                                sext_i32_i64(local_tid_236104) *\n                                read_per_thread_236137 + i_236138;\n                        int64_t index_of_group_res_236140 =\n                                sext_i32_i64(flat_segment_id_236117) *\n                                groups_per_segment_236092 + group_res_id_236139;\n                        \n                        if (slt64(group_res_id_236139,\n                                  groups_per_segment_236092)) {\n                            x_225627 = ((__global\n                                         double *) segred_tmp_mem_236097)[index_of_group_res_236140];\n                            x_225628 = ((__global\n                                         double *) segred_tmp_mem_236099)[index_of_group_res_236140];\n                            \n                            double defunc_1_op_res_225629 = x_225625 + x_225627;\n                            double defunc_1_op_res_225630 = x_225626 + x_225628;\n                            \n                            x_225625 = defunc_1_op_res_225629;\n                            x_225626 = defunc_1_op_res_225630;\n                        }\n          ",
                   "          }\n                }\n                ((__local\n                  double *) red_arr_mem_236108)[sext_i32_i64(local_tid_236104)] =\n                    x_225625;\n                ((__local\n                  double *) red_arr_mem_236110)[sext_i32_i64(local_tid_236104)] =\n                    x_225626;\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // reduce the per-group results\n                {\n                    int32_t offset_236141;\n                    int32_t skip_waves_236142 = 1;\n                    double x_236126;\n                    double x_236127;\n                    double x_236128;\n                    double x_236129;\n                    \n                    offset_236141 = 0;\n                    // participating threads read initial accumulator\n                    {\n                        if (slt32(local_tid_236104,\n                                  sext_i64_i32(segred_group_sizze_225616))) {\n                            x_236126 = ((__local\n                                         double *) red_arr_mem_236108)[sext_i32_i64(local_tid_236104 +\n                                                                       offset_236141)];\n                            x_236127 = ((__local\n                                         double *) red_arr_mem_236110)[sext_i32_i64(local_tid_236104 +\n                                                                       offset_236141)];\n                        }\n                    }\n                    offset_236141 = 1;\n                    while (slt32(offset_236141, wave_sizze_236106)) {\n                        if (slt32(local_tid_236104 + offset_236141,\n                                  sext_i64_i32(segred_group_sizze_225616)) &&\n                            ((local_tid_236104 - squot32(local_tid_236104,\n                                                         wave_sizze_236106) *\n                              wave_sizze_236106) & (2 * offset_236141 - 1)) ==\n                            0) {\n          ",
                   "                  // read array element\n                            {\n                                x_236128 = ((volatile __local\n                                             double *) red_arr_mem_236108)[sext_i32_i64(local_tid_236104 +\n                                                                           offset_236141)];\n                                x_236129 = ((volatile __local\n                                             double *) red_arr_mem_236110)[sext_i32_i64(local_tid_236104 +\n                                                                           offset_236141)];\n                            }\n                            // apply reduction operation\n                            {\n                                double defunc_1_op_res_236130 = x_236126 +\n                                       x_236128;\n                                double defunc_1_op_res_236131 = x_236127 +\n                                       x_236129;\n                                \n                                x_236126 = defunc_1_op_res_236130;\n                                x_236127 = defunc_1_op_res_236131;\n                            }\n                            // write result of operation\n                            {\n                                ((volatile __local\n                                  double *) red_arr_mem_236108)[sext_i32_i64(local_tid_236104)] =\n                                    x_236126;\n                                ((volatile __local\n                                  double *) red_arr_mem_236110)[sext_i32_i64(local_tid_236104)] =\n                                    x_236127;\n                            }\n                        }\n                        offset_236141 *= 2;\n                    }\n                    while (slt32(skip_waves_236142,\n                                 squot32(sext_i64_i32(segred_group_sizze_225616) +\n                                         wave_sizze_236106 - 1,\n                                         wave_si",
                   "zze_236106))) {\n                        barrier(CLK_LOCAL_MEM_FENCE);\n                        offset_236141 = skip_waves_236142 * wave_sizze_236106;\n                        if (slt32(local_tid_236104 + offset_236141,\n                                  sext_i64_i32(segred_group_sizze_225616)) &&\n                            ((local_tid_236104 - squot32(local_tid_236104,\n                                                         wave_sizze_236106) *\n                              wave_sizze_236106) == 0 &&\n                             (squot32(local_tid_236104, wave_sizze_236106) &\n                              (2 * skip_waves_236142 - 1)) == 0)) {\n                            // read array element\n                            {\n                                x_236128 = ((__local\n                                             double *) red_arr_mem_236108)[sext_i32_i64(local_tid_236104 +\n                                                                           offset_236141)];\n                                x_236129 = ((__local\n                                             double *) red_arr_mem_236110)[sext_i32_i64(local_tid_236104 +\n                                                                           offset_236141)];\n                            }\n                            // apply reduction operation\n                            {\n                                double defunc_1_op_res_236130 = x_236126 +\n                                       x_236128;\n                                double defunc_1_op_res_236131 = x_236127 +\n                                       x_236129;\n                                \n                                x_236126 = defunc_1_op_res_236130;\n                                x_236127 = defunc_1_op_res_236131;\n                            }\n                            // write result of operation\n                            {\n                                ((__local\n                                  double *) red_arr_mem_236108)[sext_i32_i6",
                   "4(local_tid_236104)] =\n                                    x_236126;\n                                ((__local\n                                  double *) red_arr_mem_236110)[sext_i32_i64(local_tid_236104)] =\n                                    x_236127;\n                            }\n                        }\n                        skip_waves_236142 *= 2;\n                    }\n                    // and back to memory with the final result\n                    {\n                        if (local_tid_236104 == 0) {\n                            ((__global double *) mem_231380)[gtid_225621 *\n                                                             t_n_m_203650 +\n                                                             gtid_225622] =\n                                x_236126;\n                            ((__global double *) mem_231384)[gtid_225621 *\n                                                             t_n_m_203650 +\n                                                             gtid_225622] =\n                                x_236127;\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_225616\n}\n__kernel void mainzisegred_large_228090(__global int *global_failure,\n                                        __local volatile\n                                        int64_t *sync_arr_mem_236621_backing_aligned_0,\n                                        __local volatile\n                                        int64_t *red_arr_mem_236619_backing_aligned_1,\n                                        int64_t n_203490,\n                                        int64_t partition_sizze_203577,\n                                        int64_t stl_res_203664,\n                                        int64_t j_m_i_204133,\n                                        int64_t num_groups_228085,\n                                    ",
                   "    int64_t groups_per_segment_236605,\n                                        int64_t elements_per_thread_236606,\n                                        int64_t virt_num_groups_236607,\n                                        int64_t threads_per_segment_236609,\n                                        __global unsigned char *ext_mem_231816,\n                                        __global unsigned char *mem_231833,\n                                        __global\n                                        unsigned char *segred_tmp_mem_236610,\n                                        __global\n                                        unsigned char *mainzicounter_mem_236612)\n{\n    #define segred_group_sizze_228084 (mainzisegred_group_sizze_228067)\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_236621_backing_1 =\n                                   (__local volatile\n                                    unsigned char *) sync_arr_mem_236621_backing_aligned_0;\n    __local volatile unsigned char *restrict red_arr_mem_236619_backing_0 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_236619_backing_aligned_1;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_236614;\n    int32_t local_tid_236615;\n    int64_t group_sizze_236618;\n    int32_t wave_sizze_236617;\n    int32_t group_tid_236616;\n    \n    global_tid_236614 = get_global_id(0);\n    local_tid_236615 = get_local_id(0);\n    group_sizze_236618 = get_local_size(0);\n    wave_sizze_236617 = LOCKSTEP_WIDTH;\n    group_tid_236616 = get_group_id(0);\n    \n    int32_t phys_tid_228090 = global_tid_236614;\n    __local unsigned char *red_arr_mem_236619;\n    \n    red_arr_mem_236619 = (__local unsigned char *) red_arr_mem_236619_backing_0;\n    \n    __local unsigned char *sync_arr_mem_236621;\n    \n    sync_arr_mem_236621 = (__local\n            ",
                   "               unsigned char *) sync_arr_mem_236621_backing_1;\n    \n    int32_t phys_group_id_236623;\n    \n    phys_group_id_236623 = get_group_id(0);\n    for (int32_t i_236624 = 0; i_236624 <\n         sdiv_up32(sext_i64_i32(virt_num_groups_236607) - phys_group_id_236623,\n                   sext_i64_i32(num_groups_228085)); i_236624++) {\n        int32_t virt_group_id_236625 = phys_group_id_236623 + i_236624 *\n                sext_i64_i32(num_groups_228085);\n        int32_t flat_segment_id_236626 = squot32(virt_group_id_236625,\n                                                 sext_i64_i32(groups_per_segment_236605));\n        int64_t global_tid_236627 = srem64(sext_i32_i64(virt_group_id_236625) *\n                                           segred_group_sizze_228084 +\n                                           sext_i32_i64(local_tid_236615),\n                                           segred_group_sizze_228084 *\n                                           groups_per_segment_236605);\n        int64_t slice_236628 = partition_sizze_203577;\n        int64_t gtid_228088 = sext_i32_i64(flat_segment_id_236626);\n        int64_t remnant_236629 = sext_i32_i64(flat_segment_id_236626) -\n                gtid_228088;\n        int64_t gtid_228089;\n        double x_acc_236630;\n        int64_t chunk_sizze_236631 = smin64(elements_per_thread_236606,\n                                            sdiv_up64(j_m_i_204133 -\n                                                      global_tid_236627,\n                                                      threads_per_segment_236609));\n        double x_228091;\n        double x_228092;\n        \n        // neutral-initialise the accumulators\n        {\n            x_acc_236630 = 0.0;\n        }\n        for (int64_t i_236635 = 0; i_236635 < chunk_sizze_236631; i_236635++) {\n            gtid_228089 = global_tid_236627 + threads_per_segment_236609 *\n                i_236635;\n            // apply map function\n            {\n                int64_t slice_228219 = st",
                   "l_res_203664 + gtid_228089;\n                double x_228095;\n                \n                x_228095 = ((__global double *) ext_mem_231816)[gtid_228088 *\n                                                                n_203490 +\n                                                                slice_228219];\n                // save map-out results\n                { }\n                // load accumulator\n                {\n                    x_228091 = x_acc_236630;\n                }\n                // load new values\n                {\n                    x_228092 = x_228095;\n                }\n                // apply reduction operator\n                {\n                    double defunc_1_op_res_228093 = x_228091 + x_228092;\n                    \n                    // store in accumulator\n                    {\n                        x_acc_236630 = defunc_1_op_res_228093;\n                    }\n                }\n            }\n        }\n        // to reduce current chunk, first store our result in memory\n        {\n            x_228091 = x_acc_236630;\n            ((__local\n              double *) red_arr_mem_236619)[sext_i32_i64(local_tid_236615)] =\n                x_228091;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        \n        int32_t offset_236636;\n        int32_t skip_waves_236637 = 1;\n        double x_236632;\n        double x_236633;\n        \n        offset_236636 = 0;\n        // participating threads read initial accumulator\n        {\n            if (slt32(local_tid_236615,\n                      sext_i64_i32(segred_group_sizze_228084))) {\n                x_236632 = ((__local\n                             double *) red_arr_mem_236619)[sext_i32_i64(local_tid_236615 +\n                                                           offset_236636)];\n            }\n        }\n        offset_236636 = 1;\n        while (slt32(offset_236636, wave_sizze_236617)) {\n            if (slt32(local_tid_236615 + offset_236636,\n                      sext_i64_i32(segred_group_sizze_",
                   "228084)) &&\n                ((local_tid_236615 - squot32(local_tid_236615,\n                                             wave_sizze_236617) *\n                  wave_sizze_236617) & (2 * offset_236636 - 1)) == 0) {\n                // read array element\n                {\n                    x_236633 = ((volatile __local\n                                 double *) red_arr_mem_236619)[sext_i32_i64(local_tid_236615 +\n                                                               offset_236636)];\n                }\n                // apply reduction operation\n                {\n                    double defunc_1_op_res_236634 = x_236632 + x_236633;\n                    \n                    x_236632 = defunc_1_op_res_236634;\n                }\n                // write result of operation\n                {\n                    ((volatile __local\n                      double *) red_arr_mem_236619)[sext_i32_i64(local_tid_236615)] =\n                        x_236632;\n                }\n            }\n            offset_236636 *= 2;\n        }\n        while (slt32(skip_waves_236637,\n                     squot32(sext_i64_i32(segred_group_sizze_228084) +\n                             wave_sizze_236617 - 1, wave_sizze_236617))) {\n            barrier(CLK_LOCAL_MEM_FENCE);\n            offset_236636 = skip_waves_236637 * wave_sizze_236617;\n            if (slt32(local_tid_236615 + offset_236636,\n                      sext_i64_i32(segred_group_sizze_228084)) &&\n                ((local_tid_236615 - squot32(local_tid_236615,\n                                             wave_sizze_236617) *\n                  wave_sizze_236617) == 0 && (squot32(local_tid_236615,\n                                                      wave_sizze_236617) & (2 *\n                                                                            skip_waves_236637 -\n                                                                            1)) ==\n                 0)) {\n                // read array element\n                {\n      ",
                   "              x_236633 = ((__local\n                                 double *) red_arr_mem_236619)[sext_i32_i64(local_tid_236615 +\n                                                               offset_236636)];\n                }\n                // apply reduction operation\n                {\n                    double defunc_1_op_res_236634 = x_236632 + x_236633;\n                    \n                    x_236632 = defunc_1_op_res_236634;\n                }\n                // write result of operation\n                {\n                    ((__local\n                      double *) red_arr_mem_236619)[sext_i32_i64(local_tid_236615)] =\n                        x_236632;\n                }\n            }\n            skip_waves_236637 *= 2;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        // first thread saves the result in accumulator\n        {\n            if (sext_i32_i64(local_tid_236615) == (int64_t) 0) {\n                x_acc_236630 = x_236632;\n            }\n        }\n        if (groups_per_segment_236605 == (int64_t) 1) {\n            // first thread in group saves final result to memory\n            {\n                if (local_tid_236615 == 0) {\n                    ((__global double *) mem_231833)[gtid_228088] =\n                        x_acc_236630;\n                }\n            }\n        } else {\n            int32_t old_counter_236638;\n            \n            // first thread in group saves group result to global memory\n            {\n                if (local_tid_236615 == 0) {\n                    ((__global\n                      double *) segred_tmp_mem_236610)[sext_i32_i64(virt_group_id_236625)] =\n                        x_acc_236630;\n                    mem_fence_global();\n                    old_counter_236638 =\n                        atomic_add_i32_global(&((volatile __global\n                                                 int *) mainzicounter_mem_236612)[sext_i32_i64(srem32(flat_segment_id_236626,\n                                                            ",
                   "                                          10240))],\n                                              (int) 1);\n                    ((__local bool *) sync_arr_mem_236621)[(int64_t) 0] =\n                        old_counter_236638 == groups_per_segment_236605 -\n                        (int64_t) 1;\n                }\n            }\n            barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n            \n            bool is_last_group_236639;\n            \n            is_last_group_236639 = ((__local\n                                     bool *) sync_arr_mem_236621)[(int64_t) 0];\n            if (is_last_group_236639) {\n                if (local_tid_236615 == 0) {\n                    old_counter_236638 =\n                        atomic_add_i32_global(&((volatile __global\n                                                 int *) mainzicounter_mem_236612)[sext_i32_i64(srem32(flat_segment_id_236626,\n                                                                                                      10240))],\n                                              (int) ((int64_t) 0 -\n                                                     groups_per_segment_236605));\n                }\n                // read in the per-group-results\n                {\n                    int64_t read_per_thread_236640 =\n                            sdiv_up64(groups_per_segment_236605,\n                                      segred_group_sizze_228084);\n                    \n                    x_228091 = 0.0;\n                    for (int64_t i_236641 = 0; i_236641 <\n                         read_per_thread_236640; i_236641++) {\n                        int64_t group_res_id_236642 =\n                                sext_i32_i64(local_tid_236615) *\n                                read_per_thread_236640 + i_236641;\n                        int64_t index_of_group_res_236643 =\n                                sext_i32_i64(flat_segment_id_236626) *\n                                groups_per_segment_236605 + group_res_id_236",
                   "642;\n                        \n                        if (slt64(group_res_id_236642,\n                                  groups_per_segment_236605)) {\n                            x_228092 = ((__global\n                                         double *) segred_tmp_mem_236610)[index_of_group_res_236643];\n                            \n                            double defunc_1_op_res_228093 = x_228091 + x_228092;\n                            \n                            x_228091 = defunc_1_op_res_228093;\n                        }\n                    }\n                }\n                ((__local\n                  double *) red_arr_mem_236619)[sext_i32_i64(local_tid_236615)] =\n                    x_228091;\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // reduce the per-group results\n                {\n                    int32_t offset_236644;\n                    int32_t skip_waves_236645 = 1;\n                    double x_236632;\n                    double x_236633;\n                    \n                    offset_236644 = 0;\n                    // participating threads read initial accumulator\n                    {\n                        if (slt32(local_tid_236615,\n                                  sext_i64_i32(segred_group_sizze_228084))) {\n                            x_236632 = ((__local\n                                         double *) red_arr_mem_236619)[sext_i32_i64(local_tid_236615 +\n                                                                       offset_236644)];\n                        }\n                    }\n                    offset_236644 = 1;\n                    while (slt32(offset_236644, wave_sizze_236617)) {\n                        if (slt32(local_tid_236615 + offset_236644,\n                                  sext_i64_i32(segred_group_sizze_228084)) &&\n                            ((local_tid_236615 - squot32(local_tid_236615,\n                                                         wave_sizze_236617) *\n                              wave_",
                   "sizze_236617) & (2 * offset_236644 - 1)) ==\n                            0) {\n                            // read array element\n                            {\n                                x_236633 = ((volatile __local\n                                             double *) red_arr_mem_236619)[sext_i32_i64(local_tid_236615 +\n                                                                           offset_236644)];\n                            }\n                            // apply reduction operation\n                            {\n                                double defunc_1_op_res_236634 = x_236632 +\n                                       x_236633;\n                                \n                                x_236632 = defunc_1_op_res_236634;\n                            }\n                            // write result of operation\n                            {\n                                ((volatile __local\n                                  double *) red_arr_mem_236619)[sext_i32_i64(local_tid_236615)] =\n                                    x_236632;\n                            }\n                        }\n                        offset_236644 *= 2;\n                    }\n                    while (slt32(skip_waves_236645,\n                                 squot32(sext_i64_i32(segred_group_sizze_228084) +\n                                         wave_sizze_236617 - 1,\n                                         wave_sizze_236617))) {\n                        barrier(CLK_LOCAL_MEM_FENCE);\n                        offset_236644 = skip_waves_236645 * wave_sizze_236617;\n                        if (slt32(local_tid_236615 + offset_236644,\n                                  sext_i64_i32(segred_group_sizze_228084)) &&\n                            ((local_tid_236615 - squot32(local_tid_236615,\n                                                         wave_sizze_236617) *\n                              wave_sizze_236617) == 0 &&\n                             (squot32(local_tid_236615,",
                   " wave_sizze_236617) &\n                              (2 * skip_waves_236645 - 1)) == 0)) {\n                            // read array element\n                            {\n                                x_236633 = ((__local\n                                             double *) red_arr_mem_236619)[sext_i32_i64(local_tid_236615 +\n                                                                           offset_236644)];\n                            }\n                            // apply reduction operation\n                            {\n                                double defunc_1_op_res_236634 = x_236632 +\n                                       x_236633;\n                                \n                                x_236632 = defunc_1_op_res_236634;\n                            }\n                            // write result of operation\n                            {\n                                ((__local\n                                  double *) red_arr_mem_236619)[sext_i32_i64(local_tid_236615)] =\n                                    x_236632;\n                            }\n                        }\n                        skip_waves_236645 *= 2;\n                    }\n                    // and back to memory with the final result\n                    {\n                        if (local_tid_236615 == 0) {\n                            ((__global double *) mem_231833)[gtid_228088] =\n                                x_236632;\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_228084\n}\n__kernel void mainzisegred_small_212003(__global int *global_failure,\n                                        __local volatile\n                                        int64_t *red_arr_mem_233024_backing_aligned_0,\n                                        int64_t n_p_203492, int64_t q_s_203493,\n                                 ",
                   "       int64_t partition_sizze_203577,\n                                        int64_t defunc_0_f_res_203631,\n                                        int64_t s_n_m_203636,\n                                        int64_t num_groups_211996,\n                                        int64_t segment_sizze_nonzzero_233017,\n                                        __global unsigned char *ext_mem_229264,\n                                        __global unsigned char *ext_mem_229265,\n                                        __global unsigned char *ext_mem_229362,\n                                        __global unsigned char *ext_mem_229363,\n                                        __global unsigned char *mem_229531,\n                                        __global unsigned char *mem_229687,\n                                        __global unsigned char *mem_229697)\n{\n    #define segred_group_sizze_211995 (mainzisegred_group_sizze_211176)\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_233024_backing_0 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_233024_backing_aligned_0;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_233019;\n    int32_t local_tid_233020;\n    int64_t group_sizze_233023;\n    int32_t wave_sizze_233022;\n    int32_t group_tid_233021;\n    \n    global_tid_233019 = get_global_id(0);\n    local_tid_233020 = get_local_id(0);\n    group_sizze_233023 = get_local_size(0);\n    wave_sizze_233022 = LOCKSTEP_WIDTH;\n    group_tid_233021 = get_group_id(0);\n    \n    int32_t phys_tid_212003 = global_tid_233019;\n    __local unsigned char *red_arr_mem_233024;\n    \n    red_arr_mem_233024 = (__local unsigned char *) red_arr_mem_233024_backing_0;\n    \n    int32_t phys_group_id_233026;\n    \n    phys_group_id_233026 = get_group_id(0);\n    for (int32_t i_233027 = 0; i_233027 <\n       ",
                   "  sdiv_up32(sext_i64_i32(sdiv_up64(partition_sizze_203577 * n_p_203492 *\n                                          s_n_m_203636,\n                                          squot64(segred_group_sizze_211995,\n                                                  segment_sizze_nonzzero_233017))) -\n                   phys_group_id_233026, sext_i64_i32(num_groups_211996));\n         i_233027++) {\n        int32_t virt_group_id_233028 = phys_group_id_233026 + i_233027 *\n                sext_i64_i32(num_groups_211996);\n        int64_t slice_233029 = s_n_m_203636;\n        int64_t slice_233030 = n_p_203492 * slice_233029;\n        int64_t slice_233031 = partition_sizze_203577 * slice_233030;\n        int64_t gtid_211999 = squot64(squot64(sext_i32_i64(local_tid_233020),\n                                              segment_sizze_nonzzero_233017) +\n                                      sext_i32_i64(virt_group_id_233028) *\n                                      squot64(segred_group_sizze_211995,\n                                              segment_sizze_nonzzero_233017),\n                                      slice_233030);\n        int64_t remnant_233032 = squot64(sext_i32_i64(local_tid_233020),\n                                         segment_sizze_nonzzero_233017) +\n                sext_i32_i64(virt_group_id_233028) *\n                squot64(segred_group_sizze_211995,\n                        segment_sizze_nonzzero_233017) - gtid_211999 *\n                slice_233030;\n        int64_t gtid_212000 = squot64(remnant_233032, slice_233029);\n        int64_t remnant_233033 = remnant_233032 - gtid_212000 * slice_233029;\n        int64_t gtid_212001 = remnant_233033;\n        int64_t remnant_233034 = remnant_233033 - gtid_212001;\n        int64_t gtid_212002 = srem64(sext_i32_i64(local_tid_233020),\n                                     q_s_203493);\n        \n        // apply map function if in bounds\n        {\n            if (slt64((int64_t) 0, q_s_203493) && (((slt64(gtid_211999,\n                   ",
                   "                                        partition_sizze_203577) &&\n                                                     slt64(gtid_212000,\n                                                           n_p_203492)) &&\n                                                    slt64(gtid_212001,\n                                                          s_n_m_203636)) &&\n                                                   slt64(sext_i32_i64(local_tid_233020),\n                                                         q_s_203493 *\n                                                         squot64(segred_group_sizze_211995,\n                                                                 segment_sizze_nonzzero_233017)))) {\n                int64_t x_212015;\n                \n                x_212015 = ((__global int64_t *) ext_mem_229264)[gtid_211999 *\n                                                                 n_p_203492 +\n                                                                 gtid_212000];\n                \n                int64_t x_212019;\n                \n                x_212019 = ((__global int64_t *) ext_mem_229363)[gtid_211999 *\n                                                                 (s_n_m_203636 *\n                                                                  n_p_203492) +\n                                                                 gtid_212000 *\n                                                                 s_n_m_203636 +\n                                                                 gtid_212001];\n                \n                double x_212020;\n                \n                x_212020 = ((__global double *) ext_mem_229362)[gtid_211999 *\n                                                                (s_n_m_203636 *\n                                                                 n_p_203492) +\n                                                                gtid_212000 *\n                                                                s_n_m_20",
                   "3636 +\n                                                                gtid_212001];\n                \n                int64_t defunc_0_m_fun_res_212021;\n                \n                defunc_0_m_fun_res_212021 = ((__global\n                                              int64_t *) mem_229687)[gtid_211999 *\n                                                                     (s_n_m_203636 *\n                                                                      n_p_203492) +\n                                                                     gtid_212000 *\n                                                                     s_n_m_203636 +\n                                                                     gtid_212001];\n                \n                bool cond_212023 = sle64(x_212015, gtid_212002);\n                int64_t defunc_0_f_res_212024;\n                \n                if (cond_212023) {\n                    defunc_0_f_res_212024 = (int64_t) 0;\n                } else {\n                    int64_t i_212025 = add64(gtid_212002, x_212019);\n                    int64_t defunc_0_add_arg_212026;\n                    \n                    defunc_0_add_arg_212026 = ((__global\n                                                int64_t *) ext_mem_229265)[gtid_211999 *\n                                                                           (defunc_0_f_res_203631 *\n                                                                            n_p_203492) +\n                                                                           gtid_212000 *\n                                                                           defunc_0_f_res_203631 +\n                                                                           i_212025];\n                    \n                    int64_t defunc_1_add_res_212027 = add64((int64_t) 1,\n                                                            defunc_0_add_arg_212026);\n                    \n                    defunc_0_f_res_212024 = defunc_1_add",
                   "_res_212027;\n                }\n                \n                double defunc_0_f_res_212028;\n                \n                if (cond_212023) {\n                    defunc_0_f_res_212028 = 0.0;\n                } else {\n                    int64_t i_212029 = add64(gtid_212002, x_212019);\n                    double defunc_0_add_arg_212030;\n                    \n                    defunc_0_add_arg_212030 = ((__global\n                                                double *) mem_229531)[gtid_211999 *\n                                                                      (defunc_0_f_res_203631 *\n                                                                       n_p_203492) +\n                                                                      gtid_212000 *\n                                                                      defunc_0_f_res_203631 +\n                                                                      i_212029];\n                    defunc_0_f_res_212028 = defunc_0_add_arg_212030;\n                }\n                \n                int64_t binop_p_212031 = sub64(defunc_0_f_res_212024,\n                                               defunc_0_m_fun_res_212021);\n                double defunc_0_f_res_212032 = sitofp_i64_f64(binop_p_212031);\n                double abs_res_212033 = fabs(defunc_0_f_res_212032);\n                double tmp1_212034 = abs_res_212033 / x_212020;\n                double x_212035 = tmp1_212034 * tmp1_212034;\n                double y_212036 = tmp1_212034 * x_212035;\n                double tmp2_212037 = 1.0 - y_212036;\n                double x_212038 = tmp2_212037 * tmp2_212037;\n                double tmp3_212039 = tmp2_212037 * x_212038;\n                double w_j_212040 = defunc_0_f_res_212028 * tmp3_212039;\n                \n                // save map-out results\n                { }\n                // save results to be reduced\n                {\n                    ((__local\n                      double *) red_arr_mem_233024)[sext_i3",
                   "2_i64(local_tid_233020)] =\n                        w_j_212040;\n                }\n            } else {\n                ((__local\n                  double *) red_arr_mem_233024)[sext_i32_i64(local_tid_233020)] =\n                    0.0;\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        if (slt64((int64_t) 0, q_s_203493)) {\n            // perform segmented scan to imitate reduction\n            {\n                double x_212004;\n                double x_212005;\n                double x_233035;\n                double x_233036;\n                bool ltid_in_bounds_233038 =\n                     slt64(sext_i32_i64(local_tid_233020), q_s_203493 *\n                           squot64(segred_group_sizze_211995,\n                                   segment_sizze_nonzzero_233017));\n                int32_t skip_threads_233039;\n                \n                // read input for in-block scan\n                {\n                    if (ltid_in_bounds_233038) {\n                        x_212005 = ((volatile __local\n                                     double *) red_arr_mem_233024)[sext_i32_i64(local_tid_233020)];\n                        if ((local_tid_233020 - squot32(local_tid_233020, 32) *\n                             32) == 0) {\n                            x_212004 = x_212005;\n                        }\n                    }\n                }\n                // in-block scan (hopefully no barriers needed)\n                {\n                    skip_threads_233039 = 1;\n                    while (slt32(skip_threads_233039, 32)) {\n                        bool thread_active_233040 = sle32(skip_threads_233039,\n                                                          local_tid_233020 -\n                                                          squot32(local_tid_233020,\n                                                                  32) * 32) &&\n                             ltid_in_bounds_233038;\n                        \n                        if (thread_active_233040) {\n  ",
                   "                          // read operands\n                            {\n                                x_212004 = ((volatile __local\n                                             double *) red_arr_mem_233024)[sext_i32_i64(local_tid_233020) -\n                                                                           sext_i32_i64(skip_threads_233039)];\n                            }\n                        }\n                        // perform operation\n                        {\n                            bool inactive_233041 =\n                                 slt64(srem64(sext_i32_i64(local_tid_233020),\n                                              q_s_203493),\n                                       sext_i32_i64(local_tid_233020) -\n                                       sext_i32_i64(local_tid_233020 -\n                                       skip_threads_233039));\n                            \n                            if (thread_active_233040 && inactive_233041) {\n                                x_212004 = x_212005;\n                            }\n                            if (thread_active_233040) {\n                                if (!inactive_233041) {\n                                    double defunc_1_op_res_212006 = x_212004 +\n                                           x_212005;\n                                    \n                                    x_212004 = defunc_1_op_res_212006;\n                                }\n                            }\n                        }\n                        if (sle32(wave_sizze_233022, skip_threads_233039)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        if (thread_active_233040) {\n                            // write result\n                            {\n                                ((volatile __local\n                                  double *) red_arr_mem_233024)[sext_i32_i64(local_tid_233020)] =\n                                    x_212004;\n               ",
                   "                 x_212005 = x_212004;\n                            }\n                        }\n                        if (sle32(wave_sizze_233022, skip_threads_233039)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        skip_threads_233039 *= 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_233020 - squot32(local_tid_233020, 32) *\n                         32) == 31 && ltid_in_bounds_233038) {\n                        ((volatile __local\n                          double *) red_arr_mem_233024)[sext_i32_i64(squot32(local_tid_233020,\n                                                                             32))] =\n                            x_212004;\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_233042;\n                    \n                    // read input for in-block scan\n                    {\n                        if (squot32(local_tid_233020, 32) == 0 &&\n                            ltid_in_bounds_233038) {\n                            x_233036 = ((volatile __local\n                                         double *) red_arr_mem_233024)[sext_i32_i64(local_tid_233020)];\n                            if ((local_tid_233020 - squot32(local_tid_233020,\n                                                            32) * 32) == 0) {\n                                x_233035 = x_233036;\n                            }\n                        }\n                    }\n                    // in-block scan (hopefully no barriers needed)\n                    {\n                        skip_threads_233042 = 1;\n                        while (slt32(skip_threads_233042, 32))",
                   " {\n                            bool thread_active_233043 =\n                                 sle32(skip_threads_233042, local_tid_233020 -\n                                       squot32(local_tid_233020, 32) * 32) &&\n                                 (squot32(local_tid_233020, 32) == 0 &&\n                                  ltid_in_bounds_233038);\n                            \n                            if (thread_active_233043) {\n                                // read operands\n                                {\n                                    x_233035 = ((volatile __local\n                                                 double *) red_arr_mem_233024)[sext_i32_i64(local_tid_233020) -\n                                                                               sext_i32_i64(skip_threads_233042)];\n                                }\n                            }\n                            // perform operation\n                            {\n                                bool inactive_233044 =\n                                     slt64(srem64(sext_i32_i64(local_tid_233020 *\n                                                  32 + 32 - 1), q_s_203493),\n                                           sext_i32_i64(local_tid_233020 * 32 +\n                                           32 - 1) -\n                                           sext_i32_i64((local_tid_233020 -\n                                                         skip_threads_233042) *\n                                           32 + 32 - 1));\n                                \n                                if (thread_active_233043 && inactive_233044) {\n                                    x_233035 = x_233036;\n                                }\n                                if (thread_active_233043) {\n                                    if (!inactive_233044) {\n                                        double defunc_1_op_res_233037 =\n                                               x_233035 + x_233036;\n                          ",
                   "              \n                                        x_233035 = defunc_1_op_res_233037;\n                                    }\n                                }\n                            }\n                            if (sle32(wave_sizze_233022, skip_threads_233042)) {\n                                barrier(CLK_LOCAL_MEM_FENCE);\n                            }\n                            if (thread_active_233043) {\n                                // write result\n                                {\n                                    ((volatile __local\n                                      double *) red_arr_mem_233024)[sext_i32_i64(local_tid_233020)] =\n                                        x_233035;\n                                    x_233036 = x_233035;\n                                }\n                            }\n                            if (sle32(wave_sizze_233022, skip_threads_233042)) {\n                                barrier(CLK_LOCAL_MEM_FENCE);\n                            }\n                            skip_threads_233042 *= 2;\n                        }\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                \n                bool no_carry_in_233045 = squot32(local_tid_233020, 32) == 0 ||\n                     !ltid_in_bounds_233038;\n                \n                // carry-in for every block except the first\n                {\n                    // read operands\n                    {\n                        if (!no_carry_in_233045) {\n                            x_212005 = x_212004;\n                            x_212004 = ((__local\n                                         double *) red_arr_mem_233024)[sext_i32_i64(squot32(local_tid_233020,\n                                                                                            32)) -\n                                                                       (int64_t) 1];\n                        }\n                    }\n                    // perform operation\n ",
                   "                   {\n                        bool inactive_233046 =\n                             slt64(srem64(sext_i32_i64(local_tid_233020),\n                                          q_s_203493),\n                                   sext_i32_i64(local_tid_233020) -\n                                   sext_i32_i64(squot32(local_tid_233020, 32) *\n                                   32 - 1));\n                        \n                        if (!no_carry_in_233045) {\n                            if (inactive_233046) {\n                                x_212004 = x_212005;\n                            }\n                        }\n                        if (!no_carry_in_233045) {\n                            if (!inactive_233046) {\n                                double defunc_1_op_res_212006 = x_212004 +\n                                       x_212005;\n                                \n                                x_212004 = defunc_1_op_res_212006;\n                            }\n                        }\n                    }\n                    // write final result\n                    {\n                        if (!no_carry_in_233045) {\n                            ((__local\n                              double *) red_arr_mem_233024)[sext_i32_i64(local_tid_233020)] =\n                                x_212004;\n                        }\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // restore correct values for first block\n                {\n                    if (squot32(local_tid_233020, 32) == 0 &&\n                        ltid_in_bounds_233038) {\n                        ((__local\n                          double *) red_arr_mem_233024)[sext_i32_i64(local_tid_233020)] =\n                            x_212005;\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 (slt6",
                   "4(sext_i32_i64(virt_group_id_233028) *\n                      squot64(segred_group_sizze_211995,\n                              segment_sizze_nonzzero_233017) +\n                      sext_i32_i64(local_tid_233020), partition_sizze_203577 *\n                      n_p_203492 * s_n_m_203636) &&\n                slt64(sext_i32_i64(local_tid_233020),\n                      squot64(segred_group_sizze_211995,\n                              segment_sizze_nonzzero_233017))) {\n                double tmp_233047;\n                \n                tmp_233047 = ((__local\n                               double *) red_arr_mem_233024)[(sext_i32_i64(local_tid_233020) +\n                                                              (int64_t) 1) *\n                                                             segment_sizze_nonzzero_233017 -\n                                                             (int64_t) 1];\n                ((__global\n                  double *) mem_229697)[squot64(sext_i32_i64(virt_group_id_233028) *\n                                                squot64(segred_group_sizze_211995,\n                                                        segment_sizze_nonzzero_233017) +\n                                                sext_i32_i64(local_tid_233020),\n                                                n_p_203492 * s_n_m_203636) *\n                                        (s_n_m_203636 * n_p_203492) +\n                                        squot64(sext_i32_i64(virt_group_id_233028) *\n                                                squot64(segred_group_sizze_211995,\n                                                        segment_sizze_nonzzero_233017) +\n                                                sext_i32_i64(local_tid_233020) -\n                                                squot64(sext_i32_i64(virt_group_id_233028) *\n                                                        squot64(segred_group_sizze_211995,\n                                                                segmen",
                   "t_sizze_nonzzero_233017) +\n                                                        sext_i32_i64(local_tid_233020),\n                                                        n_p_203492 *\n                                                        s_n_m_203636) *\n                                                (n_p_203492 * s_n_m_203636),\n                                                s_n_m_203636) * s_n_m_203636 +\n                                        (sext_i32_i64(virt_group_id_233028) *\n                                         squot64(segred_group_sizze_211995,\n                                                 segment_sizze_nonzzero_233017) +\n                                         sext_i32_i64(local_tid_233020) -\n                                         squot64(sext_i32_i64(virt_group_id_233028) *\n                                                 squot64(segred_group_sizze_211995,\n                                                         segment_sizze_nonzzero_233017) +\n                                                 sext_i32_i64(local_tid_233020),\n                                                 n_p_203492 * s_n_m_203636) *\n                                         (n_p_203492 * s_n_m_203636) -\n                                         squot64(sext_i32_i64(virt_group_id_233028) *\n                                                 squot64(segred_group_sizze_211995,\n                                                         segment_sizze_nonzzero_233017) +\n                                                 sext_i32_i64(local_tid_233020) -\n                                                 squot64(sext_i32_i64(virt_group_id_233028) *\n                                                         squot64(segred_group_sizze_211995,\n                                                                 segment_sizze_nonzzero_233017) +\n                                                         sext_i32_i64(local_tid_233020),\n                                                         n_p_203492 *\n   ",
                   "                                                      s_n_m_203636) *\n                                                 (n_p_203492 * s_n_m_203636),\n                                                 s_n_m_203636) *\n                                         s_n_m_203636)] = tmp_233047;\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_211995\n}\n__kernel void mainzisegred_small_212077(__global int *global_failure,\n                                        __local volatile\n                                        int64_t *red_arr_mem_233112_backing_aligned_0,\n                                        int64_t n_p_203492, int64_t q_s_203493,\n                                        int64_t partition_sizze_203577,\n                                        int64_t defunc_0_f_res_203631,\n                                        int64_t s_n_m_203636,\n                                        int64_t num_groups_212070,\n                                        int64_t segment_sizze_nonzzero_233105,\n                                        __global unsigned char *ext_mem_229264,\n                                        __global unsigned char *ext_mem_229265,\n                                        __global unsigned char *ext_mem_229362,\n                                        __global unsigned char *ext_mem_229363,\n                                        __global unsigned char *mem_229526,\n                                        __global unsigned char *mem_229531,\n                                        __global unsigned char *mem_229703,\n                                        __global unsigned char *mem_229708,\n                                        __global unsigned char *mem_229714)\n{\n    #define segred_group_sizze_212069 (mainzisegred_group_sizze_211074)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    __l",
                   "ocal volatile unsigned char *restrict red_arr_mem_233112_backing_0 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_233112_backing_aligned_0;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_233107;\n    int32_t local_tid_233108;\n    int64_t group_sizze_233111;\n    int32_t wave_sizze_233110;\n    int32_t group_tid_233109;\n    \n    global_tid_233107 = get_global_id(0);\n    local_tid_233108 = get_local_id(0);\n    group_sizze_233111 = get_local_size(0);\n    wave_sizze_233110 = LOCKSTEP_WIDTH;\n    group_tid_233109 = get_group_id(0);\n    \n    int32_t phys_tid_212077 = global_tid_233107;\n    __local unsigned char *red_arr_mem_233112;\n    \n    red_arr_mem_233112 = (__local unsigned char *) red_arr_mem_233112_backing_0;\n    \n    int32_t phys_group_id_233114;\n    \n    phys_group_id_233114 = get_group_id(0);\n    for (int32_t i_233115 = 0; i_233115 <\n         sdiv_up32(sext_i64_i32(sdiv_up64(partition_sizze_203577 * n_p_203492 *\n                                          s_n_m_203636,\n                                          squot64(segred_group_sizze_212069,\n                                                  segment_sizze_nonzzero_233105))) -\n                   phys_group_id_233114, sext_i64_i32(num_groups_212070));\n         i_233115++) {\n        int32_t virt_group_id_233116 = phys_group_id_233114 + i_233115 *\n                sext_i64_i32(num_groups_212070);\n        int64_t slice_233117 = s_n_m_203636;\n        int64_t slice_233118 = n_p_203492 * slice_233117;\n        int64_t slice_233119 = partition_sizze_203577 * slice_233118;\n        int64_t gtid_212073 = squot64(squot64(sext_i32_i64(local_tid_233108),\n                                              segment_sizze_nonzzero_233105) +\n                                      sext_i32_i64(virt_group_id_233116) *\n                                      squot64(segred_group_sizze_212069,\n                                              segment",
                   "_sizze_nonzzero_233105),\n                                      slice_233118);\n        int64_t remnant_233120 = squot64(sext_i32_i64(local_tid_233108),\n                                         segment_sizze_nonzzero_233105) +\n                sext_i32_i64(virt_group_id_233116) *\n                squot64(segred_group_sizze_212069,\n                        segment_sizze_nonzzero_233105) - gtid_212073 *\n                slice_233118;\n        int64_t gtid_212074 = squot64(remnant_233120, slice_233117);\n        int64_t remnant_233121 = remnant_233120 - gtid_212074 * slice_233117;\n        int64_t gtid_212075 = remnant_233121;\n        int64_t remnant_233122 = remnant_233121 - gtid_212075;\n        int64_t gtid_212076 = srem64(sext_i32_i64(local_tid_233108),\n                                     q_s_203493);\n        \n        // apply map function if in bounds\n        {\n            if (slt64((int64_t) 0, q_s_203493) && (((slt64(gtid_212073,\n                                                           partition_sizze_203577) &&\n                                                     slt64(gtid_212074,\n                                                           n_p_203492)) &&\n                                                    slt64(gtid_212075,\n                                                          s_n_m_203636)) &&\n                                                   slt64(sext_i32_i64(local_tid_233108),\n                                                         q_s_203493 *\n                                                         squot64(segred_group_sizze_212069,\n                                                                 segment_sizze_nonzzero_233105)))) {\n                int64_t x_212092;\n                \n                x_212092 = ((__global int64_t *) ext_mem_229264)[gtid_212073 *\n                                                                 n_p_203492 +\n                                                                 gtid_212074];\n                \n                int64_t x",
                   "_212097;\n                \n                x_212097 = ((__global int64_t *) ext_mem_229363)[gtid_212073 *\n                                                                 (s_n_m_203636 *\n                                                                  n_p_203492) +\n                                                                 gtid_212074 *\n                                                                 s_n_m_203636 +\n                                                                 gtid_212075];\n                \n                double x_212098;\n                \n                x_212098 = ((__global double *) ext_mem_229362)[gtid_212073 *\n                                                                (s_n_m_203636 *\n                                                                 n_p_203492) +\n                                                                gtid_212074 *\n                                                                s_n_m_203636 +\n                                                                gtid_212075];\n                \n                double a0_212099;\n                \n                a0_212099 = ((__global double *) mem_229703)[gtid_212073 *\n                                                             (s_n_m_203636 *\n                                                              n_p_203492) +\n                                                             gtid_212074 *\n                                                             s_n_m_203636 +\n                                                             gtid_212075];\n                \n                int64_t defunc_0_m_fun_res_212100;\n                \n                defunc_0_m_fun_res_212100 = ((__global\n                                              int64_t *) mem_229708)[gtid_212073 *\n                                                                     (s_n_m_203636 *\n                                                                      n_p_203492) +\n                                           ",
                   "                          gtid_212074 *\n                                                                     s_n_m_203636 +\n                                                                     gtid_212075];\n                \n                bool cond_212102 = sle64(x_212092, gtid_212076);\n                int64_t defunc_0_f_res_212103;\n                \n                if (cond_212102) {\n                    defunc_0_f_res_212103 = (int64_t) 0;\n                } else {\n                    int64_t i_212104 = add64(gtid_212076, x_212097);\n                    int64_t defunc_0_add_arg_212105;\n                    \n                    defunc_0_add_arg_212105 = ((__global\n                                                int64_t *) ext_mem_229265)[gtid_212073 *\n                                                                           (defunc_0_f_res_203631 *\n                                                                            n_p_203492) +\n                                                                           gtid_212074 *\n                                                                           defunc_0_f_res_203631 +\n                                                                           i_212104];\n                    \n                    int64_t defunc_1_add_res_212106 = add64((int64_t) 1,\n                                                            defunc_0_add_arg_212105);\n                    \n                    defunc_0_f_res_212103 = defunc_1_add_res_212106;\n                }\n                \n                double defunc_0_f_res_212107;\n                \n                if (cond_212102) {\n                    defunc_0_f_res_212107 = 0.0;\n                } else {\n                    int64_t i_212108 = add64(gtid_212076, x_212097);\n                    double defunc_0_add_arg_212109;\n                    \n                    defunc_0_add_arg_212109 = ((__global\n                                                double *) mem_229531)[gtid_212073 *\n                 ",
                   "                                                     (defunc_0_f_res_203631 *\n                                                                       n_p_203492) +\n                                                                      gtid_212074 *\n                                                                      defunc_0_f_res_203631 +\n                                                                      i_212108];\n                    defunc_0_f_res_212107 = defunc_0_add_arg_212109;\n                }\n                \n                int64_t binop_p_212110 = sub64(defunc_0_f_res_212103,\n                                               defunc_0_m_fun_res_212100);\n                double defunc_0_f_res_212111 = sitofp_i64_f64(binop_p_212110);\n                double abs_res_212112 = fabs(defunc_0_f_res_212111);\n                double tmp1_212113 = abs_res_212112 / x_212098;\n                double x_212114 = tmp1_212113 * tmp1_212113;\n                double y_212115 = tmp1_212113 * x_212114;\n                double tmp2_212116 = 1.0 - y_212115;\n                double x_212117 = tmp2_212116 * tmp2_212116;\n                double tmp3_212118 = tmp2_212116 * x_212117;\n                double tmp4_212119 = defunc_0_f_res_212107 * tmp3_212118;\n                double defunc_0_f_res_212120;\n                \n                if (cond_212102) {\n                    defunc_0_f_res_212120 = 0.0;\n                } else {\n                    int64_t i_212121 = add64(gtid_212076, x_212097);\n                    double defunc_0_add_arg_212122;\n                    \n                    defunc_0_add_arg_212122 = ((__global\n                                                double *) mem_229526)[gtid_212073 *\n                                                                      (defunc_0_f_res_203631 *\n                                                                       n_p_203492) +\n                                                                      gtid_212074 *\n                              ",
                   "                                        defunc_0_f_res_203631 +\n                                                                      i_212121];\n                    defunc_0_f_res_212120 = defunc_0_add_arg_212122;\n                }\n                \n                double x_212123 = a0_212099 * tmp4_212119;\n                double defunc_9_fit_fun_res_212124 = defunc_0_f_res_212120 *\n                       x_212123;\n                \n                // save map-out results\n                { }\n                // save results to be reduced\n                {\n                    ((__local\n                      double *) red_arr_mem_233112)[sext_i32_i64(local_tid_233108)] =\n                        defunc_9_fit_fun_res_212124;\n                }\n            } else {\n                ((__local\n                  double *) red_arr_mem_233112)[sext_i32_i64(local_tid_233108)] =\n                    0.0;\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        if (slt64((int64_t) 0, q_s_203493)) {\n            // perform segmented scan to imitate reduction\n            {\n                double x_212078;\n                double x_212079;\n                double x_233123;\n                double x_233124;\n                bool ltid_in_bounds_233126 =\n                     slt64(sext_i32_i64(local_tid_233108), q_s_203493 *\n                           squot64(segred_group_sizze_212069,\n                                   segment_sizze_nonzzero_233105));\n                int32_t skip_threads_233127;\n                \n                // read input for in-block scan\n                {\n                    if (ltid_in_bounds_233126) {\n                        x_212079 = ((volatile __local\n                                     double *) red_arr_mem_233112)[sext_i32_i64(local_tid_233108)];\n                        if ((local_tid_233108 - squot32(local_tid_233108, 32) *\n                             32) == 0) {\n                            x_212078 = x_212079;\n                        }\n             ",
                   "       }\n                }\n                // in-block scan (hopefully no barriers needed)\n                {\n                    skip_threads_233127 = 1;\n                    while (slt32(skip_threads_233127, 32)) {\n                        bool thread_active_233128 = sle32(skip_threads_233127,\n                                                          local_tid_233108 -\n                                                          squot32(local_tid_233108,\n                                                                  32) * 32) &&\n                             ltid_in_bounds_233126;\n                        \n                        if (thread_active_233128) {\n                            // read operands\n                            {\n                                x_212078 = ((volatile __local\n                                             double *) red_arr_mem_233112)[sext_i32_i64(local_tid_233108) -\n                                                                           sext_i32_i64(skip_threads_233127)];\n                            }\n                        }\n                        // perform operation\n                        {\n                            bool inactive_233129 =\n                                 slt64(srem64(sext_i32_i64(local_tid_233108),\n                                              q_s_203493),\n                                       sext_i32_i64(local_tid_233108) -\n                                       sext_i32_i64(local_tid_233108 -\n                                       skip_threads_233127));\n                            \n                            if (thread_active_233128 && inactive_233129) {\n                                x_212078 = x_212079;\n                            }\n                            if (thread_active_233128) {\n                                if (!inactive_233129) {\n                                    double defunc_1_op_res_212080 = x_212078 +\n                                           x_212079;\n                              ",
                   "      \n                                    x_212078 = defunc_1_op_res_212080;\n                                }\n                            }\n                        }\n                        if (sle32(wave_sizze_233110, skip_threads_233127)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        if (thread_active_233128) {\n                            // write result\n                            {\n                                ((volatile __local\n                                  double *) red_arr_mem_233112)[sext_i32_i64(local_tid_233108)] =\n                                    x_212078;\n                                x_212079 = x_212078;\n                            }\n                        }\n                        if (sle32(wave_sizze_233110, skip_threads_233127)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        skip_threads_233127 *= 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_233108 - squot32(local_tid_233108, 32) *\n                         32) == 31 && ltid_in_bounds_233126) {\n                        ((volatile __local\n                          double *) red_arr_mem_233112)[sext_i32_i64(squot32(local_tid_233108,\n                                                                             32))] =\n                            x_212078;\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_233130;\n                    \n                    // read input for in-block scan\n                    {\n                        if (squot32(local_tid_233108, 32) == 0 &&\n                            ltid_in_bo",
                   "unds_233126) {\n                            x_233124 = ((volatile __local\n                                         double *) red_arr_mem_233112)[sext_i32_i64(local_tid_233108)];\n                            if ((local_tid_233108 - squot32(local_tid_233108,\n                                                            32) * 32) == 0) {\n                                x_233123 = x_233124;\n                            }\n                        }\n                    }\n                    // in-block scan (hopefully no barriers needed)\n                    {\n                        skip_threads_233130 = 1;\n                        while (slt32(skip_threads_233130, 32)) {\n                            bool thread_active_233131 =\n                                 sle32(skip_threads_233130, local_tid_233108 -\n                                       squot32(local_tid_233108, 32) * 32) &&\n                                 (squot32(local_tid_233108, 32) == 0 &&\n                                  ltid_in_bounds_233126);\n                            \n                            if (thread_active_233131) {\n                                // read operands\n                                {\n                                    x_233123 = ((volatile __local\n                                                 double *) red_arr_mem_233112)[sext_i32_i64(local_tid_233108) -\n                                                                               sext_i32_i64(skip_threads_233130)];\n                                }\n                            }\n                            // perform operation\n                            {\n                                bool inactive_233132 =\n                                     slt64(srem64(sext_i32_i64(local_tid_233108 *\n                                                  32 + 32 - 1), q_s_203493),\n                                           sext_i32_i64(local_tid_233108 * 32 +\n                                           32 - 1) -\n                                      ",
                   "     sext_i32_i64((local_tid_233108 -\n                                                         skip_threads_233130) *\n                                           32 + 32 - 1));\n                                \n                                if (thread_active_233131 && inactive_233132) {\n                                    x_233123 = x_233124;\n                                }\n                                if (thread_active_233131) {\n                                    if (!inactive_233132) {\n                                        double defunc_1_op_res_233125 =\n                                               x_233123 + x_233124;\n                                        \n                                        x_233123 = defunc_1_op_res_233125;\n                                    }\n                                }\n                            }\n                            if (sle32(wave_sizze_233110, skip_threads_233130)) {\n                                barrier(CLK_LOCAL_MEM_FENCE);\n                            }\n                            if (thread_active_233131) {\n                                // write result\n                                {\n                                    ((volatile __local\n                                      double *) red_arr_mem_233112)[sext_i32_i64(local_tid_233108)] =\n                                        x_233123;\n                                    x_233124 = x_233123;\n                                }\n                            }\n                            if (sle32(wave_sizze_233110, skip_threads_233130)) {\n                                barrier(CLK_LOCAL_MEM_FENCE);\n                            }\n                            skip_threads_233130 *= 2;\n                        }\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                \n                bool no_carry_in_233133 = squot32(local_tid_233108, 32) == 0 ||\n                     !ltid_in_bounds_233126;\n                \n      ",
                   "          // carry-in for every block except the first\n                {\n                    // read operands\n                    {\n                        if (!no_carry_in_233133) {\n                            x_212079 = x_212078;\n                            x_212078 = ((__local\n                                         double *) red_arr_mem_233112)[sext_i32_i64(squot32(local_tid_233108,\n                                                                                            32)) -\n                                                                       (int64_t) 1];\n                        }\n                    }\n                    // perform operation\n                    {\n                        bool inactive_233134 =\n                             slt64(srem64(sext_i32_i64(local_tid_233108),\n                                          q_s_203493),\n                                   sext_i32_i64(local_tid_233108) -\n                                   sext_i32_i64(squot32(local_tid_233108, 32) *\n                                   32 - 1));\n                        \n                        if (!no_carry_in_233133) {\n                            if (inactive_233134) {\n                                x_212078 = x_212079;\n                            }\n                        }\n                        if (!no_carry_in_233133) {\n                            if (!inactive_233134) {\n                                double defunc_1_op_res_212080 = x_212078 +\n                                       x_212079;\n                                \n                                x_212078 = defunc_1_op_res_212080;\n                            }\n                        }\n                    }\n                    // write final result\n                    {\n                        if (!no_carry_in_233133) {\n                            ((__local\n                              double *) red_arr_mem_233112)[sext_i32_i64(local_tid_233108)] =\n                                x_212078;\n               ",
                   "         }\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // restore correct values for first block\n                {\n                    if (squot32(local_tid_233108, 32) == 0 &&\n                        ltid_in_bounds_233126) {\n                        ((__local\n                          double *) red_arr_mem_233112)[sext_i32_i64(local_tid_233108)] =\n                            x_212079;\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_233116) *\n                      squot64(segred_group_sizze_212069,\n                              segment_sizze_nonzzero_233105) +\n                      sext_i32_i64(local_tid_233108), partition_sizze_203577 *\n                      n_p_203492 * s_n_m_203636) &&\n                slt64(sext_i32_i64(local_tid_233108),\n                      squot64(segred_group_sizze_212069,\n                              segment_sizze_nonzzero_233105))) {\n                double tmp_233135;\n                \n                tmp_233135 = ((__local\n                               double *) red_arr_mem_233112)[(sext_i32_i64(local_tid_233108) +\n                                                              (int64_t) 1) *\n                                                             segment_sizze_nonzzero_233105 -\n                                                             (int64_t) 1];\n                ((__global\n                  double *) mem_229714)[squot64(sext_i32_i64(virt_group_id_233116) *\n                                                squot64(segred_group_sizze_212069,\n                                                        segment_sizze_nonzzero_233105) +\n                                                sext_i32_i64(local_tid_233108),\n                                                n_p_203492 * s_n_m_203636)",
                   " *\n                                        (s_n_m_203636 * n_p_203492) +\n                                        squot64(sext_i32_i64(virt_group_id_233116) *\n                                                squot64(segred_group_sizze_212069,\n                                                        segment_sizze_nonzzero_233105) +\n                                                sext_i32_i64(local_tid_233108) -\n                                                squot64(sext_i32_i64(virt_group_id_233116) *\n                                                        squot64(segred_group_sizze_212069,\n                                                                segment_sizze_nonzzero_233105) +\n                                                        sext_i32_i64(local_tid_233108),\n                                                        n_p_203492 *\n                                                        s_n_m_203636) *\n                                                (n_p_203492 * s_n_m_203636),\n                                                s_n_m_203636) * s_n_m_203636 +\n                                        (sext_i32_i64(virt_group_id_233116) *\n                                         squot64(segred_group_sizze_212069,\n                                                 segment_sizze_nonzzero_233105) +\n                                         sext_i32_i64(local_tid_233108) -\n                                         squot64(sext_i32_i64(virt_group_id_233116) *\n                                                 squot64(segred_group_sizze_212069,\n                                                         segment_sizze_nonzzero_233105) +\n                                                 sext_i32_i64(local_tid_233108),\n                                                 n_p_203492 * s_n_m_203636) *\n                                         (n_p_203492 * s_n_m_203636) -\n                                         squot64(sext_i32_i64(virt_group_id_233116) *\n                                     ",
                   "            squot64(segred_group_sizze_212069,\n                                                         segment_sizze_nonzzero_233105) +\n                                                 sext_i32_i64(local_tid_233108) -\n                                                 squot64(sext_i32_i64(virt_group_id_233116) *\n                                                         squot64(segred_group_sizze_212069,\n                                                                 segment_sizze_nonzzero_233105) +\n                                                         sext_i32_i64(local_tid_233108),\n                                                         n_p_203492 *\n                                                         s_n_m_203636) *\n                                                 (n_p_203492 * s_n_m_203636),\n                                                 s_n_m_203636) *\n                                         s_n_m_203636)] = tmp_233135;\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_212069\n}\n__kernel void mainzisegred_small_214137(__global int *global_failure,\n                                        __local volatile\n                                        int64_t *red_arr_mem_233361_backing_aligned_0,\n                                        __local volatile\n                                        int64_t *red_arr_mem_233359_backing_aligned_1,\n                                        __local volatile\n                                        int64_t *red_arr_mem_233357_backing_aligned_2,\n                                        int64_t n_p_203492, int64_t q_s_203493,\n                                        int64_t partition_sizze_203577,\n                                        int64_t defunc_0_f_res_203631,\n                                        int64_t s_n_m_203636,\n                                        int64_t num_groups_214128,\n  ",
                   "                                      int64_t segment_sizze_nonzzero_233350,\n                                        __global unsigned char *ext_mem_229264,\n                                        __global unsigned char *ext_mem_229265,\n                                        __global unsigned char *ext_mem_229362,\n                                        __global unsigned char *ext_mem_229363,\n                                        __global unsigned char *mem_229531,\n                                        __global unsigned char *mem_229973,\n                                        __global unsigned char *mem_229983,\n                                        __global unsigned char *mem_229988,\n                                        __global unsigned char *mem_229993)\n{\n    #define segred_group_sizze_214127 (mainzisegred_group_sizze_213093)\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_233361_backing_2 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_233361_backing_aligned_0;\n    __local volatile unsigned char *restrict red_arr_mem_233359_backing_1 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_233359_backing_aligned_1;\n    __local volatile unsigned char *restrict red_arr_mem_233357_backing_0 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_233357_backing_aligned_2;\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_214137 = global_tid_233352;\n    __local unsigned char *red_arr_mem_233357;\n    \n    red_arr_mem_233357 = (__local unsigned char *) red_arr_mem_233357_backing_0;\n    \n    __local unsigned char *red_arr_mem_233359;\n    \n    red_arr_mem_233359 = (__local unsigned char *) red_arr_mem_233359_backing_1;\n    \n    __local unsigned char *red_arr_mem_233361;\n    \n    red_arr_mem_233361 = (__local unsigned char *) red_arr_mem_233361_backing_2;\n    \n    int32_t phys_group_id_233363;\n    \n    phys_group_id_233363 = get_group_id(0);\n    for (int32_t i_233364 = 0; i_233364 <\n         sdiv_up32(sext_i64_i32(sdiv_up64(partition_sizze_203577 * n_p_203492 *\n                                          s_n_m_203636,\n                                          squot64(segred_group_sizze_214127,\n                                                  segment_sizze_nonzzero_233350))) -\n                   phys_group_id_233363, sext_i64_i32(num_groups_214128));\n         i_233364++) {\n        int32_t virt_group_id_233365 = phys_group_id_233363 + i_233364 *\n                sext_i64_i32(num_groups_214128);\n        int64_t slice_233366 = s_n_m_203636;\n        int64_t slice_233367 = n_p_203492 * slice_233366;\n        int64_t slice_233368 = partition_sizze_203577 * slice_233367;\n        int64_t gtid_214133 = squot64(squot64(sext_i32_i64(local_tid_233353),\n                                              segment_sizze_nonzzero_233350) +\n                                      sext_i32_i64(virt_group_id_233365) *\n                                      squot64(segred_group_sizze_214127,\n                                              segment_sizze_nonzzero_233350),\n                                      slice_233367);\n        int64_t remnant_233369 = squot64(sext_i32_i64(local_tid_233353),\n                                         segment_sizze_nonzzero_233350) +\n                sext_i32_i64(virt_group_id_233365) *\n                squot64(segred_group_sizze_214127,\n  ",
                   "                      segment_sizze_nonzzero_233350) - gtid_214133 *\n                slice_233367;\n        int64_t gtid_214134 = squot64(remnant_233369, slice_233366);\n        int64_t remnant_233370 = remnant_233369 - gtid_214134 * slice_233366;\n        int64_t gtid_214135 = remnant_233370;\n        int64_t remnant_233371 = remnant_233370 - gtid_214135;\n        int64_t gtid_214136 = srem64(sext_i32_i64(local_tid_233353),\n                                     q_s_203493);\n        \n        // apply map function if in bounds\n        {\n            if (slt64((int64_t) 0, q_s_203493) && (((slt64(gtid_214133,\n                                                           partition_sizze_203577) &&\n                                                     slt64(gtid_214134,\n                                                           n_p_203492)) &&\n                                                    slt64(gtid_214135,\n                                                          s_n_m_203636)) &&\n                                                   slt64(sext_i32_i64(local_tid_233353),\n                                                         q_s_203493 *\n                                                         squot64(segred_group_sizze_214127,\n                                                                 segment_sizze_nonzzero_233350)))) {\n                int64_t x_214155;\n                \n                x_214155 = ((__global int64_t *) ext_mem_229264)[gtid_214133 *\n                                                                 n_p_203492 +\n                                                                 gtid_214134];\n                \n                int64_t x_214159;\n                \n                x_214159 = ((__global int64_t *) ext_mem_229363)[gtid_214133 *\n                                                                 (s_n_m_203636 *\n                                                                  n_p_203492) +\n                                                                 ",
                   "gtid_214134 *\n                                                                 s_n_m_203636 +\n                                                                 gtid_214135];\n                \n                double x_214160;\n                \n                x_214160 = ((__global double *) ext_mem_229362)[gtid_214133 *\n                                                                (s_n_m_203636 *\n                                                                 n_p_203492) +\n                                                                gtid_214134 *\n                                                                s_n_m_203636 +\n                                                                gtid_214135];\n                \n                int64_t defunc_0_m_fun_res_214161;\n                \n                defunc_0_m_fun_res_214161 = ((__global\n                                              int64_t *) mem_229973)[gtid_214133 *\n                                                                     (s_n_m_203636 *\n                                                                      n_p_203492) +\n                                                                     gtid_214134 *\n                                                                     s_n_m_203636 +\n                                                                     gtid_214135];\n                \n                bool cond_214163 = sle64(x_214155, gtid_214136);\n                int64_t defunc_0_f_res_214164;\n                \n                if (cond_214163) {\n                    defunc_0_f_res_214164 = (int64_t) 0;\n                } else {\n                    int64_t i_214165 = add64(gtid_214136, x_214159);\n                    int64_t defunc_0_add_arg_214166;\n                    \n                    defunc_0_add_arg_214166 = ((__global\n                                                int64_t *) ext_mem_229265)[gtid_214133 *\n                                                                           (defunc_0_f_res_203",
                   "631 *\n                                                                            n_p_203492) +\n                                                                           gtid_214134 *\n                                                                           defunc_0_f_res_203631 +\n                                                                           i_214165];\n                    \n                    int64_t defunc_1_add_res_214167 = add64((int64_t) 1,\n                                                            defunc_0_add_arg_214166);\n                    \n                    defunc_0_f_res_214164 = defunc_1_add_res_214167;\n                }\n                \n                double defunc_0_f_res_214168;\n                \n                if (cond_214163) {\n                    defunc_0_f_res_214168 = 0.0;\n                } else {\n                    int64_t i_214169 = add64(gtid_214136, x_214159);\n                    double defunc_0_add_arg_214170;\n                    \n                    defunc_0_add_arg_214170 = ((__global\n                                                double *) mem_229531)[gtid_214133 *\n                                                                      (defunc_0_f_res_203631 *\n                                                                       n_p_203492) +\n                                                                      gtid_214134 *\n                                                                      defunc_0_f_res_203631 +\n                                                                      i_214169];\n                    defunc_0_f_res_214168 = defunc_0_add_arg_214170;\n                }\n                \n                int64_t binop_p_214171 = sub64(defunc_0_f_res_214164,\n                                               defunc_0_m_fun_res_214161);\n                double defunc_0_f_res_214172 = sitofp_i64_f64(binop_p_214171);\n                double abs_res_214173 = fabs(defunc_0_f_res_214172);\n                double tmp1_214174",
                   " = abs_res_214173 / x_214160;\n                double x_214175 = tmp1_214174 * tmp1_214174;\n                double y_214176 = tmp1_214174 * x_214175;\n                double tmp2_214177 = 1.0 - y_214176;\n                double x_214178 = tmp2_214177 * tmp2_214177;\n                double tmp3_214179 = tmp2_214177 * x_214178;\n                double w_j_214180 = defunc_0_f_res_214168 * tmp3_214179;\n                double xw_j_214181 = defunc_0_f_res_214172 * w_j_214180;\n                double x2w_j_214182 = defunc_0_f_res_214172 * xw_j_214181;\n                \n                // save map-out results\n                { }\n                // save results to be reduced\n                {\n                    ((__local\n                      double *) red_arr_mem_233357)[sext_i32_i64(local_tid_233353)] =\n                        w_j_214180;\n                    ((__local\n                      double *) red_arr_mem_233359)[sext_i32_i64(local_tid_233353)] =\n                        xw_j_214181;\n                    ((__local\n                      double *) red_arr_mem_233361)[sext_i32_i64(local_tid_233353)] =\n                        x2w_j_214182;\n                }\n            } else {\n                ((__local\n                  double *) red_arr_mem_233357)[sext_i32_i64(local_tid_233353)] =\n                    0.0;\n                ((__local\n                  double *) red_arr_mem_233359)[sext_i32_i64(local_tid_233353)] =\n                    0.0;\n                ((__local\n                  double *) red_arr_mem_233361)[sext_i32_i64(local_tid_233353)] =\n                    0.0;\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        if (slt64((int64_t) 0, q_s_203493)) {\n            // perform segmented scan to imitate reduction\n            {\n                double x_214138;\n                double x_214139;\n                double x_214140;\n                double x_214141;\n                double x_214142;\n                double x_214143;\n                double x_233372;\n     ",
                   "           double x_233373;\n                double x_233374;\n                double x_233375;\n                double x_233376;\n                double x_233377;\n                bool ltid_in_bounds_233381 =\n                     slt64(sext_i32_i64(local_tid_233353), q_s_203493 *\n                           squot64(segred_group_sizze_214127,\n                                   segment_sizze_nonzzero_233350));\n                int32_t skip_threads_233382;\n                \n                // read input for in-block scan\n                {\n                    if (ltid_in_bounds_233381) {\n                        x_214141 = ((volatile __local\n                                     double *) red_arr_mem_233357)[sext_i32_i64(local_tid_233353)];\n                        x_214142 = ((volatile __local\n                                     double *) red_arr_mem_233359)[sext_i32_i64(local_tid_233353)];\n                        x_214143 = ((volatile __local\n                                     double *) red_arr_mem_233361)[sext_i32_i64(local_tid_233353)];\n                        if ((local_tid_233353 - squot32(local_tid_233353, 32) *\n                             32) == 0) {\n                            x_214138 = x_214141;\n                            x_214139 = x_214142;\n                            x_214140 = x_214143;\n                        }\n                    }\n                }\n                // in-block scan (hopefully no barriers needed)\n                {\n                    skip_threads_233382 = 1;\n                    while (slt32(skip_threads_233382, 32)) {\n                        bool thread_active_233383 = sle32(skip_threads_233382,\n                                                          local_tid_233353 -\n                                                          squot32(local_tid_233353,\n                                                                  32) * 32) &&\n                             ltid_in_bounds_233381;\n                        \n                        if (thread_a",
                   "ctive_233383) {\n                            // read operands\n                            {\n                                x_214138 = ((volatile __local\n                                             double *) red_arr_mem_233357)[sext_i32_i64(local_tid_233353) -\n                                                                           sext_i32_i64(skip_threads_233382)];\n                                x_214139 = ((volatile __local\n                                             double *) red_arr_mem_233359)[sext_i32_i64(local_tid_233353) -\n                                                                           sext_i32_i64(skip_threads_233382)];\n                                x_214140 = ((volatile __local\n                                             double *) red_arr_mem_233361)[sext_i32_i64(local_tid_233353) -\n                                                                           sext_i32_i64(skip_threads_233382)];\n                            }\n                        }\n                        // perform operation\n                        {\n                            bool inactive_233384 =\n                                 slt64(srem64(sext_i32_i64(local_tid_233353),\n                                              q_s_203493),\n                                       sext_i32_i64(local_tid_233353) -\n                                       sext_i32_i64(local_tid_233353 -\n                                       skip_threads_233382));\n                            \n                            if (thread_active_233383 && inactive_233384) {\n                                x_214138 = x_214141;\n                                x_214139 = x_214142;\n                                x_214140 = x_214143;\n                            }\n                            if (thread_active_233383) {\n                                if (!inactive_233384) {\n                                    double defunc_1_op_res_214144 = x_214138 +\n                                           x_214141;\n         ",
                   "                           double defunc_1_op_res_214145 = x_214139 +\n                                           x_214142;\n                                    double defunc_1_op_res_214146 = x_214140 +\n                                           x_214143;\n                                    \n                                    x_214138 = defunc_1_op_res_214144;\n                                    x_214139 = defunc_1_op_res_214145;\n                                    x_214140 = defunc_1_op_res_214146;\n                                }\n                            }\n                        }\n                        if (sle32(wave_sizze_233355, skip_threads_233382)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        if (thread_active_233383) {\n                            // write result\n                            {\n                                ((volatile __local\n                                  double *) red_arr_mem_233357)[sext_i32_i64(local_tid_233353)] =\n                                    x_214138;\n                                x_214141 = x_214138;\n                                ((volatile __local\n                                  double *) red_arr_mem_233359)[sext_i32_i64(local_tid_233353)] =\n                                    x_214139;\n                                x_214142 = x_214139;\n                                ((volatile __local\n                                  double *) red_arr_mem_233361)[sext_i32_i64(local_tid_233353)] =\n                                    x_214140;\n                                x_214143 = x_214140;\n                            }\n                        }\n                        if (sle32(wave_sizze_233355, skip_threads_233382)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        skip_threads_233382 *= 2;\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // la",
                   "st thread of block 'i' writes its result to offset 'i'\n                {\n                    if ((local_tid_233353 - squot32(local_tid_233353, 32) *\n                         32) == 31 && ltid_in_bounds_233381) {\n                        ((volatile __local\n                          double *) red_arr_mem_233357)[sext_i32_i64(squot32(local_tid_233353,\n                                                                             32))] =\n                            x_214138;\n                        ((volatile __local\n                          double *) red_arr_mem_233359)[sext_i32_i64(squot32(local_tid_233353,\n                                                                             32))] =\n                            x_214139;\n                        ((volatile __local\n                          double *) red_arr_mem_233361)[sext_i32_i64(squot32(local_tid_233353,\n                                                                             32))] =\n                            x_214140;\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_233385;\n                    \n                    // read input for in-block scan\n                    {\n                        if (squot32(local_tid_233353, 32) == 0 &&\n                            ltid_in_bounds_233381) {\n                            x_233375 = ((volatile __local\n                                         double *) red_arr_mem_233357)[sext_i32_i64(local_tid_233353)];\n                            x_233376 = ((volatile __local\n                                         double *) red_arr_mem_233359)[sext_i32_i64(local_tid_233353)];\n                            x_233377 = ((volatile __local\n                                         double *) red_arr_mem_233361)[sext_i32_i64(local_tid_233353)];\n                            if ((local_tid_233353 - sq",
                   "uot32(local_tid_233353,\n                                                            32) * 32) == 0) {\n                                x_233372 = x_233375;\n                                x_233373 = x_233376;\n                                x_233374 = x_233377;\n                            }\n                        }\n                    }\n                    // in-block scan (hopefully no barriers needed)\n                    {\n                        skip_threads_233385 = 1;\n                        while (slt32(skip_threads_233385, 32)) {\n                            bool thread_active_233386 =\n                                 sle32(skip_threads_233385, local_tid_233353 -\n                                       squot32(local_tid_233353, 32) * 32) &&\n                                 (squot32(local_tid_233353, 32) == 0 &&\n                                  ltid_in_bounds_233381);\n                            \n                            if (thread_active_233386) {\n                                // read operands\n                                {\n                                    x_233372 = ((volatile __local\n                                                 double *) red_arr_mem_233357)[sext_i32_i64(local_tid_233353) -\n                                                                               sext_i32_i64(skip_threads_233385)];\n                                    x_233373 = ((volatile __local\n                                                 double *) red_arr_mem_233359)[sext_i32_i64(local_tid_233353) -\n                                                                               sext_i32_i64(skip_threads_233385)];\n                                    x_233374 = ((volatile __local\n                                                 double *) red_arr_mem_233361)[sext_i32_i64(local_tid_233353) -\n                                                                               sext_i32_i64(skip_threads_233385)];\n                                }\n                            }\n   ",
                   "                         // perform operation\n                            {\n                                bool inactive_233387 =\n                                     slt64(srem64(sext_i32_i64(local_tid_233353 *\n                                                  32 + 32 - 1), q_s_203493),\n                                           sext_i32_i64(local_tid_233353 * 32 +\n                                           32 - 1) -\n                                           sext_i32_i64((local_tid_233353 -\n                                                         skip_threads_233385) *\n                                           32 + 32 - 1));\n                                \n                                if (thread_active_233386 && inactive_233387) {\n                                    x_233372 = x_233375;\n                                    x_233373 = x_233376;\n                                    x_233374 = x_233377;\n                                }\n                                if (thread_active_233386) {\n                                    if (!inactive_233387) {\n                                        double defunc_1_op_res_233378 =\n                                               x_233372 + x_233375;\n                                        double defunc_1_op_res_233379 =\n                                               x_233373 + x_233376;\n                                        double defunc_1_op_res_233380 =\n                                               x_233374 + x_233377;\n                                        \n                                        x_233372 = defunc_1_op_res_233378;\n                                        x_233373 = defunc_1_op_res_233379;\n                                        x_233374 = defunc_1_op_res_233380;\n                                    }\n                                }\n                            }\n                            if (sle32(wave_sizze_233355, skip_threads_233385)) {\n                                barrier(CLK_LOCAL_MEM_FEN",
                   "CE);\n                            }\n                            if (thread_active_233386) {\n                                // write result\n                                {\n                                    ((volatile __local\n                                      double *) red_arr_mem_233357)[sext_i32_i64(local_tid_233353)] =\n                                        x_233372;\n                                    x_233375 = x_233372;\n                                    ((volatile __local\n                                      double *) red_arr_mem_233359)[sext_i32_i64(local_tid_233353)] =\n                                        x_233373;\n                                    x_233376 = x_233373;\n                                    ((volatile __local\n                                      double *) red_arr_mem_233361)[sext_i32_i64(local_tid_233353)] =\n                                        x_233374;\n                                    x_233377 = x_233374;\n                                }\n                            }\n                            if (sle32(wave_sizze_233355, skip_threads_233385)) {\n                                barrier(CLK_LOCAL_MEM_FENCE);\n                            }\n                            skip_threads_233385 *= 2;\n                        }\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                \n                bool no_carry_in_233388 = squot32(local_tid_233353, 32) == 0 ||\n                     !ltid_in_bounds_233381;\n                \n                // carry-in for every block except the first\n                {\n                    // read operands\n                    {\n                        if (!no_carry_in_233388) {\n                            x_214141 = x_214138;\n                            x_214142 = x_214139;\n                            x_214143 = x_214140;\n                            x_214138 = ((__local\n                                         double *) red_arr_mem_233357)[sext_i32_i64(squo",
                   "t32(local_tid_233353,\n                                                                                            32)) -\n                                                                       (int64_t) 1];\n                            x_214139 = ((__local\n                                         double *) red_arr_mem_233359)[sext_i32_i64(squot32(local_tid_233353,\n                                                                                            32)) -\n                                                                       (int64_t) 1];\n                            x_214140 = ((__local\n                                         double *) red_arr_mem_233361)[sext_i32_i64(squot32(local_tid_233353,\n                                                                                            32)) -\n                                                                       (int64_t) 1];\n                        }\n                    }\n                    // perform operation\n                    {\n                        bool inactive_233389 =\n                             slt64(srem64(sext_i32_i64(local_tid_233353),\n                                          q_s_203493),\n                                   sext_i32_i64(local_tid_233353) -\n                                   sext_i32_i64(squot32(local_tid_233353, 32) *\n                                   32 - 1));\n                        \n                        if (!no_carry_in_233388) {\n                            if (inactive_233389) {\n                                x_214138 = x_214141;\n                                x_214139 = x_214142;\n                                x_214140 = x_214143;\n                            }\n                        }\n                        if (!no_carry_in_233388) {\n                            if (!inactive_233389) {\n                                double defunc_1_op_res_214144 = x_214138 +\n                                       x_214141;\n                                double defunc_1_op_res_2141",
                   "45 = x_214139 +\n                                       x_214142;\n                                double defunc_1_op_res_214146 = x_214140 +\n                                       x_214143;\n                                \n                                x_214138 = defunc_1_op_res_214144;\n                                x_214139 = defunc_1_op_res_214145;\n                                x_214140 = defunc_1_op_res_214146;\n                            }\n                        }\n                    }\n                    // write final result\n                    {\n                        if (!no_carry_in_233388) {\n                            ((__local\n                              double *) red_arr_mem_233357)[sext_i32_i64(local_tid_233353)] =\n                                x_214138;\n                            ((__local\n                              double *) red_arr_mem_233359)[sext_i32_i64(local_tid_233353)] =\n                                x_214139;\n                            ((__local\n                              double *) red_arr_mem_233361)[sext_i32_i64(local_tid_233353)] =\n                                x_214140;\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 &&\n                        ltid_in_bounds_233381) {\n                        ((__local\n                          double *) red_arr_mem_233357)[sext_i32_i64(local_tid_233353)] =\n                            x_214141;\n                        ((__local\n                          double *) red_arr_mem_233359)[sext_i32_i64(local_tid_233353)] =\n                            x_214142;\n                        ((__local\n                          double *) red_arr_mem_233361)[sext_i32_i64(local_tid_233353)] =\n                            x_214143;\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_233365) *\n                      squot64(segred_group_sizze_214127,\n                              segment_sizze_nonzzero_233350) +\n                      sext_i32_i64(local_tid_233353), partition_sizze_203577 *\n                      n_p_203492 * s_n_m_203636) &&\n                slt64(sext_i32_i64(local_tid_233353),\n                      squot64(segred_group_sizze_214127,\n                              segment_sizze_nonzzero_233350))) {\n                double tmp_233390;\n                \n                tmp_233390 = ((__local\n                               double *) red_arr_mem_233357)[(sext_i32_i64(local_tid_233353) +\n                                                              (int64_t) 1) *\n                                                             segment_sizze_nonzzero_233350 -\n                                                             (int64_t) 1];\n                ((__global\n                  double *) mem_229983)[squot64(sext_i32_i64(virt_group_id_233365) *\n                                                squot64(segred_group_sizze_214127,\n                                                        segment_sizze_nonzzero_233350) +\n                                                sext_i32_i64(local_tid_233353),\n                                                n_p_203492 * s_n_m_203636) *\n                                        (s_n_m_203636 * n_p_203492) +\n                                        squot64(sext_i32_i64(virt_group_id_233365) *\n                                                squot64(segred_group_sizze_214127,\n                                                        segment_sizze_nonzzero_233350) +\n                                                sext_i32_i64(local_tid_233353) -\n                                                squot64(sext_i32_i64(virt_group_id_233365) *\n                   ",
                   "                                     squot64(segred_group_sizze_214127,\n                                                                segment_sizze_nonzzero_233350) +\n                                                        sext_i32_i64(local_tid_233353),\n                                                        n_p_203492 *\n                                                        s_n_m_203636) *\n                                                (n_p_203492 * s_n_m_203636),\n                                                s_n_m_203636) * s_n_m_203636 +\n                                        (sext_i32_i64(virt_group_id_233365) *\n                                         squot64(segred_group_sizze_214127,\n                                                 segment_sizze_nonzzero_233350) +\n                                         sext_i32_i64(local_tid_233353) -\n                                         squot64(sext_i32_i64(virt_group_id_233365) *\n                                                 squot64(segred_group_sizze_214127,\n                                                         segment_sizze_nonzzero_233350) +\n                                                 sext_i32_i64(local_tid_233353),\n                                                 n_p_203492 * s_n_m_203636) *\n                                         (n_p_203492 * s_n_m_203636) -\n                                         squot64(sext_i32_i64(virt_group_id_233365) *\n                                                 squot64(segred_group_sizze_214127,\n                                                         segment_sizze_nonzzero_233350) +\n                                                 sext_i32_i64(local_tid_233353) -\n                                                 squot64(sext_i32_i64(virt_group_id_233365) *\n                                                         squot64(segred_group_sizze_214127,\n                                                                 segment_sizze_nonzzero_233350) +\n                    ",
                   "                                     sext_i32_i64(local_tid_233353),\n                                                         n_p_203492 *\n                                                         s_n_m_203636) *\n                                                 (n_p_203492 * s_n_m_203636),\n                                                 s_n_m_203636) *\n                                         s_n_m_203636)] = tmp_233390;\n                \n                double tmp_233391;\n                \n                tmp_233391 = ((__local\n                               double *) red_arr_mem_233359)[(sext_i32_i64(local_tid_233353) +\n                                                              (int64_t) 1) *\n                                                             segment_sizze_nonzzero_233350 -\n                                                             (int64_t) 1];\n                ((__global\n                  double *) mem_229988)[squot64(sext_i32_i64(virt_group_id_233365) *\n                                                squot64(segred_group_sizze_214127,\n                                                        segment_sizze_nonzzero_233350) +\n                                                sext_i32_i64(local_tid_233353),\n                                                n_p_203492 * s_n_m_203636) *\n                                        (s_n_m_203636 * n_p_203492) +\n                                        squot64(sext_i32_i64(virt_group_id_233365) *\n                                                squot64(segred_group_sizze_214127,\n                                                        segment_sizze_nonzzero_233350) +\n                                                sext_i32_i64(local_tid_233353) -\n                                                squot64(sext_i32_i64(virt_group_id_233365) *\n                                                        squot64(segred_group_sizze_214127,\n                                                                segment_sizze_nonzzero_233350)",
                   " +\n                                                        sext_i32_i64(local_tid_233353),\n                                                        n_p_203492 *\n                                                        s_n_m_203636) *\n                                                (n_p_203492 * s_n_m_203636),\n                                                s_n_m_203636) * s_n_m_203636 +\n                                        (sext_i32_i64(virt_group_id_233365) *\n                                         squot64(segred_group_sizze_214127,\n                                                 segment_sizze_nonzzero_233350) +\n                                         sext_i32_i64(local_tid_233353) -\n                                         squot64(sext_i32_i64(virt_group_id_233365) *\n                                                 squot64(segred_group_sizze_214127,\n                                                         segment_sizze_nonzzero_233350) +\n                                                 sext_i32_i64(local_tid_233353),\n                                                 n_p_203492 * s_n_m_203636) *\n                                         (n_p_203492 * s_n_m_203636) -\n                                         squot64(sext_i32_i64(virt_group_id_233365) *\n                                                 squot64(segred_group_sizze_214127,\n                                                         segment_sizze_nonzzero_233350) +\n                                                 sext_i32_i64(local_tid_233353) -\n                                                 squot64(sext_i32_i64(virt_group_id_233365) *\n                                                         squot64(segred_group_sizze_214127,\n                                                                 segment_sizze_nonzzero_233350) +\n                                                         sext_i32_i64(local_tid_233353),\n                                                         n_p_203492 *\n                           ",
                   "                              s_n_m_203636) *\n                                                 (n_p_203492 * s_n_m_203636),\n                                                 s_n_m_203636) *\n                                         s_n_m_203636)] = tmp_233391;\n                \n                double tmp_233392;\n                \n                tmp_233392 = ((__local\n                               double *) red_arr_mem_233361)[(sext_i32_i64(local_tid_233353) +\n                                                              (int64_t) 1) *\n                                                             segment_sizze_nonzzero_233350 -\n                                                             (int64_t) 1];\n                ((__global\n                  double *) mem_229993)[squot64(sext_i32_i64(virt_group_id_233365) *\n                                                squot64(segred_group_sizze_214127,\n                                                        segment_sizze_nonzzero_233350) +\n                                                sext_i32_i64(local_tid_233353),\n                                                n_p_203492 * s_n_m_203636) *\n                                        (s_n_m_203636 * n_p_203492) +\n                                        squot64(sext_i32_i64(virt_group_id_233365) *\n                                                squot64(segred_group_sizze_214127,\n                                                        segment_sizze_nonzzero_233350) +\n                                                sext_i32_i64(local_tid_233353) -\n                                                squot64(sext_i32_i64(virt_group_id_233365) *\n                                                        squot64(segred_group_sizze_214127,\n                                                                segment_sizze_nonzzero_233350) +\n                                                        sext_i32_i64(local_tid_233353),\n                                                        n_p_203492 *\n      ",
                   "                                                  s_n_m_203636) *\n                                                (n_p_203492 * s_n_m_203636),\n                                                s_n_m_203636) * s_n_m_203636 +\n                                        (sext_i32_i64(virt_group_id_233365) *\n                                         squot64(segred_group_sizze_214127,\n                                                 segment_sizze_nonzzero_233350) +\n                                         sext_i32_i64(local_tid_233353) -\n                                         squot64(sext_i32_i64(virt_group_id_233365) *\n                                                 squot64(segred_group_sizze_214127,\n                                                         segment_sizze_nonzzero_233350) +\n                                                 sext_i32_i64(local_tid_233353),\n                                                 n_p_203492 * s_n_m_203636) *\n                                         (n_p_203492 * s_n_m_203636) -\n                                         squot64(sext_i32_i64(virt_group_id_233365) *\n                                                 squot64(segred_group_sizze_214127,\n                                                         segment_sizze_nonzzero_233350) +\n                                                 sext_i32_i64(local_tid_233353) -\n                                                 squot64(sext_i32_i64(virt_group_id_233365) *\n                                                         squot64(segred_group_sizze_214127,\n                                                                 segment_sizze_nonzzero_233350) +\n                                                         sext_i32_i64(local_tid_233353),\n                                                         n_p_203492 *\n                                                         s_n_m_203636) *\n                                                 (n_p_203492 * s_n_m_203636),\n                                          ",
                   "       s_n_m_203636) *\n                                         s_n_m_203636)] = tmp_233392;\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_214127\n}\n__kernel void mainzisegred_small_214231(__global int *global_failure,\n                                        __local volatile\n                                        int64_t *red_arr_mem_233475_backing_aligned_0,\n                                        __local volatile\n                                        int64_t *red_arr_mem_233473_backing_aligned_1,\n                                        int64_t n_p_203492, int64_t q_s_203493,\n                                        int64_t partition_sizze_203577,\n                                        int64_t defunc_0_f_res_203631,\n                                        int64_t s_n_m_203636,\n                                        int64_t num_groups_214223,\n                                        int64_t segment_sizze_nonzzero_233466,\n                                        __global unsigned char *ext_mem_229264,\n                                        __global unsigned char *ext_mem_229265,\n                                        __global unsigned char *ext_mem_229362,\n                                        __global unsigned char *ext_mem_229363,\n                                        __global unsigned char *mem_229526,\n                                        __global unsigned char *mem_229531,\n                                        __global unsigned char *mem_229999,\n                                        __global unsigned char *mem_230004,\n                                        __global unsigned char *mem_230009,\n                                        __global unsigned char *mem_230014,\n                                        __global unsigned char *mem_230020,\n                                        __global unsigned char *mem_23",
                   "0025)\n{\n    #define segred_group_sizze_214222 (mainzisegred_group_sizze_212960)\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_233475_backing_1 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_233475_backing_aligned_0;\n    __local volatile unsigned char *restrict red_arr_mem_233473_backing_0 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_233473_backing_aligned_1;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_233468;\n    int32_t local_tid_233469;\n    int64_t group_sizze_233472;\n    int32_t wave_sizze_233471;\n    int32_t group_tid_233470;\n    \n    global_tid_233468 = get_global_id(0);\n    local_tid_233469 = get_local_id(0);\n    group_sizze_233472 = get_local_size(0);\n    wave_sizze_233471 = LOCKSTEP_WIDTH;\n    group_tid_233470 = get_group_id(0);\n    \n    int32_t phys_tid_214231 = global_tid_233468;\n    __local unsigned char *red_arr_mem_233473;\n    \n    red_arr_mem_233473 = (__local unsigned char *) red_arr_mem_233473_backing_0;\n    \n    __local unsigned char *red_arr_mem_233475;\n    \n    red_arr_mem_233475 = (__local unsigned char *) red_arr_mem_233475_backing_1;\n    \n    int32_t phys_group_id_233477;\n    \n    phys_group_id_233477 = get_group_id(0);\n    for (int32_t i_233478 = 0; i_233478 <\n         sdiv_up32(sext_i64_i32(sdiv_up64(partition_sizze_203577 * n_p_203492 *\n                                          s_n_m_203636,\n                                          squot64(segred_group_sizze_214222,\n                                                  segment_sizze_nonzzero_233466))) -\n                   phys_group_id_233477, sext_i64_i32(num_groups_214223));\n         i_233478++) {\n        int32_t virt_group_id_233479 = phys_group_id_233477 + i_233478 *\n                sext_i64_i32(num_groups_",
                   "214223);\n        int64_t slice_233480 = s_n_m_203636;\n        int64_t slice_233481 = n_p_203492 * slice_233480;\n        int64_t slice_233482 = partition_sizze_203577 * slice_233481;\n        int64_t gtid_214227 = squot64(squot64(sext_i32_i64(local_tid_233469),\n                                              segment_sizze_nonzzero_233466) +\n                                      sext_i32_i64(virt_group_id_233479) *\n                                      squot64(segred_group_sizze_214222,\n                                              segment_sizze_nonzzero_233466),\n                                      slice_233481);\n        int64_t remnant_233483 = squot64(sext_i32_i64(local_tid_233469),\n                                         segment_sizze_nonzzero_233466) +\n                sext_i32_i64(virt_group_id_233479) *\n                squot64(segred_group_sizze_214222,\n                        segment_sizze_nonzzero_233466) - gtid_214227 *\n                slice_233481;\n        int64_t gtid_214228 = squot64(remnant_233483, slice_233480);\n        int64_t remnant_233484 = remnant_233483 - gtid_214228 * slice_233480;\n        int64_t gtid_214229 = remnant_233484;\n        int64_t remnant_233485 = remnant_233484 - gtid_214229;\n        int64_t gtid_214230 = srem64(sext_i32_i64(local_tid_233469),\n                                     q_s_203493);\n        \n        // apply map function if in bounds\n        {\n            if (slt64((int64_t) 0, q_s_203493) && (((slt64(gtid_214227,\n                                                           partition_sizze_203577) &&\n                                                     slt64(gtid_214228,\n                                                           n_p_203492)) &&\n                                                    slt64(gtid_214229,\n                                                          s_n_m_203636)) &&\n                                                   slt64(sext_i32_i64(local_tid_233469),\n                                                    ",
                   "     q_s_203493 *\n                                                         squot64(segred_group_sizze_214222,\n                                                                 segment_sizze_nonzzero_233466)))) {\n                int64_t x_214251;\n                \n                x_214251 = ((__global int64_t *) ext_mem_229264)[gtid_214227 *\n                                                                 n_p_203492 +\n                                                                 gtid_214228];\n                \n                int64_t x_214258;\n                \n                x_214258 = ((__global int64_t *) ext_mem_229363)[gtid_214227 *\n                                                                 (s_n_m_203636 *\n                                                                  n_p_203492) +\n                                                                 gtid_214228 *\n                                                                 s_n_m_203636 +\n                                                                 gtid_214229];\n                \n                double x_214259;\n                \n                x_214259 = ((__global double *) ext_mem_229362)[gtid_214227 *\n                                                                (s_n_m_203636 *\n                                                                 n_p_203492) +\n                                                                gtid_214228 *\n                                                                s_n_m_203636 +\n                                                                gtid_214229];\n                \n                double a11_214260;\n                \n                a11_214260 = ((__global double *) mem_229999)[gtid_214227 *\n                                                              (s_n_m_203636 *\n                                                               n_p_203492) +\n                                                              gtid_214228 *\n                                         ",
                   "                     s_n_m_203636 +\n                                                              gtid_214229];\n                \n                double b11_214261;\n                \n                b11_214261 = ((__global double *) mem_230004)[gtid_214227 *\n                                                              (s_n_m_203636 *\n                                                               n_p_203492) +\n                                                              gtid_214228 *\n                                                              s_n_m_203636 +\n                                                              gtid_214229];\n                \n                double c11_214262;\n                \n                c11_214262 = ((__global double *) mem_230009)[gtid_214227 *\n                                                              (s_n_m_203636 *\n                                                               n_p_203492) +\n                                                              gtid_214228 *\n                                                              s_n_m_203636 +\n                                                              gtid_214229];\n                \n                int64_t defunc_0_m_fun_res_214263;\n                \n                defunc_0_m_fun_res_214263 = ((__global\n                                              int64_t *) mem_230014)[gtid_214227 *\n                                                                     (s_n_m_203636 *\n                                                                      n_p_203492) +\n                                                                     gtid_214228 *\n                                                                     s_n_m_203636 +\n                                                                     gtid_214229];\n                \n                bool cond_214265 = sle64(x_214251, gtid_214230);\n                int64_t defunc_0_f_res_214266;\n                \n                if (cond_214265) {\n       ",
                   "             defunc_0_f_res_214266 = (int64_t) 0;\n                } else {\n                    int64_t i_214267 = add64(gtid_214230, x_214258);\n                    int64_t defunc_0_add_arg_214268;\n                    \n                    defunc_0_add_arg_214268 = ((__global\n                                                int64_t *) ext_mem_229265)[gtid_214227 *\n                                                                           (defunc_0_f_res_203631 *\n                                                                            n_p_203492) +\n                                                                           gtid_214228 *\n                                                                           defunc_0_f_res_203631 +\n                                                                           i_214267];\n                    \n                    int64_t defunc_1_add_res_214269 = add64((int64_t) 1,\n                                                            defunc_0_add_arg_214268);\n                    \n                    defunc_0_f_res_214266 = defunc_1_add_res_214269;\n                }\n                \n                double defunc_0_f_res_214270;\n                \n                if (cond_214265) {\n                    defunc_0_f_res_214270 = 0.0;\n                } else {\n                    int64_t i_214271 = add64(gtid_214230, x_214258);\n                    double defunc_0_add_arg_214272;\n                    \n                    defunc_0_add_arg_214272 = ((__global\n                                                double *) mem_229531)[gtid_214227 *\n                                                                      (defunc_0_f_res_203631 *\n                                                                       n_p_203492) +\n                                                                      gtid_214228 *\n                                                                      defunc_0_f_res_203631 +\n                                                      ",
                   "                i_214271];\n                    defunc_0_f_res_214270 = defunc_0_add_arg_214272;\n                }\n                \n                int64_t binop_p_214273 = sub64(defunc_0_f_res_214266,\n                                               defunc_0_m_fun_res_214263);\n                double defunc_0_f_res_214274 = sitofp_i64_f64(binop_p_214273);\n                double abs_res_214275 = fabs(defunc_0_f_res_214274);\n                double tmp1_214276 = abs_res_214275 / x_214259;\n                double x_214277 = tmp1_214276 * tmp1_214276;\n                double y_214278 = tmp1_214276 * x_214277;\n                double tmp2_214279 = 1.0 - y_214278;\n                double x_214280 = tmp2_214279 * tmp2_214279;\n                double tmp3_214281 = tmp2_214279 * x_214280;\n                double tmp4_214282 = defunc_0_f_res_214270 * tmp3_214281;\n                double defunc_1_f_res_214283 = defunc_0_f_res_214274 *\n                       tmp4_214282;\n                double defunc_0_f_res_214284;\n                \n                if (cond_214265) {\n                    defunc_0_f_res_214284 = 0.0;\n                } else {\n                    int64_t i_214285 = add64(gtid_214230, x_214258);\n                    double defunc_0_add_arg_214286;\n                    \n                    defunc_0_add_arg_214286 = ((__global\n                                                double *) mem_229526)[gtid_214227 *\n                                                                      (defunc_0_f_res_203631 *\n                                                                       n_p_203492) +\n                                                                      gtid_214228 *\n                                                                      defunc_0_f_res_203631 +\n                                                                      i_214285];\n                    defunc_0_f_res_214284 = defunc_0_add_arg_214286;\n                }\n                \n                double x_214287 = a11_2",
                   "14260 * tmp4_214282;\n                double y_214288 = b11_214261 * defunc_1_f_res_214283;\n                double x_214289 = x_214287 + y_214288;\n                double defunc_9_fit_fun_res_214290 = defunc_0_f_res_214284 *\n                       x_214289;\n                double x_214291 = b11_214261 * tmp4_214282;\n                double y_214292 = c11_214262 * defunc_1_f_res_214283;\n                double x_214293 = x_214291 + y_214292;\n                double defunc_9_slope_fun_res_214294 = defunc_0_f_res_214284 *\n                       x_214293;\n                \n                // save map-out results\n                { }\n                // save results to be reduced\n                {\n                    ((__local\n                      double *) red_arr_mem_233473)[sext_i32_i64(local_tid_233469)] =\n                        defunc_9_fit_fun_res_214290;\n                    ((__local\n                      double *) red_arr_mem_233475)[sext_i32_i64(local_tid_233469)] =\n                        defunc_9_slope_fun_res_214294;\n                }\n            } else {\n                ((__local\n                  double *) red_arr_mem_233473)[sext_i32_i64(local_tid_233469)] =\n                    0.0;\n                ((__local\n                  double *) red_arr_mem_233475)[sext_i32_i64(local_tid_233469)] =\n                    0.0;\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        if (slt64((int64_t) 0, q_s_203493)) {\n            // perform segmented scan to imitate reduction\n            {\n                double x_214232;\n                double x_214233;\n                double x_214234;\n                double x_214235;\n                double x_233486;\n                double x_233487;\n                double x_233488;\n                double x_233489;\n                bool ltid_in_bounds_233492 =\n                     slt64(sext_i32_i64(local_tid_233469), q_s_203493 *\n                           squot64(segred_group_sizze_214222,\n                                   se",
                   "gment_sizze_nonzzero_233466));\n                int32_t skip_threads_233493;\n                \n                // read input for in-block scan\n                {\n                    if (ltid_in_bounds_233492) {\n                        x_214234 = ((volatile __local\n                                     double *) red_arr_mem_233473)[sext_i32_i64(local_tid_233469)];\n                        x_214235 = ((volatile __local\n                                     double *) red_arr_mem_233475)[sext_i32_i64(local_tid_233469)];\n                        if ((local_tid_233469 - squot32(local_tid_233469, 32) *\n                             32) == 0) {\n                            x_214232 = x_214234;\n                            x_214233 = x_214235;\n                        }\n                    }\n                }\n                // in-block scan (hopefully no barriers needed)\n                {\n                    skip_threads_233493 = 1;\n                    while (slt32(skip_threads_233493, 32)) {\n                        bool thread_active_233494 = sle32(skip_threads_233493,\n                                                          local_tid_233469 -\n                                                          squot32(local_tid_233469,\n                                                                  32) * 32) &&\n                             ltid_in_bounds_233492;\n                        \n                        if (thread_active_233494) {\n                            // read operands\n                            {\n                                x_214232 = ((volatile __local\n                                             double *) red_arr_mem_233473)[sext_i32_i64(local_tid_233469) -\n                                                                           sext_i32_i64(skip_threads_233493)];\n                                x_214233 = ((volatile __local\n                                             double *) red_arr_mem_233475)[sext_i32_i64(local_tid_233469) -\n                                     ",
                   "                                      sext_i32_i64(skip_threads_233493)];\n                            }\n                        }\n                        // perform operation\n                        {\n                            bool inactive_233495 =\n                                 slt64(srem64(sext_i32_i64(local_tid_233469),\n                                              q_s_203493),\n                                       sext_i32_i64(local_tid_233469) -\n                                       sext_i32_i64(local_tid_233469 -\n                                       skip_threads_233493));\n                            \n                            if (thread_active_233494 && inactive_233495) {\n                                x_214232 = x_214234;\n                                x_214233 = x_214235;\n                            }\n                            if (thread_active_233494) {\n                                if (!inactive_233495) {\n                                    double defunc_1_op_res_214236 = x_214232 +\n                                           x_214234;\n                                    double defunc_1_op_res_214237 = x_214233 +\n                                           x_214235;\n                                    \n                                    x_214232 = defunc_1_op_res_214236;\n                                    x_214233 = defunc_1_op_res_214237;\n                                }\n                            }\n                        }\n                        if (sle32(wave_sizze_233471, skip_threads_233493)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        if (thread_active_233494) {\n                            // write result\n                            {\n                                ((volatile __local\n                                  double *) red_arr_mem_233473)[sext_i32_i64(local_tid_233469)] =\n                                    x_214232;\n                                x_21423",
                   "4 = x_214232;\n                                ((volatile __local\n                                  double *) red_arr_mem_233475)[sext_i32_i64(local_tid_233469)] =\n                                    x_214233;\n                                x_214235 = x_214233;\n                            }\n                        }\n                        if (sle32(wave_sizze_233471, skip_threads_233493)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        skip_threads_233493 *= 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_233469 - squot32(local_tid_233469, 32) *\n                         32) == 31 && ltid_in_bounds_233492) {\n                        ((volatile __local\n                          double *) red_arr_mem_233473)[sext_i32_i64(squot32(local_tid_233469,\n                                                                             32))] =\n                            x_214232;\n                        ((volatile __local\n                          double *) red_arr_mem_233475)[sext_i32_i64(squot32(local_tid_233469,\n                                                                             32))] =\n                            x_214233;\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_233496;\n                    \n                    // read input for in-block scan\n                    {\n                        if (squot32(local_tid_233469, 32) == 0 &&\n                            ltid_in_bounds_233492) {\n                            x_233488 = ((volatile __local\n                                         double *) red_arr_mem_233473)[sext_i32_i64(local_tid_233469)];\n   ",
                   "                         x_233489 = ((volatile __local\n                                         double *) red_arr_mem_233475)[sext_i32_i64(local_tid_233469)];\n                            if ((local_tid_233469 - squot32(local_tid_233469,\n                                                            32) * 32) == 0) {\n                                x_233486 = x_233488;\n                                x_233487 = x_233489;\n                            }\n                        }\n                    }\n                    // in-block scan (hopefully no barriers needed)\n                    {\n                        skip_threads_233496 = 1;\n                        while (slt32(skip_threads_233496, 32)) {\n                            bool thread_active_233497 =\n                                 sle32(skip_threads_233496, local_tid_233469 -\n                                       squot32(local_tid_233469, 32) * 32) &&\n                                 (squot32(local_tid_233469, 32) == 0 &&\n                                  ltid_in_bounds_233492);\n                            \n                            if (thread_active_233497) {\n                                // read operands\n                                {\n                                    x_233486 = ((volatile __local\n                                                 double *) red_arr_mem_233473)[sext_i32_i64(local_tid_233469) -\n                                                                               sext_i32_i64(skip_threads_233496)];\n                                    x_233487 = ((volatile __local\n                                                 double *) red_arr_mem_233475)[sext_i32_i64(local_tid_233469) -\n                                                                               sext_i32_i64(skip_threads_233496)];\n                                }\n                            }\n                            // perform operation\n                            {\n                                bool inactive_233498 =\n  ",
                   "                                   slt64(srem64(sext_i32_i64(local_tid_233469 *\n                                                  32 + 32 - 1), q_s_203493),\n                                           sext_i32_i64(local_tid_233469 * 32 +\n                                           32 - 1) -\n                                           sext_i32_i64((local_tid_233469 -\n                                                         skip_threads_233496) *\n                                           32 + 32 - 1));\n                                \n                                if (thread_active_233497 && inactive_233498) {\n                                    x_233486 = x_233488;\n                                    x_233487 = x_233489;\n                                }\n                                if (thread_active_233497) {\n                                    if (!inactive_233498) {\n                                        double defunc_1_op_res_233490 =\n                                               x_233486 + x_233488;\n                                        double defunc_1_op_res_233491 =\n                                               x_233487 + x_233489;\n                                        \n                                        x_233486 = defunc_1_op_res_233490;\n                                        x_233487 = defunc_1_op_res_233491;\n                                    }\n                                }\n                            }\n                            if (sle32(wave_sizze_233471, skip_threads_233496)) {\n                                barrier(CLK_LOCAL_MEM_FENCE);\n                            }\n                            if (thread_active_233497) {\n                                // write result\n                                {\n                                    ((volatile __local\n                                      double *) red_arr_mem_233473)[sext_i32_i64(local_tid_233469)] =\n                                        x_233486;\n                         ",
                   "           x_233488 = x_233486;\n                                    ((volatile __local\n                                      double *) red_arr_mem_233475)[sext_i32_i64(local_tid_233469)] =\n                                        x_233487;\n                                    x_233489 = x_233487;\n                                }\n                            }\n                            if (sle32(wave_sizze_233471, skip_threads_233496)) {\n                                barrier(CLK_LOCAL_MEM_FENCE);\n                            }\n                            skip_threads_233496 *= 2;\n                        }\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                \n                bool no_carry_in_233499 = squot32(local_tid_233469, 32) == 0 ||\n                     !ltid_in_bounds_233492;\n                \n                // carry-in for every block except the first\n                {\n                    // read operands\n                    {\n                        if (!no_carry_in_233499) {\n                            x_214234 = x_214232;\n                            x_214235 = x_214233;\n                            x_214232 = ((__local\n                                         double *) red_arr_mem_233473)[sext_i32_i64(squot32(local_tid_233469,\n                                                                                            32)) -\n                                                                       (int64_t) 1];\n                            x_214233 = ((__local\n                                         double *) red_arr_mem_233475)[sext_i32_i64(squot32(local_tid_233469,\n                                                                                            32)) -\n                                                                       (int64_t) 1];\n                        }\n                    }\n                    // perform operation\n                    {\n                        bool inactive_233500 =\n           ",
                   "                  slt64(srem64(sext_i32_i64(local_tid_233469),\n                                          q_s_203493),\n                                   sext_i32_i64(local_tid_233469) -\n                                   sext_i32_i64(squot32(local_tid_233469, 32) *\n                                   32 - 1));\n                        \n                        if (!no_carry_in_233499) {\n                            if (inactive_233500) {\n                                x_214232 = x_214234;\n                                x_214233 = x_214235;\n                            }\n                        }\n                        if (!no_carry_in_233499) {\n                            if (!inactive_233500) {\n                                double defunc_1_op_res_214236 = x_214232 +\n                                       x_214234;\n                                double defunc_1_op_res_214237 = x_214233 +\n                                       x_214235;\n                                \n                                x_214232 = defunc_1_op_res_214236;\n                                x_214233 = defunc_1_op_res_214237;\n                            }\n                        }\n                    }\n                    // write final result\n                    {\n                        if (!no_carry_in_233499) {\n                            ((__local\n                              double *) red_arr_mem_233473)[sext_i32_i64(local_tid_233469)] =\n                                x_214232;\n                            ((__local\n                              double *) red_arr_mem_233475)[sext_i32_i64(local_tid_233469)] =\n                                x_214233;\n                        }\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // restore correct values for first block\n                {\n                    if (squot32(local_tid_233469, 32) == 0 &&\n                        ltid_in_bounds_233492) {\n                        ((__local\n        ",
                   "                  double *) red_arr_mem_233473)[sext_i32_i64(local_tid_233469)] =\n                            x_214234;\n                        ((__local\n                          double *) red_arr_mem_233475)[sext_i32_i64(local_tid_233469)] =\n                            x_214235;\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_233479) *\n                      squot64(segred_group_sizze_214222,\n                              segment_sizze_nonzzero_233466) +\n                      sext_i32_i64(local_tid_233469), partition_sizze_203577 *\n                      n_p_203492 * s_n_m_203636) &&\n                slt64(sext_i32_i64(local_tid_233469),\n                      squot64(segred_group_sizze_214222,\n                              segment_sizze_nonzzero_233466))) {\n                double tmp_233501;\n                \n                tmp_233501 = ((__local\n                               double *) red_arr_mem_233473)[(sext_i32_i64(local_tid_233469) +\n                                                              (int64_t) 1) *\n                                                             segment_sizze_nonzzero_233466 -\n                                                             (int64_t) 1];\n                ((__global\n                  double *) mem_230020)[squot64(sext_i32_i64(virt_group_id_233479) *\n                                                squot64(segred_group_sizze_214222,\n                                                        segment_sizze_nonzzero_233466) +\n                                                sext_i32_i64(local_tid_233469),\n                                                n_p_203492 * s_n_m_203636) *\n                                        (s_n_m_203636 * n_p_203492) +\n                                        squot64(sext_i32_i64(virt_group_id_233479) *\n      ",
                   "                                          squot64(segred_group_sizze_214222,\n                                                        segment_sizze_nonzzero_233466) +\n                                                sext_i32_i64(local_tid_233469) -\n                                                squot64(sext_i32_i64(virt_group_id_233479) *\n                                                        squot64(segred_group_sizze_214222,\n                                                                segment_sizze_nonzzero_233466) +\n                                                        sext_i32_i64(local_tid_233469),\n                                                        n_p_203492 *\n                                                        s_n_m_203636) *\n                                                (n_p_203492 * s_n_m_203636),\n                                                s_n_m_203636) * s_n_m_203636 +\n                                        (sext_i32_i64(virt_group_id_233479) *\n                                         squot64(segred_group_sizze_214222,\n                                                 segment_sizze_nonzzero_233466) +\n                                         sext_i32_i64(local_tid_233469) -\n                                         squot64(sext_i32_i64(virt_group_id_233479) *\n                                                 squot64(segred_group_sizze_214222,\n                                                         segment_sizze_nonzzero_233466) +\n                                                 sext_i32_i64(local_tid_233469),\n                                                 n_p_203492 * s_n_m_203636) *\n                                         (n_p_203492 * s_n_m_203636) -\n                                         squot64(sext_i32_i64(virt_group_id_233479) *\n                                                 squot64(segred_group_sizze_214222,\n                                                         segment_sizze_nonzzero_233466) +\n                           ",
                   "                      sext_i32_i64(local_tid_233469) -\n                                                 squot64(sext_i32_i64(virt_group_id_233479) *\n                                                         squot64(segred_group_sizze_214222,\n                                                                 segment_sizze_nonzzero_233466) +\n                                                         sext_i32_i64(local_tid_233469),\n                                                         n_p_203492 *\n                                                         s_n_m_203636) *\n                                                 (n_p_203492 * s_n_m_203636),\n                                                 s_n_m_203636) *\n                                         s_n_m_203636)] = tmp_233501;\n                \n                double tmp_233502;\n                \n                tmp_233502 = ((__local\n                               double *) red_arr_mem_233475)[(sext_i32_i64(local_tid_233469) +\n                                                              (int64_t) 1) *\n                                                             segment_sizze_nonzzero_233466 -\n                                                             (int64_t) 1];\n                ((__global\n                  double *) mem_230025)[squot64(sext_i32_i64(virt_group_id_233479) *\n                                                squot64(segred_group_sizze_214222,\n                                                        segment_sizze_nonzzero_233466) +\n                                                sext_i32_i64(local_tid_233469),\n                                                n_p_203492 * s_n_m_203636) *\n                                        (s_n_m_203636 * n_p_203492) +\n                                        squot64(sext_i32_i64(virt_group_id_233479) *\n                                                squot64(segred_group_sizze_214222,\n                                                        segment_sizze_nonzzero_233466) +\n",
                   "                                                sext_i32_i64(local_tid_233469) -\n                                                squot64(sext_i32_i64(virt_group_id_233479) *\n                                                        squot64(segred_group_sizze_214222,\n                                                                segment_sizze_nonzzero_233466) +\n                                                        sext_i32_i64(local_tid_233469),\n                                                        n_p_203492 *\n                                                        s_n_m_203636) *\n                                                (n_p_203492 * s_n_m_203636),\n                                                s_n_m_203636) * s_n_m_203636 +\n                                        (sext_i32_i64(virt_group_id_233479) *\n                                         squot64(segred_group_sizze_214222,\n                                                 segment_sizze_nonzzero_233466) +\n                                         sext_i32_i64(local_tid_233469) -\n                                         squot64(sext_i32_i64(virt_group_id_233479) *\n                                                 squot64(segred_group_sizze_214222,\n                                                         segment_sizze_nonzzero_233466) +\n                                                 sext_i32_i64(local_tid_233469),\n                                                 n_p_203492 * s_n_m_203636) *\n                                         (n_p_203492 * s_n_m_203636) -\n                                         squot64(sext_i32_i64(virt_group_id_233479) *\n                                                 squot64(segred_group_sizze_214222,\n                                                         segment_sizze_nonzzero_233466) +\n                                                 sext_i32_i64(local_tid_233469) -\n                                                 squot64(sext_i32_i64(virt_group_id_233479) *\n                 ",
                   "                                        squot64(segred_group_sizze_214222,\n                                                                 segment_sizze_nonzzero_233466) +\n                                                         sext_i32_i64(local_tid_233469),\n                                                         n_p_203492 *\n                                                         s_n_m_203636) *\n                                                 (n_p_203492 * s_n_m_203636),\n                                                 s_n_m_203636) *\n                                         s_n_m_203636)] = tmp_233502;\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_214222\n}\n__kernel void mainzisegred_small_216784(__global int *global_failure,\n                                        __local volatile\n                                        int64_t *red_arr_mem_233762_backing_aligned_0,\n                                        __local volatile\n                                        int64_t *red_arr_mem_233760_backing_aligned_1,\n                                        __local volatile\n                                        int64_t *red_arr_mem_233758_backing_aligned_2,\n                                        __local volatile\n                                        int64_t *red_arr_mem_233756_backing_aligned_3,\n                                        __local volatile\n                                        int64_t *red_arr_mem_233754_backing_aligned_4,\n                                        int64_t n_p_203492, int64_t q_s_203493,\n                                        int64_t partition_sizze_203577,\n                                        int64_t defunc_0_f_res_203631,\n                                        int64_t s_n_m_203636,\n                                        int64_t num_groups_216773,\n                                        int6",
                   "4_t segment_sizze_nonzzero_233747,\n                                        __global unsigned char *ext_mem_229264,\n                                        __global unsigned char *ext_mem_229265,\n                                        __global unsigned char *ext_mem_229362,\n                                        __global unsigned char *ext_mem_229363,\n                                        __global unsigned char *mem_229531,\n                                        __global unsigned char *mem_230312,\n                                        __global unsigned char *mem_230322,\n                                        __global unsigned char *mem_230327,\n                                        __global unsigned char *mem_230332,\n                                        __global unsigned char *mem_230337,\n                                        __global unsigned char *mem_230342)\n{\n    #define segred_group_sizze_216772 (mainzisegred_group_sizze_215512)\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_233762_backing_4 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_233762_backing_aligned_0;\n    __local volatile unsigned char *restrict red_arr_mem_233760_backing_3 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_233760_backing_aligned_1;\n    __local volatile unsigned char *restrict red_arr_mem_233758_backing_2 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_233758_backing_aligned_2;\n    __local volatile unsigned char *restrict red_arr_mem_233756_backing_1 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_233756_backing_aligned_3;\n    __local volatile unsigned char *restrict red_arr_mem_233754_",
                   "backing_0 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_233754_backing_aligned_4;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_233749;\n    int32_t local_tid_233750;\n    int64_t group_sizze_233753;\n    int32_t wave_sizze_233752;\n    int32_t group_tid_233751;\n    \n    global_tid_233749 = get_global_id(0);\n    local_tid_233750 = get_local_id(0);\n    group_sizze_233753 = get_local_size(0);\n    wave_sizze_233752 = LOCKSTEP_WIDTH;\n    group_tid_233751 = get_group_id(0);\n    \n    int32_t phys_tid_216784 = global_tid_233749;\n    __local unsigned char *red_arr_mem_233754;\n    \n    red_arr_mem_233754 = (__local unsigned char *) red_arr_mem_233754_backing_0;\n    \n    __local unsigned char *red_arr_mem_233756;\n    \n    red_arr_mem_233756 = (__local unsigned char *) red_arr_mem_233756_backing_1;\n    \n    __local unsigned char *red_arr_mem_233758;\n    \n    red_arr_mem_233758 = (__local unsigned char *) red_arr_mem_233758_backing_2;\n    \n    __local unsigned char *red_arr_mem_233760;\n    \n    red_arr_mem_233760 = (__local unsigned char *) red_arr_mem_233760_backing_3;\n    \n    __local unsigned char *red_arr_mem_233762;\n    \n    red_arr_mem_233762 = (__local unsigned char *) red_arr_mem_233762_backing_4;\n    \n    int32_t phys_group_id_233764;\n    \n    phys_group_id_233764 = get_group_id(0);\n    for (int32_t i_233765 = 0; i_233765 <\n         sdiv_up32(sext_i64_i32(sdiv_up64(partition_sizze_203577 * n_p_203492 *\n                                          s_n_m_203636,\n                                          squot64(segred_group_sizze_216772,\n                                                  segment_sizze_nonzzero_233747))) -\n                   phys_group_id_233764, sext_i64_i32(num_groups_216773));\n         i_233765++) {\n        int32_t virt_group_id_233766 = phys_group_id_233764 + i_233765 *\n                sext_i64_i32(num_groups_216773);\n        int64_t slice_233767 = s_n_m",
                   "_203636;\n        int64_t slice_233768 = n_p_203492 * slice_233767;\n        int64_t slice_233769 = partition_sizze_203577 * slice_233768;\n        int64_t gtid_216780 = squot64(squot64(sext_i32_i64(local_tid_233750),\n                                              segment_sizze_nonzzero_233747) +\n                                      sext_i32_i64(virt_group_id_233766) *\n                                      squot64(segred_group_sizze_216772,\n                                              segment_sizze_nonzzero_233747),\n                                      slice_233768);\n        int64_t remnant_233770 = squot64(sext_i32_i64(local_tid_233750),\n                                         segment_sizze_nonzzero_233747) +\n                sext_i32_i64(virt_group_id_233766) *\n                squot64(segred_group_sizze_216772,\n                        segment_sizze_nonzzero_233747) - gtid_216780 *\n                slice_233768;\n        int64_t gtid_216781 = squot64(remnant_233770, slice_233767);\n        int64_t remnant_233771 = remnant_233770 - gtid_216781 * slice_233767;\n        int64_t gtid_216782 = remnant_233771;\n        int64_t remnant_233772 = remnant_233771 - gtid_216782;\n        int64_t gtid_216783 = srem64(sext_i32_i64(local_tid_233750),\n                                     q_s_203493);\n        \n        // apply map function if in bounds\n        {\n            if (slt64((int64_t) 0, q_s_203493) && (((slt64(gtid_216780,\n                                                           partition_sizze_203577) &&\n                                                     slt64(gtid_216781,\n                                                           n_p_203492)) &&\n                                                    slt64(gtid_216782,\n                                                          s_n_m_203636)) &&\n                                                   slt64(sext_i32_i64(local_tid_233750),\n                                                         q_s_203493 *\n                           ",
                   "                              squot64(segred_group_sizze_216772,\n                                                                 segment_sizze_nonzzero_233747)))) {\n                int64_t x_216808;\n                \n                x_216808 = ((__global int64_t *) ext_mem_229264)[gtid_216780 *\n                                                                 n_p_203492 +\n                                                                 gtid_216781];\n                \n                int64_t x_216812;\n                \n                x_216812 = ((__global int64_t *) ext_mem_229363)[gtid_216780 *\n                                                                 (s_n_m_203636 *\n                                                                  n_p_203492) +\n                                                                 gtid_216781 *\n                                                                 s_n_m_203636 +\n                                                                 gtid_216782];\n                \n                double x_216813;\n                \n                x_216813 = ((__global double *) ext_mem_229362)[gtid_216780 *\n                                                                (s_n_m_203636 *\n                                                                 n_p_203492) +\n                                                                gtid_216781 *\n                                                                s_n_m_203636 +\n                                                                gtid_216782];\n                \n                int64_t defunc_0_m_fun_res_216814;\n                \n                defunc_0_m_fun_res_216814 = ((__global\n                                              int64_t *) mem_230312)[gtid_216780 *\n                                                                     (s_n_m_203636 *\n                                                                      n_p_203492) +\n                                                                     g",
                   "tid_216781 *\n                                                                     s_n_m_203636 +\n                                                                     gtid_216782];\n                \n                bool cond_216816 = sle64(x_216808, gtid_216783);\n                int64_t defunc_0_f_res_216817;\n                \n                if (cond_216816) {\n                    defunc_0_f_res_216817 = (int64_t) 0;\n                } else {\n                    int64_t i_216818 = add64(gtid_216783, x_216812);\n                    int64_t defunc_0_add_arg_216819;\n                    \n                    defunc_0_add_arg_216819 = ((__global\n                                                int64_t *) ext_mem_229265)[gtid_216780 *\n                                                                           (defunc_0_f_res_203631 *\n                                                                            n_p_203492) +\n                                                                           gtid_216781 *\n                                                                           defunc_0_f_res_203631 +\n                                                                           i_216818];\n                    \n                    int64_t defunc_1_add_res_216820 = add64((int64_t) 1,\n                                                            defunc_0_add_arg_216819);\n                    \n                    defunc_0_f_res_216817 = defunc_1_add_res_216820;\n                }\n                \n                double defunc_0_f_res_216821;\n                \n                if (cond_216816) {\n                    defunc_0_f_res_216821 = 0.0;\n                } else {\n                    int64_t i_216822 = add64(gtid_216783, x_216812);\n                    double defunc_0_add_arg_216823;\n                    \n                    defunc_0_add_arg_216823 = ((__global\n                                                double *) mem_229531)[gtid_216780 *\n                                            ",
                   "                          (defunc_0_f_res_203631 *\n                                                                       n_p_203492) +\n                                                                      gtid_216781 *\n                                                                      defunc_0_f_res_203631 +\n                                                                      i_216822];\n                    defunc_0_f_res_216821 = defunc_0_add_arg_216823;\n                }\n                \n                int64_t binop_p_216824 = sub64(defunc_0_f_res_216817,\n                                               defunc_0_m_fun_res_216814);\n                double defunc_0_f_res_216825 = sitofp_i64_f64(binop_p_216824);\n                double abs_res_216826 = fabs(defunc_0_f_res_216825);\n                double tmp1_216827 = abs_res_216826 / x_216813;\n                double x_216828 = tmp1_216827 * tmp1_216827;\n                double y_216829 = tmp1_216827 * x_216828;\n                double tmp2_216830 = 1.0 - y_216829;\n                double x_216831 = tmp2_216830 * tmp2_216830;\n                double tmp3_216832 = tmp2_216830 * x_216831;\n                double w_j_216833 = defunc_0_f_res_216821 * tmp3_216832;\n                double xw_j_216834 = defunc_0_f_res_216825 * w_j_216833;\n                double x2w_j_216835 = defunc_0_f_res_216825 * xw_j_216834;\n                double x3w_j_216836 = defunc_0_f_res_216825 * x2w_j_216835;\n                double x4w_j_216837 = defunc_0_f_res_216825 * x3w_j_216836;\n                \n                // save map-out results\n                { }\n                // save results to be reduced\n                {\n                    ((__local\n                      double *) red_arr_mem_233754)[sext_i32_i64(local_tid_233750)] =\n                        w_j_216833;\n                    ((__local\n                      double *) red_arr_mem_233756)[sext_i32_i64(local_tid_233750)] =\n                        xw_j_216834;\n                    ((__local\n ",
                   "                     double *) red_arr_mem_233758)[sext_i32_i64(local_tid_233750)] =\n                        x2w_j_216835;\n                    ((__local\n                      double *) red_arr_mem_233760)[sext_i32_i64(local_tid_233750)] =\n                        x3w_j_216836;\n                    ((__local\n                      double *) red_arr_mem_233762)[sext_i32_i64(local_tid_233750)] =\n                        x4w_j_216837;\n                }\n            } else {\n                ((__local\n                  double *) red_arr_mem_233754)[sext_i32_i64(local_tid_233750)] =\n                    0.0;\n                ((__local\n                  double *) red_arr_mem_233756)[sext_i32_i64(local_tid_233750)] =\n                    0.0;\n                ((__local\n                  double *) red_arr_mem_233758)[sext_i32_i64(local_tid_233750)] =\n                    0.0;\n                ((__local\n                  double *) red_arr_mem_233760)[sext_i32_i64(local_tid_233750)] =\n                    0.0;\n                ((__local\n                  double *) red_arr_mem_233762)[sext_i32_i64(local_tid_233750)] =\n                    0.0;\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        if (slt64((int64_t) 0, q_s_203493)) {\n            // perform segmented scan to imitate reduction\n            {\n                double x_216785;\n                double x_216786;\n                double x_216787;\n                double x_216788;\n                double x_216789;\n                double x_216790;\n                double x_216791;\n                double x_216792;\n                double x_216793;\n                double x_216794;\n                double x_233773;\n                double x_233774;\n                double x_233775;\n                double x_233776;\n                double x_233777;\n                double x_233778;\n                double x_233779;\n                double x_233780;\n                double x_233781;\n                double x_233782;\n                bool lti",
                   "d_in_bounds_233788 =\n                     slt64(sext_i32_i64(local_tid_233750), q_s_203493 *\n                           squot64(segred_group_sizze_216772,\n                                   segment_sizze_nonzzero_233747));\n                int32_t skip_threads_233789;\n                \n                // read input for in-block scan\n                {\n                    if (ltid_in_bounds_233788) {\n                        x_216790 = ((volatile __local\n                                     double *) red_arr_mem_233754)[sext_i32_i64(local_tid_233750)];\n                        x_216791 = ((volatile __local\n                                     double *) red_arr_mem_233756)[sext_i32_i64(local_tid_233750)];\n                        x_216792 = ((volatile __local\n                                     double *) red_arr_mem_233758)[sext_i32_i64(local_tid_233750)];\n                        x_216793 = ((volatile __local\n                                     double *) red_arr_mem_233760)[sext_i32_i64(local_tid_233750)];\n                        x_216794 = ((volatile __local\n                                     double *) red_arr_mem_233762)[sext_i32_i64(local_tid_233750)];\n                        if ((local_tid_233750 - squot32(local_tid_233750, 32) *\n                             32) == 0) {\n                            x_216785 = x_216790;\n                            x_216786 = x_216791;\n                            x_216787 = x_216792;\n                            x_216788 = x_216793;\n                            x_216789 = x_216794;\n                        }\n                    }\n                }\n                // in-block scan (hopefully no barriers needed)\n                {\n                    skip_threads_233789 = 1;\n                    while (slt32(skip_threads_233789, 32)) {\n                        bool thread_active_233790 = sle32(skip_threads_233789,\n                                                          local_tid_233750 -\n                                                      ",
                   "    squot32(local_tid_233750,\n                                                                  32) * 32) &&\n                             ltid_in_bounds_233788;\n                        \n                        if (thread_active_233790) {\n                            // read operands\n                            {\n                                x_216785 = ((volatile __local\n                                             double *) red_arr_mem_233754)[sext_i32_i64(local_tid_233750) -\n                                                                           sext_i32_i64(skip_threads_233789)];\n                                x_216786 = ((volatile __local\n                                             double *) red_arr_mem_233756)[sext_i32_i64(local_tid_233750) -\n                                                                           sext_i32_i64(skip_threads_233789)];\n                                x_216787 = ((volatile __local\n                                             double *) red_arr_mem_233758)[sext_i32_i64(local_tid_233750) -\n                                                                           sext_i32_i64(skip_threads_233789)];\n                                x_216788 = ((volatile __local\n                                             double *) red_arr_mem_233760)[sext_i32_i64(local_tid_233750) -\n                                                                           sext_i32_i64(skip_threads_233789)];\n                                x_216789 = ((volatile __local\n                                             double *) red_arr_mem_233762)[sext_i32_i64(local_tid_233750) -\n                                                                           sext_i32_i64(skip_threads_233789)];\n                            }\n                        }\n                        // perform operation\n                        {\n                            bool inactive_233791 =\n                                 slt64(srem64(sext_i32_i64(local_tid_233750),\n                          ",
                   "                    q_s_203493),\n                                       sext_i32_i64(local_tid_233750) -\n                                       sext_i32_i64(local_tid_233750 -\n                                       skip_threads_233789));\n                            \n                            if (thread_active_233790 && inactive_233791) {\n                                x_216785 = x_216790;\n                                x_216786 = x_216791;\n                                x_216787 = x_216792;\n                                x_216788 = x_216793;\n                                x_216789 = x_216794;\n                            }\n                            if (thread_active_233790) {\n                                if (!inactive_233791) {\n                                    double defunc_1_op_res_216795 = x_216785 +\n                                           x_216790;\n                                    double defunc_1_op_res_216796 = x_216786 +\n                                           x_216791;\n                                    double defunc_1_op_res_216797 = x_216787 +\n                                           x_216792;\n                                    double defunc_1_op_res_216798 = x_216788 +\n                                           x_216793;\n                                    double defunc_1_op_res_216799 = x_216789 +\n                                           x_216794;\n                                    \n                                    x_216785 = defunc_1_op_res_216795;\n                                    x_216786 = defunc_1_op_res_216796;\n                                    x_216787 = defunc_1_op_res_216797;\n                                    x_216788 = defunc_1_op_res_216798;\n                                    x_216789 = defunc_1_op_res_216799;\n                                }\n                            }\n                        }\n                        if (sle32(wave_sizze_233752, skip_threads_233789)) {\n                            barr",
                   "ier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        if (thread_active_233790) {\n                            // write result\n                            {\n                                ((volatile __local\n                                  double *) red_arr_mem_233754)[sext_i32_i64(local_tid_233750)] =\n                                    x_216785;\n                                x_216790 = x_216785;\n                                ((volatile __local\n                                  double *) red_arr_mem_233756)[sext_i32_i64(local_tid_233750)] =\n                                    x_216786;\n                                x_216791 = x_216786;\n                                ((volatile __local\n                                  double *) red_arr_mem_233758)[sext_i32_i64(local_tid_233750)] =\n                                    x_216787;\n                                x_216792 = x_216787;\n                                ((volatile __local\n                                  double *) red_arr_mem_233760)[sext_i32_i64(local_tid_233750)] =\n                                    x_216788;\n                                x_216793 = x_216788;\n                                ((volatile __local\n                                  double *) red_arr_mem_233762)[sext_i32_i64(local_tid_233750)] =\n                                    x_216789;\n                                x_216794 = x_216789;\n                            }\n                        }\n                        if (sle32(wave_sizze_233752, skip_threads_233789)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        skip_threads_233789 *= 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_233750 - squot32(local_tid_233750, 32) *\n                         32) == 31 && ltid_in_bounds_233788",
                   ") {\n                        ((volatile __local\n                          double *) red_arr_mem_233754)[sext_i32_i64(squot32(local_tid_233750,\n                                                                             32))] =\n                            x_216785;\n                        ((volatile __local\n                          double *) red_arr_mem_233756)[sext_i32_i64(squot32(local_tid_233750,\n                                                                             32))] =\n                            x_216786;\n                        ((volatile __local\n                          double *) red_arr_mem_233758)[sext_i32_i64(squot32(local_tid_233750,\n                                                                             32))] =\n                            x_216787;\n                        ((volatile __local\n                          double *) red_arr_mem_233760)[sext_i32_i64(squot32(local_tid_233750,\n                                                                             32))] =\n                            x_216788;\n                        ((volatile __local\n                          double *) red_arr_mem_233762)[sext_i32_i64(squot32(local_tid_233750,\n                                                                             32))] =\n                            x_216789;\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_233792;\n                    \n                    // read input for in-block scan\n                    {\n                        if (squot32(local_tid_233750, 32) == 0 &&\n                            ltid_in_bounds_233788) {\n                            x_233778 = ((volatile __local\n                                         double *) red_arr_mem_233754)[sext_i32_i64(local_tid_233750)];\n                            x_233779 = ((volatile __local\n      ",
                   "                                   double *) red_arr_mem_233756)[sext_i32_i64(local_tid_233750)];\n                            x_233780 = ((volatile __local\n                                         double *) red_arr_mem_233758)[sext_i32_i64(local_tid_233750)];\n                            x_233781 = ((volatile __local\n                                         double *) red_arr_mem_233760)[sext_i32_i64(local_tid_233750)];\n                            x_233782 = ((volatile __local\n                                         double *) red_arr_mem_233762)[sext_i32_i64(local_tid_233750)];\n                            if ((local_tid_233750 - squot32(local_tid_233750,\n                                                            32) * 32) == 0) {\n                                x_233773 = x_233778;\n                                x_233774 = x_233779;\n                                x_233775 = x_233780;\n                                x_233776 = x_233781;\n                                x_233777 = x_233782;\n                            }\n                        }\n                    }\n                    // in-block scan (hopefully no barriers needed)\n                    {\n                        skip_threads_233792 = 1;\n                        while (slt32(skip_threads_233792, 32)) {\n                            bool thread_active_233793 =\n                                 sle32(skip_threads_233792, local_tid_233750 -\n                                       squot32(local_tid_233750, 32) * 32) &&\n                                 (squot32(local_tid_233750, 32) == 0 &&\n                                  ltid_in_bounds_233788);\n                            \n                            if (thread_active_233793) {\n                                // read operands\n                                {\n                                    x_233773 = ((volatile __local\n                                                 double *) red_arr_mem_233754)[sext_i32_i64(local_tid_233750) -\n                        ",
                   "                                                       sext_i32_i64(skip_threads_233792)];\n                                    x_233774 = ((volatile __local\n                                                 double *) red_arr_mem_233756)[sext_i32_i64(local_tid_233750) -\n                                                                               sext_i32_i64(skip_threads_233792)];\n                                    x_233775 = ((volatile __local\n                                                 double *) red_arr_mem_233758)[sext_i32_i64(local_tid_233750) -\n                                                                               sext_i32_i64(skip_threads_233792)];\n                                    x_233776 = ((volatile __local\n                                                 double *) red_arr_mem_233760)[sext_i32_i64(local_tid_233750) -\n                                                                               sext_i32_i64(skip_threads_233792)];\n                                    x_233777 = ((volatile __local\n                                                 double *) red_arr_mem_233762)[sext_i32_i64(local_tid_233750) -\n                                                                               sext_i32_i64(skip_threads_233792)];\n                                }\n                            }\n                            // perform operation\n                            {\n                                bool inactive_233794 =\n                                     slt64(srem64(sext_i32_i64(local_tid_233750 *\n                                                  32 + 32 - 1), q_s_203493),\n                                           sext_i32_i64(local_tid_233750 * 32 +\n                                           32 - 1) -\n                                           sext_i32_i64((local_tid_233750 -\n                                                         skip_threads_233792) *\n                                           32 + 32 - 1));\n                                \n",
                   "                                if (thread_active_233793 && inactive_233794) {\n                                    x_233773 = x_233778;\n                                    x_233774 = x_233779;\n                                    x_233775 = x_233780;\n                                    x_233776 = x_233781;\n                                    x_233777 = x_233782;\n                                }\n                                if (thread_active_233793) {\n                                    if (!inactive_233794) {\n                                        double defunc_1_op_res_233783 =\n                                               x_233773 + x_233778;\n                                        double defunc_1_op_res_233784 =\n                                               x_233774 + x_233779;\n                                        double defunc_1_op_res_233785 =\n                                               x_233775 + x_233780;\n                                        double defunc_1_op_res_233786 =\n                                               x_233776 + x_233781;\n                                        double defunc_1_op_res_233787 =\n                                               x_233777 + x_233782;\n                                        \n                                        x_233773 = defunc_1_op_res_233783;\n                                        x_233774 = defunc_1_op_res_233784;\n                                        x_233775 = defunc_1_op_res_233785;\n                                        x_233776 = defunc_1_op_res_233786;\n                                        x_233777 = defunc_1_op_res_233787;\n                                    }\n                                }\n                            }\n                            if (sle32(wave_sizze_233752, skip_threads_233792)) {\n                                barrier(CLK_LOCAL_MEM_FENCE);\n                            }\n                            if (thread_active_233793) {\n                                // ",
                   "write result\n                                {\n                                    ((volatile __local\n                                      double *) red_arr_mem_233754)[sext_i32_i64(local_tid_233750)] =\n                                        x_233773;\n                                    x_233778 = x_233773;\n                                    ((volatile __local\n                                      double *) red_arr_mem_233756)[sext_i32_i64(local_tid_233750)] =\n                                        x_233774;\n                                    x_233779 = x_233774;\n                                    ((volatile __local\n                                      double *) red_arr_mem_233758)[sext_i32_i64(local_tid_233750)] =\n                                        x_233775;\n                                    x_233780 = x_233775;\n                                    ((volatile __local\n                                      double *) red_arr_mem_233760)[sext_i32_i64(local_tid_233750)] =\n                                        x_233776;\n                                    x_233781 = x_233776;\n                                    ((volatile __local\n                                      double *) red_arr_mem_233762)[sext_i32_i64(local_tid_233750)] =\n                                        x_233777;\n                                    x_233782 = x_233777;\n                                }\n                            }\n                            if (sle32(wave_sizze_233752, skip_threads_233792)) {\n                                barrier(CLK_LOCAL_MEM_FENCE);\n                            }\n                            skip_threads_233792 *= 2;\n                        }\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                \n                bool no_carry_in_233795 = squot32(local_tid_233750, 32) == 0 ||\n                     !ltid_in_bounds_233788;\n                \n                // carry-in for every block except the first\n          ",
                   "      {\n                    // read operands\n                    {\n                        if (!no_carry_in_233795) {\n                            x_216790 = x_216785;\n                            x_216791 = x_216786;\n                            x_216792 = x_216787;\n                            x_216793 = x_216788;\n                            x_216794 = x_216789;\n                            x_216785 = ((__local\n                                         double *) red_arr_mem_233754)[sext_i32_i64(squot32(local_tid_233750,\n                                                                                            32)) -\n                                                                       (int64_t) 1];\n                            x_216786 = ((__local\n                                         double *) red_arr_mem_233756)[sext_i32_i64(squot32(local_tid_233750,\n                                                                                            32)) -\n                                                                       (int64_t) 1];\n                            x_216787 = ((__local\n                                         double *) red_arr_mem_233758)[sext_i32_i64(squot32(local_tid_233750,\n                                                                                            32)) -\n                                                                       (int64_t) 1];\n                            x_216788 = ((__local\n                                         double *) red_arr_mem_233760)[sext_i32_i64(squot32(local_tid_233750,\n                                                                                            32)) -\n                                                                       (int64_t) 1];\n                            x_216789 = ((__local\n                                         double *) red_arr_mem_233762)[sext_i32_i64(squot32(local_tid_233750,\n                                                                                            32)) -\n       ",
                   "                                                                (int64_t) 1];\n                        }\n                    }\n                    // perform operation\n                    {\n                        bool inactive_233796 =\n                             slt64(srem64(sext_i32_i64(local_tid_233750),\n                                          q_s_203493),\n                                   sext_i32_i64(local_tid_233750) -\n                                   sext_i32_i64(squot32(local_tid_233750, 32) *\n                                   32 - 1));\n                        \n                        if (!no_carry_in_233795) {\n                            if (inactive_233796) {\n                                x_216785 = x_216790;\n                                x_216786 = x_216791;\n                                x_216787 = x_216792;\n                                x_216788 = x_216793;\n                                x_216789 = x_216794;\n                            }\n                        }\n                        if (!no_carry_in_233795) {\n                            if (!inactive_233796) {\n                                double defunc_1_op_res_216795 = x_216785 +\n                                       x_216790;\n                                double defunc_1_op_res_216796 = x_216786 +\n                                       x_216791;\n                                double defunc_1_op_res_216797 = x_216787 +\n                                       x_216792;\n                                double defunc_1_op_res_216798 = x_216788 +\n                                       x_216793;\n                                double defunc_1_op_res_216799 = x_216789 +\n                                       x_216794;\n                                \n                                x_216785 = defunc_1_op_res_216795;\n                                x_216786 = defunc_1_op_res_216796;\n                                x_216787 = defunc_1_op_res_216797;\n                                x_216",
                   "788 = defunc_1_op_res_216798;\n                                x_216789 = defunc_1_op_res_216799;\n                            }\n                        }\n                    }\n                    // write final result\n                    {\n                        if (!no_carry_in_233795) {\n                            ((__local\n                              double *) red_arr_mem_233754)[sext_i32_i64(local_tid_233750)] =\n                                x_216785;\n                            ((__local\n                              double *) red_arr_mem_233756)[sext_i32_i64(local_tid_233750)] =\n                                x_216786;\n                            ((__local\n                              double *) red_arr_mem_233758)[sext_i32_i64(local_tid_233750)] =\n                                x_216787;\n                            ((__local\n                              double *) red_arr_mem_233760)[sext_i32_i64(local_tid_233750)] =\n                                x_216788;\n                            ((__local\n                              double *) red_arr_mem_233762)[sext_i32_i64(local_tid_233750)] =\n                                x_216789;\n                        }\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // restore correct values for first block\n                {\n                    if (squot32(local_tid_233750, 32) == 0 &&\n                        ltid_in_bounds_233788) {\n                        ((__local\n                          double *) red_arr_mem_233754)[sext_i32_i64(local_tid_233750)] =\n                            x_216790;\n                        ((__local\n                          double *) red_arr_mem_233756)[sext_i32_i64(local_tid_233750)] =\n                            x_216791;\n                        ((__local\n                          double *) red_arr_mem_233758)[sext_i32_i64(local_tid_233750)] =\n                            x_216792;\n                        ((__local\n                     ",
                   "     double *) red_arr_mem_233760)[sext_i32_i64(local_tid_233750)] =\n                            x_216793;\n                        ((__local\n                          double *) red_arr_mem_233762)[sext_i32_i64(local_tid_233750)] =\n                            x_216794;\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_233766) *\n                      squot64(segred_group_sizze_216772,\n                              segment_sizze_nonzzero_233747) +\n                      sext_i32_i64(local_tid_233750), partition_sizze_203577 *\n                      n_p_203492 * s_n_m_203636) &&\n                slt64(sext_i32_i64(local_tid_233750),\n                      squot64(segred_group_sizze_216772,\n                              segment_sizze_nonzzero_233747))) {\n                double tmp_233797;\n                \n                tmp_233797 = ((__local\n                               double *) red_arr_mem_233754)[(sext_i32_i64(local_tid_233750) +\n                                                              (int64_t) 1) *\n                                                             segment_sizze_nonzzero_233747 -\n                                                             (int64_t) 1];\n                ((__global\n                  double *) mem_230322)[squot64(sext_i32_i64(virt_group_id_233766) *\n                                                squot64(segred_group_sizze_216772,\n                                                        segment_sizze_nonzzero_233747) +\n                                                sext_i32_i64(local_tid_233750),\n                                                n_p_203492 * s_n_m_203636) *\n                                        (s_n_m_203636 * n_p_203492) +\n                                        squot64(sext_i32_i64(virt_group_id_233766) *\n                   ",
                   "                             squot64(segred_group_sizze_216772,\n                                                        segment_sizze_nonzzero_233747) +\n                                                sext_i32_i64(local_tid_233750) -\n                                                squot64(sext_i32_i64(virt_group_id_233766) *\n                                                        squot64(segred_group_sizze_216772,\n                                                                segment_sizze_nonzzero_233747) +\n                                                        sext_i32_i64(local_tid_233750),\n                                                        n_p_203492 *\n                                                        s_n_m_203636) *\n                                                (n_p_203492 * s_n_m_203636),\n                                                s_n_m_203636) * s_n_m_203636 +\n                                        (sext_i32_i64(virt_group_id_233766) *\n                                         squot64(segred_group_sizze_216772,\n                                                 segment_sizze_nonzzero_233747) +\n                                         sext_i32_i64(local_tid_233750) -\n                                         squot64(sext_i32_i64(virt_group_id_233766) *\n                                                 squot64(segred_group_sizze_216772,\n                                                         segment_sizze_nonzzero_233747) +\n                                                 sext_i32_i64(local_tid_233750),\n                                                 n_p_203492 * s_n_m_203636) *\n                                         (n_p_203492 * s_n_m_203636) -\n                                         squot64(sext_i32_i64(virt_group_id_233766) *\n                                                 squot64(segred_group_sizze_216772,\n                                                         segment_sizze_nonzzero_233747) +\n                                        ",
                   "         sext_i32_i64(local_tid_233750) -\n                                                 squot64(sext_i32_i64(virt_group_id_233766) *\n                                                         squot64(segred_group_sizze_216772,\n                                                                 segment_sizze_nonzzero_233747) +\n                                                         sext_i32_i64(local_tid_233750),\n                                                         n_p_203492 *\n                                                         s_n_m_203636) *\n                                                 (n_p_203492 * s_n_m_203636),\n                                                 s_n_m_203636) *\n                                         s_n_m_203636)] = tmp_233797;\n                \n                double tmp_233798;\n                \n                tmp_233798 = ((__local\n                               double *) red_arr_mem_233756)[(sext_i32_i64(local_tid_233750) +\n                                                              (int64_t) 1) *\n                                                             segment_sizze_nonzzero_233747 -\n                                                             (int64_t) 1];\n                ((__global\n                  double *) mem_230327)[squot64(sext_i32_i64(virt_group_id_233766) *\n                                                squot64(segred_group_sizze_216772,\n                                                        segment_sizze_nonzzero_233747) +\n                                                sext_i32_i64(local_tid_233750),\n                                                n_p_203492 * s_n_m_203636) *\n                                        (s_n_m_203636 * n_p_203492) +\n                                        squot64(sext_i32_i64(virt_group_id_233766) *\n                                                squot64(segred_group_sizze_216772,\n                                                        segment_sizze_nonzzero_233747) +\n             ",
                   "                                   sext_i32_i64(local_tid_233750) -\n                                                squot64(sext_i32_i64(virt_group_id_233766) *\n                                                        squot64(segred_group_sizze_216772,\n                                                                segment_sizze_nonzzero_233747) +\n                                                        sext_i32_i64(local_tid_233750),\n                                                        n_p_203492 *\n                                                        s_n_m_203636) *\n                                                (n_p_203492 * s_n_m_203636),\n                                                s_n_m_203636) * s_n_m_203636 +\n                                        (sext_i32_i64(virt_group_id_233766) *\n                                         squot64(segred_group_sizze_216772,\n                                                 segment_sizze_nonzzero_233747) +\n                                         sext_i32_i64(local_tid_233750) -\n                                         squot64(sext_i32_i64(virt_group_id_233766) *\n                                                 squot64(segred_group_sizze_216772,\n                                                         segment_sizze_nonzzero_233747) +\n                                                 sext_i32_i64(local_tid_233750),\n                                                 n_p_203492 * s_n_m_203636) *\n                                         (n_p_203492 * s_n_m_203636) -\n                                         squot64(sext_i32_i64(virt_group_id_233766) *\n                                                 squot64(segred_group_sizze_216772,\n                                                         segment_sizze_nonzzero_233747) +\n                                                 sext_i32_i64(local_tid_233750) -\n                                                 squot64(sext_i32_i64(virt_group_id_233766) *\n                              ",
                   "                           squot64(segred_group_sizze_216772,\n                                                                 segment_sizze_nonzzero_233747) +\n                                                         sext_i32_i64(local_tid_233750),\n                                                         n_p_203492 *\n                                                         s_n_m_203636) *\n                                                 (n_p_203492 * s_n_m_203636),\n                                                 s_n_m_203636) *\n                                         s_n_m_203636)] = tmp_233798;\n                \n                double tmp_233799;\n                \n                tmp_233799 = ((__local\n                               double *) red_arr_mem_233758)[(sext_i32_i64(local_tid_233750) +\n                                                              (int64_t) 1) *\n                                                             segment_sizze_nonzzero_233747 -\n                                                             (int64_t) 1];\n                ((__global\n                  double *) mem_230332)[squot64(sext_i32_i64(virt_group_id_233766) *\n                                                squot64(segred_group_sizze_216772,\n                                                        segment_sizze_nonzzero_233747) +\n                                                sext_i32_i64(local_tid_233750),\n                                                n_p_203492 * s_n_m_203636) *\n                                        (s_n_m_203636 * n_p_203492) +\n                                        squot64(sext_i32_i64(virt_group_id_233766) *\n                                                squot64(segred_group_sizze_216772,\n                                                        segment_sizze_nonzzero_233747) +\n                                                sext_i32_i64(local_tid_233750) -\n                                                squot64(sext_i32_i64(virt_group_id_233766) *\n     ",
                   "                                                   squot64(segred_group_sizze_216772,\n                                                                segment_sizze_nonzzero_233747) +\n                                                        sext_i32_i64(local_tid_233750),\n                                                        n_p_203492 *\n                                                        s_n_m_203636) *\n                                                (n_p_203492 * s_n_m_203636),\n                                                s_n_m_203636) * s_n_m_203636 +\n                                        (sext_i32_i64(virt_group_id_233766) *\n                                         squot64(segred_group_sizze_216772,\n                                                 segment_sizze_nonzzero_233747) +\n                                         sext_i32_i64(local_tid_233750) -\n                                         squot64(sext_i32_i64(virt_group_id_233766) *\n                                                 squot64(segred_group_sizze_216772,\n                                                         segment_sizze_nonzzero_233747) +\n                                                 sext_i32_i64(local_tid_233750),\n                                                 n_p_203492 * s_n_m_203636) *\n                                         (n_p_203492 * s_n_m_203636) -\n                                         squot64(sext_i32_i64(virt_group_id_233766) *\n                                                 squot64(segred_group_sizze_216772,\n                                                         segment_sizze_nonzzero_233747) +\n                                                 sext_i32_i64(local_tid_233750) -\n                                                 squot64(sext_i32_i64(virt_group_id_233766) *\n                                                         squot64(segred_group_sizze_216772,\n                                                                 segment_sizze_nonzzero_233747) +\n      ",
                   "                                                   sext_i32_i64(local_tid_233750),\n                                                         n_p_203492 *\n                                                         s_n_m_203636) *\n                                                 (n_p_203492 * s_n_m_203636),\n                                                 s_n_m_203636) *\n                                         s_n_m_203636)] = tmp_233799;\n                \n                double tmp_233800;\n                \n                tmp_233800 = ((__local\n                               double *) red_arr_mem_233760)[(sext_i32_i64(local_tid_233750) +\n                                                              (int64_t) 1) *\n                                                             segment_sizze_nonzzero_233747 -\n                                                             (int64_t) 1];\n                ((__global\n                  double *) mem_230337)[squot64(sext_i32_i64(virt_group_id_233766) *\n                                                squot64(segred_group_sizze_216772,\n                                                        segment_sizze_nonzzero_233747) +\n                                                sext_i32_i64(local_tid_233750),\n                                                n_p_203492 * s_n_m_203636) *\n                                        (s_n_m_203636 * n_p_203492) +\n                                        squot64(sext_i32_i64(virt_group_id_233766) *\n                                                squot64(segred_group_sizze_216772,\n                                                        segment_sizze_nonzzero_233747) +\n                                                sext_i32_i64(local_tid_233750) -\n                                                squot64(sext_i32_i64(virt_group_id_233766) *\n                                                        squot64(segred_group_sizze_216772,\n                                                                segment_sizze_no",
                   "nzzero_233747) +\n                                                        sext_i32_i64(local_tid_233750),\n                                                        n_p_203492 *\n                                                        s_n_m_203636) *\n                                                (n_p_203492 * s_n_m_203636),\n                                                s_n_m_203636) * s_n_m_203636 +\n                                        (sext_i32_i64(virt_group_id_233766) *\n                                         squot64(segred_group_sizze_216772,\n                                                 segment_sizze_nonzzero_233747) +\n                                         sext_i32_i64(local_tid_233750) -\n                                         squot64(sext_i32_i64(virt_group_id_233766) *\n                                                 squot64(segred_group_sizze_216772,\n                                                         segment_sizze_nonzzero_233747) +\n                                                 sext_i32_i64(local_tid_233750),\n                                                 n_p_203492 * s_n_m_203636) *\n                                         (n_p_203492 * s_n_m_203636) -\n                                         squot64(sext_i32_i64(virt_group_id_233766) *\n                                                 squot64(segred_group_sizze_216772,\n                                                         segment_sizze_nonzzero_233747) +\n                                                 sext_i32_i64(local_tid_233750) -\n                                                 squot64(sext_i32_i64(virt_group_id_233766) *\n                                                         squot64(segred_group_sizze_216772,\n                                                                 segment_sizze_nonzzero_233747) +\n                                                         sext_i32_i64(local_tid_233750),\n                                                         n_p_203492 *\n             ",
                   "                                            s_n_m_203636) *\n                                                 (n_p_203492 * s_n_m_203636),\n                                                 s_n_m_203636) *\n                                         s_n_m_203636)] = tmp_233800;\n                \n                double tmp_233801;\n                \n                tmp_233801 = ((__local\n                               double *) red_arr_mem_233762)[(sext_i32_i64(local_tid_233750) +\n                                                              (int64_t) 1) *\n                                                             segment_sizze_nonzzero_233747 -\n                                                             (int64_t) 1];\n                ((__global\n                  double *) mem_230342)[squot64(sext_i32_i64(virt_group_id_233766) *\n                                                squot64(segred_group_sizze_216772,\n                                                        segment_sizze_nonzzero_233747) +\n                                                sext_i32_i64(local_tid_233750),\n                                                n_p_203492 * s_n_m_203636) *\n                                        (s_n_m_203636 * n_p_203492) +\n                                        squot64(sext_i32_i64(virt_group_id_233766) *\n                                                squot64(segred_group_sizze_216772,\n                                                        segment_sizze_nonzzero_233747) +\n                                                sext_i32_i64(local_tid_233750) -\n                                                squot64(sext_i32_i64(virt_group_id_233766) *\n                                                        squot64(segred_group_sizze_216772,\n                                                                segment_sizze_nonzzero_233747) +\n                                                        sext_i32_i64(local_tid_233750),\n                                                        n_p_2",
                   "03492 *\n                                                        s_n_m_203636) *\n                                                (n_p_203492 * s_n_m_203636),\n                                                s_n_m_203636) * s_n_m_203636 +\n                                        (sext_i32_i64(virt_group_id_233766) *\n                                         squot64(segred_group_sizze_216772,\n                                                 segment_sizze_nonzzero_233747) +\n                                         sext_i32_i64(local_tid_233750) -\n                                         squot64(sext_i32_i64(virt_group_id_233766) *\n                                                 squot64(segred_group_sizze_216772,\n                                                         segment_sizze_nonzzero_233747) +\n                                                 sext_i32_i64(local_tid_233750),\n                                                 n_p_203492 * s_n_m_203636) *\n                                         (n_p_203492 * s_n_m_203636) -\n                                         squot64(sext_i32_i64(virt_group_id_233766) *\n                                                 squot64(segred_group_sizze_216772,\n                                                         segment_sizze_nonzzero_233747) +\n                                                 sext_i32_i64(local_tid_233750) -\n                                                 squot64(sext_i32_i64(virt_group_id_233766) *\n                                                         squot64(segred_group_sizze_216772,\n                                                                 segment_sizze_nonzzero_233747) +\n                                                         sext_i32_i64(local_tid_233750),\n                                                         n_p_203492 *\n                                                         s_n_m_203636) *\n                                                 (n_p_203492 * s_n_m_203636),\n                            ",
                   "                     s_n_m_203636) *\n                                         s_n_m_203636)] = tmp_233801;\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_216772\n}\n__kernel void mainzisegred_small_216907(__global int *global_failure,\n                                        __local volatile\n                                        int64_t *red_arr_mem_233900_backing_aligned_0,\n                                        __local volatile\n                                        int64_t *red_arr_mem_233898_backing_aligned_1,\n                                        int64_t n_p_203492, int64_t q_s_203493,\n                                        int64_t partition_sizze_203577,\n                                        int64_t defunc_0_f_res_203631,\n                                        int64_t s_n_m_203636,\n                                        int64_t num_groups_216899,\n                                        int64_t segment_sizze_nonzzero_233891,\n                                        __global unsigned char *ext_mem_229264,\n                                        __global unsigned char *ext_mem_229265,\n                                        __global unsigned char *ext_mem_229362,\n                                        __global unsigned char *ext_mem_229363,\n                                        __global unsigned char *mem_229526,\n                                        __global unsigned char *mem_229531,\n                                        __global unsigned char *mem_230348,\n                                        __global unsigned char *mem_230353,\n                                        __global unsigned char *mem_230358,\n                                        __global unsigned char *mem_230363,\n                                        __global unsigned char *mem_230368,\n                                        __global unsigne",
                   "d char *mem_230373,\n                                        __global unsigned char *mem_230379,\n                                        __global unsigned char *mem_230384)\n{\n    #define segred_group_sizze_216898 (mainzisegred_group_sizze_215343)\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_233900_backing_1 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_233900_backing_aligned_0;\n    __local volatile unsigned char *restrict red_arr_mem_233898_backing_0 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_233898_backing_aligned_1;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_233893;\n    int32_t local_tid_233894;\n    int64_t group_sizze_233897;\n    int32_t wave_sizze_233896;\n    int32_t group_tid_233895;\n    \n    global_tid_233893 = get_global_id(0);\n    local_tid_233894 = get_local_id(0);\n    group_sizze_233897 = get_local_size(0);\n    wave_sizze_233896 = LOCKSTEP_WIDTH;\n    group_tid_233895 = get_group_id(0);\n    \n    int32_t phys_tid_216907 = global_tid_233893;\n    __local unsigned char *red_arr_mem_233898;\n    \n    red_arr_mem_233898 = (__local unsigned char *) red_arr_mem_233898_backing_0;\n    \n    __local unsigned char *red_arr_mem_233900;\n    \n    red_arr_mem_233900 = (__local unsigned char *) red_arr_mem_233900_backing_1;\n    \n    int32_t phys_group_id_233902;\n    \n    phys_group_id_233902 = get_group_id(0);\n    for (int32_t i_233903 = 0; i_233903 <\n         sdiv_up32(sext_i64_i32(sdiv_up64(partition_sizze_203577 * n_p_203492 *\n                                          s_n_m_203636,\n                                          squot64(segred_group_sizze_216898,\n                                                  segment_sizze_nonzzero_233891))) -\n                   phys_group_id_233902, sext",
                   "_i64_i32(num_groups_216899));\n         i_233903++) {\n        int32_t virt_group_id_233904 = phys_group_id_233902 + i_233903 *\n                sext_i64_i32(num_groups_216899);\n        int64_t slice_233905 = s_n_m_203636;\n        int64_t slice_233906 = n_p_203492 * slice_233905;\n        int64_t slice_233907 = partition_sizze_203577 * slice_233906;\n        int64_t gtid_216903 = squot64(squot64(sext_i32_i64(local_tid_233894),\n                                              segment_sizze_nonzzero_233891) +\n                                      sext_i32_i64(virt_group_id_233904) *\n                                      squot64(segred_group_sizze_216898,\n                                              segment_sizze_nonzzero_233891),\n                                      slice_233906);\n        int64_t remnant_233908 = squot64(sext_i32_i64(local_tid_233894),\n                                         segment_sizze_nonzzero_233891) +\n                sext_i32_i64(virt_group_id_233904) *\n                squot64(segred_group_sizze_216898,\n                        segment_sizze_nonzzero_233891) - gtid_216903 *\n                slice_233906;\n        int64_t gtid_216904 = squot64(remnant_233908, slice_233905);\n        int64_t remnant_233909 = remnant_233908 - gtid_216904 * slice_233905;\n        int64_t gtid_216905 = remnant_233909;\n        int64_t remnant_233910 = remnant_233909 - gtid_216905;\n        int64_t gtid_216906 = srem64(sext_i32_i64(local_tid_233894),\n                                     q_s_203493);\n        \n        // apply map function if in bounds\n        {\n            if (slt64((int64_t) 0, q_s_203493) && (((slt64(gtid_216903,\n                                                           partition_sizze_203577) &&\n                                                     slt64(gtid_216904,\n                                                           n_p_203492)) &&\n                                                    slt64(gtid_216905,\n                                                   ",
                   "       s_n_m_203636)) &&\n                                                   slt64(sext_i32_i64(local_tid_233894),\n                                                         q_s_203493 *\n                                                         squot64(segred_group_sizze_216898,\n                                                                 segment_sizze_nonzzero_233891)))) {\n                int64_t x_216929;\n                \n                x_216929 = ((__global int64_t *) ext_mem_229264)[gtid_216903 *\n                                                                 n_p_203492 +\n                                                                 gtid_216904];\n                \n                int64_t x_216938;\n                \n                x_216938 = ((__global int64_t *) ext_mem_229363)[gtid_216903 *\n                                                                 (s_n_m_203636 *\n                                                                  n_p_203492) +\n                                                                 gtid_216904 *\n                                                                 s_n_m_203636 +\n                                                                 gtid_216905];\n                \n                double x_216939;\n                \n                x_216939 = ((__global double *) ext_mem_229362)[gtid_216903 *\n                                                                (s_n_m_203636 *\n                                                                 n_p_203492) +\n                                                                gtid_216904 *\n                                                                s_n_m_203636 +\n                                                                gtid_216905];\n                \n                double a12_216940;\n                \n                a12_216940 = ((__global double *) mem_230348)[gtid_216903 *\n                                                              (s_n_m_203636 *\n                            ",
                   "                                   n_p_203492) +\n                                                              gtid_216904 *\n                                                              s_n_m_203636 +\n                                                              gtid_216905];\n                \n                double b12_216941;\n                \n                b12_216941 = ((__global double *) mem_230353)[gtid_216903 *\n                                                              (s_n_m_203636 *\n                                                               n_p_203492) +\n                                                              gtid_216904 *\n                                                              s_n_m_203636 +\n                                                              gtid_216905];\n                \n                double c12_216942;\n                \n                c12_216942 = ((__global double *) mem_230358)[gtid_216903 *\n                                                              (s_n_m_203636 *\n                                                               n_p_203492) +\n                                                              gtid_216904 *\n                                                              s_n_m_203636 +\n                                                              gtid_216905];\n                \n                double b2_216943;\n                \n                b2_216943 = ((__global double *) mem_230363)[gtid_216903 *\n                                                             (s_n_m_203636 *\n                                                              n_p_203492) +\n                                                             gtid_216904 *\n                                                             s_n_m_203636 +\n                                                             gtid_216905];\n                \n                double c2_216944;\n                \n                c2_216944 = ((__global double *) mem_230368)[gtid_216903 *",
                   "\n                                                             (s_n_m_203636 *\n                                                              n_p_203492) +\n                                                             gtid_216904 *\n                                                             s_n_m_203636 +\n                                                             gtid_216905];\n                \n                int64_t defunc_0_m_fun_res_216945;\n                \n                defunc_0_m_fun_res_216945 = ((__global\n                                              int64_t *) mem_230373)[gtid_216903 *\n                                                                     (s_n_m_203636 *\n                                                                      n_p_203492) +\n                                                                     gtid_216904 *\n                                                                     s_n_m_203636 +\n                                                                     gtid_216905];\n                \n                bool cond_216947 = sle64(x_216929, gtid_216906);\n                int64_t defunc_0_f_res_216948;\n                \n                if (cond_216947) {\n                    defunc_0_f_res_216948 = (int64_t) 0;\n                } else {\n                    int64_t i_216949 = add64(gtid_216906, x_216938);\n                    int64_t defunc_0_add_arg_216950;\n                    \n                    defunc_0_add_arg_216950 = ((__global\n                                                int64_t *) ext_mem_229265)[gtid_216903 *\n                                                                           (defunc_0_f_res_203631 *\n                                                                            n_p_203492) +\n                                                                           gtid_216904 *\n                                                                           defunc_0_f_res_203631 +\n                                                ",
                   "                           i_216949];\n                    \n                    int64_t defunc_1_add_res_216951 = add64((int64_t) 1,\n                                                            defunc_0_add_arg_216950);\n                    \n                    defunc_0_f_res_216948 = defunc_1_add_res_216951;\n                }\n                \n                double defunc_0_f_res_216952;\n                \n                if (cond_216947) {\n                    defunc_0_f_res_216952 = 0.0;\n                } else {\n                    int64_t i_216953 = add64(gtid_216906, x_216938);\n                    double defunc_0_add_arg_216954;\n                    \n                    defunc_0_add_arg_216954 = ((__global\n                                                double *) mem_229531)[gtid_216903 *\n                                                                      (defunc_0_f_res_203631 *\n                                                                       n_p_203492) +\n                                                                      gtid_216904 *\n                                                                      defunc_0_f_res_203631 +\n                                                                      i_216953];\n                    defunc_0_f_res_216952 = defunc_0_add_arg_216954;\n                }\n                \n                int64_t binop_p_216955 = sub64(defunc_0_f_res_216948,\n                                               defunc_0_m_fun_res_216945);\n                double defunc_0_f_res_216956 = sitofp_i64_f64(binop_p_216955);\n                double abs_res_216957 = fabs(defunc_0_f_res_216956);\n                double tmp1_216958 = abs_res_216957 / x_216939;\n                double x_216959 = tmp1_216958 * tmp1_216958;\n                double y_216960 = tmp1_216958 * x_216959;\n                double tmp2_216961 = 1.0 - y_216960;\n                double x_216962 = tmp2_216961 * tmp2_216961;\n                double tmp3_216963 = tmp2_216961 * x_216962;\n        ",
                   "        double tmp4_216964 = defunc_0_f_res_216952 * tmp3_216963;\n                double defunc_1_f_res_216965 = defunc_0_f_res_216956 *\n                       tmp4_216964;\n                double defunc_1_f_res_216966 = defunc_0_f_res_216956 *\n                       defunc_1_f_res_216965;\n                double defunc_0_f_res_216967;\n                \n                if (cond_216947) {\n                    defunc_0_f_res_216967 = 0.0;\n                } else {\n                    int64_t i_216968 = add64(gtid_216906, x_216938);\n                    double defunc_0_add_arg_216969;\n                    \n                    defunc_0_add_arg_216969 = ((__global\n                                                double *) mem_229526)[gtid_216903 *\n                                                                      (defunc_0_f_res_203631 *\n                                                                       n_p_203492) +\n                                                                      gtid_216904 *\n                                                                      defunc_0_f_res_203631 +\n                                                                      i_216968];\n                    defunc_0_f_res_216967 = defunc_0_add_arg_216969;\n                }\n                \n                double x_216970 = a12_216940 * tmp4_216964;\n                double y_216971 = b12_216941 * defunc_1_f_res_216965;\n                double x_216972 = x_216970 + y_216971;\n                double y_216973 = c12_216942 * defunc_1_f_res_216966;\n                double x_216974 = x_216972 + y_216973;\n                double defunc_9_fit_fun_res_216975 = defunc_0_f_res_216967 *\n                       x_216974;\n                double x_216976 = b12_216941 * tmp4_216964;\n                double y_216977 = b2_216943 * defunc_1_f_res_216965;\n                double x_216978 = x_216976 + y_216977;\n                double y_216979 = c2_216944 * defunc_1_f_res_216966;\n                double x_216980 = x_216",
                   "978 + y_216979;\n                double defunc_9_slope_fun_res_216981 = defunc_0_f_res_216967 *\n                       x_216980;\n                \n                // save map-out results\n                { }\n                // save results to be reduced\n                {\n                    ((__local\n                      double *) red_arr_mem_233898)[sext_i32_i64(local_tid_233894)] =\n                        defunc_9_fit_fun_res_216975;\n                    ((__local\n                      double *) red_arr_mem_233900)[sext_i32_i64(local_tid_233894)] =\n                        defunc_9_slope_fun_res_216981;\n                }\n            } else {\n                ((__local\n                  double *) red_arr_mem_233898)[sext_i32_i64(local_tid_233894)] =\n                    0.0;\n                ((__local\n                  double *) red_arr_mem_233900)[sext_i32_i64(local_tid_233894)] =\n                    0.0;\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        if (slt64((int64_t) 0, q_s_203493)) {\n            // perform segmented scan to imitate reduction\n            {\n                double x_216908;\n                double x_216909;\n                double x_216910;\n                double x_216911;\n                double x_233911;\n                double x_233912;\n                double x_233913;\n                double x_233914;\n                bool ltid_in_bounds_233917 =\n                     slt64(sext_i32_i64(local_tid_233894), q_s_203493 *\n                           squot64(segred_group_sizze_216898,\n                                   segment_sizze_nonzzero_233891));\n                int32_t skip_threads_233918;\n                \n                // read input for in-block scan\n                {\n                    if (ltid_in_bounds_233917) {\n                        x_216910 = ((volatile __local\n                                     double *) red_arr_mem_233898)[sext_i32_i64(local_tid_233894)];\n                        x_216911 = ((volatile __local\n         ",
                   "                            double *) red_arr_mem_233900)[sext_i32_i64(local_tid_233894)];\n                        if ((local_tid_233894 - squot32(local_tid_233894, 32) *\n                             32) == 0) {\n                            x_216908 = x_216910;\n                            x_216909 = x_216911;\n                        }\n                    }\n                }\n                // in-block scan (hopefully no barriers needed)\n                {\n                    skip_threads_233918 = 1;\n                    while (slt32(skip_threads_233918, 32)) {\n                        bool thread_active_233919 = sle32(skip_threads_233918,\n                                                          local_tid_233894 -\n                                                          squot32(local_tid_233894,\n                                                                  32) * 32) &&\n                             ltid_in_bounds_233917;\n                        \n                        if (thread_active_233919) {\n                            // read operands\n                            {\n                                x_216908 = ((volatile __local\n                                             double *) red_arr_mem_233898)[sext_i32_i64(local_tid_233894) -\n                                                                           sext_i32_i64(skip_threads_233918)];\n                                x_216909 = ((volatile __local\n                                             double *) red_arr_mem_233900)[sext_i32_i64(local_tid_233894) -\n                                                                           sext_i32_i64(skip_threads_233918)];\n                            }\n                        }\n                        // perform operation\n                        {\n                            bool inactive_233920 =\n                                 slt64(srem64(sext_i32_i64(local_tid_233894),\n                                              q_s_203493),\n                                    ",
                   "   sext_i32_i64(local_tid_233894) -\n                                       sext_i32_i64(local_tid_233894 -\n                                       skip_threads_233918));\n                            \n                            if (thread_active_233919 && inactive_233920) {\n                                x_216908 = x_216910;\n                                x_216909 = x_216911;\n                            }\n                            if (thread_active_233919) {\n                                if (!inactive_233920) {\n                                    double defunc_1_op_res_216912 = x_216908 +\n                                           x_216910;\n                                    double defunc_1_op_res_216913 = x_216909 +\n                                           x_216911;\n                                    \n                                    x_216908 = defunc_1_op_res_216912;\n                                    x_216909 = defunc_1_op_res_216913;\n                                }\n                            }\n                        }\n                        if (sle32(wave_sizze_233896, skip_threads_233918)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        if (thread_active_233919) {\n                            // write result\n                            {\n                                ((volatile __local\n                                  double *) red_arr_mem_233898)[sext_i32_i64(local_tid_233894)] =\n                                    x_216908;\n                                x_216910 = x_216908;\n                                ((volatile __local\n                                  double *) red_arr_mem_233900)[sext_i32_i64(local_tid_233894)] =\n                                    x_216909;\n                                x_216911 = x_216909;\n                            }\n                        }\n                        if (sle32(wave_sizze_233896, skip_threads_233918)) {\n                            ba",
                   "rrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        skip_threads_233918 *= 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_233894 - squot32(local_tid_233894, 32) *\n                         32) == 31 && ltid_in_bounds_233917) {\n                        ((volatile __local\n                          double *) red_arr_mem_233898)[sext_i32_i64(squot32(local_tid_233894,\n                                                                             32))] =\n                            x_216908;\n                        ((volatile __local\n                          double *) red_arr_mem_233900)[sext_i32_i64(squot32(local_tid_233894,\n                                                                             32))] =\n                            x_216909;\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_233921;\n                    \n                    // read input for in-block scan\n                    {\n                        if (squot32(local_tid_233894, 32) == 0 &&\n                            ltid_in_bounds_233917) {\n                            x_233913 = ((volatile __local\n                                         double *) red_arr_mem_233898)[sext_i32_i64(local_tid_233894)];\n                            x_233914 = ((volatile __local\n                                         double *) red_arr_mem_233900)[sext_i32_i64(local_tid_233894)];\n                            if ((local_tid_233894 - squot32(local_tid_233894,\n                                                            32) * 32) == 0) {\n                                x_233911 = x_233913;\n                                x_233912 = x_233914;\n    ",
                   "                        }\n                        }\n                    }\n                    // in-block scan (hopefully no barriers needed)\n                    {\n                        skip_threads_233921 = 1;\n                        while (slt32(skip_threads_233921, 32)) {\n                            bool thread_active_233922 =\n                                 sle32(skip_threads_233921, local_tid_233894 -\n                                       squot32(local_tid_233894, 32) * 32) &&\n                                 (squot32(local_tid_233894, 32) == 0 &&\n                                  ltid_in_bounds_233917);\n                            \n                            if (thread_active_233922) {\n                                // read operands\n                                {\n                                    x_233911 = ((volatile __local\n                                                 double *) red_arr_mem_233898)[sext_i32_i64(local_tid_233894) -\n                                                                               sext_i32_i64(skip_threads_233921)];\n                                    x_233912 = ((volatile __local\n                                                 double *) red_arr_mem_233900)[sext_i32_i64(local_tid_233894) -\n                                                                               sext_i32_i64(skip_threads_233921)];\n                                }\n                            }\n                            // perform operation\n                            {\n                                bool inactive_233923 =\n                                     slt64(srem64(sext_i32_i64(local_tid_233894 *\n                                                  32 + 32 - 1), q_s_203493),\n                                           sext_i32_i64(local_tid_233894 * 32 +\n                                           32 - 1) -\n                                           sext_i32_i64((local_tid_233894 -\n                                                         sk",
                   "ip_threads_233921) *\n                                           32 + 32 - 1));\n                                \n                                if (thread_active_233922 && inactive_233923) {\n                                    x_233911 = x_233913;\n                                    x_233912 = x_233914;\n                                }\n                                if (thread_active_233922) {\n                                    if (!inactive_233923) {\n                                        double defunc_1_op_res_233915 =\n                                               x_233911 + x_233913;\n                                        double defunc_1_op_res_233916 =\n                                               x_233912 + x_233914;\n                                        \n                                        x_233911 = defunc_1_op_res_233915;\n                                        x_233912 = defunc_1_op_res_233916;\n                                    }\n                                }\n                            }\n                            if (sle32(wave_sizze_233896, skip_threads_233921)) {\n                                barrier(CLK_LOCAL_MEM_FENCE);\n                            }\n                            if (thread_active_233922) {\n                                // write result\n                                {\n                                    ((volatile __local\n                                      double *) red_arr_mem_233898)[sext_i32_i64(local_tid_233894)] =\n                                        x_233911;\n                                    x_233913 = x_233911;\n                                    ((volatile __local\n                                      double *) red_arr_mem_233900)[sext_i32_i64(local_tid_233894)] =\n                                        x_233912;\n                                    x_233914 = x_233912;\n                                }\n                            }\n                            if (sle32(wave_sizze_233896, skip_thr",
                   "eads_233921)) {\n                                barrier(CLK_LOCAL_MEM_FENCE);\n                            }\n                            skip_threads_233921 *= 2;\n                        }\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                \n                bool no_carry_in_233924 = squot32(local_tid_233894, 32) == 0 ||\n                     !ltid_in_bounds_233917;\n                \n                // carry-in for every block except the first\n                {\n                    // read operands\n                    {\n                        if (!no_carry_in_233924) {\n                            x_216910 = x_216908;\n                            x_216911 = x_216909;\n                            x_216908 = ((__local\n                                         double *) red_arr_mem_233898)[sext_i32_i64(squot32(local_tid_233894,\n                                                                                            32)) -\n                                                                       (int64_t) 1];\n                            x_216909 = ((__local\n                                         double *) red_arr_mem_233900)[sext_i32_i64(squot32(local_tid_233894,\n                                                                                            32)) -\n                                                                       (int64_t) 1];\n                        }\n                    }\n                    // perform operation\n                    {\n                        bool inactive_233925 =\n                             slt64(srem64(sext_i32_i64(local_tid_233894),\n                                          q_s_203493),\n                                   sext_i32_i64(local_tid_233894) -\n                                   sext_i32_i64(squot32(local_tid_233894, 32) *\n                                   32 - 1));\n                        \n                        if (!no_carry_in_233924) {\n                            if (inacti",
                   "ve_233925) {\n                                x_216908 = x_216910;\n                                x_216909 = x_216911;\n                            }\n                        }\n                        if (!no_carry_in_233924) {\n                            if (!inactive_233925) {\n                                double defunc_1_op_res_216912 = x_216908 +\n                                       x_216910;\n                                double defunc_1_op_res_216913 = x_216909 +\n                                       x_216911;\n                                \n                                x_216908 = defunc_1_op_res_216912;\n                                x_216909 = defunc_1_op_res_216913;\n                            }\n                        }\n                    }\n                    // write final result\n                    {\n                        if (!no_carry_in_233924) {\n                            ((__local\n                              double *) red_arr_mem_233898)[sext_i32_i64(local_tid_233894)] =\n                                x_216908;\n                            ((__local\n                              double *) red_arr_mem_233900)[sext_i32_i64(local_tid_233894)] =\n                                x_216909;\n                        }\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // restore correct values for first block\n                {\n                    if (squot32(local_tid_233894, 32) == 0 &&\n                        ltid_in_bounds_233917) {\n                        ((__local\n                          double *) red_arr_mem_233898)[sext_i32_i64(local_tid_233894)] =\n                            x_216910;\n                        ((__local\n                          double *) red_arr_mem_233900)[sext_i32_i64(local_tid_233894)] =\n                            x_216911;\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FEN",
                   "CE);\n        // save final values of segments\n        {\n            if (slt64(sext_i32_i64(virt_group_id_233904) *\n                      squot64(segred_group_sizze_216898,\n                              segment_sizze_nonzzero_233891) +\n                      sext_i32_i64(local_tid_233894), partition_sizze_203577 *\n                      n_p_203492 * s_n_m_203636) &&\n                slt64(sext_i32_i64(local_tid_233894),\n                      squot64(segred_group_sizze_216898,\n                              segment_sizze_nonzzero_233891))) {\n                double tmp_233926;\n                \n                tmp_233926 = ((__local\n                               double *) red_arr_mem_233898)[(sext_i32_i64(local_tid_233894) +\n                                                              (int64_t) 1) *\n                                                             segment_sizze_nonzzero_233891 -\n                                                             (int64_t) 1];\n                ((__global\n                  double *) mem_230379)[squot64(sext_i32_i64(virt_group_id_233904) *\n                                                squot64(segred_group_sizze_216898,\n                                                        segment_sizze_nonzzero_233891) +\n                                                sext_i32_i64(local_tid_233894),\n                                                n_p_203492 * s_n_m_203636) *\n                                        (s_n_m_203636 * n_p_203492) +\n                                        squot64(sext_i32_i64(virt_group_id_233904) *\n                                                squot64(segred_group_sizze_216898,\n                                                        segment_sizze_nonzzero_233891) +\n                                                sext_i32_i64(local_tid_233894) -\n                                                squot64(sext_i32_i64(virt_group_id_233904) *\n                                                        squot64(segred_group_sizze_21",
                   "6898,\n                                                                segment_sizze_nonzzero_233891) +\n                                                        sext_i32_i64(local_tid_233894),\n                                                        n_p_203492 *\n                                                        s_n_m_203636) *\n                                                (n_p_203492 * s_n_m_203636),\n                                                s_n_m_203636) * s_n_m_203636 +\n                                        (sext_i32_i64(virt_group_id_233904) *\n                                         squot64(segred_group_sizze_216898,\n                                                 segment_sizze_nonzzero_233891) +\n                                         sext_i32_i64(local_tid_233894) -\n                                         squot64(sext_i32_i64(virt_group_id_233904) *\n                                                 squot64(segred_group_sizze_216898,\n                                                         segment_sizze_nonzzero_233891) +\n                                                 sext_i32_i64(local_tid_233894),\n                                                 n_p_203492 * s_n_m_203636) *\n                                         (n_p_203492 * s_n_m_203636) -\n                                         squot64(sext_i32_i64(virt_group_id_233904) *\n                                                 squot64(segred_group_sizze_216898,\n                                                         segment_sizze_nonzzero_233891) +\n                                                 sext_i32_i64(local_tid_233894) -\n                                                 squot64(sext_i32_i64(virt_group_id_233904) *\n                                                         squot64(segred_group_sizze_216898,\n                                                                 segment_sizze_nonzzero_233891) +\n                                                         sext_i32_i64(local_tid_233894",
                   "),\n                                                         n_p_203492 *\n                                                         s_n_m_203636) *\n                                                 (n_p_203492 * s_n_m_203636),\n                                                 s_n_m_203636) *\n                                         s_n_m_203636)] = tmp_233926;\n                \n                double tmp_233927;\n                \n                tmp_233927 = ((__local\n                               double *) red_arr_mem_233900)[(sext_i32_i64(local_tid_233894) +\n                                                              (int64_t) 1) *\n                                                             segment_sizze_nonzzero_233891 -\n                                                             (int64_t) 1];\n                ((__global\n                  double *) mem_230384)[squot64(sext_i32_i64(virt_group_id_233904) *\n                                                squot64(segred_group_sizze_216898,\n                                                        segment_sizze_nonzzero_233891) +\n                                                sext_i32_i64(local_tid_233894),\n                                                n_p_203492 * s_n_m_203636) *\n                                        (s_n_m_203636 * n_p_203492) +\n                                        squot64(sext_i32_i64(virt_group_id_233904) *\n                                                squot64(segred_group_sizze_216898,\n                                                        segment_sizze_nonzzero_233891) +\n                                                sext_i32_i64(local_tid_233894) -\n                                                squot64(sext_i32_i64(virt_group_id_233904) *\n                                                        squot64(segred_group_sizze_216898,\n                                                                segment_sizze_nonzzero_233891) +\n                                                        sext_i3",
                   "2_i64(local_tid_233894),\n                                                        n_p_203492 *\n                                                        s_n_m_203636) *\n                                                (n_p_203492 * s_n_m_203636),\n                                                s_n_m_203636) * s_n_m_203636 +\n                                        (sext_i32_i64(virt_group_id_233904) *\n                                         squot64(segred_group_sizze_216898,\n                                                 segment_sizze_nonzzero_233891) +\n                                         sext_i32_i64(local_tid_233894) -\n                                         squot64(sext_i32_i64(virt_group_id_233904) *\n                                                 squot64(segred_group_sizze_216898,\n                                                         segment_sizze_nonzzero_233891) +\n                                                 sext_i32_i64(local_tid_233894),\n                                                 n_p_203492 * s_n_m_203636) *\n                                         (n_p_203492 * s_n_m_203636) -\n                                         squot64(sext_i32_i64(virt_group_id_233904) *\n                                                 squot64(segred_group_sizze_216898,\n                                                         segment_sizze_nonzzero_233891) +\n                                                 sext_i32_i64(local_tid_233894) -\n                                                 squot64(sext_i32_i64(virt_group_id_233904) *\n                                                         squot64(segred_group_sizze_216898,\n                                                                 segment_sizze_nonzzero_233891) +\n                                                         sext_i32_i64(local_tid_233894),\n                                                         n_p_203492 *\n                                                         s_n_m_203636) *\n                    ",
                   "                             (n_p_203492 * s_n_m_203636),\n                                                 s_n_m_203636) *\n                                         s_n_m_203636)] = tmp_233927;\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_216898\n}\n__kernel void mainzisegred_small_218631(__global int *global_failure,\n                                        __local volatile\n                                        int64_t *red_arr_mem_234105_backing_aligned_0,\n                                        int64_t n_p_203492,\n                                        int64_t partition_sizze_203577,\n                                        int64_t C_len_203634,\n                                        int64_t num_groups_218626,\n                                        int64_t segment_sizze_nonzzero_234098,\n                                        __global unsigned char *mem_230500,\n                                        __global unsigned char *mem_230511)\n{\n    #define segred_group_sizze_218625 (mainzisegred_group_sizze_218608)\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_234105_backing_0 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_234105_backing_aligned_0;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_234100;\n    int32_t local_tid_234101;\n    int64_t group_sizze_234104;\n    int32_t wave_sizze_234103;\n    int32_t group_tid_234102;\n    \n    global_tid_234100 = get_global_id(0);\n    local_tid_234101 = get_local_id(0);\n    group_sizze_234104 = get_local_size(0);\n    wave_sizze_234103 = LOCKSTEP_WIDTH;\n    group_tid_234102 = get_group_id(0);\n    \n    int32_t phys_tid_218631 = global_tid_234100;\n    __local unsigned char *red_arr_mem_23",
                   "4105;\n    \n    red_arr_mem_234105 = (__local unsigned char *) red_arr_mem_234105_backing_0;\n    \n    int32_t phys_group_id_234107;\n    \n    phys_group_id_234107 = get_group_id(0);\n    for (int32_t i_234108 = 0; i_234108 <\n         sdiv_up32(sext_i64_i32(sdiv_up64(partition_sizze_203577,\n                                          squot64(segred_group_sizze_218625,\n                                                  segment_sizze_nonzzero_234098))) -\n                   phys_group_id_234107, sext_i64_i32(num_groups_218626));\n         i_234108++) {\n        int32_t virt_group_id_234109 = phys_group_id_234107 + i_234108 *\n                sext_i64_i32(num_groups_218626);\n        int64_t slice_234110 = partition_sizze_203577;\n        int64_t gtid_218629 = squot64(sext_i32_i64(local_tid_234101),\n                                      segment_sizze_nonzzero_234098) +\n                sext_i32_i64(virt_group_id_234109) *\n                squot64(segred_group_sizze_218625,\n                        segment_sizze_nonzzero_234098);\n        int64_t remnant_234111 = squot64(sext_i32_i64(local_tid_234101),\n                                         segment_sizze_nonzzero_234098) +\n                sext_i32_i64(virt_group_id_234109) *\n                squot64(segred_group_sizze_218625,\n                        segment_sizze_nonzzero_234098) - gtid_218629;\n        int64_t gtid_218630 = srem64(sext_i32_i64(local_tid_234101),\n                                     n_p_203492);\n        \n        // apply map function if in bounds\n        {\n            if (slt64((int64_t) 0, n_p_203492) && (slt64(gtid_218629,\n                                                         partition_sizze_203577) &&\n                                                   slt64(sext_i32_i64(local_tid_234101),\n                                                         n_p_203492 *\n                                                         squot64(segred_group_sizze_218625,\n                                                                 se",
                   "gment_sizze_nonzzero_234098)))) {\n                double x_218636;\n                \n                x_218636 = ((__global double *) mem_230500)[gtid_218629 *\n                                                            C_len_203634 +\n                                                            gtid_218630];\n                // save map-out results\n                { }\n                // save results to be reduced\n                {\n                    ((__local\n                      double *) red_arr_mem_234105)[sext_i32_i64(local_tid_234101)] =\n                        x_218636;\n                }\n            } else {\n                ((__local\n                  double *) red_arr_mem_234105)[sext_i32_i64(local_tid_234101)] =\n                    0.0;\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        if (slt64((int64_t) 0, n_p_203492)) {\n            // perform segmented scan to imitate reduction\n            {\n                double x_218632;\n                double x_218633;\n                double x_234112;\n                double x_234113;\n                bool ltid_in_bounds_234115 =\n                     slt64(sext_i32_i64(local_tid_234101), n_p_203492 *\n                           squot64(segred_group_sizze_218625,\n                                   segment_sizze_nonzzero_234098));\n                int32_t skip_threads_234116;\n                \n                // read input for in-block scan\n                {\n                    if (ltid_in_bounds_234115) {\n                        x_218633 = ((volatile __local\n                                     double *) red_arr_mem_234105)[sext_i32_i64(local_tid_234101)];\n                        if ((local_tid_234101 - squot32(local_tid_234101, 32) *\n                             32) == 0) {\n                            x_218632 = x_218633;\n                        }\n                    }\n                }\n                // in-block scan (hopefully no barriers needed)\n                {\n                    skip_threads_23411",
                   "6 = 1;\n                    while (slt32(skip_threads_234116, 32)) {\n                        bool thread_active_234117 = sle32(skip_threads_234116,\n                                                          local_tid_234101 -\n                                                          squot32(local_tid_234101,\n                                                                  32) * 32) &&\n                             ltid_in_bounds_234115;\n                        \n                        if (thread_active_234117) {\n                            // read operands\n                            {\n                                x_218632 = ((volatile __local\n                                             double *) red_arr_mem_234105)[sext_i32_i64(local_tid_234101) -\n                                                                           sext_i32_i64(skip_threads_234116)];\n                            }\n                        }\n                        // perform operation\n                        {\n                            bool inactive_234118 =\n                                 slt64(srem64(sext_i32_i64(local_tid_234101),\n                                              n_p_203492),\n                                       sext_i32_i64(local_tid_234101) -\n                                       sext_i32_i64(local_tid_234101 -\n                                       skip_threads_234116));\n                            \n                            if (thread_active_234117 && inactive_234118) {\n                                x_218632 = x_218633;\n                            }\n                            if (thread_active_234117) {\n                                if (!inactive_234118) {\n                                    double defunc_1_op_res_218634 = x_218632 +\n                                           x_218633;\n                                    \n                                    x_218632 = defunc_1_op_res_218634;\n                                }\n                            }\n     ",
                   "                   }\n                        if (sle32(wave_sizze_234103, skip_threads_234116)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        if (thread_active_234117) {\n                            // write result\n                            {\n                                ((volatile __local\n                                  double *) red_arr_mem_234105)[sext_i32_i64(local_tid_234101)] =\n                                    x_218632;\n                                x_218633 = x_218632;\n                            }\n                        }\n                        if (sle32(wave_sizze_234103, skip_threads_234116)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        skip_threads_234116 *= 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_234101 - squot32(local_tid_234101, 32) *\n                         32) == 31 && ltid_in_bounds_234115) {\n                        ((volatile __local\n                          double *) red_arr_mem_234105)[sext_i32_i64(squot32(local_tid_234101,\n                                                                             32))] =\n                            x_218632;\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_234119;\n                    \n                    // read input for in-block scan\n                    {\n                        if (squot32(local_tid_234101, 32) == 0 &&\n                            ltid_in_bounds_234115) {\n                            x_234113 = ((volatile __local\n                                         double *) red_arr_mem_234105)[sex",
                   "t_i32_i64(local_tid_234101)];\n                            if ((local_tid_234101 - squot32(local_tid_234101,\n                                                            32) * 32) == 0) {\n                                x_234112 = x_234113;\n                            }\n                        }\n                    }\n                    // in-block scan (hopefully no barriers needed)\n                    {\n                        skip_threads_234119 = 1;\n                        while (slt32(skip_threads_234119, 32)) {\n                            bool thread_active_234120 =\n                                 sle32(skip_threads_234119, local_tid_234101 -\n                                       squot32(local_tid_234101, 32) * 32) &&\n                                 (squot32(local_tid_234101, 32) == 0 &&\n                                  ltid_in_bounds_234115);\n                            \n                            if (thread_active_234120) {\n                                // read operands\n                                {\n                                    x_234112 = ((volatile __local\n                                                 double *) red_arr_mem_234105)[sext_i32_i64(local_tid_234101) -\n                                                                               sext_i32_i64(skip_threads_234119)];\n                                }\n                            }\n                            // perform operation\n                            {\n                                bool inactive_234121 =\n                                     slt64(srem64(sext_i32_i64(local_tid_234101 *\n                                                  32 + 32 - 1), n_p_203492),\n                                           sext_i32_i64(local_tid_234101 * 32 +\n                                           32 - 1) -\n                                           sext_i32_i64((local_tid_234101 -\n                                                         skip_threads_234119) *\n                             ",
                   "              32 + 32 - 1));\n                                \n                                if (thread_active_234120 && inactive_234121) {\n                                    x_234112 = x_234113;\n                                }\n                                if (thread_active_234120) {\n                                    if (!inactive_234121) {\n                                        double defunc_1_op_res_234114 =\n                                               x_234112 + x_234113;\n                                        \n                                        x_234112 = defunc_1_op_res_234114;\n                                    }\n                                }\n                            }\n                            if (sle32(wave_sizze_234103, skip_threads_234119)) {\n                                barrier(CLK_LOCAL_MEM_FENCE);\n                            }\n                            if (thread_active_234120) {\n                                // write result\n                                {\n                                    ((volatile __local\n                                      double *) red_arr_mem_234105)[sext_i32_i64(local_tid_234101)] =\n                                        x_234112;\n                                    x_234113 = x_234112;\n                                }\n                            }\n                            if (sle32(wave_sizze_234103, skip_threads_234119)) {\n                                barrier(CLK_LOCAL_MEM_FENCE);\n                            }\n                            skip_threads_234119 *= 2;\n                        }\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                \n                bool no_carry_in_234122 = squot32(local_tid_234101, 32) == 0 ||\n                     !ltid_in_bounds_234115;\n                \n                // carry-in for every block except the first\n                {\n                    // read operands\n                    {\n               ",
                   "         if (!no_carry_in_234122) {\n                            x_218633 = x_218632;\n                            x_218632 = ((__local\n                                         double *) red_arr_mem_234105)[sext_i32_i64(squot32(local_tid_234101,\n                                                                                            32)) -\n                                                                       (int64_t) 1];\n                        }\n                    }\n                    // perform operation\n                    {\n                        bool inactive_234123 =\n                             slt64(srem64(sext_i32_i64(local_tid_234101),\n                                          n_p_203492),\n                                   sext_i32_i64(local_tid_234101) -\n                                   sext_i32_i64(squot32(local_tid_234101, 32) *\n                                   32 - 1));\n                        \n                        if (!no_carry_in_234122) {\n                            if (inactive_234123) {\n                                x_218632 = x_218633;\n                            }\n                        }\n                        if (!no_carry_in_234122) {\n                            if (!inactive_234123) {\n                                double defunc_1_op_res_218634 = x_218632 +\n                                       x_218633;\n                                \n                                x_218632 = defunc_1_op_res_218634;\n                            }\n                        }\n                    }\n                    // write final result\n                    {\n                        if (!no_carry_in_234122) {\n                            ((__local\n                              double *) red_arr_mem_234105)[sext_i32_i64(local_tid_234101)] =\n                                x_218632;\n                        }\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // restore correct values for firs",
                   "t block\n                {\n                    if (squot32(local_tid_234101, 32) == 0 &&\n                        ltid_in_bounds_234115) {\n                        ((__local\n                          double *) red_arr_mem_234105)[sext_i32_i64(local_tid_234101)] =\n                            x_218633;\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_234109) *\n                      squot64(segred_group_sizze_218625,\n                              segment_sizze_nonzzero_234098) +\n                      sext_i32_i64(local_tid_234101), partition_sizze_203577) &&\n                slt64(sext_i32_i64(local_tid_234101),\n                      squot64(segred_group_sizze_218625,\n                              segment_sizze_nonzzero_234098))) {\n                double tmp_234124;\n                \n                tmp_234124 = ((__local\n                               double *) red_arr_mem_234105)[(sext_i32_i64(local_tid_234101) +\n                                                              (int64_t) 1) *\n                                                             segment_sizze_nonzzero_234098 -\n                                                             (int64_t) 1];\n                ((__global\n                  double *) mem_230511)[sext_i32_i64(virt_group_id_234109) *\n                                        squot64(segred_group_sizze_218625,\n                                                segment_sizze_nonzzero_234098) +\n                                        sext_i32_i64(local_tid_234101)] =\n                    tmp_234124;\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_218625\n}\n__kernel void mainzisegred_small_218762(__global int *global_failure,\n   ",
                   "                                     __local volatile\n                                        int64_t *red_arr_mem_234248_backing_aligned_0,\n                                        int64_t n_p_203492,\n                                        int64_t partition_sizze_203577,\n                                        int64_t lifted_single_ma_l_arg_204134,\n                                        int64_t num_groups_218757,\n                                        int64_t segment_sizze_nonzzero_234241,\n                                        __global unsigned char *mem_230517,\n                                        __global unsigned char *mem_230528)\n{\n    #define segred_group_sizze_218756 (mainzisegred_group_sizze_218739)\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_234248_backing_0 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_234248_backing_aligned_0;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_234243;\n    int32_t local_tid_234244;\n    int64_t group_sizze_234247;\n    int32_t wave_sizze_234246;\n    int32_t group_tid_234245;\n    \n    global_tid_234243 = get_global_id(0);\n    local_tid_234244 = get_local_id(0);\n    group_sizze_234247 = get_local_size(0);\n    wave_sizze_234246 = LOCKSTEP_WIDTH;\n    group_tid_234245 = get_group_id(0);\n    \n    int32_t phys_tid_218762 = global_tid_234243;\n    __local unsigned char *red_arr_mem_234248;\n    \n    red_arr_mem_234248 = (__local unsigned char *) red_arr_mem_234248_backing_0;\n    \n    int32_t phys_group_id_234250;\n    \n    phys_group_id_234250 = get_group_id(0);\n    for (int32_t i_234251 = 0; i_234251 <\n         sdiv_up32(sext_i64_i32(sdiv_up64(partition_sizze_203577,\n                                          squot64(segred_group_sizze_218756,\n                                                  segment_sizze_nonzzero_234241)",
                   ")) -\n                   phys_group_id_234250, sext_i64_i32(num_groups_218757));\n         i_234251++) {\n        int32_t virt_group_id_234252 = phys_group_id_234250 + i_234251 *\n                sext_i64_i32(num_groups_218757);\n        int64_t slice_234253 = partition_sizze_203577;\n        int64_t gtid_218760 = squot64(sext_i32_i64(local_tid_234244),\n                                      segment_sizze_nonzzero_234241) +\n                sext_i32_i64(virt_group_id_234252) *\n                squot64(segred_group_sizze_218756,\n                        segment_sizze_nonzzero_234241);\n        int64_t remnant_234254 = squot64(sext_i32_i64(local_tid_234244),\n                                         segment_sizze_nonzzero_234241) +\n                sext_i32_i64(virt_group_id_234252) *\n                squot64(segred_group_sizze_218756,\n                        segment_sizze_nonzzero_234241) - gtid_218760;\n        int64_t gtid_218761 = srem64(sext_i32_i64(local_tid_234244),\n                                     n_p_203492);\n        \n        // apply map function if in bounds\n        {\n            if (slt64((int64_t) 0, n_p_203492) && (slt64(gtid_218760,\n                                                         partition_sizze_203577) &&\n                                                   slt64(sext_i32_i64(local_tid_234244),\n                                                         n_p_203492 *\n                                                         squot64(segred_group_sizze_218756,\n                                                                 segment_sizze_nonzzero_234241)))) {\n                double x_218767;\n                \n                x_218767 = ((__global double *) mem_230517)[gtid_218760 *\n                                                            lifted_single_ma_l_arg_204134 +\n                                                            gtid_218761];\n                // save map-out results\n                { }\n                // save results to be reduced\n               ",
                   " {\n                    ((__local\n                      double *) red_arr_mem_234248)[sext_i32_i64(local_tid_234244)] =\n                        x_218767;\n                }\n            } else {\n                ((__local\n                  double *) red_arr_mem_234248)[sext_i32_i64(local_tid_234244)] =\n                    0.0;\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        if (slt64((int64_t) 0, n_p_203492)) {\n            // perform segmented scan to imitate reduction\n            {\n                double x_218763;\n                double x_218764;\n                double x_234255;\n                double x_234256;\n                bool ltid_in_bounds_234258 =\n                     slt64(sext_i32_i64(local_tid_234244), n_p_203492 *\n                           squot64(segred_group_sizze_218756,\n                                   segment_sizze_nonzzero_234241));\n                int32_t skip_threads_234259;\n                \n                // read input for in-block scan\n                {\n                    if (ltid_in_bounds_234258) {\n                        x_218764 = ((volatile __local\n                                     double *) red_arr_mem_234248)[sext_i32_i64(local_tid_234244)];\n                        if ((local_tid_234244 - squot32(local_tid_234244, 32) *\n                             32) == 0) {\n                            x_218763 = x_218764;\n                        }\n                    }\n                }\n                // in-block scan (hopefully no barriers needed)\n                {\n                    skip_threads_234259 = 1;\n                    while (slt32(skip_threads_234259, 32)) {\n                        bool thread_active_234260 = sle32(skip_threads_234259,\n                                                          local_tid_234244 -\n                                                          squot32(local_tid_234244,\n                                                                  32) * 32) &&\n                             ltid_in_boun",
                   "ds_234258;\n                        \n                        if (thread_active_234260) {\n                            // read operands\n                            {\n                                x_218763 = ((volatile __local\n                                             double *) red_arr_mem_234248)[sext_i32_i64(local_tid_234244) -\n                                                                           sext_i32_i64(skip_threads_234259)];\n                            }\n                        }\n                        // perform operation\n                        {\n                            bool inactive_234261 =\n                                 slt64(srem64(sext_i32_i64(local_tid_234244),\n                                              n_p_203492),\n                                       sext_i32_i64(local_tid_234244) -\n                                       sext_i32_i64(local_tid_234244 -\n                                       skip_threads_234259));\n                            \n                            if (thread_active_234260 && inactive_234261) {\n                                x_218763 = x_218764;\n                            }\n                            if (thread_active_234260) {\n                                if (!inactive_234261) {\n                                    double defunc_1_op_res_218765 = x_218763 +\n                                           x_218764;\n                                    \n                                    x_218763 = defunc_1_op_res_218765;\n                                }\n                            }\n                        }\n                        if (sle32(wave_sizze_234246, skip_threads_234259)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        if (thread_active_234260) {\n                            // write result\n                            {\n                                ((volatile __local\n                                  double *) red_arr_mem_234248)[sext_",
                   "i32_i64(local_tid_234244)] =\n                                    x_218763;\n                                x_218764 = x_218763;\n                            }\n                        }\n                        if (sle32(wave_sizze_234246, skip_threads_234259)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        skip_threads_234259 *= 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_234244 - squot32(local_tid_234244, 32) *\n                         32) == 31 && ltid_in_bounds_234258) {\n                        ((volatile __local\n                          double *) red_arr_mem_234248)[sext_i32_i64(squot32(local_tid_234244,\n                                                                             32))] =\n                            x_218763;\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_234262;\n                    \n                    // read input for in-block scan\n                    {\n                        if (squot32(local_tid_234244, 32) == 0 &&\n                            ltid_in_bounds_234258) {\n                            x_234256 = ((volatile __local\n                                         double *) red_arr_mem_234248)[sext_i32_i64(local_tid_234244)];\n                            if ((local_tid_234244 - squot32(local_tid_234244,\n                                                            32) * 32) == 0) {\n                                x_234255 = x_234256;\n                            }\n                        }\n                    }\n                    // in-block scan (hopefully no barriers needed)\n                    {\n                     ",
                   "   skip_threads_234262 = 1;\n                        while (slt32(skip_threads_234262, 32)) {\n                            bool thread_active_234263 =\n                                 sle32(skip_threads_234262, local_tid_234244 -\n                                       squot32(local_tid_234244, 32) * 32) &&\n                                 (squot32(local_tid_234244, 32) == 0 &&\n                                  ltid_in_bounds_234258);\n                            \n                            if (thread_active_234263) {\n                                // read operands\n                                {\n                                    x_234255 = ((volatile __local\n                                                 double *) red_arr_mem_234248)[sext_i32_i64(local_tid_234244) -\n                                                                               sext_i32_i64(skip_threads_234262)];\n                                }\n                            }\n                            // perform operation\n                            {\n                                bool inactive_234264 =\n                                     slt64(srem64(sext_i32_i64(local_tid_234244 *\n                                                  32 + 32 - 1), n_p_203492),\n                                           sext_i32_i64(local_tid_234244 * 32 +\n                                           32 - 1) -\n                                           sext_i32_i64((local_tid_234244 -\n                                                         skip_threads_234262) *\n                                           32 + 32 - 1));\n                                \n                                if (thread_active_234263 && inactive_234264) {\n                                    x_234255 = x_234256;\n                                }\n                                if (thread_active_234263) {\n                                    if (!inactive_234264) {\n                                        double defunc_1_op_res_234257 =\n    ",
                   "                                           x_234255 + x_234256;\n                                        \n                                        x_234255 = defunc_1_op_res_234257;\n                                    }\n                                }\n                            }\n                            if (sle32(wave_sizze_234246, skip_threads_234262)) {\n                                barrier(CLK_LOCAL_MEM_FENCE);\n                            }\n                            if (thread_active_234263) {\n                                // write result\n                                {\n                                    ((volatile __local\n                                      double *) red_arr_mem_234248)[sext_i32_i64(local_tid_234244)] =\n                                        x_234255;\n                                    x_234256 = x_234255;\n                                }\n                            }\n                            if (sle32(wave_sizze_234246, skip_threads_234262)) {\n                                barrier(CLK_LOCAL_MEM_FENCE);\n                            }\n                            skip_threads_234262 *= 2;\n                        }\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                \n                bool no_carry_in_234265 = squot32(local_tid_234244, 32) == 0 ||\n                     !ltid_in_bounds_234258;\n                \n                // carry-in for every block except the first\n                {\n                    // read operands\n                    {\n                        if (!no_carry_in_234265) {\n                            x_218764 = x_218763;\n                            x_218763 = ((__local\n                                         double *) red_arr_mem_234248)[sext_i32_i64(squot32(local_tid_234244,\n                                                                                            32)) -\n                                                                       (int64_t) 1];\n",
                   "                        }\n                    }\n                    // perform operation\n                    {\n                        bool inactive_234266 =\n                             slt64(srem64(sext_i32_i64(local_tid_234244),\n                                          n_p_203492),\n                                   sext_i32_i64(local_tid_234244) -\n                                   sext_i32_i64(squot32(local_tid_234244, 32) *\n                                   32 - 1));\n                        \n                        if (!no_carry_in_234265) {\n                            if (inactive_234266) {\n                                x_218763 = x_218764;\n                            }\n                        }\n                        if (!no_carry_in_234265) {\n                            if (!inactive_234266) {\n                                double defunc_1_op_res_218765 = x_218763 +\n                                       x_218764;\n                                \n                                x_218763 = defunc_1_op_res_218765;\n                            }\n                        }\n                    }\n                    // write final result\n                    {\n                        if (!no_carry_in_234265) {\n                            ((__local\n                              double *) red_arr_mem_234248)[sext_i32_i64(local_tid_234244)] =\n                                x_218763;\n                        }\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // restore correct values for first block\n                {\n                    if (squot32(local_tid_234244, 32) == 0 &&\n                        ltid_in_bounds_234258) {\n                        ((__local\n                          double *) red_arr_mem_234248)[sext_i32_i64(local_tid_234244)] =\n                            x_218764;\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_234252) *\n                      squot64(segred_group_sizze_218756,\n                              segment_sizze_nonzzero_234241) +\n                      sext_i32_i64(local_tid_234244), partition_sizze_203577) &&\n                slt64(sext_i32_i64(local_tid_234244),\n                      squot64(segred_group_sizze_218756,\n                              segment_sizze_nonzzero_234241))) {\n                double tmp_234267;\n                \n                tmp_234267 = ((__local\n                               double *) red_arr_mem_234248)[(sext_i32_i64(local_tid_234244) +\n                                                              (int64_t) 1) *\n                                                             segment_sizze_nonzzero_234241 -\n                                                             (int64_t) 1];\n                ((__global\n                  double *) mem_230528)[sext_i32_i64(virt_group_id_234252) *\n                                        squot64(segred_group_sizze_218756,\n                                                segment_sizze_nonzzero_234241) +\n                                        sext_i32_i64(local_tid_234244)] =\n                    tmp_234267;\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_218756\n}\n__kernel void mainzisegred_small_218893(__global int *global_failure,\n                                        __local volatile\n                                        int64_t *red_arr_mem_234391_backing_aligned_0,\n                                        int64_t partition_sizze_203577,\n                                        int64_t dyn_lifted_single_ma_l_arg_204144,\n                                        int64_t num_groups_218888,\n                                        int64_t segment_sizze_non",
                   "zzero_234384,\n                                        __global unsigned char *mem_230534,\n                                        __global unsigned char *mem_230545)\n{\n    #define segred_group_sizze_218887 (mainzisegred_group_sizze_218870)\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_234391_backing_0 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_234391_backing_aligned_0;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_234386;\n    int32_t local_tid_234387;\n    int64_t group_sizze_234390;\n    int32_t wave_sizze_234389;\n    int32_t group_tid_234388;\n    \n    global_tid_234386 = get_global_id(0);\n    local_tid_234387 = get_local_id(0);\n    group_sizze_234390 = get_local_size(0);\n    wave_sizze_234389 = LOCKSTEP_WIDTH;\n    group_tid_234388 = get_group_id(0);\n    \n    int32_t phys_tid_218893 = global_tid_234386;\n    __local unsigned char *red_arr_mem_234391;\n    \n    red_arr_mem_234391 = (__local unsigned char *) red_arr_mem_234391_backing_0;\n    \n    int32_t phys_group_id_234393;\n    \n    phys_group_id_234393 = get_group_id(0);\n    for (int32_t i_234394 = 0; i_234394 <\n         sdiv_up32(sext_i64_i32(sdiv_up64(partition_sizze_203577,\n                                          squot64(segred_group_sizze_218887,\n                                                  segment_sizze_nonzzero_234384))) -\n                   phys_group_id_234393, sext_i64_i32(num_groups_218888));\n         i_234394++) {\n        int32_t virt_group_id_234395 = phys_group_id_234393 + i_234394 *\n                sext_i64_i32(num_groups_218888);\n        int64_t slice_234396 = partition_sizze_203577;\n        int64_t gtid_218891 = squot64(sext_i32_i64(local_tid_234387),\n                                      segment_sizze_nonzzero_234384) +\n                sext_i32_i64(virt_group_id_234395) *\n          ",
                   "      squot64(segred_group_sizze_218887,\n                        segment_sizze_nonzzero_234384);\n        int64_t remnant_234397 = squot64(sext_i32_i64(local_tid_234387),\n                                         segment_sizze_nonzzero_234384) +\n                sext_i32_i64(virt_group_id_234395) *\n                squot64(segred_group_sizze_218887,\n                        segment_sizze_nonzzero_234384) - gtid_218891;\n        int64_t gtid_218892 = srem64(sext_i32_i64(local_tid_234387),\n                                     (int64_t) 3);\n        \n        // apply map function if in bounds\n        {\n            if (slt64((int64_t) 0, (int64_t) 3) && (slt64(gtid_218891,\n                                                          partition_sizze_203577) &&\n                                                    slt64(sext_i32_i64(local_tid_234387),\n                                                          (int64_t) 3 *\n                                                          squot64(segred_group_sizze_218887,\n                                                                  segment_sizze_nonzzero_234384)))) {\n                double x_218898;\n                \n                x_218898 = ((__global double *) mem_230534)[gtid_218891 *\n                                                            dyn_lifted_single_ma_l_arg_204144 +\n                                                            gtid_218892];\n                // save map-out results\n                { }\n                // save results to be reduced\n                {\n                    ((__local\n                      double *) red_arr_mem_234391)[sext_i32_i64(local_tid_234387)] =\n                        x_218898;\n                }\n            } else {\n                ((__local\n                  double *) red_arr_mem_234391)[sext_i32_i64(local_tid_234387)] =\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_218894;\n                double x_218895;\n                double x_234398;\n                double x_234399;\n                bool ltid_in_bounds_234401 =\n                     slt64(sext_i32_i64(local_tid_234387), (int64_t) 3 *\n                           squot64(segred_group_sizze_218887,\n                                   segment_sizze_nonzzero_234384));\n                int32_t skip_threads_234402;\n                \n                // read input for in-block scan\n                {\n                    if (ltid_in_bounds_234401) {\n                        x_218895 = ((volatile __local\n                                     double *) red_arr_mem_234391)[sext_i32_i64(local_tid_234387)];\n                        if ((local_tid_234387 - squot32(local_tid_234387, 32) *\n                             32) == 0) {\n                            x_218894 = x_218895;\n                        }\n                    }\n                }\n                // in-block scan (hopefully no barriers needed)\n                {\n                    skip_threads_234402 = 1;\n                    while (slt32(skip_threads_234402, 32)) {\n                        bool thread_active_234403 = sle32(skip_threads_234402,\n                                                          local_tid_234387 -\n                                                          squot32(local_tid_234387,\n                                                                  32) * 32) &&\n                             ltid_in_bounds_234401;\n                        \n                        if (thread_active_234403) {\n                            // read operands\n                            {\n                                x_218894 = ((volatile __local\n                                             double *) red_arr_mem_234391)[sext_i32_i64(local_tid_234387) -\n                                                                           sext_i32_i64(skip_threads_234402)];\n                          ",
                   "  }\n                        }\n                        // perform operation\n                        {\n                            bool inactive_234404 =\n                                 slt64(srem64(sext_i32_i64(local_tid_234387),\n                                              (int64_t) 3),\n                                       sext_i32_i64(local_tid_234387) -\n                                       sext_i32_i64(local_tid_234387 -\n                                       skip_threads_234402));\n                            \n                            if (thread_active_234403 && inactive_234404) {\n                                x_218894 = x_218895;\n                            }\n                            if (thread_active_234403) {\n                                if (!inactive_234404) {\n                                    double defunc_1_op_res_218896 = x_218894 +\n                                           x_218895;\n                                    \n                                    x_218894 = defunc_1_op_res_218896;\n                                }\n                            }\n                        }\n                        if (sle32(wave_sizze_234389, skip_threads_234402)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        if (thread_active_234403) {\n                            // write result\n                            {\n                                ((volatile __local\n                                  double *) red_arr_mem_234391)[sext_i32_i64(local_tid_234387)] =\n                                    x_218894;\n                                x_218895 = x_218894;\n                            }\n                        }\n                        if (sle32(wave_sizze_234389, skip_threads_234402)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        skip_threads_234402 *= 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_234387 - squot32(local_tid_234387, 32) *\n                         32) == 31 && ltid_in_bounds_234401) {\n                        ((volatile __local\n                          double *) red_arr_mem_234391)[sext_i32_i64(squot32(local_tid_234387,\n                                                                             32))] =\n                            x_218894;\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_234405;\n                    \n                    // read input for in-block scan\n                    {\n                        if (squot32(local_tid_234387, 32) == 0 &&\n                            ltid_in_bounds_234401) {\n                            x_234399 = ((volatile __local\n                                         double *) red_arr_mem_234391)[sext_i32_i64(local_tid_234387)];\n                            if ((local_tid_234387 - squot32(local_tid_234387,\n                                                            32) * 32) == 0) {\n                                x_234398 = x_234399;\n                            }\n                        }\n                    }\n                    // in-block scan (hopefully no barriers needed)\n                    {\n                        skip_threads_234405 = 1;\n                        while (slt32(skip_threads_234405, 32)) {\n                            bool thread_active_234406 =\n                                 sle32(skip_threads_234405, local_tid_234387 -\n                                       squot32(local_tid_234387, 32) * 32) &&\n                                 (squot32(local_tid_234387, 32) == 0 &&\n                                  ltid_in_bounds_234401);\n                            \n    ",
                   "                        if (thread_active_234406) {\n                                // read operands\n                                {\n                                    x_234398 = ((volatile __local\n                                                 double *) red_arr_mem_234391)[sext_i32_i64(local_tid_234387) -\n                                                                               sext_i32_i64(skip_threads_234405)];\n                                }\n                            }\n                            // perform operation\n                            {\n                                bool inactive_234407 =\n                                     slt64(srem64(sext_i32_i64(local_tid_234387 *\n                                                  32 + 32 - 1), (int64_t) 3),\n                                           sext_i32_i64(local_tid_234387 * 32 +\n                                           32 - 1) -\n                                           sext_i32_i64((local_tid_234387 -\n                                                         skip_threads_234405) *\n                                           32 + 32 - 1));\n                                \n                                if (thread_active_234406 && inactive_234407) {\n                                    x_234398 = x_234399;\n                                }\n                                if (thread_active_234406) {\n                                    if (!inactive_234407) {\n                                        double defunc_1_op_res_234400 =\n                                               x_234398 + x_234399;\n                                        \n                                        x_234398 = defunc_1_op_res_234400;\n                                    }\n                                }\n                            }\n                            if (sle32(wave_sizze_234389, skip_threads_234405)) {\n                                barrier(CLK_LOCAL_MEM_FENCE);\n                            }\n             ",
                   "               if (thread_active_234406) {\n                                // write result\n                                {\n                                    ((volatile __local\n                                      double *) red_arr_mem_234391)[sext_i32_i64(local_tid_234387)] =\n                                        x_234398;\n                                    x_234399 = x_234398;\n                                }\n                            }\n                            if (sle32(wave_sizze_234389, skip_threads_234405)) {\n                                barrier(CLK_LOCAL_MEM_FENCE);\n                            }\n                            skip_threads_234405 *= 2;\n                        }\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                \n                bool no_carry_in_234408 = squot32(local_tid_234387, 32) == 0 ||\n                     !ltid_in_bounds_234401;\n                \n                // carry-in for every block except the first\n                {\n                    // read operands\n                    {\n                        if (!no_carry_in_234408) {\n                            x_218895 = x_218894;\n                            x_218894 = ((__local\n                                         double *) red_arr_mem_234391)[sext_i32_i64(squot32(local_tid_234387,\n                                                                                            32)) -\n                                                                       (int64_t) 1];\n                        }\n                    }\n                    // perform operation\n                    {\n                        bool inactive_234409 =\n                             slt64(srem64(sext_i32_i64(local_tid_234387),\n                                          (int64_t) 3),\n                                   sext_i32_i64(local_tid_234387) -\n                                   sext_i32_i64(squot32(local_tid_234387, 32) *\n                                ",
                   "   32 - 1));\n                        \n                        if (!no_carry_in_234408) {\n                            if (inactive_234409) {\n                                x_218894 = x_218895;\n                            }\n                        }\n                        if (!no_carry_in_234408) {\n                            if (!inactive_234409) {\n                                double defunc_1_op_res_218896 = x_218894 +\n                                       x_218895;\n                                \n                                x_218894 = defunc_1_op_res_218896;\n                            }\n                        }\n                    }\n                    // write final result\n                    {\n                        if (!no_carry_in_234408) {\n                            ((__local\n                              double *) red_arr_mem_234391)[sext_i32_i64(local_tid_234387)] =\n                                x_218894;\n                        }\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // restore correct values for first block\n                {\n                    if (squot32(local_tid_234387, 32) == 0 &&\n                        ltid_in_bounds_234401) {\n                        ((__local\n                          double *) red_arr_mem_234391)[sext_i32_i64(local_tid_234387)] =\n                            x_218895;\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_234395) *\n                      squot64(segred_group_sizze_218887,\n                              segment_sizze_nonzzero_234384) +\n                      sext_i32_i64(local_tid_234387), partition_sizze_203577) &&\n                slt64(sext_i32_i64(local_tid_234387),\n                      squot64(segred_group_sizze_218887,\n                          ",
                   "    segment_sizze_nonzzero_234384))) {\n                double tmp_234410;\n                \n                tmp_234410 = ((__local\n                               double *) red_arr_mem_234391)[(sext_i32_i64(local_tid_234387) +\n                                                              (int64_t) 1) *\n                                                             segment_sizze_nonzzero_234384 -\n                                                             (int64_t) 1];\n                ((__global\n                  double *) mem_230545)[sext_i32_i64(virt_group_id_234395) *\n                                        squot64(segred_group_sizze_218887,\n                                                segment_sizze_nonzzero_234384) +\n                                        sext_i32_i64(local_tid_234387)] =\n                    tmp_234410;\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_218887\n}\n__kernel void mainzisegred_small_219515(__global int *global_failure,\n                                        __local volatile\n                                        int64_t *red_arr_mem_234568_backing_aligned_0,\n                                        int64_t n_203490, int64_t q_l_203495,\n                                        int64_t jump_t_203500,\n                                        int64_t partition_sizze_203577,\n                                        int64_t l_n_m_203643, int64_t i_203670,\n                                        int64_t num_groups_219509,\n                                        int64_t ctx_param_ext_229488,\n                                        int64_t ctx_param_ext_229489,\n                                        int64_t ctx_param_ext_229491,\n                                        int64_t segment_sizze_nonzzero_234561,\n                                        __global unsigned char *ext_mem_229411,\n                         ",
                   "               __global unsigned char *ext_mem_229412,\n                                        __global\n                                        unsigned char *mem_param_229493,\n                                        __global unsigned char *mem_230596)\n{\n    #define segred_group_sizze_219508 (mainzisegred_group_sizze_219260)\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_234568_backing_0 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_234568_backing_aligned_0;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_234563;\n    int32_t local_tid_234564;\n    int64_t group_sizze_234567;\n    int32_t wave_sizze_234566;\n    int32_t group_tid_234565;\n    \n    global_tid_234563 = get_global_id(0);\n    local_tid_234564 = get_local_id(0);\n    group_sizze_234567 = get_local_size(0);\n    wave_sizze_234566 = LOCKSTEP_WIDTH;\n    group_tid_234565 = get_group_id(0);\n    \n    int32_t phys_tid_219515 = global_tid_234563;\n    __local unsigned char *red_arr_mem_234568;\n    \n    red_arr_mem_234568 = (__local unsigned char *) red_arr_mem_234568_backing_0;\n    \n    int32_t phys_group_id_234570;\n    \n    phys_group_id_234570 = get_group_id(0);\n    for (int32_t i_234571 = 0; i_234571 <\n         sdiv_up32(sext_i64_i32(sdiv_up64(partition_sizze_203577 * l_n_m_203643,\n                                          squot64(segred_group_sizze_219508,\n                                                  segment_sizze_nonzzero_234561))) -\n                   phys_group_id_234570, sext_i64_i32(num_groups_219509));\n         i_234571++) {\n        int32_t virt_group_id_234572 = phys_group_id_234570 + i_234571 *\n                sext_i64_i32(num_groups_219509);\n        int64_t slice_234573 = l_n_m_203643;\n        int64_t slice_234574 = partition_sizze_203577 * slice_234573;\n        int64_t gtid_219512 = squot64(squo",
                   "t64(sext_i32_i64(local_tid_234564),\n                                              segment_sizze_nonzzero_234561) +\n                                      sext_i32_i64(virt_group_id_234572) *\n                                      squot64(segred_group_sizze_219508,\n                                              segment_sizze_nonzzero_234561),\n                                      slice_234573);\n        int64_t remnant_234575 = squot64(sext_i32_i64(local_tid_234564),\n                                         segment_sizze_nonzzero_234561) +\n                sext_i32_i64(virt_group_id_234572) *\n                squot64(segred_group_sizze_219508,\n                        segment_sizze_nonzzero_234561) - gtid_219512 *\n                slice_234573;\n        int64_t gtid_219513 = remnant_234575;\n        int64_t remnant_234576 = remnant_234575 - gtid_219513;\n        int64_t gtid_219514 = srem64(sext_i32_i64(local_tid_234564),\n                                     q_l_203495);\n        \n        // apply map function if in bounds\n        {\n            if (slt64((int64_t) 0, q_l_203495) && ((slt64(gtid_219512,\n                                                          partition_sizze_203577) &&\n                                                    slt64(gtid_219513,\n                                                          l_n_m_203643)) &&\n                                                   slt64(sext_i32_i64(local_tid_234564),\n                                                         q_l_203495 *\n                                                         squot64(segred_group_sizze_219508,\n                                                                 segment_sizze_nonzzero_234561)))) {\n                int64_t x_219523;\n                \n                x_219523 = ((__global int64_t *) ext_mem_229412)[gtid_219512 *\n                                                                 l_n_m_203643 +\n                                                                 gtid_219513];\n                \n   ",
                   "             double x_219524;\n                \n                x_219524 = ((__global double *) ext_mem_229411)[gtid_219512 *\n                                                                l_n_m_203643 +\n                                                                gtid_219513];\n                \n                int64_t binop_y_228694 = mul64(jump_t_203500, gtid_219513);\n                int64_t binop_y_228695 = smin64(i_203670, binop_y_228694);\n                int64_t index_primexp_228696 = add64((int64_t) 1,\n                                                     binop_y_228695);\n                bool cond_219527 = sle64(n_203490, gtid_219514);\n                int64_t defunc_0_f_res_219528;\n                \n                if (cond_219527) {\n                    defunc_0_f_res_219528 = (int64_t) 0;\n                } else {\n                    int64_t i_219529 = add64(gtid_219514, x_219523);\n                    int64_t defunc_1_add_res_219530 = add64((int64_t) 1,\n                                                            i_219529);\n                    \n                    defunc_0_f_res_219528 = defunc_1_add_res_219530;\n                }\n                \n                double defunc_0_f_res_219531;\n                \n                if (cond_219527) {\n                    defunc_0_f_res_219531 = 0.0;\n                } else {\n                    int64_t i_219532 = add64(gtid_219514, x_219523);\n                    double defunc_0_add_arg_219533;\n                    \n                    defunc_0_add_arg_219533 = ((__global\n                                                double *) mem_param_229493)[ctx_param_ext_229488 +\n                                                                            (gtid_219512 *\n                                                                             ctx_param_ext_229489 +\n                                                                             i_219532 *\n                                                                             ctx_",
                   "param_ext_229491)];\n                    defunc_0_f_res_219531 = defunc_0_add_arg_219533;\n                }\n                \n                int64_t binop_p_219534 = sub64(defunc_0_f_res_219528,\n                                               index_primexp_228696);\n                double defunc_0_f_res_219535 = sitofp_i64_f64(binop_p_219534);\n                double abs_res_219536 = fabs(defunc_0_f_res_219535);\n                double tmp1_219537 = abs_res_219536 / x_219524;\n                double x_219538 = tmp1_219537 * tmp1_219537;\n                double y_219539 = tmp1_219537 * x_219538;\n                double tmp2_219540 = 1.0 - y_219539;\n                double x_219541 = tmp2_219540 * tmp2_219540;\n                double tmp3_219542 = tmp2_219540 * x_219541;\n                double w_j_219543 = defunc_0_f_res_219531 * tmp3_219542;\n                \n                // save map-out results\n                { }\n                // save results to be reduced\n                {\n                    ((__local\n                      double *) red_arr_mem_234568)[sext_i32_i64(local_tid_234564)] =\n                        w_j_219543;\n                }\n            } else {\n                ((__local\n                  double *) red_arr_mem_234568)[sext_i32_i64(local_tid_234564)] =\n                    0.0;\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        if (slt64((int64_t) 0, q_l_203495)) {\n            // perform segmented scan to imitate reduction\n            {\n                double x_219516;\n                double x_219517;\n                double x_234577;\n                double x_234578;\n                bool ltid_in_bounds_234580 =\n                     slt64(sext_i32_i64(local_tid_234564), q_l_203495 *\n                           squot64(segred_group_sizze_219508,\n                                   segment_sizze_nonzzero_234561));\n                int32_t skip_threads_234581;\n                \n                // read input for in-block scan\n                {\n    ",
                   "                if (ltid_in_bounds_234580) {\n                        x_219517 = ((volatile __local\n                                     double *) red_arr_mem_234568)[sext_i32_i64(local_tid_234564)];\n                        if ((local_tid_234564 - squot32(local_tid_234564, 32) *\n                             32) == 0) {\n                            x_219516 = x_219517;\n                        }\n                    }\n                }\n                // in-block scan (hopefully no barriers needed)\n                {\n                    skip_threads_234581 = 1;\n                    while (slt32(skip_threads_234581, 32)) {\n                        bool thread_active_234582 = sle32(skip_threads_234581,\n                                                          local_tid_234564 -\n                                                          squot32(local_tid_234564,\n                                                                  32) * 32) &&\n                             ltid_in_bounds_234580;\n                        \n                        if (thread_active_234582) {\n                            // read operands\n                            {\n                                x_219516 = ((volatile __local\n                                             double *) red_arr_mem_234568)[sext_i32_i64(local_tid_234564) -\n                                                                           sext_i32_i64(skip_threads_234581)];\n                            }\n                        }\n                        // perform operation\n                        {\n                            bool inactive_234583 =\n                                 slt64(srem64(sext_i32_i64(local_tid_234564),\n                                              q_l_203495),\n                                       sext_i32_i64(local_tid_234564) -\n                                       sext_i32_i64(local_tid_234564 -\n                                       skip_threads_234581));\n                            \n                        ",
                   "    if (thread_active_234582 && inactive_234583) {\n                                x_219516 = x_219517;\n                            }\n                            if (thread_active_234582) {\n                                if (!inactive_234583) {\n                                    double defunc_1_op_res_219518 = x_219516 +\n                                           x_219517;\n                                    \n                                    x_219516 = defunc_1_op_res_219518;\n                                }\n                            }\n                        }\n                        if (sle32(wave_sizze_234566, skip_threads_234581)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        if (thread_active_234582) {\n                            // write result\n                            {\n                                ((volatile __local\n                                  double *) red_arr_mem_234568)[sext_i32_i64(local_tid_234564)] =\n                                    x_219516;\n                                x_219517 = x_219516;\n                            }\n                        }\n                        if (sle32(wave_sizze_234566, skip_threads_234581)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        skip_threads_234581 *= 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_234564 - squot32(local_tid_234564, 32) *\n                         32) == 31 && ltid_in_bounds_234580) {\n                        ((volatile __local\n                          double *) red_arr_mem_234568)[sext_i32_i64(squot32(local_tid_234564,\n                                                                             32))] =\n                            x_219516;\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_234584;\n                    \n                    // read input for in-block scan\n                    {\n                        if (squot32(local_tid_234564, 32) == 0 &&\n                            ltid_in_bounds_234580) {\n                            x_234578 = ((volatile __local\n                                         double *) red_arr_mem_234568)[sext_i32_i64(local_tid_234564)];\n                            if ((local_tid_234564 - squot32(local_tid_234564,\n                                                            32) * 32) == 0) {\n                                x_234577 = x_234578;\n                            }\n                        }\n                    }\n                    // in-block scan (hopefully no barriers needed)\n                    {\n                        skip_threads_234584 = 1;\n                        while (slt32(skip_threads_234584, 32)) {\n                            bool thread_active_234585 =\n                                 sle32(skip_threads_234584, local_tid_234564 -\n                                       squot32(local_tid_234564, 32) * 32) &&\n                                 (squot32(local_tid_234564, 32) == 0 &&\n                                  ltid_in_bounds_234580);\n                            \n                            if (thread_active_234585) {\n                                // read operands\n                                {\n                                    x_234577 = ((volatile __local\n                                                 double *) red_arr_mem_234568)[sext_i32_i64(local_tid_234564) -\n                                                                               sext_i32_i64(skip_threads_234584)];\n                                }\n                            }\n                            // perform operation\n       ",
                   "                     {\n                                bool inactive_234586 =\n                                     slt64(srem64(sext_i32_i64(local_tid_234564 *\n                                                  32 + 32 - 1), q_l_203495),\n                                           sext_i32_i64(local_tid_234564 * 32 +\n                                           32 - 1) -\n                                           sext_i32_i64((local_tid_234564 -\n                                                         skip_threads_234584) *\n                                           32 + 32 - 1));\n                                \n                                if (thread_active_234585 && inactive_234586) {\n                                    x_234577 = x_234578;\n                                }\n                                if (thread_active_234585) {\n                                    if (!inactive_234586) {\n                                        double defunc_1_op_res_234579 =\n                                               x_234577 + x_234578;\n                                        \n                                        x_234577 = defunc_1_op_res_234579;\n                                    }\n                                }\n                            }\n                            if (sle32(wave_sizze_234566, skip_threads_234584)) {\n                                barrier(CLK_LOCAL_MEM_FENCE);\n                            }\n                            if (thread_active_234585) {\n                                // write result\n                                {\n                                    ((volatile __local\n                                      double *) red_arr_mem_234568)[sext_i32_i64(local_tid_234564)] =\n                                        x_234577;\n                                    x_234578 = x_234577;\n                                }\n                            }\n                            if (sle32(wave_sizze_234566, skip_threads_234584)) {\n               ",
                   "                 barrier(CLK_LOCAL_MEM_FENCE);\n                            }\n                            skip_threads_234584 *= 2;\n                        }\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                \n                bool no_carry_in_234587 = squot32(local_tid_234564, 32) == 0 ||\n                     !ltid_in_bounds_234580;\n                \n                // carry-in for every block except the first\n                {\n                    // read operands\n                    {\n                        if (!no_carry_in_234587) {\n                            x_219517 = x_219516;\n                            x_219516 = ((__local\n                                         double *) red_arr_mem_234568)[sext_i32_i64(squot32(local_tid_234564,\n                                                                                            32)) -\n                                                                       (int64_t) 1];\n                        }\n                    }\n                    // perform operation\n                    {\n                        bool inactive_234588 =\n                             slt64(srem64(sext_i32_i64(local_tid_234564),\n                                          q_l_203495),\n                                   sext_i32_i64(local_tid_234564) -\n                                   sext_i32_i64(squot32(local_tid_234564, 32) *\n                                   32 - 1));\n                        \n                        if (!no_carry_in_234587) {\n                            if (inactive_234588) {\n                                x_219516 = x_219517;\n                            }\n                        }\n                        if (!no_carry_in_234587) {\n                            if (!inactive_234588) {\n                                double defunc_1_op_res_219518 = x_219516 +\n                                       x_219517;\n                                \n                                x_219516 ",
                   "= defunc_1_op_res_219518;\n                            }\n                        }\n                    }\n                    // write final result\n                    {\n                        if (!no_carry_in_234587) {\n                            ((__local\n                              double *) red_arr_mem_234568)[sext_i32_i64(local_tid_234564)] =\n                                x_219516;\n                        }\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // restore correct values for first block\n                {\n                    if (squot32(local_tid_234564, 32) == 0 &&\n                        ltid_in_bounds_234580) {\n                        ((__local\n                          double *) red_arr_mem_234568)[sext_i32_i64(local_tid_234564)] =\n                            x_219517;\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_234572) *\n                      squot64(segred_group_sizze_219508,\n                              segment_sizze_nonzzero_234561) +\n                      sext_i32_i64(local_tid_234564), partition_sizze_203577 *\n                      l_n_m_203643) && slt64(sext_i32_i64(local_tid_234564),\n                                             squot64(segred_group_sizze_219508,\n                                                     segment_sizze_nonzzero_234561))) {\n                double tmp_234589;\n                \n                tmp_234589 = ((__local\n                               double *) red_arr_mem_234568)[(sext_i32_i64(local_tid_234564) +\n                                                              (int64_t) 1) *\n                                                             segment_sizze_nonzzero_234561 -\n                                                             (int64_t) 1];\n             ",
                   "   ((__global\n                  double *) mem_230596)[squot64(sext_i32_i64(virt_group_id_234572) *\n                                                squot64(segred_group_sizze_219508,\n                                                        segment_sizze_nonzzero_234561) +\n                                                sext_i32_i64(local_tid_234564),\n                                                l_n_m_203643) * l_n_m_203643 +\n                                        (sext_i32_i64(virt_group_id_234572) *\n                                         squot64(segred_group_sizze_219508,\n                                                 segment_sizze_nonzzero_234561) +\n                                         sext_i32_i64(local_tid_234564) -\n                                         squot64(sext_i32_i64(virt_group_id_234572) *\n                                                 squot64(segred_group_sizze_219508,\n                                                         segment_sizze_nonzzero_234561) +\n                                                 sext_i32_i64(local_tid_234564),\n                                                 l_n_m_203643) *\n                                         l_n_m_203643)] = tmp_234589;\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_219508\n}\n__kernel void mainzisegred_small_219564(__global int *global_failure,\n                                        __local volatile\n                                        int64_t *red_arr_mem_234650_backing_aligned_0,\n                                        int64_t n_203490, int64_t q_l_203495,\n                                        int64_t jump_t_203500,\n                                        int64_t partition_sizze_203577,\n                                        int64_t l_n_m_203643, int64_t i_203670,\n                                        int64_t num_groups_219558,\n              ",
                   "                          int64_t ctx_param_ext_229488,\n                                        int64_t ctx_param_ext_229489,\n                                        int64_t ctx_param_ext_229491,\n                                        int64_t segment_sizze_nonzzero_234643,\n                                        __global unsigned char *ext_mem_229411,\n                                        __global unsigned char *ext_mem_229412,\n                                        __global\n                                        unsigned char *mem_param_229493,\n                                        __global unsigned char *mem_230551,\n                                        __global unsigned char *mem_230601,\n                                        __global unsigned char *mem_230606)\n{\n    #define segred_group_sizze_219557 (mainzisegred_group_sizze_219193)\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_234650_backing_0 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_234650_backing_aligned_0;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_234645;\n    int32_t local_tid_234646;\n    int64_t group_sizze_234649;\n    int32_t wave_sizze_234648;\n    int32_t group_tid_234647;\n    \n    global_tid_234645 = get_global_id(0);\n    local_tid_234646 = get_local_id(0);\n    group_sizze_234649 = get_local_size(0);\n    wave_sizze_234648 = LOCKSTEP_WIDTH;\n    group_tid_234647 = get_group_id(0);\n    \n    int32_t phys_tid_219564 = global_tid_234645;\n    __local unsigned char *red_arr_mem_234650;\n    \n    red_arr_mem_234650 = (__local unsigned char *) red_arr_mem_234650_backing_0;\n    \n    int32_t phys_group_id_234652;\n    \n    phys_group_id_234652 = get_group_id(0);\n    for (int32_t i_234653 = 0; i_234653 <\n         sdiv_up32(sext_i64_i32(sdiv_up64(partition_sizze_203577 * l_n_m_203643,\n       ",
                   "                                   squot64(segred_group_sizze_219557,\n                                                  segment_sizze_nonzzero_234643))) -\n                   phys_group_id_234652, sext_i64_i32(num_groups_219558));\n         i_234653++) {\n        int32_t virt_group_id_234654 = phys_group_id_234652 + i_234653 *\n                sext_i64_i32(num_groups_219558);\n        int64_t slice_234655 = l_n_m_203643;\n        int64_t slice_234656 = partition_sizze_203577 * slice_234655;\n        int64_t gtid_219561 = squot64(squot64(sext_i32_i64(local_tid_234646),\n                                              segment_sizze_nonzzero_234643) +\n                                      sext_i32_i64(virt_group_id_234654) *\n                                      squot64(segred_group_sizze_219557,\n                                              segment_sizze_nonzzero_234643),\n                                      slice_234655);\n        int64_t remnant_234657 = squot64(sext_i32_i64(local_tid_234646),\n                                         segment_sizze_nonzzero_234643) +\n                sext_i32_i64(virt_group_id_234654) *\n                squot64(segred_group_sizze_219557,\n                        segment_sizze_nonzzero_234643) - gtid_219561 *\n                slice_234655;\n        int64_t gtid_219562 = remnant_234657;\n        int64_t remnant_234658 = remnant_234657 - gtid_219562;\n        int64_t gtid_219563 = srem64(sext_i32_i64(local_tid_234646),\n                                     q_l_203495);\n        \n        // apply map function if in bounds\n        {\n            if (slt64((int64_t) 0, q_l_203495) && ((slt64(gtid_219561,\n                                                          partition_sizze_203577) &&\n                                                    slt64(gtid_219562,\n                                                          l_n_m_203643)) &&\n                                                   slt64(sext_i32_i64(local_tid_234646),\n                                        ",
                   "                 q_l_203495 *\n                                                         squot64(segred_group_sizze_219557,\n                                                                 segment_sizze_nonzzero_234643)))) {\n                int64_t x_219574;\n                \n                x_219574 = ((__global int64_t *) ext_mem_229412)[gtid_219561 *\n                                                                 l_n_m_203643 +\n                                                                 gtid_219562];\n                \n                double x_219575;\n                \n                x_219575 = ((__global double *) ext_mem_229411)[gtid_219561 *\n                                                                l_n_m_203643 +\n                                                                gtid_219562];\n                \n                int64_t binop_y_228689 = mul64(jump_t_203500, gtid_219562);\n                int64_t binop_y_228690 = smin64(i_203670, binop_y_228689);\n                int64_t index_primexp_228691 = add64((int64_t) 1,\n                                                     binop_y_228690);\n                double a0_219577;\n                \n                a0_219577 = ((__global double *) mem_230601)[gtid_219561 *\n                                                             l_n_m_203643 +\n                                                             gtid_219562];\n                \n                bool cond_219579 = sle64(n_203490, gtid_219563);\n                int64_t defunc_0_f_res_219580;\n                \n                if (cond_219579) {\n                    defunc_0_f_res_219580 = (int64_t) 0;\n                } else {\n                    int64_t i_219581 = add64(gtid_219563, x_219574);\n                    int64_t defunc_1_add_res_219582 = add64((int64_t) 1,\n                                                            i_219581);\n                    \n                    defunc_0_f_res_219580 = defunc_1_add_res_219582;\n                }\n                \n    ",
                   "            double defunc_0_f_res_219583;\n                \n                if (cond_219579) {\n                    defunc_0_f_res_219583 = 0.0;\n                } else {\n                    int64_t i_219584 = add64(gtid_219563, x_219574);\n                    double defunc_0_add_arg_219585;\n                    \n                    defunc_0_add_arg_219585 = ((__global\n                                                double *) mem_param_229493)[ctx_param_ext_229488 +\n                                                                            (gtid_219561 *\n                                                                             ctx_param_ext_229489 +\n                                                                             i_219584 *\n                                                                             ctx_param_ext_229491)];\n                    defunc_0_f_res_219583 = defunc_0_add_arg_219585;\n                }\n                \n                int64_t binop_p_219586 = sub64(defunc_0_f_res_219580,\n                                               index_primexp_228691);\n                double defunc_0_f_res_219587 = sitofp_i64_f64(binop_p_219586);\n                double abs_res_219588 = fabs(defunc_0_f_res_219587);\n                double tmp1_219589 = abs_res_219588 / x_219575;\n                double x_219590 = tmp1_219589 * tmp1_219589;\n                double y_219591 = tmp1_219589 * x_219590;\n                double tmp2_219592 = 1.0 - y_219591;\n                double x_219593 = tmp2_219592 * tmp2_219592;\n                double tmp3_219594 = tmp2_219592 * x_219593;\n                double tmp4_219595 = defunc_0_f_res_219583 * tmp3_219594;\n                double defunc_0_f_res_219596;\n                \n                if (cond_219579) {\n                    defunc_0_f_res_219596 = 0.0;\n                } else {\n                    int64_t i_219597 = add64(gtid_219563, x_219574);\n                    double defunc_0_add_arg_219598;\n                    \n                ",
                   "    defunc_0_add_arg_219598 = ((__global\n                                                double *) mem_230551)[gtid_219561 *\n                                                                      n_203490 +\n                                                                      i_219597];\n                    defunc_0_f_res_219596 = defunc_0_add_arg_219598;\n                }\n                \n                double x_219599 = a0_219577 * tmp4_219595;\n                double defunc_9_fit_fun_res_219600 = defunc_0_f_res_219596 *\n                       x_219599;\n                \n                // save map-out results\n                { }\n                // save results to be reduced\n                {\n                    ((__local\n                      double *) red_arr_mem_234650)[sext_i32_i64(local_tid_234646)] =\n                        defunc_9_fit_fun_res_219600;\n                }\n            } else {\n                ((__local\n                  double *) red_arr_mem_234650)[sext_i32_i64(local_tid_234646)] =\n                    0.0;\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        if (slt64((int64_t) 0, q_l_203495)) {\n            // perform segmented scan to imitate reduction\n            {\n                double x_219565;\n                double x_219566;\n                double x_234659;\n                double x_234660;\n                bool ltid_in_bounds_234662 =\n                     slt64(sext_i32_i64(local_tid_234646), q_l_203495 *\n                           squot64(segred_group_sizze_219557,\n                                   segment_sizze_nonzzero_234643));\n                int32_t skip_threads_234663;\n                \n                // read input for in-block scan\n                {\n                    if (ltid_in_bounds_234662) {\n                        x_219566 = ((volatile __local\n                                     double *) red_arr_mem_234650)[sext_i32_i64(local_tid_234646)];\n                        if ((local_tid_234646 - squot32(local_tid_2",
                   "34646, 32) *\n                             32) == 0) {\n                            x_219565 = x_219566;\n                        }\n                    }\n                }\n                // in-block scan (hopefully no barriers needed)\n                {\n                    skip_threads_234663 = 1;\n                    while (slt32(skip_threads_234663, 32)) {\n                        bool thread_active_234664 = sle32(skip_threads_234663,\n                                                          local_tid_234646 -\n                                                          squot32(local_tid_234646,\n                                                                  32) * 32) &&\n                             ltid_in_bounds_234662;\n                        \n                        if (thread_active_234664) {\n                            // read operands\n                            {\n                                x_219565 = ((volatile __local\n                                             double *) red_arr_mem_234650)[sext_i32_i64(local_tid_234646) -\n                                                                           sext_i32_i64(skip_threads_234663)];\n                            }\n                        }\n                        // perform operation\n                        {\n                            bool inactive_234665 =\n                                 slt64(srem64(sext_i32_i64(local_tid_234646),\n                                              q_l_203495),\n                                       sext_i32_i64(local_tid_234646) -\n                                       sext_i32_i64(local_tid_234646 -\n                                       skip_threads_234663));\n                            \n                            if (thread_active_234664 && inactive_234665) {\n                                x_219565 = x_219566;\n                            }\n                            if (thread_active_234664) {\n                                if (!inactive_234665) {\n                    ",
                   "                double defunc_1_op_res_219567 = x_219565 +\n                                           x_219566;\n                                    \n                                    x_219565 = defunc_1_op_res_219567;\n                                }\n                            }\n                        }\n                        if (sle32(wave_sizze_234648, skip_threads_234663)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        if (thread_active_234664) {\n                            // write result\n                            {\n                                ((volatile __local\n                                  double *) red_arr_mem_234650)[sext_i32_i64(local_tid_234646)] =\n                                    x_219565;\n                                x_219566 = x_219565;\n                            }\n                        }\n                        if (sle32(wave_sizze_234648, skip_threads_234663)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        skip_threads_234663 *= 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_234646 - squot32(local_tid_234646, 32) *\n                         32) == 31 && ltid_in_bounds_234662) {\n                        ((volatile __local\n                          double *) red_arr_mem_234650)[sext_i32_i64(squot32(local_tid_234646,\n                                                                             32))] =\n                            x_219565;\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_234666;\n                    \n                    // read input fo",
                   "r in-block scan\n                    {\n                        if (squot32(local_tid_234646, 32) == 0 &&\n                            ltid_in_bounds_234662) {\n                            x_234660 = ((volatile __local\n                                         double *) red_arr_mem_234650)[sext_i32_i64(local_tid_234646)];\n                            if ((local_tid_234646 - squot32(local_tid_234646,\n                                                            32) * 32) == 0) {\n                                x_234659 = x_234660;\n                            }\n                        }\n                    }\n                    // in-block scan (hopefully no barriers needed)\n                    {\n                        skip_threads_234666 = 1;\n                        while (slt32(skip_threads_234666, 32)) {\n                            bool thread_active_234667 =\n                                 sle32(skip_threads_234666, local_tid_234646 -\n                                       squot32(local_tid_234646, 32) * 32) &&\n                                 (squot32(local_tid_234646, 32) == 0 &&\n                                  ltid_in_bounds_234662);\n                            \n                            if (thread_active_234667) {\n                                // read operands\n                                {\n                                    x_234659 = ((volatile __local\n                                                 double *) red_arr_mem_234650)[sext_i32_i64(local_tid_234646) -\n                                                                               sext_i32_i64(skip_threads_234666)];\n                                }\n                            }\n                            // perform operation\n                            {\n                                bool inactive_234668 =\n                                     slt64(srem64(sext_i32_i64(local_tid_234646 *\n                                                  32 + 32 - 1), q_l_203495),\n                             ",
                   "              sext_i32_i64(local_tid_234646 * 32 +\n                                           32 - 1) -\n                                           sext_i32_i64((local_tid_234646 -\n                                                         skip_threads_234666) *\n                                           32 + 32 - 1));\n                                \n                                if (thread_active_234667 && inactive_234668) {\n                                    x_234659 = x_234660;\n                                }\n                                if (thread_active_234667) {\n                                    if (!inactive_234668) {\n                                        double defunc_1_op_res_234661 =\n                                               x_234659 + x_234660;\n                                        \n                                        x_234659 = defunc_1_op_res_234661;\n                                    }\n                                }\n                            }\n                            if (sle32(wave_sizze_234648, skip_threads_234666)) {\n                                barrier(CLK_LOCAL_MEM_FENCE);\n                            }\n                            if (thread_active_234667) {\n                                // write result\n                                {\n                                    ((volatile __local\n                                      double *) red_arr_mem_234650)[sext_i32_i64(local_tid_234646)] =\n                                        x_234659;\n                                    x_234660 = x_234659;\n                                }\n                            }\n                            if (sle32(wave_sizze_234648, skip_threads_234666)) {\n                                barrier(CLK_LOCAL_MEM_FENCE);\n                            }\n                            skip_threads_234666 *= 2;\n                        }\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                \n      ",
                   "          bool no_carry_in_234669 = squot32(local_tid_234646, 32) == 0 ||\n                     !ltid_in_bounds_234662;\n                \n                // carry-in for every block except the first\n                {\n                    // read operands\n                    {\n                        if (!no_carry_in_234669) {\n                            x_219566 = x_219565;\n                            x_219565 = ((__local\n                                         double *) red_arr_mem_234650)[sext_i32_i64(squot32(local_tid_234646,\n                                                                                            32)) -\n                                                                       (int64_t) 1];\n                        }\n                    }\n                    // perform operation\n                    {\n                        bool inactive_234670 =\n                             slt64(srem64(sext_i32_i64(local_tid_234646),\n                                          q_l_203495),\n                                   sext_i32_i64(local_tid_234646) -\n                                   sext_i32_i64(squot32(local_tid_234646, 32) *\n                                   32 - 1));\n                        \n                        if (!no_carry_in_234669) {\n                            if (inactive_234670) {\n                                x_219565 = x_219566;\n                            }\n                        }\n                        if (!no_carry_in_234669) {\n                            if (!inactive_234670) {\n                                double defunc_1_op_res_219567 = x_219565 +\n                                       x_219566;\n                                \n                                x_219565 = defunc_1_op_res_219567;\n                            }\n                        }\n                    }\n                    // write final result\n                    {\n                        if (!no_carry_in_234669) {\n                            ((__local\n         ",
                   "                     double *) red_arr_mem_234650)[sext_i32_i64(local_tid_234646)] =\n                                x_219565;\n                        }\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // restore correct values for first block\n                {\n                    if (squot32(local_tid_234646, 32) == 0 &&\n                        ltid_in_bounds_234662) {\n                        ((__local\n                          double *) red_arr_mem_234650)[sext_i32_i64(local_tid_234646)] =\n                            x_219566;\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_234654) *\n                      squot64(segred_group_sizze_219557,\n                              segment_sizze_nonzzero_234643) +\n                      sext_i32_i64(local_tid_234646), partition_sizze_203577 *\n                      l_n_m_203643) && slt64(sext_i32_i64(local_tid_234646),\n                                             squot64(segred_group_sizze_219557,\n                                                     segment_sizze_nonzzero_234643))) {\n                double tmp_234671;\n                \n                tmp_234671 = ((__local\n                               double *) red_arr_mem_234650)[(sext_i32_i64(local_tid_234646) +\n                                                              (int64_t) 1) *\n                                                             segment_sizze_nonzzero_234643 -\n                                                             (int64_t) 1];\n                ((__global\n                  double *) mem_230606)[squot64(sext_i32_i64(virt_group_id_234654) *\n                                                squot64(segred_group_sizze_219557,\n                                                        segment_sizze_nonzzero_23464",
                   "3) +\n                                                sext_i32_i64(local_tid_234646),\n                                                l_n_m_203643) * l_n_m_203643 +\n                                        (sext_i32_i64(virt_group_id_234654) *\n                                         squot64(segred_group_sizze_219557,\n                                                 segment_sizze_nonzzero_234643) +\n                                         sext_i32_i64(local_tid_234646) -\n                                         squot64(sext_i32_i64(virt_group_id_234654) *\n                                                 squot64(segred_group_sizze_219557,\n                                                         segment_sizze_nonzzero_234643) +\n                                                 sext_i32_i64(local_tid_234646),\n                                                 l_n_m_203643) *\n                                         l_n_m_203643)] = tmp_234671;\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_219557\n}\n__kernel void mainzisegred_small_220344(__global int *global_failure,\n                                        __local volatile\n                                        int64_t *red_arr_mem_234780_backing_aligned_0,\n                                        __local volatile\n                                        int64_t *red_arr_mem_234778_backing_aligned_1,\n                                        __local volatile\n                                        int64_t *red_arr_mem_234776_backing_aligned_2,\n                                        int64_t n_203490, int64_t q_l_203495,\n                                        int64_t jump_t_203500,\n                                        int64_t partition_sizze_203577,\n                                        int64_t l_n_m_203643, int64_t i_203670,\n                                        int64_t num_groups_",
                   "220336,\n                                        int64_t ctx_param_ext_229488,\n                                        int64_t ctx_param_ext_229489,\n                                        int64_t ctx_param_ext_229491,\n                                        int64_t segment_sizze_nonzzero_234769,\n                                        __global unsigned char *ext_mem_229411,\n                                        __global unsigned char *ext_mem_229412,\n                                        __global\n                                        unsigned char *mem_param_229493,\n                                        __global unsigned char *mem_230676,\n                                        __global unsigned char *mem_230680,\n                                        __global unsigned char *mem_230684)\n{\n    #define segred_group_sizze_220335 (mainzisegred_group_sizze_220012)\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_234780_backing_2 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_234780_backing_aligned_0;\n    __local volatile unsigned char *restrict red_arr_mem_234778_backing_1 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_234778_backing_aligned_1;\n    __local volatile unsigned char *restrict red_arr_mem_234776_backing_0 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_234776_backing_aligned_2;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_234771;\n    int32_t local_tid_234772;\n    int64_t group_sizze_234775;\n    int32_t wave_sizze_234774;\n    int32_t group_tid_234773;\n    \n    global_tid_234771 = get_global_id(0);\n    local_tid_234772 = get_local_id(0);\n    group_sizze_234775 = get_local_size(0);\n    wave_sizze_234774 =",
                   " LOCKSTEP_WIDTH;\n    group_tid_234773 = get_group_id(0);\n    \n    int32_t phys_tid_220344 = global_tid_234771;\n    __local unsigned char *red_arr_mem_234776;\n    \n    red_arr_mem_234776 = (__local unsigned char *) red_arr_mem_234776_backing_0;\n    \n    __local unsigned char *red_arr_mem_234778;\n    \n    red_arr_mem_234778 = (__local unsigned char *) red_arr_mem_234778_backing_1;\n    \n    __local unsigned char *red_arr_mem_234780;\n    \n    red_arr_mem_234780 = (__local unsigned char *) red_arr_mem_234780_backing_2;\n    \n    int32_t phys_group_id_234782;\n    \n    phys_group_id_234782 = get_group_id(0);\n    for (int32_t i_234783 = 0; i_234783 <\n         sdiv_up32(sext_i64_i32(sdiv_up64(partition_sizze_203577 * l_n_m_203643,\n                                          squot64(segred_group_sizze_220335,\n                                                  segment_sizze_nonzzero_234769))) -\n                   phys_group_id_234782, sext_i64_i32(num_groups_220336));\n         i_234783++) {\n        int32_t virt_group_id_234784 = phys_group_id_234782 + i_234783 *\n                sext_i64_i32(num_groups_220336);\n        int64_t slice_234785 = l_n_m_203643;\n        int64_t slice_234786 = partition_sizze_203577 * slice_234785;\n        int64_t gtid_220341 = squot64(squot64(sext_i32_i64(local_tid_234772),\n                                              segment_sizze_nonzzero_234769) +\n                                      sext_i32_i64(virt_group_id_234784) *\n                                      squot64(segred_group_sizze_220335,\n                                              segment_sizze_nonzzero_234769),\n                                      slice_234785);\n        int64_t remnant_234787 = squot64(sext_i32_i64(local_tid_234772),\n                                         segment_sizze_nonzzero_234769) +\n                sext_i32_i64(virt_group_id_234784) *\n                squot64(segred_group_sizze_220335,\n                        segment_sizze_nonzzero_234769) - gtid_220341 *\n              ",
                   "  slice_234785;\n        int64_t gtid_220342 = remnant_234787;\n        int64_t remnant_234788 = remnant_234787 - gtid_220342;\n        int64_t gtid_220343 = srem64(sext_i32_i64(local_tid_234772),\n                                     q_l_203495);\n        \n        // apply map function if in bounds\n        {\n            if (slt64((int64_t) 0, q_l_203495) && ((slt64(gtid_220341,\n                                                          partition_sizze_203577) &&\n                                                    slt64(gtid_220342,\n                                                          l_n_m_203643)) &&\n                                                   slt64(sext_i32_i64(local_tid_234772),\n                                                         q_l_203495 *\n                                                         squot64(segred_group_sizze_220335,\n                                                                 segment_sizze_nonzzero_234769)))) {\n                int64_t x_220358;\n                \n                x_220358 = ((__global int64_t *) ext_mem_229412)[gtid_220341 *\n                                                                 l_n_m_203643 +\n                                                                 gtid_220342];\n                \n                double x_220359;\n                \n                x_220359 = ((__global double *) ext_mem_229411)[gtid_220341 *\n                                                                l_n_m_203643 +\n                                                                gtid_220342];\n                \n                int64_t binop_y_228704 = mul64(jump_t_203500, gtid_220342);\n                int64_t binop_y_228705 = smin64(i_203670, binop_y_228704);\n                int64_t index_primexp_228706 = add64((int64_t) 1,\n                                                     binop_y_228705);\n                bool cond_220362 = sle64(n_203490, gtid_220343);\n                int64_t defunc_0_f_res_220363;\n                \n               ",
                   " if (cond_220362) {\n                    defunc_0_f_res_220363 = (int64_t) 0;\n                } else {\n                    int64_t i_220364 = add64(gtid_220343, x_220358);\n                    int64_t defunc_1_add_res_220365 = add64((int64_t) 1,\n                                                            i_220364);\n                    \n                    defunc_0_f_res_220363 = defunc_1_add_res_220365;\n                }\n                \n                double defunc_0_f_res_220366;\n                \n                if (cond_220362) {\n                    defunc_0_f_res_220366 = 0.0;\n                } else {\n                    int64_t i_220367 = add64(gtid_220343, x_220358);\n                    double defunc_0_add_arg_220368;\n                    \n                    defunc_0_add_arg_220368 = ((__global\n                                                double *) mem_param_229493)[ctx_param_ext_229488 +\n                                                                            (gtid_220341 *\n                                                                             ctx_param_ext_229489 +\n                                                                             i_220367 *\n                                                                             ctx_param_ext_229491)];\n                    defunc_0_f_res_220366 = defunc_0_add_arg_220368;\n                }\n                \n                int64_t binop_p_220369 = sub64(defunc_0_f_res_220363,\n                                               index_primexp_228706);\n                double defunc_0_f_res_220370 = sitofp_i64_f64(binop_p_220369);\n                double abs_res_220371 = fabs(defunc_0_f_res_220370);\n                double tmp1_220372 = abs_res_220371 / x_220359;\n                double x_220373 = tmp1_220372 * tmp1_220372;\n                double y_220374 = tmp1_220372 * x_220373;\n                double tmp2_220375 = 1.0 - y_220374;\n                double x_220376 = tmp2_220375 * tmp2_220375;\n                doubl",
                   "e tmp3_220377 = tmp2_220375 * x_220376;\n                double w_j_220378 = defunc_0_f_res_220366 * tmp3_220377;\n                double xw_j_220379 = defunc_0_f_res_220370 * w_j_220378;\n                double x2w_j_220380 = defunc_0_f_res_220370 * xw_j_220379;\n                \n                // save map-out results\n                { }\n                // save results to be reduced\n                {\n                    ((__local\n                      double *) red_arr_mem_234776)[sext_i32_i64(local_tid_234772)] =\n                        w_j_220378;\n                    ((__local\n                      double *) red_arr_mem_234778)[sext_i32_i64(local_tid_234772)] =\n                        xw_j_220379;\n                    ((__local\n                      double *) red_arr_mem_234780)[sext_i32_i64(local_tid_234772)] =\n                        x2w_j_220380;\n                }\n            } else {\n                ((__local\n                  double *) red_arr_mem_234776)[sext_i32_i64(local_tid_234772)] =\n                    0.0;\n                ((__local\n                  double *) red_arr_mem_234778)[sext_i32_i64(local_tid_234772)] =\n                    0.0;\n                ((__local\n                  double *) red_arr_mem_234780)[sext_i32_i64(local_tid_234772)] =\n                    0.0;\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        if (slt64((int64_t) 0, q_l_203495)) {\n            // perform segmented scan to imitate reduction\n            {\n                double x_220345;\n                double x_220346;\n                double x_220347;\n                double x_220348;\n                double x_220349;\n                double x_220350;\n                double x_234789;\n                double x_234790;\n                double x_234791;\n                double x_234792;\n                double x_234793;\n                double x_234794;\n                bool ltid_in_bounds_234798 =\n                     slt64(sext_i32_i64(local_tid_234772), q_l_203495 *\n       ",
                   "                    squot64(segred_group_sizze_220335,\n                                   segment_sizze_nonzzero_234769));\n                int32_t skip_threads_234799;\n                \n                // read input for in-block scan\n                {\n                    if (ltid_in_bounds_234798) {\n                        x_220348 = ((volatile __local\n                                     double *) red_arr_mem_234776)[sext_i32_i64(local_tid_234772)];\n                        x_220349 = ((volatile __local\n                                     double *) red_arr_mem_234778)[sext_i32_i64(local_tid_234772)];\n                        x_220350 = ((volatile __local\n                                     double *) red_arr_mem_234780)[sext_i32_i64(local_tid_234772)];\n                        if ((local_tid_234772 - squot32(local_tid_234772, 32) *\n                             32) == 0) {\n                            x_220345 = x_220348;\n                            x_220346 = x_220349;\n                            x_220347 = x_220350;\n                        }\n                    }\n                }\n                // in-block scan (hopefully no barriers needed)\n                {\n                    skip_threads_234799 = 1;\n                    while (slt32(skip_threads_234799, 32)) {\n                        bool thread_active_234800 = sle32(skip_threads_234799,\n                                                          local_tid_234772 -\n                                                          squot32(local_tid_234772,\n                                                                  32) * 32) &&\n                             ltid_in_bounds_234798;\n                        \n                        if (thread_active_234800) {\n                            // read operands\n                            {\n                                x_220345 = ((volatile __local\n                                             double *) red_arr_mem_234776)[sext_i32_i64(local_tid_234772) -\n                       ",
                   "                                                    sext_i32_i64(skip_threads_234799)];\n                                x_220346 = ((volatile __local\n                                             double *) red_arr_mem_234778)[sext_i32_i64(local_tid_234772) -\n                                                                           sext_i32_i64(skip_threads_234799)];\n                                x_220347 = ((volatile __local\n                                             double *) red_arr_mem_234780)[sext_i32_i64(local_tid_234772) -\n                                                                           sext_i32_i64(skip_threads_234799)];\n                            }\n                        }\n                        // perform operation\n                        {\n                            bool inactive_234801 =\n                                 slt64(srem64(sext_i32_i64(local_tid_234772),\n                                              q_l_203495),\n                                       sext_i32_i64(local_tid_234772) -\n                                       sext_i32_i64(local_tid_234772 -\n                                       skip_threads_234799));\n                            \n                            if (thread_active_234800 && inactive_234801) {\n                                x_220345 = x_220348;\n                                x_220346 = x_220349;\n                                x_220347 = x_220350;\n                            }\n                            if (thread_active_234800) {\n                                if (!inactive_234801) {\n                                    double defunc_1_op_res_220351 = x_220345 +\n                                           x_220348;\n                                    double defunc_1_op_res_220352 = x_220346 +\n                                           x_220349;\n                                    double defunc_1_op_res_220353 = x_220347 +\n                                           x_220350;\n                             ",
                   "       \n                                    x_220345 = defunc_1_op_res_220351;\n                                    x_220346 = defunc_1_op_res_220352;\n                                    x_220347 = defunc_1_op_res_220353;\n                                }\n                            }\n                        }\n                        if (sle32(wave_sizze_234774, skip_threads_234799)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        if (thread_active_234800) {\n                            // write result\n                            {\n                                ((volatile __local\n                                  double *) red_arr_mem_234776)[sext_i32_i64(local_tid_234772)] =\n                                    x_220345;\n                                x_220348 = x_220345;\n                                ((volatile __local\n                                  double *) red_arr_mem_234778)[sext_i32_i64(local_tid_234772)] =\n                                    x_220346;\n                                x_220349 = x_220346;\n                                ((volatile __local\n                                  double *) red_arr_mem_234780)[sext_i32_i64(local_tid_234772)] =\n                                    x_220347;\n                                x_220350 = x_220347;\n                            }\n                        }\n                        if (sle32(wave_sizze_234774, skip_threads_234799)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        skip_threads_234799 *= 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_234772 - squot32(local_tid_234772, 32) *\n                         32) == 31 && ltid_in_bounds_234798) {\n                        ((volatile __local\n                          dou",
                   "ble *) red_arr_mem_234776)[sext_i32_i64(squot32(local_tid_234772,\n                                                                             32))] =\n                            x_220345;\n                        ((volatile __local\n                          double *) red_arr_mem_234778)[sext_i32_i64(squot32(local_tid_234772,\n                                                                             32))] =\n                            x_220346;\n                        ((volatile __local\n                          double *) red_arr_mem_234780)[sext_i32_i64(squot32(local_tid_234772,\n                                                                             32))] =\n                            x_220347;\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_234802;\n                    \n                    // read input for in-block scan\n                    {\n                        if (squot32(local_tid_234772, 32) == 0 &&\n                            ltid_in_bounds_234798) {\n                            x_234792 = ((volatile __local\n                                         double *) red_arr_mem_234776)[sext_i32_i64(local_tid_234772)];\n                            x_234793 = ((volatile __local\n                                         double *) red_arr_mem_234778)[sext_i32_i64(local_tid_234772)];\n                            x_234794 = ((volatile __local\n                                         double *) red_arr_mem_234780)[sext_i32_i64(local_tid_234772)];\n                            if ((local_tid_234772 - squot32(local_tid_234772,\n                                                            32) * 32) == 0) {\n                                x_234789 = x_234792;\n                                x_234790 = x_234793;\n                                x_234791 = x_234794;\n                       ",
                   "     }\n                        }\n                    }\n                    // in-block scan (hopefully no barriers needed)\n                    {\n                        skip_threads_234802 = 1;\n                        while (slt32(skip_threads_234802, 32)) {\n                            bool thread_active_234803 =\n                                 sle32(skip_threads_234802, local_tid_234772 -\n                                       squot32(local_tid_234772, 32) * 32) &&\n                                 (squot32(local_tid_234772, 32) == 0 &&\n                                  ltid_in_bounds_234798);\n                            \n                            if (thread_active_234803) {\n                                // read operands\n                                {\n                                    x_234789 = ((volatile __local\n                                                 double *) red_arr_mem_234776)[sext_i32_i64(local_tid_234772) -\n                                                                               sext_i32_i64(skip_threads_234802)];\n                                    x_234790 = ((volatile __local\n                                                 double *) red_arr_mem_234778)[sext_i32_i64(local_tid_234772) -\n                                                                               sext_i32_i64(skip_threads_234802)];\n                                    x_234791 = ((volatile __local\n                                                 double *) red_arr_mem_234780)[sext_i32_i64(local_tid_234772) -\n                                                                               sext_i32_i64(skip_threads_234802)];\n                                }\n                            }\n                            // perform operation\n                            {\n                                bool inactive_234804 =\n                                     slt64(srem64(sext_i32_i64(local_tid_234772 *\n                                                  32 + 32 - 1), q_l_203",
                   "495),\n                                           sext_i32_i64(local_tid_234772 * 32 +\n                                           32 - 1) -\n                                           sext_i32_i64((local_tid_234772 -\n                                                         skip_threads_234802) *\n                                           32 + 32 - 1));\n                                \n                                if (thread_active_234803 && inactive_234804) {\n                                    x_234789 = x_234792;\n                                    x_234790 = x_234793;\n                                    x_234791 = x_234794;\n                                }\n                                if (thread_active_234803) {\n                                    if (!inactive_234804) {\n                                        double defunc_1_op_res_234795 =\n                                               x_234789 + x_234792;\n                                        double defunc_1_op_res_234796 =\n                                               x_234790 + x_234793;\n                                        double defunc_1_op_res_234797 =\n                                               x_234791 + x_234794;\n                                        \n                                        x_234789 = defunc_1_op_res_234795;\n                                        x_234790 = defunc_1_op_res_234796;\n                                        x_234791 = defunc_1_op_res_234797;\n                                    }\n                                }\n                            }\n                            if (sle32(wave_sizze_234774, skip_threads_234802)) {\n                                barrier(CLK_LOCAL_MEM_FENCE);\n                            }\n                            if (thread_active_234803) {\n                                // write result\n                                {\n                                    ((volatile __local\n                                      double *) red_arr_",
                   "mem_234776)[sext_i32_i64(local_tid_234772)] =\n                                        x_234789;\n                                    x_234792 = x_234789;\n                                    ((volatile __local\n                                      double *) red_arr_mem_234778)[sext_i32_i64(local_tid_234772)] =\n                                        x_234790;\n                                    x_234793 = x_234790;\n                                    ((volatile __local\n                                      double *) red_arr_mem_234780)[sext_i32_i64(local_tid_234772)] =\n                                        x_234791;\n                                    x_234794 = x_234791;\n                                }\n                            }\n                            if (sle32(wave_sizze_234774, skip_threads_234802)) {\n                                barrier(CLK_LOCAL_MEM_FENCE);\n                            }\n                            skip_threads_234802 *= 2;\n                        }\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                \n                bool no_carry_in_234805 = squot32(local_tid_234772, 32) == 0 ||\n                     !ltid_in_bounds_234798;\n                \n                // carry-in for every block except the first\n                {\n                    // read operands\n                    {\n                        if (!no_carry_in_234805) {\n                            x_220348 = x_220345;\n                            x_220349 = x_220346;\n                            x_220350 = x_220347;\n                            x_220345 = ((__local\n                                         double *) red_arr_mem_234776)[sext_i32_i64(squot32(local_tid_234772,\n                                                                                            32)) -\n                                                                       (int64_t) 1];\n                            x_220346 = ((__local\n                             ",
                   "            double *) red_arr_mem_234778)[sext_i32_i64(squot32(local_tid_234772,\n                                                                                            32)) -\n                                                                       (int64_t) 1];\n                            x_220347 = ((__local\n                                         double *) red_arr_mem_234780)[sext_i32_i64(squot32(local_tid_234772,\n                                                                                            32)) -\n                                                                       (int64_t) 1];\n                        }\n                    }\n                    // perform operation\n                    {\n                        bool inactive_234806 =\n                             slt64(srem64(sext_i32_i64(local_tid_234772),\n                                          q_l_203495),\n                                   sext_i32_i64(local_tid_234772) -\n                                   sext_i32_i64(squot32(local_tid_234772, 32) *\n                                   32 - 1));\n                        \n                        if (!no_carry_in_234805) {\n                            if (inactive_234806) {\n                                x_220345 = x_220348;\n                                x_220346 = x_220349;\n                                x_220347 = x_220350;\n                            }\n                        }\n                        if (!no_carry_in_234805) {\n                            if (!inactive_234806) {\n                                double defunc_1_op_res_220351 = x_220345 +\n                                       x_220348;\n                                double defunc_1_op_res_220352 = x_220346 +\n                                       x_220349;\n                                double defunc_1_op_res_220353 = x_220347 +\n                                       x_220350;\n                                \n                                x_220345 = defunc_1_op_res_220",
                   "351;\n                                x_220346 = defunc_1_op_res_220352;\n                                x_220347 = defunc_1_op_res_220353;\n                            }\n                        }\n                    }\n                    // write final result\n                    {\n                        if (!no_carry_in_234805) {\n                            ((__local\n                              double *) red_arr_mem_234776)[sext_i32_i64(local_tid_234772)] =\n                                x_220345;\n                            ((__local\n                              double *) red_arr_mem_234778)[sext_i32_i64(local_tid_234772)] =\n                                x_220346;\n                            ((__local\n                              double *) red_arr_mem_234780)[sext_i32_i64(local_tid_234772)] =\n                                x_220347;\n                        }\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // restore correct values for first block\n                {\n                    if (squot32(local_tid_234772, 32) == 0 &&\n                        ltid_in_bounds_234798) {\n                        ((__local\n                          double *) red_arr_mem_234776)[sext_i32_i64(local_tid_234772)] =\n                            x_220348;\n                        ((__local\n                          double *) red_arr_mem_234778)[sext_i32_i64(local_tid_234772)] =\n                            x_220349;\n                        ((__local\n                          double *) red_arr_mem_234780)[sext_i32_i64(local_tid_234772)] =\n                            x_220350;\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_234784) *\n                      squot64(segred_group_sizze_220335,\n                              segment_sizze_no",
                   "nzzero_234769) +\n                      sext_i32_i64(local_tid_234772), partition_sizze_203577 *\n                      l_n_m_203643) && slt64(sext_i32_i64(local_tid_234772),\n                                             squot64(segred_group_sizze_220335,\n                                                     segment_sizze_nonzzero_234769))) {\n                double tmp_234807;\n                \n                tmp_234807 = ((__local\n                               double *) red_arr_mem_234776)[(sext_i32_i64(local_tid_234772) +\n                                                              (int64_t) 1) *\n                                                             segment_sizze_nonzzero_234769 -\n                                                             (int64_t) 1];\n                ((__global\n                  double *) mem_230676)[squot64(sext_i32_i64(virt_group_id_234784) *\n                                                squot64(segred_group_sizze_220335,\n                                                        segment_sizze_nonzzero_234769) +\n                                                sext_i32_i64(local_tid_234772),\n                                                l_n_m_203643) * l_n_m_203643 +\n                                        (sext_i32_i64(virt_group_id_234784) *\n                                         squot64(segred_group_sizze_220335,\n                                                 segment_sizze_nonzzero_234769) +\n                                         sext_i32_i64(local_tid_234772) -\n                                         squot64(sext_i32_i64(virt_group_id_234784) *\n                                                 squot64(segred_group_sizze_220335,\n                                                         segment_sizze_nonzzero_234769) +\n                                                 sext_i32_i64(local_tid_234772),\n                                                 l_n_m_203643) *\n                                         l_n_m_203643)] = tmp_234807;",
                   "\n                \n                double tmp_234808;\n                \n                tmp_234808 = ((__local\n                               double *) red_arr_mem_234778)[(sext_i32_i64(local_tid_234772) +\n                                                              (int64_t) 1) *\n                                                             segment_sizze_nonzzero_234769 -\n                                                             (int64_t) 1];\n                ((__global\n                  double *) mem_230680)[squot64(sext_i32_i64(virt_group_id_234784) *\n                                                squot64(segred_group_sizze_220335,\n                                                        segment_sizze_nonzzero_234769) +\n                                                sext_i32_i64(local_tid_234772),\n                                                l_n_m_203643) * l_n_m_203643 +\n                                        (sext_i32_i64(virt_group_id_234784) *\n                                         squot64(segred_group_sizze_220335,\n                                                 segment_sizze_nonzzero_234769) +\n                                         sext_i32_i64(local_tid_234772) -\n                                         squot64(sext_i32_i64(virt_group_id_234784) *\n                                                 squot64(segred_group_sizze_220335,\n                                                         segment_sizze_nonzzero_234769) +\n                                                 sext_i32_i64(local_tid_234772),\n                                                 l_n_m_203643) *\n                                         l_n_m_203643)] = tmp_234808;\n                \n                double tmp_234809;\n                \n                tmp_234809 = ((__local\n                               double *) red_arr_mem_234780)[(sext_i32_i64(local_tid_234772) +\n                                                              (int64_t) 1) *\n                                          ",
                   "                   segment_sizze_nonzzero_234769 -\n                                                             (int64_t) 1];\n                ((__global\n                  double *) mem_230684)[squot64(sext_i32_i64(virt_group_id_234784) *\n                                                squot64(segred_group_sizze_220335,\n                                                        segment_sizze_nonzzero_234769) +\n                                                sext_i32_i64(local_tid_234772),\n                                                l_n_m_203643) * l_n_m_203643 +\n                                        (sext_i32_i64(virt_group_id_234784) *\n                                         squot64(segred_group_sizze_220335,\n                                                 segment_sizze_nonzzero_234769) +\n                                         sext_i32_i64(local_tid_234772) -\n                                         squot64(sext_i32_i64(virt_group_id_234784) *\n                                                 squot64(segred_group_sizze_220335,\n                                                         segment_sizze_nonzzero_234769) +\n                                                 sext_i32_i64(local_tid_234772),\n                                                 l_n_m_203643) *\n                                         l_n_m_203643)] = tmp_234809;\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_220335\n}\n__kernel void mainzisegred_small_220413(__global int *global_failure,\n                                        __local volatile\n                                        int64_t *red_arr_mem_234888_backing_aligned_0,\n                                        __local volatile\n                                        int64_t *red_arr_mem_234886_backing_aligned_1,\n                                        int64_t n_203490, int64_t q_l_203495,\n             ",
                   "                           int64_t jump_t_203500,\n                                        int64_t partition_sizze_203577,\n                                        int64_t l_n_m_203643, int64_t i_203670,\n                                        int64_t num_groups_220406,\n                                        int64_t ctx_param_ext_229488,\n                                        int64_t ctx_param_ext_229489,\n                                        int64_t ctx_param_ext_229491,\n                                        int64_t segment_sizze_nonzzero_234879,\n                                        __global unsigned char *ext_mem_229411,\n                                        __global unsigned char *ext_mem_229412,\n                                        __global\n                                        unsigned char *mem_param_229493,\n                                        __global unsigned char *mem_230551,\n                                        __global unsigned char *mem_230689,\n                                        __global unsigned char *mem_230693,\n                                        __global unsigned char *mem_230697,\n                                        __global unsigned char *mem_230702,\n                                        __global unsigned char *mem_230706)\n{\n    #define segred_group_sizze_220405 (mainzisegred_group_sizze_219918)\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_234888_backing_1 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_234888_backing_aligned_0;\n    __local volatile unsigned char *restrict red_arr_mem_234886_backing_0 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_234886_backing_aligned_1;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_234881;\n    int3",
                   "2_t local_tid_234882;\n    int64_t group_sizze_234885;\n    int32_t wave_sizze_234884;\n    int32_t group_tid_234883;\n    \n    global_tid_234881 = get_global_id(0);\n    local_tid_234882 = get_local_id(0);\n    group_sizze_234885 = get_local_size(0);\n    wave_sizze_234884 = LOCKSTEP_WIDTH;\n    group_tid_234883 = get_group_id(0);\n    \n    int32_t phys_tid_220413 = global_tid_234881;\n    __local unsigned char *red_arr_mem_234886;\n    \n    red_arr_mem_234886 = (__local unsigned char *) red_arr_mem_234886_backing_0;\n    \n    __local unsigned char *red_arr_mem_234888;\n    \n    red_arr_mem_234888 = (__local unsigned char *) red_arr_mem_234888_backing_1;\n    \n    int32_t phys_group_id_234890;\n    \n    phys_group_id_234890 = get_group_id(0);\n    for (int32_t i_234891 = 0; i_234891 <\n         sdiv_up32(sext_i64_i32(sdiv_up64(partition_sizze_203577 * l_n_m_203643,\n                                          squot64(segred_group_sizze_220405,\n                                                  segment_sizze_nonzzero_234879))) -\n                   phys_group_id_234890, sext_i64_i32(num_groups_220406));\n         i_234891++) {\n        int32_t virt_group_id_234892 = phys_group_id_234890 + i_234891 *\n                sext_i64_i32(num_groups_220406);\n        int64_t slice_234893 = l_n_m_203643;\n        int64_t slice_234894 = partition_sizze_203577 * slice_234893;\n        int64_t gtid_220410 = squot64(squot64(sext_i32_i64(local_tid_234882),\n                                              segment_sizze_nonzzero_234879) +\n                                      sext_i32_i64(virt_group_id_234892) *\n                                      squot64(segred_group_sizze_220405,\n                                              segment_sizze_nonzzero_234879),\n                                      slice_234893);\n        int64_t remnant_234895 = squot64(sext_i32_i64(local_tid_234882),\n                                         segment_sizze_nonzzero_234879) +\n                sext_i32_i64(virt_group_id_234892) *\n     ",
                   "           squot64(segred_group_sizze_220405,\n                        segment_sizze_nonzzero_234879) - gtid_220410 *\n                slice_234893;\n        int64_t gtid_220411 = remnant_234895;\n        int64_t remnant_234896 = remnant_234895 - gtid_220411;\n        int64_t gtid_220412 = srem64(sext_i32_i64(local_tid_234882),\n                                     q_l_203495);\n        \n        // apply map function if in bounds\n        {\n            if (slt64((int64_t) 0, q_l_203495) && ((slt64(gtid_220410,\n                                                          partition_sizze_203577) &&\n                                                    slt64(gtid_220411,\n                                                          l_n_m_203643)) &&\n                                                   slt64(sext_i32_i64(local_tid_234882),\n                                                         q_l_203495 *\n                                                         squot64(segred_group_sizze_220405,\n                                                                 segment_sizze_nonzzero_234879)))) {\n                int64_t x_220428;\n                \n                x_220428 = ((__global int64_t *) ext_mem_229412)[gtid_220410 *\n                                                                 l_n_m_203643 +\n                                                                 gtid_220411];\n                \n                double x_220429;\n                \n                x_220429 = ((__global double *) ext_mem_229411)[gtid_220410 *\n                                                                l_n_m_203643 +\n                                                                gtid_220411];\n                \n                int64_t binop_y_228699 = mul64(jump_t_203500, gtid_220411);\n                int64_t binop_y_228700 = smin64(i_203670, binop_y_228699);\n                int64_t index_primexp_228701 = add64((int64_t) 1,\n                                                     binop_y_228700);\n             ",
                   "   double a11_220431;\n                \n                a11_220431 = ((__global double *) mem_230689)[gtid_220410 *\n                                                              l_n_m_203643 +\n                                                              gtid_220411];\n                \n                double b11_220432;\n                \n                b11_220432 = ((__global double *) mem_230693)[gtid_220410 *\n                                                              l_n_m_203643 +\n                                                              gtid_220411];\n                \n                double c11_220433;\n                \n                c11_220433 = ((__global double *) mem_230697)[gtid_220410 *\n                                                              l_n_m_203643 +\n                                                              gtid_220411];\n                \n                bool cond_220435 = sle64(n_203490, gtid_220412);\n                int64_t defunc_0_f_res_220436;\n                \n                if (cond_220435) {\n                    defunc_0_f_res_220436 = (int64_t) 0;\n                } else {\n                    int64_t i_220437 = add64(gtid_220412, x_220428);\n                    int64_t defunc_1_add_res_220438 = add64((int64_t) 1,\n                                                            i_220437);\n                    \n                    defunc_0_f_res_220436 = defunc_1_add_res_220438;\n                }\n                \n                double defunc_0_f_res_220439;\n                \n                if (cond_220435) {\n                    defunc_0_f_res_220439 = 0.0;\n                } else {\n                    int64_t i_220440 = add64(gtid_220412, x_220428);\n                    double defunc_0_add_arg_220441;\n                    \n                    defunc_0_add_arg_220441 = ((__global\n                                                double *) mem_param_229493)[ctx_param_ext_229488 +\n                                                                 ",
                   "           (gtid_220410 *\n                                                                             ctx_param_ext_229489 +\n                                                                             i_220440 *\n                                                                             ctx_param_ext_229491)];\n                    defunc_0_f_res_220439 = defunc_0_add_arg_220441;\n                }\n                \n                int64_t binop_p_220442 = sub64(defunc_0_f_res_220436,\n                                               index_primexp_228701);\n                double defunc_0_f_res_220443 = sitofp_i64_f64(binop_p_220442);\n                double abs_res_220444 = fabs(defunc_0_f_res_220443);\n                double tmp1_220445 = abs_res_220444 / x_220429;\n                double x_220446 = tmp1_220445 * tmp1_220445;\n                double y_220447 = tmp1_220445 * x_220446;\n                double tmp2_220448 = 1.0 - y_220447;\n                double x_220449 = tmp2_220448 * tmp2_220448;\n                double tmp3_220450 = tmp2_220448 * x_220449;\n                double tmp4_220451 = defunc_0_f_res_220439 * tmp3_220450;\n                double defunc_1_f_res_220452 = defunc_0_f_res_220443 *\n                       tmp4_220451;\n                double defunc_0_f_res_220453;\n                \n                if (cond_220435) {\n                    defunc_0_f_res_220453 = 0.0;\n                } else {\n                    int64_t i_220454 = add64(gtid_220412, x_220428);\n                    double defunc_0_add_arg_220455;\n                    \n                    defunc_0_add_arg_220455 = ((__global\n                                                double *) mem_230551)[gtid_220410 *\n                                                                      n_203490 +\n                                                                      i_220454];\n                    defunc_0_f_res_220453 = defunc_0_add_arg_220455;\n                }\n                \n                double x_220456 =",
                   " a11_220431 * tmp4_220451;\n                double y_220457 = b11_220432 * defunc_1_f_res_220452;\n                double x_220458 = x_220456 + y_220457;\n                double defunc_9_fit_fun_res_220459 = defunc_0_f_res_220453 *\n                       x_220458;\n                double x_220460 = b11_220432 * tmp4_220451;\n                double y_220461 = c11_220433 * defunc_1_f_res_220452;\n                double x_220462 = x_220460 + y_220461;\n                double defunc_9_slope_fun_res_220463 = defunc_0_f_res_220453 *\n                       x_220462;\n                \n                // save map-out results\n                { }\n                // save results to be reduced\n                {\n                    ((__local\n                      double *) red_arr_mem_234886)[sext_i32_i64(local_tid_234882)] =\n                        defunc_9_fit_fun_res_220459;\n                    ((__local\n                      double *) red_arr_mem_234888)[sext_i32_i64(local_tid_234882)] =\n                        defunc_9_slope_fun_res_220463;\n                }\n            } else {\n                ((__local\n                  double *) red_arr_mem_234886)[sext_i32_i64(local_tid_234882)] =\n                    0.0;\n                ((__local\n                  double *) red_arr_mem_234888)[sext_i32_i64(local_tid_234882)] =\n                    0.0;\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        if (slt64((int64_t) 0, q_l_203495)) {\n            // perform segmented scan to imitate reduction\n            {\n                double x_220414;\n                double x_220415;\n                double x_220416;\n                double x_220417;\n                double x_234897;\n                double x_234898;\n                double x_234899;\n                double x_234900;\n                bool ltid_in_bounds_234903 =\n                     slt64(sext_i32_i64(local_tid_234882), q_l_203495 *\n                           squot64(segred_group_sizze_220405,\n                               ",
                   "    segment_sizze_nonzzero_234879));\n                int32_t skip_threads_234904;\n                \n                // read input for in-block scan\n                {\n                    if (ltid_in_bounds_234903) {\n                        x_220416 = ((volatile __local\n                                     double *) red_arr_mem_234886)[sext_i32_i64(local_tid_234882)];\n                        x_220417 = ((volatile __local\n                                     double *) red_arr_mem_234888)[sext_i32_i64(local_tid_234882)];\n                        if ((local_tid_234882 - squot32(local_tid_234882, 32) *\n                             32) == 0) {\n                            x_220414 = x_220416;\n                            x_220415 = x_220417;\n                        }\n                    }\n                }\n                // in-block scan (hopefully no barriers needed)\n                {\n                    skip_threads_234904 = 1;\n                    while (slt32(skip_threads_234904, 32)) {\n                        bool thread_active_234905 = sle32(skip_threads_234904,\n                                                          local_tid_234882 -\n                                                          squot32(local_tid_234882,\n                                                                  32) * 32) &&\n                             ltid_in_bounds_234903;\n                        \n                        if (thread_active_234905) {\n                            // read operands\n                            {\n                                x_220414 = ((volatile __local\n                                             double *) red_arr_mem_234886)[sext_i32_i64(local_tid_234882) -\n                                                                           sext_i32_i64(skip_threads_234904)];\n                                x_220415 = ((volatile __local\n                                             double *) red_arr_mem_234888)[sext_i32_i64(local_tid_234882) -\n                               ",
                   "                                            sext_i32_i64(skip_threads_234904)];\n                            }\n                        }\n                        // perform operation\n                        {\n                            bool inactive_234906 =\n                                 slt64(srem64(sext_i32_i64(local_tid_234882),\n                                              q_l_203495),\n                                       sext_i32_i64(local_tid_234882) -\n                                       sext_i32_i64(local_tid_234882 -\n                                       skip_threads_234904));\n                            \n                            if (thread_active_234905 && inactive_234906) {\n                                x_220414 = x_220416;\n                                x_220415 = x_220417;\n                            }\n                            if (thread_active_234905) {\n                                if (!inactive_234906) {\n                                    double defunc_1_op_res_220418 = x_220414 +\n                                           x_220416;\n                                    double defunc_1_op_res_220419 = x_220415 +\n                                           x_220417;\n                                    \n                                    x_220414 = defunc_1_op_res_220418;\n                                    x_220415 = defunc_1_op_res_220419;\n                                }\n                            }\n                        }\n                        if (sle32(wave_sizze_234884, skip_threads_234904)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        if (thread_active_234905) {\n                            // write result\n                            {\n                                ((volatile __local\n                                  double *) red_arr_mem_234886)[sext_i32_i64(local_tid_234882)] =\n                                    x_220414;\n                                x",
                   "_220416 = x_220414;\n                                ((volatile __local\n                                  double *) red_arr_mem_234888)[sext_i32_i64(local_tid_234882)] =\n                                    x_220415;\n                                x_220417 = x_220415;\n                            }\n                        }\n                        if (sle32(wave_sizze_234884, skip_threads_234904)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        skip_threads_234904 *= 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_234882 - squot32(local_tid_234882, 32) *\n                         32) == 31 && ltid_in_bounds_234903) {\n                        ((volatile __local\n                          double *) red_arr_mem_234886)[sext_i32_i64(squot32(local_tid_234882,\n                                                                             32))] =\n                            x_220414;\n                        ((volatile __local\n                          double *) red_arr_mem_234888)[sext_i32_i64(squot32(local_tid_234882,\n                                                                             32))] =\n                            x_220415;\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_234907;\n                    \n                    // read input for in-block scan\n                    {\n                        if (squot32(local_tid_234882, 32) == 0 &&\n                            ltid_in_bounds_234903) {\n                            x_234899 = ((volatile __local\n                                         double *) red_arr_mem_234886)[sext_i32_i64(local_tid_234882)",
                   "];\n                            x_234900 = ((volatile __local\n                                         double *) red_arr_mem_234888)[sext_i32_i64(local_tid_234882)];\n                            if ((local_tid_234882 - squot32(local_tid_234882,\n                                                            32) * 32) == 0) {\n                                x_234897 = x_234899;\n                                x_234898 = x_234900;\n                            }\n                        }\n                    }\n                    // in-block scan (hopefully no barriers needed)\n                    {\n                        skip_threads_234907 = 1;\n                        while (slt32(skip_threads_234907, 32)) {\n                            bool thread_active_234908 =\n                                 sle32(skip_threads_234907, local_tid_234882 -\n                                       squot32(local_tid_234882, 32) * 32) &&\n                                 (squot32(local_tid_234882, 32) == 0 &&\n                                  ltid_in_bounds_234903);\n                            \n                            if (thread_active_234908) {\n                                // read operands\n                                {\n                                    x_234897 = ((volatile __local\n                                                 double *) red_arr_mem_234886)[sext_i32_i64(local_tid_234882) -\n                                                                               sext_i32_i64(skip_threads_234907)];\n                                    x_234898 = ((volatile __local\n                                                 double *) red_arr_mem_234888)[sext_i32_i64(local_tid_234882) -\n                                                                               sext_i32_i64(skip_threads_234907)];\n                                }\n                            }\n                            // perform operation\n                            {\n                                bool inactive_23490",
                   "9 =\n                                     slt64(srem64(sext_i32_i64(local_tid_234882 *\n                                                  32 + 32 - 1), q_l_203495),\n                                           sext_i32_i64(local_tid_234882 * 32 +\n                                           32 - 1) -\n                                           sext_i32_i64((local_tid_234882 -\n                                                         skip_threads_234907) *\n                                           32 + 32 - 1));\n                                \n                                if (thread_active_234908 && inactive_234909) {\n                                    x_234897 = x_234899;\n                                    x_234898 = x_234900;\n                                }\n                                if (thread_active_234908) {\n                                    if (!inactive_234909) {\n                                        double defunc_1_op_res_234901 =\n                                               x_234897 + x_234899;\n                                        double defunc_1_op_res_234902 =\n                                               x_234898 + x_234900;\n                                        \n                                        x_234897 = defunc_1_op_res_234901;\n                                        x_234898 = defunc_1_op_res_234902;\n                                    }\n                                }\n                            }\n                            if (sle32(wave_sizze_234884, skip_threads_234907)) {\n                                barrier(CLK_LOCAL_MEM_FENCE);\n                            }\n                            if (thread_active_234908) {\n                                // write result\n                                {\n                                    ((volatile __local\n                                      double *) red_arr_mem_234886)[sext_i32_i64(local_tid_234882)] =\n                                        x_234897;\n                   ",
                   "                 x_234899 = x_234897;\n                                    ((volatile __local\n                                      double *) red_arr_mem_234888)[sext_i32_i64(local_tid_234882)] =\n                                        x_234898;\n                                    x_234900 = x_234898;\n                                }\n                            }\n                            if (sle32(wave_sizze_234884, skip_threads_234907)) {\n                                barrier(CLK_LOCAL_MEM_FENCE);\n                            }\n                            skip_threads_234907 *= 2;\n                        }\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                \n                bool no_carry_in_234910 = squot32(local_tid_234882, 32) == 0 ||\n                     !ltid_in_bounds_234903;\n                \n                // carry-in for every block except the first\n                {\n                    // read operands\n                    {\n                        if (!no_carry_in_234910) {\n                            x_220416 = x_220414;\n                            x_220417 = x_220415;\n                            x_220414 = ((__local\n                                         double *) red_arr_mem_234886)[sext_i32_i64(squot32(local_tid_234882,\n                                                                                            32)) -\n                                                                       (int64_t) 1];\n                            x_220415 = ((__local\n                                         double *) red_arr_mem_234888)[sext_i32_i64(squot32(local_tid_234882,\n                                                                                            32)) -\n                                                                       (int64_t) 1];\n                        }\n                    }\n                    // perform operation\n                    {\n                        bool inactive_234911 =\n     ",
                   "                        slt64(srem64(sext_i32_i64(local_tid_234882),\n                                          q_l_203495),\n                                   sext_i32_i64(local_tid_234882) -\n                                   sext_i32_i64(squot32(local_tid_234882, 32) *\n                                   32 - 1));\n                        \n                        if (!no_carry_in_234910) {\n                            if (inactive_234911) {\n                                x_220414 = x_220416;\n                                x_220415 = x_220417;\n                            }\n                        }\n                        if (!no_carry_in_234910) {\n                            if (!inactive_234911) {\n                                double defunc_1_op_res_220418 = x_220414 +\n                                       x_220416;\n                                double defunc_1_op_res_220419 = x_220415 +\n                                       x_220417;\n                                \n                                x_220414 = defunc_1_op_res_220418;\n                                x_220415 = defunc_1_op_res_220419;\n                            }\n                        }\n                    }\n                    // write final result\n                    {\n                        if (!no_carry_in_234910) {\n                            ((__local\n                              double *) red_arr_mem_234886)[sext_i32_i64(local_tid_234882)] =\n                                x_220414;\n                            ((__local\n                              double *) red_arr_mem_234888)[sext_i32_i64(local_tid_234882)] =\n                                x_220415;\n                        }\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // restore correct values for first block\n                {\n                    if (squot32(local_tid_234882, 32) == 0 &&\n                        ltid_in_bounds_234903) {\n                        ((__local\n  ",
                   "                        double *) red_arr_mem_234886)[sext_i32_i64(local_tid_234882)] =\n                            x_220416;\n                        ((__local\n                          double *) red_arr_mem_234888)[sext_i32_i64(local_tid_234882)] =\n                            x_220417;\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_234892) *\n                      squot64(segred_group_sizze_220405,\n                              segment_sizze_nonzzero_234879) +\n                      sext_i32_i64(local_tid_234882), partition_sizze_203577 *\n                      l_n_m_203643) && slt64(sext_i32_i64(local_tid_234882),\n                                             squot64(segred_group_sizze_220405,\n                                                     segment_sizze_nonzzero_234879))) {\n                double tmp_234912;\n                \n                tmp_234912 = ((__local\n                               double *) red_arr_mem_234886)[(sext_i32_i64(local_tid_234882) +\n                                                              (int64_t) 1) *\n                                                             segment_sizze_nonzzero_234879 -\n                                                             (int64_t) 1];\n                ((__global\n                  double *) mem_230702)[squot64(sext_i32_i64(virt_group_id_234892) *\n                                                squot64(segred_group_sizze_220405,\n                                                        segment_sizze_nonzzero_234879) +\n                                                sext_i32_i64(local_tid_234882),\n                                                l_n_m_203643) * l_n_m_203643 +\n                                        (sext_i32_i64(virt_group_id_234892) *\n                                         squot64(segred_gr",
                   "oup_sizze_220405,\n                                                 segment_sizze_nonzzero_234879) +\n                                         sext_i32_i64(local_tid_234882) -\n                                         squot64(sext_i32_i64(virt_group_id_234892) *\n                                                 squot64(segred_group_sizze_220405,\n                                                         segment_sizze_nonzzero_234879) +\n                                                 sext_i32_i64(local_tid_234882),\n                                                 l_n_m_203643) *\n                                         l_n_m_203643)] = tmp_234912;\n                \n                double tmp_234913;\n                \n                tmp_234913 = ((__local\n                               double *) red_arr_mem_234888)[(sext_i32_i64(local_tid_234882) +\n                                                              (int64_t) 1) *\n                                                             segment_sizze_nonzzero_234879 -\n                                                             (int64_t) 1];\n                ((__global\n                  double *) mem_230706)[squot64(sext_i32_i64(virt_group_id_234892) *\n                                                squot64(segred_group_sizze_220405,\n                                                        segment_sizze_nonzzero_234879) +\n                                                sext_i32_i64(local_tid_234882),\n                                                l_n_m_203643) * l_n_m_203643 +\n                                        (sext_i32_i64(virt_group_id_234892) *\n                                         squot64(segred_group_sizze_220405,\n                                                 segment_sizze_nonzzero_234879) +\n                                         sext_i32_i64(local_tid_234882) -\n                                         squot64(sext_i32_i64(virt_group_id_234892) *\n                                                 squot64(segred",
                   "_group_sizze_220405,\n                                                         segment_sizze_nonzzero_234879) +\n                                                 sext_i32_i64(local_tid_234882),\n                                                 l_n_m_203643) *\n                                         l_n_m_203643)] = tmp_234913;\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_220405\n}\n__kernel void mainzisegred_small_221423(__global int *global_failure,\n                                        __local volatile\n                                        int64_t *red_arr_mem_235038_backing_aligned_0,\n                                        __local volatile\n                                        int64_t *red_arr_mem_235036_backing_aligned_1,\n                                        __local volatile\n                                        int64_t *red_arr_mem_235034_backing_aligned_2,\n                                        __local volatile\n                                        int64_t *red_arr_mem_235032_backing_aligned_3,\n                                        __local volatile\n                                        int64_t *red_arr_mem_235030_backing_aligned_4,\n                                        int64_t n_203490, int64_t q_l_203495,\n                                        int64_t jump_t_203500,\n                                        int64_t partition_sizze_203577,\n                                        int64_t l_n_m_203643, int64_t i_203670,\n                                        int64_t num_groups_221413,\n                                        int64_t ctx_param_ext_229488,\n                                        int64_t ctx_param_ext_229489,\n                                        int64_t ctx_param_ext_229491,\n                                        int64_t segment_sizze_nonzzero_235023,\n                                      ",
                   "  __global unsigned char *ext_mem_229411,\n                                        __global unsigned char *ext_mem_229412,\n                                        __global\n                                        unsigned char *mem_param_229493,\n                                        __global unsigned char *mem_230783,\n                                        __global unsigned char *mem_230787,\n                                        __global unsigned char *mem_230791,\n                                        __global unsigned char *mem_230795,\n                                        __global unsigned char *mem_230799)\n{\n    #define segred_group_sizze_221412 (mainzisegred_group_sizze_221009)\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_235038_backing_4 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_235038_backing_aligned_0;\n    __local volatile unsigned char *restrict red_arr_mem_235036_backing_3 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_235036_backing_aligned_1;\n    __local volatile unsigned char *restrict red_arr_mem_235034_backing_2 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_235034_backing_aligned_2;\n    __local volatile unsigned char *restrict red_arr_mem_235032_backing_1 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_235032_backing_aligned_3;\n    __local volatile unsigned char *restrict red_arr_mem_235030_backing_0 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_235030_backing_aligned_4;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_235025;\n    int32_t local_ti",
                   "d_235026;\n    int64_t group_sizze_235029;\n    int32_t wave_sizze_235028;\n    int32_t group_tid_235027;\n    \n    global_tid_235025 = get_global_id(0);\n    local_tid_235026 = get_local_id(0);\n    group_sizze_235029 = get_local_size(0);\n    wave_sizze_235028 = LOCKSTEP_WIDTH;\n    group_tid_235027 = get_group_id(0);\n    \n    int32_t phys_tid_221423 = global_tid_235025;\n    __local unsigned char *red_arr_mem_235030;\n    \n    red_arr_mem_235030 = (__local unsigned char *) red_arr_mem_235030_backing_0;\n    \n    __local unsigned char *red_arr_mem_235032;\n    \n    red_arr_mem_235032 = (__local unsigned char *) red_arr_mem_235032_backing_1;\n    \n    __local unsigned char *red_arr_mem_235034;\n    \n    red_arr_mem_235034 = (__local unsigned char *) red_arr_mem_235034_backing_2;\n    \n    __local unsigned char *red_arr_mem_235036;\n    \n    red_arr_mem_235036 = (__local unsigned char *) red_arr_mem_235036_backing_3;\n    \n    __local unsigned char *red_arr_mem_235038;\n    \n    red_arr_mem_235038 = (__local unsigned char *) red_arr_mem_235038_backing_4;\n    \n    int32_t phys_group_id_235040;\n    \n    phys_group_id_235040 = get_group_id(0);\n    for (int32_t i_235041 = 0; i_235041 <\n         sdiv_up32(sext_i64_i32(sdiv_up64(partition_sizze_203577 * l_n_m_203643,\n                                          squot64(segred_group_sizze_221412,\n                                                  segment_sizze_nonzzero_235023))) -\n                   phys_group_id_235040, sext_i64_i32(num_groups_221413));\n         i_235041++) {\n        int32_t virt_group_id_235042 = phys_group_id_235040 + i_235041 *\n                sext_i64_i32(num_groups_221413);\n        int64_t slice_235043 = l_n_m_203643;\n        int64_t slice_235044 = partition_sizze_203577 * slice_235043;\n        int64_t gtid_221420 = squot64(squot64(sext_i32_i64(local_tid_235026),\n                                              segment_sizze_nonzzero_235023) +\n                                      sext_i32_i64(virt_group_id_235042) *\n       ",
                   "                               squot64(segred_group_sizze_221412,\n                                              segment_sizze_nonzzero_235023),\n                                      slice_235043);\n        int64_t remnant_235045 = squot64(sext_i32_i64(local_tid_235026),\n                                         segment_sizze_nonzzero_235023) +\n                sext_i32_i64(virt_group_id_235042) *\n                squot64(segred_group_sizze_221412,\n                        segment_sizze_nonzzero_235023) - gtid_221420 *\n                slice_235043;\n        int64_t gtid_221421 = remnant_235045;\n        int64_t remnant_235046 = remnant_235045 - gtid_221421;\n        int64_t gtid_221422 = srem64(sext_i32_i64(local_tid_235026),\n                                     q_l_203495);\n        \n        // apply map function if in bounds\n        {\n            if (slt64((int64_t) 0, q_l_203495) && ((slt64(gtid_221420,\n                                                          partition_sizze_203577) &&\n                                                    slt64(gtid_221421,\n                                                          l_n_m_203643)) &&\n                                                   slt64(sext_i32_i64(local_tid_235026),\n                                                         q_l_203495 *\n                                                         squot64(segred_group_sizze_221412,\n                                                                 segment_sizze_nonzzero_235023)))) {\n                int64_t x_221443;\n                \n                x_221443 = ((__global int64_t *) ext_mem_229412)[gtid_221420 *\n                                                                 l_n_m_203643 +\n                                                                 gtid_221421];\n                \n                double x_221444;\n                \n                x_221444 = ((__global double *) ext_mem_229411)[gtid_221420 *\n                                                                l_n_m_20",
                   "3643 +\n                                                                gtid_221421];\n                \n                int64_t binop_y_228714 = mul64(jump_t_203500, gtid_221421);\n                int64_t binop_y_228715 = smin64(i_203670, binop_y_228714);\n                int64_t index_primexp_228716 = add64((int64_t) 1,\n                                                     binop_y_228715);\n                bool cond_221447 = sle64(n_203490, gtid_221422);\n                int64_t defunc_0_f_res_221448;\n                \n                if (cond_221447) {\n                    defunc_0_f_res_221448 = (int64_t) 0;\n                } else {\n                    int64_t i_221449 = add64(gtid_221422, x_221443);\n                    int64_t defunc_1_add_res_221450 = add64((int64_t) 1,\n                                                            i_221449);\n                    \n                    defunc_0_f_res_221448 = defunc_1_add_res_221450;\n                }\n                \n                double defunc_0_f_res_221451;\n                \n                if (cond_221447) {\n                    defunc_0_f_res_221451 = 0.0;\n                } else {\n                    int64_t i_221452 = add64(gtid_221422, x_221443);\n                    double defunc_0_add_arg_221453;\n                    \n                    defunc_0_add_arg_221453 = ((__global\n                                                double *) mem_param_229493)[ctx_param_ext_229488 +\n                                                                            (gtid_221420 *\n                                                                             ctx_param_ext_229489 +\n                                                                             i_221452 *\n                                                                             ctx_param_ext_229491)];\n                    defunc_0_f_res_221451 = defunc_0_add_arg_221453;\n                }\n                \n                int64_t binop_p_221454 = sub64(defunc_0_f_res_221448,\n   ",
                   "                                            index_primexp_228716);\n                double defunc_0_f_res_221455 = sitofp_i64_f64(binop_p_221454);\n                double abs_res_221456 = fabs(defunc_0_f_res_221455);\n                double tmp1_221457 = abs_res_221456 / x_221444;\n                double x_221458 = tmp1_221457 * tmp1_221457;\n                double y_221459 = tmp1_221457 * x_221458;\n                double tmp2_221460 = 1.0 - y_221459;\n                double x_221461 = tmp2_221460 * tmp2_221460;\n                double tmp3_221462 = tmp2_221460 * x_221461;\n                double w_j_221463 = defunc_0_f_res_221451 * tmp3_221462;\n                double xw_j_221464 = defunc_0_f_res_221455 * w_j_221463;\n                double x2w_j_221465 = defunc_0_f_res_221455 * xw_j_221464;\n                double x3w_j_221466 = defunc_0_f_res_221455 * x2w_j_221465;\n                double x4w_j_221467 = defunc_0_f_res_221455 * x3w_j_221466;\n                \n                // save map-out results\n                { }\n                // save results to be reduced\n                {\n                    ((__local\n                      double *) red_arr_mem_235030)[sext_i32_i64(local_tid_235026)] =\n                        w_j_221463;\n                    ((__local\n                      double *) red_arr_mem_235032)[sext_i32_i64(local_tid_235026)] =\n                        xw_j_221464;\n                    ((__local\n                      double *) red_arr_mem_235034)[sext_i32_i64(local_tid_235026)] =\n                        x2w_j_221465;\n                    ((__local\n                      double *) red_arr_mem_235036)[sext_i32_i64(local_tid_235026)] =\n                        x3w_j_221466;\n                    ((__local\n                      double *) red_arr_mem_235038)[sext_i32_i64(local_tid_235026)] =\n                        x4w_j_221467;\n                }\n            } else {\n                ((__local\n                  double *) red_arr_mem_235030)[sext_i32_i64(local_tid_235026)] =",
                   "\n                    0.0;\n                ((__local\n                  double *) red_arr_mem_235032)[sext_i32_i64(local_tid_235026)] =\n                    0.0;\n                ((__local\n                  double *) red_arr_mem_235034)[sext_i32_i64(local_tid_235026)] =\n                    0.0;\n                ((__local\n                  double *) red_arr_mem_235036)[sext_i32_i64(local_tid_235026)] =\n                    0.0;\n                ((__local\n                  double *) red_arr_mem_235038)[sext_i32_i64(local_tid_235026)] =\n                    0.0;\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        if (slt64((int64_t) 0, q_l_203495)) {\n            // perform segmented scan to imitate reduction\n            {\n                double x_221424;\n                double x_221425;\n                double x_221426;\n                double x_221427;\n                double x_221428;\n                double x_221429;\n                double x_221430;\n                double x_221431;\n                double x_221432;\n                double x_221433;\n                double x_235047;\n                double x_235048;\n                double x_235049;\n                double x_235050;\n                double x_235051;\n                double x_235052;\n                double x_235053;\n                double x_235054;\n                double x_235055;\n                double x_235056;\n                bool ltid_in_bounds_235062 =\n                     slt64(sext_i32_i64(local_tid_235026), q_l_203495 *\n                           squot64(segred_group_sizze_221412,\n                                   segment_sizze_nonzzero_235023));\n                int32_t skip_threads_235063;\n                \n                // read input for in-block scan\n                {\n                    if (ltid_in_bounds_235062) {\n                        x_221429 = ((volatile __local\n                                     double *) red_arr_mem_235030)[sext_i32_i64(local_tid_235026)];\n                       ",
                   " x_221430 = ((volatile __local\n                                     double *) red_arr_mem_235032)[sext_i32_i64(local_tid_235026)];\n                        x_221431 = ((volatile __local\n                                     double *) red_arr_mem_235034)[sext_i32_i64(local_tid_235026)];\n                        x_221432 = ((volatile __local\n                                     double *) red_arr_mem_235036)[sext_i32_i64(local_tid_235026)];\n                        x_221433 = ((volatile __local\n                                     double *) red_arr_mem_235038)[sext_i32_i64(local_tid_235026)];\n                        if ((local_tid_235026 - squot32(local_tid_235026, 32) *\n                             32) == 0) {\n                            x_221424 = x_221429;\n                            x_221425 = x_221430;\n                            x_221426 = x_221431;\n                            x_221427 = x_221432;\n                            x_221428 = x_221433;\n                        }\n                    }\n                }\n                // in-block scan (hopefully no barriers needed)\n                {\n                    skip_threads_235063 = 1;\n                    while (slt32(skip_threads_235063, 32)) {\n                        bool thread_active_235064 = sle32(skip_threads_235063,\n                                                          local_tid_235026 -\n                                                          squot32(local_tid_235026,\n                                                                  32) * 32) &&\n                             ltid_in_bounds_235062;\n                        \n                        if (thread_active_235064) {\n                            // read operands\n                            {\n                                x_221424 = ((volatile __local\n                                             double *) red_arr_mem_235030)[sext_i32_i64(local_tid_235026) -\n                                                                           sext_i32_i64(skip_t",
                   "hreads_235063)];\n                                x_221425 = ((volatile __local\n                                             double *) red_arr_mem_235032)[sext_i32_i64(local_tid_235026) -\n                                                                           sext_i32_i64(skip_threads_235063)];\n                                x_221426 = ((volatile __local\n                                             double *) red_arr_mem_235034)[sext_i32_i64(local_tid_235026) -\n                                                                           sext_i32_i64(skip_threads_235063)];\n                                x_221427 = ((volatile __local\n                                             double *) red_arr_mem_235036)[sext_i32_i64(local_tid_235026) -\n                                                                           sext_i32_i64(skip_threads_235063)];\n                                x_221428 = ((volatile __local\n                                             double *) red_arr_mem_235038)[sext_i32_i64(local_tid_235026) -\n                                                                           sext_i32_i64(skip_threads_235063)];\n                            }\n                        }\n                        // perform operation\n                        {\n                            bool inactive_235065 =\n                                 slt64(srem64(sext_i32_i64(local_tid_235026),\n                                              q_l_203495),\n                                       sext_i32_i64(local_tid_235026) -\n                                       sext_i32_i64(local_tid_235026 -\n                                       skip_threads_235063));\n                            \n                            if (thread_active_235064 && inactive_235065) {\n                                x_221424 = x_221429;\n                                x_221425 = x_221430;\n                                x_221426 = x_221431;\n                                x_221427 = x_221432;\n                       ",
                   "         x_221428 = x_221433;\n                            }\n                            if (thread_active_235064) {\n                                if (!inactive_235065) {\n                                    double defunc_1_op_res_221434 = x_221424 +\n                                           x_221429;\n                                    double defunc_1_op_res_221435 = x_221425 +\n                                           x_221430;\n                                    double defunc_1_op_res_221436 = x_221426 +\n                                           x_221431;\n                                    double defunc_1_op_res_221437 = x_221427 +\n                                           x_221432;\n                                    double defunc_1_op_res_221438 = x_221428 +\n                                           x_221433;\n                                    \n                                    x_221424 = defunc_1_op_res_221434;\n                                    x_221425 = defunc_1_op_res_221435;\n                                    x_221426 = defunc_1_op_res_221436;\n                                    x_221427 = defunc_1_op_res_221437;\n                                    x_221428 = defunc_1_op_res_221438;\n                                }\n                            }\n                        }\n                        if (sle32(wave_sizze_235028, skip_threads_235063)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        if (thread_active_235064) {\n                            // write result\n                            {\n                                ((volatile __local\n                                  double *) red_arr_mem_235030)[sext_i32_i64(local_tid_235026)] =\n                                    x_221424;\n                                x_221429 = x_221424;\n                                ((volatile __local\n                                  double *) red_arr_mem_235032)[sext_i32_i64(local_tid_235026)] =\n  ",
                   "                                  x_221425;\n                                x_221430 = x_221425;\n                                ((volatile __local\n                                  double *) red_arr_mem_235034)[sext_i32_i64(local_tid_235026)] =\n                                    x_221426;\n                                x_221431 = x_221426;\n                                ((volatile __local\n                                  double *) red_arr_mem_235036)[sext_i32_i64(local_tid_235026)] =\n                                    x_221427;\n                                x_221432 = x_221427;\n                                ((volatile __local\n                                  double *) red_arr_mem_235038)[sext_i32_i64(local_tid_235026)] =\n                                    x_221428;\n                                x_221433 = x_221428;\n                            }\n                        }\n                        if (sle32(wave_sizze_235028, skip_threads_235063)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        skip_threads_235063 *= 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_235026 - squot32(local_tid_235026, 32) *\n                         32) == 31 && ltid_in_bounds_235062) {\n                        ((volatile __local\n                          double *) red_arr_mem_235030)[sext_i32_i64(squot32(local_tid_235026,\n                                                                             32))] =\n                            x_221424;\n                        ((volatile __local\n                          double *) red_arr_mem_235032)[sext_i32_i64(squot32(local_tid_235026,\n                                                                             32))] =\n                            x_221425;\n                        ((volatile __local\n        ",
                   "                  double *) red_arr_mem_235034)[sext_i32_i64(squot32(local_tid_235026,\n                                                                             32))] =\n                            x_221426;\n                        ((volatile __local\n                          double *) red_arr_mem_235036)[sext_i32_i64(squot32(local_tid_235026,\n                                                                             32))] =\n                            x_221427;\n                        ((volatile __local\n                          double *) red_arr_mem_235038)[sext_i32_i64(squot32(local_tid_235026,\n                                                                             32))] =\n                            x_221428;\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_235066;\n                    \n                    // read input for in-block scan\n                    {\n                        if (squot32(local_tid_235026, 32) == 0 &&\n                            ltid_in_bounds_235062) {\n                            x_235052 = ((volatile __local\n                                         double *) red_arr_mem_235030)[sext_i32_i64(local_tid_235026)];\n                            x_235053 = ((volatile __local\n                                         double *) red_arr_mem_235032)[sext_i32_i64(local_tid_235026)];\n                            x_235054 = ((volatile __local\n                                         double *) red_arr_mem_235034)[sext_i32_i64(local_tid_235026)];\n                            x_235055 = ((volatile __local\n                                         double *) red_arr_mem_235036)[sext_i32_i64(local_tid_235026)];\n                            x_235056 = ((volatile __local\n                                         double *) red_arr_mem_235038)[sext_i32_i64(local_tid_235",
                   "026)];\n                            if ((local_tid_235026 - squot32(local_tid_235026,\n                                                            32) * 32) == 0) {\n                                x_235047 = x_235052;\n                                x_235048 = x_235053;\n                                x_235049 = x_235054;\n                                x_235050 = x_235055;\n                                x_235051 = x_235056;\n                            }\n                        }\n                    }\n                    // in-block scan (hopefully no barriers needed)\n                    {\n                        skip_threads_235066 = 1;\n                        while (slt32(skip_threads_235066, 32)) {\n                            bool thread_active_235067 =\n                                 sle32(skip_threads_235066, local_tid_235026 -\n                                       squot32(local_tid_235026, 32) * 32) &&\n                                 (squot32(local_tid_235026, 32) == 0 &&\n                                  ltid_in_bounds_235062);\n                            \n                            if (thread_active_235067) {\n                                // read operands\n                                {\n                                    x_235047 = ((volatile __local\n                                                 double *) red_arr_mem_235030)[sext_i32_i64(local_tid_235026) -\n                                                                               sext_i32_i64(skip_threads_235066)];\n                                    x_235048 = ((volatile __local\n                                                 double *) red_arr_mem_235032)[sext_i32_i64(local_tid_235026) -\n                                                                               sext_i32_i64(skip_threads_235066)];\n                                    x_235049 = ((volatile __local\n                                                 double *) red_arr_mem_235034)[sext_i32_i64(local_tid_235026) -\n               ",
                   "                                                                sext_i32_i64(skip_threads_235066)];\n                                    x_235050 = ((volatile __local\n                                                 double *) red_arr_mem_235036)[sext_i32_i64(local_tid_235026) -\n                                                                               sext_i32_i64(skip_threads_235066)];\n                                    x_235051 = ((volatile __local\n                                                 double *) red_arr_mem_235038)[sext_i32_i64(local_tid_235026) -\n                                                                               sext_i32_i64(skip_threads_235066)];\n                                }\n                            }\n                            // perform operation\n                            {\n                                bool inactive_235068 =\n                                     slt64(srem64(sext_i32_i64(local_tid_235026 *\n                                                  32 + 32 - 1), q_l_203495),\n                                           sext_i32_i64(local_tid_235026 * 32 +\n                                           32 - 1) -\n                                           sext_i32_i64((local_tid_235026 -\n                                                         skip_threads_235066) *\n                                           32 + 32 - 1));\n                                \n                                if (thread_active_235067 && inactive_235068) {\n                                    x_235047 = x_235052;\n                                    x_235048 = x_235053;\n                                    x_235049 = x_235054;\n                                    x_235050 = x_235055;\n                                    x_235051 = x_235056;\n                                }\n                                if (thread_active_235067) {\n                                    if (!inactive_235068) {\n                                        double defunc_1_op_",
                   "res_235057 =\n                                               x_235047 + x_235052;\n                                        double defunc_1_op_res_235058 =\n                                               x_235048 + x_235053;\n                                        double defunc_1_op_res_235059 =\n                                               x_235049 + x_235054;\n                                        double defunc_1_op_res_235060 =\n                                               x_235050 + x_235055;\n                                        double defunc_1_op_res_235061 =\n                                               x_235051 + x_235056;\n                                        \n                                        x_235047 = defunc_1_op_res_235057;\n                                        x_235048 = defunc_1_op_res_235058;\n                                        x_235049 = defunc_1_op_res_235059;\n                                        x_235050 = defunc_1_op_res_235060;\n                                        x_235051 = defunc_1_op_res_235061;\n                                    }\n                                }\n                            }\n                            if (sle32(wave_sizze_235028, skip_threads_235066)) {\n                                barrier(CLK_LOCAL_MEM_FENCE);\n                            }\n                            if (thread_active_235067) {\n                                // write result\n                                {\n                                    ((volatile __local\n                                      double *) red_arr_mem_235030)[sext_i32_i64(local_tid_235026)] =\n                                        x_235047;\n                                    x_235052 = x_235047;\n                                    ((volatile __local\n                                      double *) red_arr_mem_235032)[sext_i32_i64(local_tid_235026)] =\n                                        x_235048;\n                                    x_235053 = x_235048;\n  ",
                   "                                  ((volatile __local\n                                      double *) red_arr_mem_235034)[sext_i32_i64(local_tid_235026)] =\n                                        x_235049;\n                                    x_235054 = x_235049;\n                                    ((volatile __local\n                                      double *) red_arr_mem_235036)[sext_i32_i64(local_tid_235026)] =\n                                        x_235050;\n                                    x_235055 = x_235050;\n                                    ((volatile __local\n                                      double *) red_arr_mem_235038)[sext_i32_i64(local_tid_235026)] =\n                                        x_235051;\n                                    x_235056 = x_235051;\n                                }\n                            }\n                            if (sle32(wave_sizze_235028, skip_threads_235066)) {\n                                barrier(CLK_LOCAL_MEM_FENCE);\n                            }\n                            skip_threads_235066 *= 2;\n                        }\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                \n                bool no_carry_in_235069 = squot32(local_tid_235026, 32) == 0 ||\n                     !ltid_in_bounds_235062;\n                \n                // carry-in for every block except the first\n                {\n                    // read operands\n                    {\n                        if (!no_carry_in_235069) {\n                            x_221429 = x_221424;\n                            x_221430 = x_221425;\n                            x_221431 = x_221426;\n                            x_221432 = x_221427;\n                            x_221433 = x_221428;\n                            x_221424 = ((__local\n                                         double *) red_arr_mem_235030)[sext_i32_i64(squot32(local_tid_235026,\n                                                       ",
                   "                                     32)) -\n                                                                       (int64_t) 1];\n                            x_221425 = ((__local\n                                         double *) red_arr_mem_235032)[sext_i32_i64(squot32(local_tid_235026,\n                                                                                            32)) -\n                                                                       (int64_t) 1];\n                            x_221426 = ((__local\n                                         double *) red_arr_mem_235034)[sext_i32_i64(squot32(local_tid_235026,\n                                                                                            32)) -\n                                                                       (int64_t) 1];\n                            x_221427 = ((__local\n                                         double *) red_arr_mem_235036)[sext_i32_i64(squot32(local_tid_235026,\n                                                                                            32)) -\n                                                                       (int64_t) 1];\n                            x_221428 = ((__local\n                                         double *) red_arr_mem_235038)[sext_i32_i64(squot32(local_tid_235026,\n                                                                                            32)) -\n                                                                       (int64_t) 1];\n                        }\n                    }\n                    // perform operation\n                    {\n                        bool inactive_235070 =\n                             slt64(srem64(sext_i32_i64(local_tid_235026),\n                                          q_l_203495),\n                                   sext_i32_i64(local_tid_235026) -\n                                   sext_i32_i64(squot32(local_tid_235026, 32) *\n                                   32 - 1));\n                   ",
                   "     \n                        if (!no_carry_in_235069) {\n                            if (inactive_235070) {\n                                x_221424 = x_221429;\n                                x_221425 = x_221430;\n                                x_221426 = x_221431;\n                                x_221427 = x_221432;\n                                x_221428 = x_221433;\n                            }\n                        }\n                        if (!no_carry_in_235069) {\n                            if (!inactive_235070) {\n                                double defunc_1_op_res_221434 = x_221424 +\n                                       x_221429;\n                                double defunc_1_op_res_221435 = x_221425 +\n                                       x_221430;\n                                double defunc_1_op_res_221436 = x_221426 +\n                                       x_221431;\n                                double defunc_1_op_res_221437 = x_221427 +\n                                       x_221432;\n                                double defunc_1_op_res_221438 = x_221428 +\n                                       x_221433;\n                                \n                                x_221424 = defunc_1_op_res_221434;\n                                x_221425 = defunc_1_op_res_221435;\n                                x_221426 = defunc_1_op_res_221436;\n                                x_221427 = defunc_1_op_res_221437;\n                                x_221428 = defunc_1_op_res_221438;\n                            }\n                        }\n                    }\n                    // write final result\n                    {\n                        if (!no_carry_in_235069) {\n                            ((__local\n                              double *) red_arr_mem_235030)[sext_i32_i64(local_tid_235026)] =\n                                x_221424;\n                            ((__local\n                              double *) red_arr_mem_235032)[sext_i32_i64(lo",
                   "cal_tid_235026)] =\n                                x_221425;\n                            ((__local\n                              double *) red_arr_mem_235034)[sext_i32_i64(local_tid_235026)] =\n                                x_221426;\n                            ((__local\n                              double *) red_arr_mem_235036)[sext_i32_i64(local_tid_235026)] =\n                                x_221427;\n                            ((__local\n                              double *) red_arr_mem_235038)[sext_i32_i64(local_tid_235026)] =\n                                x_221428;\n                        }\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // restore correct values for first block\n                {\n                    if (squot32(local_tid_235026, 32) == 0 &&\n                        ltid_in_bounds_235062) {\n                        ((__local\n                          double *) red_arr_mem_235030)[sext_i32_i64(local_tid_235026)] =\n                            x_221429;\n                        ((__local\n                          double *) red_arr_mem_235032)[sext_i32_i64(local_tid_235026)] =\n                            x_221430;\n                        ((__local\n                          double *) red_arr_mem_235034)[sext_i32_i64(local_tid_235026)] =\n                            x_221431;\n                        ((__local\n                          double *) red_arr_mem_235036)[sext_i32_i64(local_tid_235026)] =\n                            x_221432;\n                        ((__local\n                          double *) red_arr_mem_235038)[sext_i32_i64(local_tid_235026)] =\n                            x_221433;\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_235042) *\n                      squot64(segred_group_sizze_2",
                   "21412,\n                              segment_sizze_nonzzero_235023) +\n                      sext_i32_i64(local_tid_235026), partition_sizze_203577 *\n                      l_n_m_203643) && slt64(sext_i32_i64(local_tid_235026),\n                                             squot64(segred_group_sizze_221412,\n                                                     segment_sizze_nonzzero_235023))) {\n                double tmp_235071;\n                \n                tmp_235071 = ((__local\n                               double *) red_arr_mem_235030)[(sext_i32_i64(local_tid_235026) +\n                                                              (int64_t) 1) *\n                                                             segment_sizze_nonzzero_235023 -\n                                                             (int64_t) 1];\n                ((__global\n                  double *) mem_230783)[squot64(sext_i32_i64(virt_group_id_235042) *\n                                                squot64(segred_group_sizze_221412,\n                                                        segment_sizze_nonzzero_235023) +\n                                                sext_i32_i64(local_tid_235026),\n                                                l_n_m_203643) * l_n_m_203643 +\n                                        (sext_i32_i64(virt_group_id_235042) *\n                                         squot64(segred_group_sizze_221412,\n                                                 segment_sizze_nonzzero_235023) +\n                                         sext_i32_i64(local_tid_235026) -\n                                         squot64(sext_i32_i64(virt_group_id_235042) *\n                                                 squot64(segred_group_sizze_221412,\n                                                         segment_sizze_nonzzero_235023) +\n                                                 sext_i32_i64(local_tid_235026),\n                                                 l_n_m_203643) *\n                ",
                   "                         l_n_m_203643)] = tmp_235071;\n                \n                double tmp_235072;\n                \n                tmp_235072 = ((__local\n                               double *) red_arr_mem_235032)[(sext_i32_i64(local_tid_235026) +\n                                                              (int64_t) 1) *\n                                                             segment_sizze_nonzzero_235023 -\n                                                             (int64_t) 1];\n                ((__global\n                  double *) mem_230787)[squot64(sext_i32_i64(virt_group_id_235042) *\n                                                squot64(segred_group_sizze_221412,\n                                                        segment_sizze_nonzzero_235023) +\n                                                sext_i32_i64(local_tid_235026),\n                                                l_n_m_203643) * l_n_m_203643 +\n                                        (sext_i32_i64(virt_group_id_235042) *\n                                         squot64(segred_group_sizze_221412,\n                                                 segment_sizze_nonzzero_235023) +\n                                         sext_i32_i64(local_tid_235026) -\n                                         squot64(sext_i32_i64(virt_group_id_235042) *\n                                                 squot64(segred_group_sizze_221412,\n                                                         segment_sizze_nonzzero_235023) +\n                                                 sext_i32_i64(local_tid_235026),\n                                                 l_n_m_203643) *\n                                         l_n_m_203643)] = tmp_235072;\n                \n                double tmp_235073;\n                \n                tmp_235073 = ((__local\n                               double *) red_arr_mem_235034)[(sext_i32_i64(local_tid_235026) +\n                                                              (int",
                   "64_t) 1) *\n                                                             segment_sizze_nonzzero_235023 -\n                                                             (int64_t) 1];\n                ((__global\n                  double *) mem_230791)[squot64(sext_i32_i64(virt_group_id_235042) *\n                                                squot64(segred_group_sizze_221412,\n                                                        segment_sizze_nonzzero_235023) +\n                                                sext_i32_i64(local_tid_235026),\n                                                l_n_m_203643) * l_n_m_203643 +\n                                        (sext_i32_i64(virt_group_id_235042) *\n                                         squot64(segred_group_sizze_221412,\n                                                 segment_sizze_nonzzero_235023) +\n                                         sext_i32_i64(local_tid_235026) -\n                                         squot64(sext_i32_i64(virt_group_id_235042) *\n                                                 squot64(segred_group_sizze_221412,\n                                                         segment_sizze_nonzzero_235023) +\n                                                 sext_i32_i64(local_tid_235026),\n                                                 l_n_m_203643) *\n                                         l_n_m_203643)] = tmp_235073;\n                \n                double tmp_235074;\n                \n                tmp_235074 = ((__local\n                               double *) red_arr_mem_235036)[(sext_i32_i64(local_tid_235026) +\n                                                              (int64_t) 1) *\n                                                             segment_sizze_nonzzero_235023 -\n                                                             (int64_t) 1];\n                ((__global\n                  double *) mem_230795)[squot64(sext_i32_i64(virt_group_id_235042) *\n                                ",
                   "                squot64(segred_group_sizze_221412,\n                                                        segment_sizze_nonzzero_235023) +\n                                                sext_i32_i64(local_tid_235026),\n                                                l_n_m_203643) * l_n_m_203643 +\n                                        (sext_i32_i64(virt_group_id_235042) *\n                                         squot64(segred_group_sizze_221412,\n                                                 segment_sizze_nonzzero_235023) +\n                                         sext_i32_i64(local_tid_235026) -\n                                         squot64(sext_i32_i64(virt_group_id_235042) *\n                                                 squot64(segred_group_sizze_221412,\n                                                         segment_sizze_nonzzero_235023) +\n                                                 sext_i32_i64(local_tid_235026),\n                                                 l_n_m_203643) *\n                                         l_n_m_203643)] = tmp_235074;\n                \n                double tmp_235075;\n                \n                tmp_235075 = ((__local\n                               double *) red_arr_mem_235038)[(sext_i32_i64(local_tid_235026) +\n                                                              (int64_t) 1) *\n                                                             segment_sizze_nonzzero_235023 -\n                                                             (int64_t) 1];\n                ((__global\n                  double *) mem_230799)[squot64(sext_i32_i64(virt_group_id_235042) *\n                                                squot64(segred_group_sizze_221412,\n                                                        segment_sizze_nonzzero_235023) +\n                                                sext_i32_i64(local_tid_235026),\n                                                l_n_m_203643) * l_n_m_203643 +\n                        ",
                   "                (sext_i32_i64(virt_group_id_235042) *\n                                         squot64(segred_group_sizze_221412,\n                                                 segment_sizze_nonzzero_235023) +\n                                         sext_i32_i64(local_tid_235026) -\n                                         squot64(sext_i32_i64(virt_group_id_235042) *\n                                                 squot64(segred_group_sizze_221412,\n                                                         segment_sizze_nonzzero_235023) +\n                                                 sext_i32_i64(local_tid_235026),\n                                                 l_n_m_203643) *\n                                         l_n_m_203643)] = tmp_235075;\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_221412\n}\n__kernel void mainzisegred_small_221521(__global int *global_failure,\n                                        __local volatile\n                                        int64_t *red_arr_mem_235170_backing_aligned_0,\n                                        __local volatile\n                                        int64_t *red_arr_mem_235168_backing_aligned_1,\n                                        int64_t n_203490, int64_t q_l_203495,\n                                        int64_t jump_t_203500,\n                                        int64_t partition_sizze_203577,\n                                        int64_t l_n_m_203643, int64_t i_203670,\n                                        int64_t num_groups_221514,\n                                        int64_t ctx_param_ext_229488,\n                                        int64_t ctx_param_ext_229489,\n                                        int64_t ctx_param_ext_229491,\n                                        int64_t segment_sizze_nonzzero_235161,\n                                   ",
                   "     __global unsigned char *ext_mem_229411,\n                                        __global unsigned char *ext_mem_229412,\n                                        __global\n                                        unsigned char *mem_param_229493,\n                                        __global unsigned char *mem_230551,\n                                        __global unsigned char *mem_230804,\n                                        __global unsigned char *mem_230808,\n                                        __global unsigned char *mem_230812,\n                                        __global unsigned char *mem_230816,\n                                        __global unsigned char *mem_230820,\n                                        __global unsigned char *mem_230825,\n                                        __global unsigned char *mem_230829)\n{\n    #define segred_group_sizze_221513 (mainzisegred_group_sizze_220883)\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_235170_backing_1 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_235170_backing_aligned_0;\n    __local volatile unsigned char *restrict red_arr_mem_235168_backing_0 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_235168_backing_aligned_1;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_235163;\n    int32_t local_tid_235164;\n    int64_t group_sizze_235167;\n    int32_t wave_sizze_235166;\n    int32_t group_tid_235165;\n    \n    global_tid_235163 = get_global_id(0);\n    local_tid_235164 = get_local_id(0);\n    group_sizze_235167 = get_local_size(0);\n    wave_sizze_235166 = LOCKSTEP_WIDTH;\n    group_tid_235165 = get_group_id(0);\n    \n    int32_t phys_tid_221521 = global_tid_235163;\n    __local unsigned char *red_arr_mem_235168;\n    \n    red_a",
                   "rr_mem_235168 = (__local unsigned char *) red_arr_mem_235168_backing_0;\n    \n    __local unsigned char *red_arr_mem_235170;\n    \n    red_arr_mem_235170 = (__local unsigned char *) red_arr_mem_235170_backing_1;\n    \n    int32_t phys_group_id_235172;\n    \n    phys_group_id_235172 = get_group_id(0);\n    for (int32_t i_235173 = 0; i_235173 <\n         sdiv_up32(sext_i64_i32(sdiv_up64(partition_sizze_203577 * l_n_m_203643,\n                                          squot64(segred_group_sizze_221513,\n                                                  segment_sizze_nonzzero_235161))) -\n                   phys_group_id_235172, sext_i64_i32(num_groups_221514));\n         i_235173++) {\n        int32_t virt_group_id_235174 = phys_group_id_235172 + i_235173 *\n                sext_i64_i32(num_groups_221514);\n        int64_t slice_235175 = l_n_m_203643;\n        int64_t slice_235176 = partition_sizze_203577 * slice_235175;\n        int64_t gtid_221518 = squot64(squot64(sext_i32_i64(local_tid_235164),\n                                              segment_sizze_nonzzero_235161) +\n                                      sext_i32_i64(virt_group_id_235174) *\n                                      squot64(segred_group_sizze_221513,\n                                              segment_sizze_nonzzero_235161),\n                                      slice_235175);\n        int64_t remnant_235177 = squot64(sext_i32_i64(local_tid_235164),\n                                         segment_sizze_nonzzero_235161) +\n                sext_i32_i64(virt_group_id_235174) *\n                squot64(segred_group_sizze_221513,\n                        segment_sizze_nonzzero_235161) - gtid_221518 *\n                slice_235175;\n        int64_t gtid_221519 = remnant_235177;\n        int64_t remnant_235178 = remnant_235177 - gtid_221519;\n        int64_t gtid_221520 = srem64(sext_i32_i64(local_tid_235164),\n                                     q_l_203495);\n        \n        // apply map function if in bounds\n        {\n    ",
                   "        if (slt64((int64_t) 0, q_l_203495) && ((slt64(gtid_221518,\n                                                          partition_sizze_203577) &&\n                                                    slt64(gtid_221519,\n                                                          l_n_m_203643)) &&\n                                                   slt64(sext_i32_i64(local_tid_235164),\n                                                         q_l_203495 *\n                                                         squot64(segred_group_sizze_221513,\n                                                                 segment_sizze_nonzzero_235161)))) {\n                int64_t x_221538;\n                \n                x_221538 = ((__global int64_t *) ext_mem_229412)[gtid_221518 *\n                                                                 l_n_m_203643 +\n                                                                 gtid_221519];\n                \n                double x_221539;\n                \n                x_221539 = ((__global double *) ext_mem_229411)[gtid_221518 *\n                                                                l_n_m_203643 +\n                                                                gtid_221519];\n                \n                int64_t binop_y_228709 = mul64(jump_t_203500, gtid_221519);\n                int64_t binop_y_228710 = smin64(i_203670, binop_y_228709);\n                int64_t index_primexp_228711 = add64((int64_t) 1,\n                                                     binop_y_228710);\n                double a12_221541;\n                \n                a12_221541 = ((__global double *) mem_230804)[gtid_221518 *\n                                                              l_n_m_203643 +\n                                                              gtid_221519];\n                \n                double b12_221542;\n                \n                b12_221542 = ((__global double *) mem_230808)[gtid_221518 *\n                            ",
                   "                                  l_n_m_203643 +\n                                                              gtid_221519];\n                \n                double c12_221543;\n                \n                c12_221543 = ((__global double *) mem_230812)[gtid_221518 *\n                                                              l_n_m_203643 +\n                                                              gtid_221519];\n                \n                double b2_221544;\n                \n                b2_221544 = ((__global double *) mem_230816)[gtid_221518 *\n                                                             l_n_m_203643 +\n                                                             gtid_221519];\n                \n                double c2_221545;\n                \n                c2_221545 = ((__global double *) mem_230820)[gtid_221518 *\n                                                             l_n_m_203643 +\n                                                             gtid_221519];\n                \n                bool cond_221547 = sle64(n_203490, gtid_221520);\n                int64_t defunc_0_f_res_221548;\n                \n                if (cond_221547) {\n                    defunc_0_f_res_221548 = (int64_t) 0;\n                } else {\n                    int64_t i_221549 = add64(gtid_221520, x_221538);\n                    int64_t defunc_1_add_res_221550 = add64((int64_t) 1,\n                                                            i_221549);\n                    \n                    defunc_0_f_res_221548 = defunc_1_add_res_221550;\n                }\n                \n                double defunc_0_f_res_221551;\n                \n                if (cond_221547) {\n                    defunc_0_f_res_221551 = 0.0;\n                } else {\n                    int64_t i_221552 = add64(gtid_221520, x_221538);\n                    double defunc_0_add_arg_221553;\n                    \n                    defunc_0_add_arg_221553 = ((__global\n                 ",
                   "                               double *) mem_param_229493)[ctx_param_ext_229488 +\n                                                                            (gtid_221518 *\n                                                                             ctx_param_ext_229489 +\n                                                                             i_221552 *\n                                                                             ctx_param_ext_229491)];\n                    defunc_0_f_res_221551 = defunc_0_add_arg_221553;\n                }\n                \n                int64_t binop_p_221554 = sub64(defunc_0_f_res_221548,\n                                               index_primexp_228711);\n                double defunc_0_f_res_221555 = sitofp_i64_f64(binop_p_221554);\n                double abs_res_221556 = fabs(defunc_0_f_res_221555);\n                double tmp1_221557 = abs_res_221556 / x_221539;\n                double x_221558 = tmp1_221557 * tmp1_221557;\n                double y_221559 = tmp1_221557 * x_221558;\n                double tmp2_221560 = 1.0 - y_221559;\n                double x_221561 = tmp2_221560 * tmp2_221560;\n                double tmp3_221562 = tmp2_221560 * x_221561;\n                double tmp4_221563 = defunc_0_f_res_221551 * tmp3_221562;\n                double defunc_1_f_res_221564 = defunc_0_f_res_221555 *\n                       tmp4_221563;\n                double defunc_1_f_res_221565 = defunc_0_f_res_221555 *\n                       defunc_1_f_res_221564;\n                double defunc_0_f_res_221566;\n                \n                if (cond_221547) {\n                    defunc_0_f_res_221566 = 0.0;\n                } else {\n                    int64_t i_221567 = add64(gtid_221520, x_221538);\n                    double defunc_0_add_arg_221568;\n                    \n                    defunc_0_add_arg_221568 = ((__global\n                                                double *) mem_230551)[gtid_221518 *\n                                   ",
                   "                                   n_203490 +\n                                                                      i_221567];\n                    defunc_0_f_res_221566 = defunc_0_add_arg_221568;\n                }\n                \n                double x_221569 = a12_221541 * tmp4_221563;\n                double y_221570 = b12_221542 * defunc_1_f_res_221564;\n                double x_221571 = x_221569 + y_221570;\n                double y_221572 = c12_221543 * defunc_1_f_res_221565;\n                double x_221573 = x_221571 + y_221572;\n                double defunc_9_fit_fun_res_221574 = defunc_0_f_res_221566 *\n                       x_221573;\n                double x_221575 = b12_221542 * tmp4_221563;\n                double y_221576 = b2_221544 * defunc_1_f_res_221564;\n                double x_221577 = x_221575 + y_221576;\n                double y_221578 = c2_221545 * defunc_1_f_res_221565;\n                double x_221579 = x_221577 + y_221578;\n                double defunc_9_slope_fun_res_221580 = defunc_0_f_res_221566 *\n                       x_221579;\n                \n                // save map-out results\n                { }\n                // save results to be reduced\n                {\n                    ((__local\n                      double *) red_arr_mem_235168)[sext_i32_i64(local_tid_235164)] =\n                        defunc_9_fit_fun_res_221574;\n                    ((__local\n                      double *) red_arr_mem_235170)[sext_i32_i64(local_tid_235164)] =\n                        defunc_9_slope_fun_res_221580;\n                }\n            } else {\n                ((__local\n                  double *) red_arr_mem_235168)[sext_i32_i64(local_tid_235164)] =\n                    0.0;\n                ((__local\n                  double *) red_arr_mem_235170)[sext_i32_i64(local_tid_235164)] =\n                    0.0;\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        if (slt64((int64_t) 0, q_l_203495)) {\n            // perform segmented sc",
                   "an to imitate reduction\n            {\n                double x_221522;\n                double x_221523;\n                double x_221524;\n                double x_221525;\n                double x_235179;\n                double x_235180;\n                double x_235181;\n                double x_235182;\n                bool ltid_in_bounds_235185 =\n                     slt64(sext_i32_i64(local_tid_235164), q_l_203495 *\n                           squot64(segred_group_sizze_221513,\n                                   segment_sizze_nonzzero_235161));\n                int32_t skip_threads_235186;\n                \n                // read input for in-block scan\n                {\n                    if (ltid_in_bounds_235185) {\n                        x_221524 = ((volatile __local\n                                     double *) red_arr_mem_235168)[sext_i32_i64(local_tid_235164)];\n                        x_221525 = ((volatile __local\n                                     double *) red_arr_mem_235170)[sext_i32_i64(local_tid_235164)];\n                        if ((local_tid_235164 - squot32(local_tid_235164, 32) *\n                             32) == 0) {\n                            x_221522 = x_221524;\n                            x_221523 = x_221525;\n                        }\n                    }\n                }\n                // in-block scan (hopefully no barriers needed)\n                {\n                    skip_threads_235186 = 1;\n                    while (slt32(skip_threads_235186, 32)) {\n                        bool thread_active_235187 = sle32(skip_threads_235186,\n                                                          local_tid_235164 -\n                                                          squot32(local_tid_235164,\n                                                                  32) * 32) &&\n                             ltid_in_bounds_235185;\n                        \n                        if (thread_active_235187) {\n                            // read operands\n",
                   "                            {\n                                x_221522 = ((volatile __local\n                                             double *) red_arr_mem_235168)[sext_i32_i64(local_tid_235164) -\n                                                                           sext_i32_i64(skip_threads_235186)];\n                                x_221523 = ((volatile __local\n                                             double *) red_arr_mem_235170)[sext_i32_i64(local_tid_235164) -\n                                                                           sext_i32_i64(skip_threads_235186)];\n                            }\n                        }\n                        // perform operation\n                        {\n                            bool inactive_235188 =\n                                 slt64(srem64(sext_i32_i64(local_tid_235164),\n                                              q_l_203495),\n                                       sext_i32_i64(local_tid_235164) -\n                                       sext_i32_i64(local_tid_235164 -\n                                       skip_threads_235186));\n                            \n                            if (thread_active_235187 && inactive_235188) {\n                                x_221522 = x_221524;\n                                x_221523 = x_221525;\n                            }\n                            if (thread_active_235187) {\n                                if (!inactive_235188) {\n                                    double defunc_1_op_res_221526 = x_221522 +\n                                           x_221524;\n                                    double defunc_1_op_res_221527 = x_221523 +\n                                           x_221525;\n                                    \n                                    x_221522 = defunc_1_op_res_221526;\n                                    x_221523 = defunc_1_op_res_221527;\n                                }\n                            }\n                        }\n   ",
                   "                     if (sle32(wave_sizze_235166, skip_threads_235186)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        if (thread_active_235187) {\n                            // write result\n                            {\n                                ((volatile __local\n                                  double *) red_arr_mem_235168)[sext_i32_i64(local_tid_235164)] =\n                                    x_221522;\n                                x_221524 = x_221522;\n                                ((volatile __local\n                                  double *) red_arr_mem_235170)[sext_i32_i64(local_tid_235164)] =\n                                    x_221523;\n                                x_221525 = x_221523;\n                            }\n                        }\n                        if (sle32(wave_sizze_235166, skip_threads_235186)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        skip_threads_235186 *= 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_235164 - squot32(local_tid_235164, 32) *\n                         32) == 31 && ltid_in_bounds_235185) {\n                        ((volatile __local\n                          double *) red_arr_mem_235168)[sext_i32_i64(squot32(local_tid_235164,\n                                                                             32))] =\n                            x_221522;\n                        ((volatile __local\n                          double *) red_arr_mem_235170)[sext_i32_i64(squot32(local_tid_235164,\n                                                                             32))] =\n                            x_221523;\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // scan th",
                   "e first block, after which offset 'i' contains carry-in for block 'i+1'\n                {\n                    int32_t skip_threads_235189;\n                    \n                    // read input for in-block scan\n                    {\n                        if (squot32(local_tid_235164, 32) == 0 &&\n                            ltid_in_bounds_235185) {\n                            x_235181 = ((volatile __local\n                                         double *) red_arr_mem_235168)[sext_i32_i64(local_tid_235164)];\n                            x_235182 = ((volatile __local\n                                         double *) red_arr_mem_235170)[sext_i32_i64(local_tid_235164)];\n                            if ((local_tid_235164 - squot32(local_tid_235164,\n                                                            32) * 32) == 0) {\n                                x_235179 = x_235181;\n                                x_235180 = x_235182;\n                            }\n                        }\n                    }\n                    // in-block scan (hopefully no barriers needed)\n                    {\n                        skip_threads_235189 = 1;\n                        while (slt32(skip_threads_235189, 32)) {\n                            bool thread_active_235190 =\n                                 sle32(skip_threads_235189, local_tid_235164 -\n                                       squot32(local_tid_235164, 32) * 32) &&\n                                 (squot32(local_tid_235164, 32) == 0 &&\n                                  ltid_in_bounds_235185);\n                            \n                            if (thread_active_235190) {\n                                // read operands\n                                {\n                                    x_235179 = ((volatile __local\n                                                 double *) red_arr_mem_235168)[sext_i32_i64(local_tid_235164) -\n                                                                               sext_i32_i6",
                   "4(skip_threads_235189)];\n                                    x_235180 = ((volatile __local\n                                                 double *) red_arr_mem_235170)[sext_i32_i64(local_tid_235164) -\n                                                                               sext_i32_i64(skip_threads_235189)];\n                                }\n                            }\n                            // perform operation\n                            {\n                                bool inactive_235191 =\n                                     slt64(srem64(sext_i32_i64(local_tid_235164 *\n                                                  32 + 32 - 1), q_l_203495),\n                                           sext_i32_i64(local_tid_235164 * 32 +\n                                           32 - 1) -\n                                           sext_i32_i64((local_tid_235164 -\n                                                         skip_threads_235189) *\n                                           32 + 32 - 1));\n                                \n                                if (thread_active_235190 && inactive_235191) {\n                                    x_235179 = x_235181;\n                                    x_235180 = x_235182;\n                                }\n                                if (thread_active_235190) {\n                                    if (!inactive_235191) {\n                                        double defunc_1_op_res_235183 =\n                                               x_235179 + x_235181;\n                                        double defunc_1_op_res_235184 =\n                                               x_235180 + x_235182;\n                                        \n                                        x_235179 = defunc_1_op_res_235183;\n                                        x_235180 = defunc_1_op_res_235184;\n                                    }\n                                }\n                            }\n                         ",
                   "   if (sle32(wave_sizze_235166, skip_threads_235189)) {\n                                barrier(CLK_LOCAL_MEM_FENCE);\n                            }\n                            if (thread_active_235190) {\n                                // write result\n                                {\n                                    ((volatile __local\n                                      double *) red_arr_mem_235168)[sext_i32_i64(local_tid_235164)] =\n                                        x_235179;\n                                    x_235181 = x_235179;\n                                    ((volatile __local\n                                      double *) red_arr_mem_235170)[sext_i32_i64(local_tid_235164)] =\n                                        x_235180;\n                                    x_235182 = x_235180;\n                                }\n                            }\n                            if (sle32(wave_sizze_235166, skip_threads_235189)) {\n                                barrier(CLK_LOCAL_MEM_FENCE);\n                            }\n                            skip_threads_235189 *= 2;\n                        }\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                \n                bool no_carry_in_235192 = squot32(local_tid_235164, 32) == 0 ||\n                     !ltid_in_bounds_235185;\n                \n                // carry-in for every block except the first\n                {\n                    // read operands\n                    {\n                        if (!no_carry_in_235192) {\n                            x_221524 = x_221522;\n                            x_221525 = x_221523;\n                            x_221522 = ((__local\n                                         double *) red_arr_mem_235168)[sext_i32_i64(squot32(local_tid_235164,\n                                                                                            32)) -\n                                                                       (int64_t",
                   ") 1];\n                            x_221523 = ((__local\n                                         double *) red_arr_mem_235170)[sext_i32_i64(squot32(local_tid_235164,\n                                                                                            32)) -\n                                                                       (int64_t) 1];\n                        }\n                    }\n                    // perform operation\n                    {\n                        bool inactive_235193 =\n                             slt64(srem64(sext_i32_i64(local_tid_235164),\n                                          q_l_203495),\n                                   sext_i32_i64(local_tid_235164) -\n                                   sext_i32_i64(squot32(local_tid_235164, 32) *\n                                   32 - 1));\n                        \n                        if (!no_carry_in_235192) {\n                            if (inactive_235193) {\n                                x_221522 = x_221524;\n                                x_221523 = x_221525;\n                            }\n                        }\n                        if (!no_carry_in_235192) {\n                            if (!inactive_235193) {\n                                double defunc_1_op_res_221526 = x_221522 +\n                                       x_221524;\n                                double defunc_1_op_res_221527 = x_221523 +\n                                       x_221525;\n                                \n                                x_221522 = defunc_1_op_res_221526;\n                                x_221523 = defunc_1_op_res_221527;\n                            }\n                        }\n                    }\n                    // write final result\n                    {\n                        if (!no_carry_in_235192) {\n                            ((__local\n                              double *) red_arr_mem_235168)[sext_i32_i64(local_tid_235164)] =\n                                x_22152",
                   "2;\n                            ((__local\n                              double *) red_arr_mem_235170)[sext_i32_i64(local_tid_235164)] =\n                                x_221523;\n                        }\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // restore correct values for first block\n                {\n                    if (squot32(local_tid_235164, 32) == 0 &&\n                        ltid_in_bounds_235185) {\n                        ((__local\n                          double *) red_arr_mem_235168)[sext_i32_i64(local_tid_235164)] =\n                            x_221524;\n                        ((__local\n                          double *) red_arr_mem_235170)[sext_i32_i64(local_tid_235164)] =\n                            x_221525;\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_235174) *\n                      squot64(segred_group_sizze_221513,\n                              segment_sizze_nonzzero_235161) +\n                      sext_i32_i64(local_tid_235164), partition_sizze_203577 *\n                      l_n_m_203643) && slt64(sext_i32_i64(local_tid_235164),\n                                             squot64(segred_group_sizze_221513,\n                                                     segment_sizze_nonzzero_235161))) {\n                double tmp_235194;\n                \n                tmp_235194 = ((__local\n                               double *) red_arr_mem_235168)[(sext_i32_i64(local_tid_235164) +\n                                                              (int64_t) 1) *\n                                                             segment_sizze_nonzzero_235161 -\n                                                             (int64_t) 1];\n                ((__global\n                  double *) mem_230825)[",
                   "squot64(sext_i32_i64(virt_group_id_235174) *\n                                                squot64(segred_group_sizze_221513,\n                                                        segment_sizze_nonzzero_235161) +\n                                                sext_i32_i64(local_tid_235164),\n                                                l_n_m_203643) * l_n_m_203643 +\n                                        (sext_i32_i64(virt_group_id_235174) *\n                                         squot64(segred_group_sizze_221513,\n                                                 segment_sizze_nonzzero_235161) +\n                                         sext_i32_i64(local_tid_235164) -\n                                         squot64(sext_i32_i64(virt_group_id_235174) *\n                                                 squot64(segred_group_sizze_221513,\n                                                         segment_sizze_nonzzero_235161) +\n                                                 sext_i32_i64(local_tid_235164),\n                                                 l_n_m_203643) *\n                                         l_n_m_203643)] = tmp_235194;\n                \n                double tmp_235195;\n                \n                tmp_235195 = ((__local\n                               double *) red_arr_mem_235170)[(sext_i32_i64(local_tid_235164) +\n                                                              (int64_t) 1) *\n                                                             segment_sizze_nonzzero_235161 -\n                                                             (int64_t) 1];\n                ((__global\n                  double *) mem_230829)[squot64(sext_i32_i64(virt_group_id_235174) *\n                                                squot64(segred_group_sizze_221513,\n                                                        segment_sizze_nonzzero_235161) +\n                                                sext_i32_i64(local_tid_235164),\n                          ",
                   "                      l_n_m_203643) * l_n_m_203643 +\n                                        (sext_i32_i64(virt_group_id_235174) *\n                                         squot64(segred_group_sizze_221513,\n                                                 segment_sizze_nonzzero_235161) +\n                                         sext_i32_i64(local_tid_235164) -\n                                         squot64(sext_i32_i64(virt_group_id_235174) *\n                                                 squot64(segred_group_sizze_221513,\n                                                         segment_sizze_nonzzero_235161) +\n                                                 sext_i32_i64(local_tid_235164),\n                                                 l_n_m_203643) *\n                                         l_n_m_203643)] = tmp_235195;\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_221513\n}\n__kernel void mainzisegred_small_223197(__global int *global_failure,\n                                        __local volatile\n                                        int64_t *red_arr_mem_235418_backing_aligned_0,\n                                        int64_t n_203490, int64_t q_t_203494,\n                                        int64_t jump_t_203500,\n                                        int64_t partition_sizze_203577,\n                                        int64_t t_n_m_203650, int64_t i_203670,\n                                        int64_t num_groups_223191,\n                                        int64_t segment_sizze_nonzzero_235411,\n                                        __global unsigned char *ext_mem_229196,\n                                        __global unsigned char *ext_mem_229197,\n                                        __global unsigned char *ext_mem_229460,\n                                        __global unsigned char *ext_mem_",
                   "229461,\n                                        __global unsigned char *mem_231013,\n                                        __global unsigned char *mem_231027)\n{\n    #define segred_group_sizze_223190 (mainzisegred_group_sizze_222794)\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_235418_backing_0 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_235418_backing_aligned_0;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_235413;\n    int32_t local_tid_235414;\n    int64_t group_sizze_235417;\n    int32_t wave_sizze_235416;\n    int32_t group_tid_235415;\n    \n    global_tid_235413 = get_global_id(0);\n    local_tid_235414 = get_local_id(0);\n    group_sizze_235417 = get_local_size(0);\n    wave_sizze_235416 = LOCKSTEP_WIDTH;\n    group_tid_235415 = get_group_id(0);\n    \n    int32_t phys_tid_223197 = global_tid_235413;\n    __local unsigned char *red_arr_mem_235418;\n    \n    red_arr_mem_235418 = (__local unsigned char *) red_arr_mem_235418_backing_0;\n    \n    int32_t phys_group_id_235420;\n    \n    phys_group_id_235420 = get_group_id(0);\n    for (int32_t i_235421 = 0; i_235421 <\n         sdiv_up32(sext_i64_i32(sdiv_up64(partition_sizze_203577 * t_n_m_203650,\n                                          squot64(segred_group_sizze_223190,\n                                                  segment_sizze_nonzzero_235411))) -\n                   phys_group_id_235420, sext_i64_i32(num_groups_223191));\n         i_235421++) {\n        int32_t virt_group_id_235422 = phys_group_id_235420 + i_235421 *\n                sext_i64_i32(num_groups_223191);\n        int64_t slice_235423 = t_n_m_203650;\n        int64_t slice_235424 = partition_sizze_203577 * slice_235423;\n        int64_t gtid_223194 = squot64(squot64(sext_i32_i64(local_tid_235414),\n                                              segment_siz",
                   "ze_nonzzero_235411) +\n                                      sext_i32_i64(virt_group_id_235422) *\n                                      squot64(segred_group_sizze_223190,\n                                              segment_sizze_nonzzero_235411),\n                                      slice_235423);\n        int64_t remnant_235425 = squot64(sext_i32_i64(local_tid_235414),\n                                         segment_sizze_nonzzero_235411) +\n                sext_i32_i64(virt_group_id_235422) *\n                squot64(segred_group_sizze_223190,\n                        segment_sizze_nonzzero_235411) - gtid_223194 *\n                slice_235423;\n        int64_t gtid_223195 = remnant_235425;\n        int64_t remnant_235426 = remnant_235425 - gtid_223195;\n        int64_t gtid_223196 = srem64(sext_i32_i64(local_tid_235414),\n                                     q_t_203494);\n        \n        // apply map function if in bounds\n        {\n            if (slt64((int64_t) 0, q_t_203494) && ((slt64(gtid_223194,\n                                                          partition_sizze_203577) &&\n                                                    slt64(gtid_223195,\n                                                          t_n_m_203650)) &&\n                                                   slt64(sext_i32_i64(local_tid_235414),\n                                                         q_t_203494 *\n                                                         squot64(segred_group_sizze_223190,\n                                                                 segment_sizze_nonzzero_235411)))) {\n                int64_t x_223202;\n                \n                x_223202 = ((__global int64_t *) ext_mem_229196)[gtid_223194];\n                \n                int64_t x_223207;\n                \n                x_223207 = ((__global int64_t *) ext_mem_229461)[gtid_223194 *\n                                                                 t_n_m_203650 +\n                                             ",
                   "                    gtid_223195];\n                \n                double x_223208;\n                \n                x_223208 = ((__global double *) ext_mem_229460)[gtid_223194 *\n                                                                t_n_m_203650 +\n                                                                gtid_223195];\n                \n                int64_t binop_y_228664 = mul64(jump_t_203500, gtid_223195);\n                int64_t binop_y_228665 = smin64(i_203670, binop_y_228664);\n                int64_t index_primexp_228666 = add64((int64_t) 1,\n                                                     binop_y_228665);\n                bool cond_223211 = sle64(x_223202, gtid_223196);\n                int64_t defunc_0_f_res_223212;\n                \n                if (cond_223211) {\n                    defunc_0_f_res_223212 = (int64_t) 0;\n                } else {\n                    int64_t i_223213 = add64(gtid_223196, x_223207);\n                    int64_t defunc_0_add_arg_223214;\n                    \n                    defunc_0_add_arg_223214 = ((__global\n                                                int64_t *) ext_mem_229197)[gtid_223194 *\n                                                                           n_203490 +\n                                                                           i_223213];\n                    \n                    int64_t defunc_1_add_res_223215 = add64((int64_t) 1,\n                                                            defunc_0_add_arg_223214);\n                    \n                    defunc_0_f_res_223212 = defunc_1_add_res_223215;\n                }\n                \n                double defunc_0_f_res_223216;\n                \n                if (cond_223211) {\n                    defunc_0_f_res_223216 = 0.0;\n                } else {\n                    int64_t i_223217 = add64(gtid_223196, x_223207);\n                    double defunc_0_add_arg_223218;\n                    \n                    defunc_0_add_a",
                   "rg_223218 = ((__global\n                                                double *) mem_231013)[gtid_223194 *\n                                                                      n_203490 +\n                                                                      i_223217];\n                    defunc_0_f_res_223216 = defunc_0_add_arg_223218;\n                }\n                \n                int64_t binop_p_223219 = sub64(defunc_0_f_res_223212,\n                                               index_primexp_228666);\n                double defunc_0_f_res_223220 = sitofp_i64_f64(binop_p_223219);\n                double abs_res_223221 = fabs(defunc_0_f_res_223220);\n                double tmp1_223222 = abs_res_223221 / x_223208;\n                double x_223223 = tmp1_223222 * tmp1_223222;\n                double y_223224 = tmp1_223222 * x_223223;\n                double tmp2_223225 = 1.0 - y_223224;\n                double x_223226 = tmp2_223225 * tmp2_223225;\n                double tmp3_223227 = tmp2_223225 * x_223226;\n                double w_j_223228 = defunc_0_f_res_223216 * tmp3_223227;\n                \n                // save map-out results\n                { }\n                // save results to be reduced\n                {\n                    ((__local\n                      double *) red_arr_mem_235418)[sext_i32_i64(local_tid_235414)] =\n                        w_j_223228;\n                }\n            } else {\n                ((__local\n                  double *) red_arr_mem_235418)[sext_i32_i64(local_tid_235414)] =\n                    0.0;\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        if (slt64((int64_t) 0, q_t_203494)) {\n            // perform segmented scan to imitate reduction\n            {\n                double x_223198;\n                double x_223199;\n                double x_235427;\n                double x_235428;\n                bool ltid_in_bounds_235430 =\n                     slt64(sext_i32_i64(local_tid_235414), q_t_203494 *\n             ",
                   "              squot64(segred_group_sizze_223190,\n                                   segment_sizze_nonzzero_235411));\n                int32_t skip_threads_235431;\n                \n                // read input for in-block scan\n                {\n                    if (ltid_in_bounds_235430) {\n                        x_223199 = ((volatile __local\n                                     double *) red_arr_mem_235418)[sext_i32_i64(local_tid_235414)];\n                        if ((local_tid_235414 - squot32(local_tid_235414, 32) *\n                             32) == 0) {\n                            x_223198 = x_223199;\n                        }\n                    }\n                }\n                // in-block scan (hopefully no barriers needed)\n                {\n                    skip_threads_235431 = 1;\n                    while (slt32(skip_threads_235431, 32)) {\n                        bool thread_active_235432 = sle32(skip_threads_235431,\n                                                          local_tid_235414 -\n                                                          squot32(local_tid_235414,\n                                                                  32) * 32) &&\n                             ltid_in_bounds_235430;\n                        \n                        if (thread_active_235432) {\n                            // read operands\n                            {\n                                x_223198 = ((volatile __local\n                                             double *) red_arr_mem_235418)[sext_i32_i64(local_tid_235414) -\n                                                                           sext_i32_i64(skip_threads_235431)];\n                            }\n                        }\n                        // perform operation\n                        {\n                            bool inactive_235433 =\n                                 slt64(srem64(sext_i32_i64(local_tid_235414),\n                                              q_t_203494),\n         ",
                   "                              sext_i32_i64(local_tid_235414) -\n                                       sext_i32_i64(local_tid_235414 -\n                                       skip_threads_235431));\n                            \n                            if (thread_active_235432 && inactive_235433) {\n                                x_223198 = x_223199;\n                            }\n                            if (thread_active_235432) {\n                                if (!inactive_235433) {\n                                    double defunc_1_op_res_223200 = x_223198 +\n                                           x_223199;\n                                    \n                                    x_223198 = defunc_1_op_res_223200;\n                                }\n                            }\n                        }\n                        if (sle32(wave_sizze_235416, skip_threads_235431)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        if (thread_active_235432) {\n                            // write result\n                            {\n                                ((volatile __local\n                                  double *) red_arr_mem_235418)[sext_i32_i64(local_tid_235414)] =\n                                    x_223198;\n                                x_223199 = x_223198;\n                            }\n                        }\n                        if (sle32(wave_sizze_235416, skip_threads_235431)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        skip_threads_235431 *= 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_235414 - squot32(local_tid_235414, 32) *\n                         32) == 31 && ltid_in_bounds_235430) {\n                        ((volatile __local\n           ",
                   "               double *) red_arr_mem_235418)[sext_i32_i64(squot32(local_tid_235414,\n                                                                             32))] =\n                            x_223198;\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_235434;\n                    \n                    // read input for in-block scan\n                    {\n                        if (squot32(local_tid_235414, 32) == 0 &&\n                            ltid_in_bounds_235430) {\n                            x_235428 = ((volatile __local\n                                         double *) red_arr_mem_235418)[sext_i32_i64(local_tid_235414)];\n                            if ((local_tid_235414 - squot32(local_tid_235414,\n                                                            32) * 32) == 0) {\n                                x_235427 = x_235428;\n                            }\n                        }\n                    }\n                    // in-block scan (hopefully no barriers needed)\n                    {\n                        skip_threads_235434 = 1;\n                        while (slt32(skip_threads_235434, 32)) {\n                            bool thread_active_235435 =\n                                 sle32(skip_threads_235434, local_tid_235414 -\n                                       squot32(local_tid_235414, 32) * 32) &&\n                                 (squot32(local_tid_235414, 32) == 0 &&\n                                  ltid_in_bounds_235430);\n                            \n                            if (thread_active_235435) {\n                                // read operands\n                                {\n                                    x_235427 = ((volatile __local\n                                                 double *) red_arr_mem_235418)[sext_i32_i64(local_",
                   "tid_235414) -\n                                                                               sext_i32_i64(skip_threads_235434)];\n                                }\n                            }\n                            // perform operation\n                            {\n                                bool inactive_235436 =\n                                     slt64(srem64(sext_i32_i64(local_tid_235414 *\n                                                  32 + 32 - 1), q_t_203494),\n                                           sext_i32_i64(local_tid_235414 * 32 +\n                                           32 - 1) -\n                                           sext_i32_i64((local_tid_235414 -\n                                                         skip_threads_235434) *\n                                           32 + 32 - 1));\n                                \n                                if (thread_active_235435 && inactive_235436) {\n                                    x_235427 = x_235428;\n                                }\n                                if (thread_active_235435) {\n                                    if (!inactive_235436) {\n                                        double defunc_1_op_res_235429 =\n                                               x_235427 + x_235428;\n                                        \n                                        x_235427 = defunc_1_op_res_235429;\n                                    }\n                                }\n                            }\n                            if (sle32(wave_sizze_235416, skip_threads_235434)) {\n                                barrier(CLK_LOCAL_MEM_FENCE);\n                            }\n                            if (thread_active_235435) {\n                                // write result\n                                {\n                                    ((volatile __local\n                                      double *) red_arr_mem_235418)[sext_i32_i64(local_tid_235414)] =\n                  ",
                   "                      x_235427;\n                                    x_235428 = x_235427;\n                                }\n                            }\n                            if (sle32(wave_sizze_235416, skip_threads_235434)) {\n                                barrier(CLK_LOCAL_MEM_FENCE);\n                            }\n                            skip_threads_235434 *= 2;\n                        }\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                \n                bool no_carry_in_235437 = squot32(local_tid_235414, 32) == 0 ||\n                     !ltid_in_bounds_235430;\n                \n                // carry-in for every block except the first\n                {\n                    // read operands\n                    {\n                        if (!no_carry_in_235437) {\n                            x_223199 = x_223198;\n                            x_223198 = ((__local\n                                         double *) red_arr_mem_235418)[sext_i32_i64(squot32(local_tid_235414,\n                                                                                            32)) -\n                                                                       (int64_t) 1];\n                        }\n                    }\n                    // perform operation\n                    {\n                        bool inactive_235438 =\n                             slt64(srem64(sext_i32_i64(local_tid_235414),\n                                          q_t_203494),\n                                   sext_i32_i64(local_tid_235414) -\n                                   sext_i32_i64(squot32(local_tid_235414, 32) *\n                                   32 - 1));\n                        \n                        if (!no_carry_in_235437) {\n                            if (inactive_235438) {\n                                x_223198 = x_223199;\n                            }\n                        }\n                        if (!no_carry_in_235437) {\n ",
                   "                           if (!inactive_235438) {\n                                double defunc_1_op_res_223200 = x_223198 +\n                                       x_223199;\n                                \n                                x_223198 = defunc_1_op_res_223200;\n                            }\n                        }\n                    }\n                    // write final result\n                    {\n                        if (!no_carry_in_235437) {\n                            ((__local\n                              double *) red_arr_mem_235418)[sext_i32_i64(local_tid_235414)] =\n                                x_223198;\n                        }\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // restore correct values for first block\n                {\n                    if (squot32(local_tid_235414, 32) == 0 &&\n                        ltid_in_bounds_235430) {\n                        ((__local\n                          double *) red_arr_mem_235418)[sext_i32_i64(local_tid_235414)] =\n                            x_223199;\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_235422) *\n                      squot64(segred_group_sizze_223190,\n                              segment_sizze_nonzzero_235411) +\n                      sext_i32_i64(local_tid_235414), partition_sizze_203577 *\n                      t_n_m_203650) && slt64(sext_i32_i64(local_tid_235414),\n                                             squot64(segred_group_sizze_223190,\n                                                     segment_sizze_nonzzero_235411))) {\n                double tmp_235439;\n                \n                tmp_235439 = ((__local\n                               double *) red_arr_mem_235418)[(sext_i32_i64(local_tid_235414) +\n         ",
                   "                                                     (int64_t) 1) *\n                                                             segment_sizze_nonzzero_235411 -\n                                                             (int64_t) 1];\n                ((__global\n                  double *) mem_231027)[squot64(sext_i32_i64(virt_group_id_235422) *\n                                                squot64(segred_group_sizze_223190,\n                                                        segment_sizze_nonzzero_235411) +\n                                                sext_i32_i64(local_tid_235414),\n                                                t_n_m_203650) * t_n_m_203650 +\n                                        (sext_i32_i64(virt_group_id_235422) *\n                                         squot64(segred_group_sizze_223190,\n                                                 segment_sizze_nonzzero_235411) +\n                                         sext_i32_i64(local_tid_235414) -\n                                         squot64(sext_i32_i64(virt_group_id_235422) *\n                                                 squot64(segred_group_sizze_223190,\n                                                         segment_sizze_nonzzero_235411) +\n                                                 sext_i32_i64(local_tid_235414),\n                                                 t_n_m_203650) *\n                                         t_n_m_203650)] = tmp_235439;\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_223190\n}\n__kernel void mainzisegred_small_223249(__global int *global_failure,\n                                        __local volatile\n                                        int64_t *red_arr_mem_235500_backing_aligned_0,\n                                        int64_t n_203490, int64_t q_t_203494,\n                                        int64_t",
                   " jump_t_203500,\n                                        int64_t partition_sizze_203577,\n                                        int64_t t_n_m_203650, int64_t i_203670,\n                                        int64_t num_groups_223243,\n                                        int64_t segment_sizze_nonzzero_235493,\n                                        __global unsigned char *ext_mem_229196,\n                                        __global unsigned char *ext_mem_229197,\n                                        __global unsigned char *ext_mem_229460,\n                                        __global unsigned char *ext_mem_229461,\n                                        __global unsigned char *mem_231013,\n                                        __global unsigned char *mem_231017,\n                                        __global unsigned char *mem_231032,\n                                        __global unsigned char *mem_231037)\n{\n    #define segred_group_sizze_223242 (mainzisegred_group_sizze_222724)\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_235500_backing_0 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_235500_backing_aligned_0;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_235495;\n    int32_t local_tid_235496;\n    int64_t group_sizze_235499;\n    int32_t wave_sizze_235498;\n    int32_t group_tid_235497;\n    \n    global_tid_235495 = get_global_id(0);\n    local_tid_235496 = get_local_id(0);\n    group_sizze_235499 = get_local_size(0);\n    wave_sizze_235498 = LOCKSTEP_WIDTH;\n    group_tid_235497 = get_group_id(0);\n    \n    int32_t phys_tid_223249 = global_tid_235495;\n    __local unsigned char *red_arr_mem_235500;\n    \n    red_arr_mem_235500 = (__local unsigned char *) red_arr_mem_235500_backing_0;\n    \n    int32_t phys_group_id_235502;\n    \n    phys_group_id_235",
                   "502 = get_group_id(0);\n    for (int32_t i_235503 = 0; i_235503 <\n         sdiv_up32(sext_i64_i32(sdiv_up64(partition_sizze_203577 * t_n_m_203650,\n                                          squot64(segred_group_sizze_223242,\n                                                  segment_sizze_nonzzero_235493))) -\n                   phys_group_id_235502, sext_i64_i32(num_groups_223243));\n         i_235503++) {\n        int32_t virt_group_id_235504 = phys_group_id_235502 + i_235503 *\n                sext_i64_i32(num_groups_223243);\n        int64_t slice_235505 = t_n_m_203650;\n        int64_t slice_235506 = partition_sizze_203577 * slice_235505;\n        int64_t gtid_223246 = squot64(squot64(sext_i32_i64(local_tid_235496),\n                                              segment_sizze_nonzzero_235493) +\n                                      sext_i32_i64(virt_group_id_235504) *\n                                      squot64(segred_group_sizze_223242,\n                                              segment_sizze_nonzzero_235493),\n                                      slice_235505);\n        int64_t remnant_235507 = squot64(sext_i32_i64(local_tid_235496),\n                                         segment_sizze_nonzzero_235493) +\n                sext_i32_i64(virt_group_id_235504) *\n                squot64(segred_group_sizze_223242,\n                        segment_sizze_nonzzero_235493) - gtid_223246 *\n                slice_235505;\n        int64_t gtid_223247 = remnant_235507;\n        int64_t remnant_235508 = remnant_235507 - gtid_223247;\n        int64_t gtid_223248 = srem64(sext_i32_i64(local_tid_235496),\n                                     q_t_203494);\n        \n        // apply map function if in bounds\n        {\n            if (slt64((int64_t) 0, q_t_203494) && ((slt64(gtid_223246,\n                                                          partition_sizze_203577) &&\n                                                    slt64(gtid_223247,\n                                                    ",
                   "      t_n_m_203650)) &&\n                                                   slt64(sext_i32_i64(local_tid_235496),\n                                                         q_t_203494 *\n                                                         squot64(segred_group_sizze_223242,\n                                                                 segment_sizze_nonzzero_235493)))) {\n                int64_t x_223254;\n                \n                x_223254 = ((__global int64_t *) ext_mem_229196)[gtid_223246];\n                \n                int64_t x_223261;\n                \n                x_223261 = ((__global int64_t *) ext_mem_229461)[gtid_223246 *\n                                                                 t_n_m_203650 +\n                                                                 gtid_223247];\n                \n                double x_223262;\n                \n                x_223262 = ((__global double *) ext_mem_229460)[gtid_223246 *\n                                                                t_n_m_203650 +\n                                                                gtid_223247];\n                \n                int64_t binop_y_228659 = mul64(jump_t_203500, gtid_223247);\n                int64_t binop_y_228660 = smin64(i_203670, binop_y_228659);\n                int64_t index_primexp_228661 = add64((int64_t) 1,\n                                                     binop_y_228660);\n                double a0_223264;\n                \n                a0_223264 = ((__global double *) mem_231032)[gtid_223246 *\n                                                             t_n_m_203650 +\n                                                             gtid_223247];\n                \n                bool cond_223266 = sle64(x_223254, gtid_223248);\n                int64_t defunc_0_f_res_223267;\n                \n                if (cond_223266) {\n                    defunc_0_f_res_223267 = (int64_t) 0;\n                } else {\n                    int64_t i_223268 = add",
                   "64(gtid_223248, x_223261);\n                    int64_t defunc_0_add_arg_223269;\n                    \n                    defunc_0_add_arg_223269 = ((__global\n                                                int64_t *) ext_mem_229197)[gtid_223246 *\n                                                                           n_203490 +\n                                                                           i_223268];\n                    \n                    int64_t defunc_1_add_res_223270 = add64((int64_t) 1,\n                                                            defunc_0_add_arg_223269);\n                    \n                    defunc_0_f_res_223267 = defunc_1_add_res_223270;\n                }\n                \n                double defunc_0_f_res_223271;\n                \n                if (cond_223266) {\n                    defunc_0_f_res_223271 = 0.0;\n                } else {\n                    int64_t i_223272 = add64(gtid_223248, x_223261);\n                    double defunc_0_add_arg_223273;\n                    \n                    defunc_0_add_arg_223273 = ((__global\n                                                double *) mem_231013)[gtid_223246 *\n                                                                      n_203490 +\n                                                                      i_223272];\n                    defunc_0_f_res_223271 = defunc_0_add_arg_223273;\n                }\n                \n                int64_t binop_p_223274 = sub64(defunc_0_f_res_223267,\n                                               index_primexp_228661);\n                double defunc_0_f_res_223275 = sitofp_i64_f64(binop_p_223274);\n                double abs_res_223276 = fabs(defunc_0_f_res_223275);\n                double tmp1_223277 = abs_res_223276 / x_223262;\n                double x_223278 = tmp1_223277 * tmp1_223277;\n                double y_223279 = tmp1_223277 * x_223278;\n                double tmp2_223280 = 1.0 - y_223279;\n                double x_223281",
                   " = tmp2_223280 * tmp2_223280;\n                double tmp3_223282 = tmp2_223280 * x_223281;\n                double tmp4_223283 = defunc_0_f_res_223271 * tmp3_223282;\n                double defunc_0_f_res_223284;\n                \n                if (cond_223266) {\n                    defunc_0_f_res_223284 = 0.0;\n                } else {\n                    int64_t i_223285 = add64(gtid_223248, x_223261);\n                    double defunc_0_add_arg_223286;\n                    \n                    defunc_0_add_arg_223286 = ((__global\n                                                double *) mem_231017)[gtid_223246 *\n                                                                      n_203490 +\n                                                                      i_223285];\n                    defunc_0_f_res_223284 = defunc_0_add_arg_223286;\n                }\n                \n                double x_223287 = a0_223264 * tmp4_223283;\n                double defunc_9_fit_fun_res_223288 = defunc_0_f_res_223284 *\n                       x_223287;\n                \n                // save map-out results\n                { }\n                // save results to be reduced\n                {\n                    ((__local\n                      double *) red_arr_mem_235500)[sext_i32_i64(local_tid_235496)] =\n                        defunc_9_fit_fun_res_223288;\n                }\n            } else {\n                ((__local\n                  double *) red_arr_mem_235500)[sext_i32_i64(local_tid_235496)] =\n                    0.0;\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        if (slt64((int64_t) 0, q_t_203494)) {\n            // perform segmented scan to imitate reduction\n            {\n                double x_223250;\n                double x_223251;\n                double x_235509;\n                double x_235510;\n                bool ltid_in_bounds_235512 =\n                     slt64(sext_i32_i64(local_tid_235496), q_t_203494 *\n                           squot6",
                   "4(segred_group_sizze_223242,\n                                   segment_sizze_nonzzero_235493));\n                int32_t skip_threads_235513;\n                \n                // read input for in-block scan\n                {\n                    if (ltid_in_bounds_235512) {\n                        x_223251 = ((volatile __local\n                                     double *) red_arr_mem_235500)[sext_i32_i64(local_tid_235496)];\n                        if ((local_tid_235496 - squot32(local_tid_235496, 32) *\n                             32) == 0) {\n                            x_223250 = x_223251;\n                        }\n                    }\n                }\n                // in-block scan (hopefully no barriers needed)\n                {\n                    skip_threads_235513 = 1;\n                    while (slt32(skip_threads_235513, 32)) {\n                        bool thread_active_235514 = sle32(skip_threads_235513,\n                                                          local_tid_235496 -\n                                                          squot32(local_tid_235496,\n                                                                  32) * 32) &&\n                             ltid_in_bounds_235512;\n                        \n                        if (thread_active_235514) {\n                            // read operands\n                            {\n                                x_223250 = ((volatile __local\n                                             double *) red_arr_mem_235500)[sext_i32_i64(local_tid_235496) -\n                                                                           sext_i32_i64(skip_threads_235513)];\n                            }\n                        }\n                        // perform operation\n                        {\n                            bool inactive_235515 =\n                                 slt64(srem64(sext_i32_i64(local_tid_235496),\n                                              q_t_203494),\n                             ",
                   "          sext_i32_i64(local_tid_235496) -\n                                       sext_i32_i64(local_tid_235496 -\n                                       skip_threads_235513));\n                            \n                            if (thread_active_235514 && inactive_235515) {\n                                x_223250 = x_223251;\n                            }\n                            if (thread_active_235514) {\n                                if (!inactive_235515) {\n                                    double defunc_1_op_res_223252 = x_223250 +\n                                           x_223251;\n                                    \n                                    x_223250 = defunc_1_op_res_223252;\n                                }\n                            }\n                        }\n                        if (sle32(wave_sizze_235498, skip_threads_235513)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        if (thread_active_235514) {\n                            // write result\n                            {\n                                ((volatile __local\n                                  double *) red_arr_mem_235500)[sext_i32_i64(local_tid_235496)] =\n                                    x_223250;\n                                x_223251 = x_223250;\n                            }\n                        }\n                        if (sle32(wave_sizze_235498, skip_threads_235513)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        skip_threads_235513 *= 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_235496 - squot32(local_tid_235496, 32) *\n                         32) == 31 && ltid_in_bounds_235512) {\n                        ((volatile __local\n                          doubl",
                   "e *) red_arr_mem_235500)[sext_i32_i64(squot32(local_tid_235496,\n                                                                             32))] =\n                            x_223250;\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_235516;\n                    \n                    // read input for in-block scan\n                    {\n                        if (squot32(local_tid_235496, 32) == 0 &&\n                            ltid_in_bounds_235512) {\n                            x_235510 = ((volatile __local\n                                         double *) red_arr_mem_235500)[sext_i32_i64(local_tid_235496)];\n                            if ((local_tid_235496 - squot32(local_tid_235496,\n                                                            32) * 32) == 0) {\n                                x_235509 = x_235510;\n                            }\n                        }\n                    }\n                    // in-block scan (hopefully no barriers needed)\n                    {\n                        skip_threads_235516 = 1;\n                        while (slt32(skip_threads_235516, 32)) {\n                            bool thread_active_235517 =\n                                 sle32(skip_threads_235516, local_tid_235496 -\n                                       squot32(local_tid_235496, 32) * 32) &&\n                                 (squot32(local_tid_235496, 32) == 0 &&\n                                  ltid_in_bounds_235512);\n                            \n                            if (thread_active_235517) {\n                                // read operands\n                                {\n                                    x_235509 = ((volatile __local\n                                                 double *) red_arr_mem_235500)[sext_i32_i64(local_tid_235496) -\n      ",
                   "                                                                         sext_i32_i64(skip_threads_235516)];\n                                }\n                            }\n                            // perform operation\n                            {\n                                bool inactive_235518 =\n                                     slt64(srem64(sext_i32_i64(local_tid_235496 *\n                                                  32 + 32 - 1), q_t_203494),\n                                           sext_i32_i64(local_tid_235496 * 32 +\n                                           32 - 1) -\n                                           sext_i32_i64((local_tid_235496 -\n                                                         skip_threads_235516) *\n                                           32 + 32 - 1));\n                                \n                                if (thread_active_235517 && inactive_235518) {\n                                    x_235509 = x_235510;\n                                }\n                                if (thread_active_235517) {\n                                    if (!inactive_235518) {\n                                        double defunc_1_op_res_235511 =\n                                               x_235509 + x_235510;\n                                        \n                                        x_235509 = defunc_1_op_res_235511;\n                                    }\n                                }\n                            }\n                            if (sle32(wave_sizze_235498, skip_threads_235516)) {\n                                barrier(CLK_LOCAL_MEM_FENCE);\n                            }\n                            if (thread_active_235517) {\n                                // write result\n                                {\n                                    ((volatile __local\n                                      double *) red_arr_mem_235500)[sext_i32_i64(local_tid_235496)] =\n                                      ",
                   "  x_235509;\n                                    x_235510 = x_235509;\n                                }\n                            }\n                            if (sle32(wave_sizze_235498, skip_threads_235516)) {\n                                barrier(CLK_LOCAL_MEM_FENCE);\n                            }\n                            skip_threads_235516 *= 2;\n                        }\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                \n                bool no_carry_in_235519 = squot32(local_tid_235496, 32) == 0 ||\n                     !ltid_in_bounds_235512;\n                \n                // carry-in for every block except the first\n                {\n                    // read operands\n                    {\n                        if (!no_carry_in_235519) {\n                            x_223251 = x_223250;\n                            x_223250 = ((__local\n                                         double *) red_arr_mem_235500)[sext_i32_i64(squot32(local_tid_235496,\n                                                                                            32)) -\n                                                                       (int64_t) 1];\n                        }\n                    }\n                    // perform operation\n                    {\n                        bool inactive_235520 =\n                             slt64(srem64(sext_i32_i64(local_tid_235496),\n                                          q_t_203494),\n                                   sext_i32_i64(local_tid_235496) -\n                                   sext_i32_i64(squot32(local_tid_235496, 32) *\n                                   32 - 1));\n                        \n                        if (!no_carry_in_235519) {\n                            if (inactive_235520) {\n                                x_223250 = x_223251;\n                            }\n                        }\n                        if (!no_carry_in_235519) {\n                     ",
                   "       if (!inactive_235520) {\n                                double defunc_1_op_res_223252 = x_223250 +\n                                       x_223251;\n                                \n                                x_223250 = defunc_1_op_res_223252;\n                            }\n                        }\n                    }\n                    // write final result\n                    {\n                        if (!no_carry_in_235519) {\n                            ((__local\n                              double *) red_arr_mem_235500)[sext_i32_i64(local_tid_235496)] =\n                                x_223250;\n                        }\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // restore correct values for first block\n                {\n                    if (squot32(local_tid_235496, 32) == 0 &&\n                        ltid_in_bounds_235512) {\n                        ((__local\n                          double *) red_arr_mem_235500)[sext_i32_i64(local_tid_235496)] =\n                            x_223251;\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_235504) *\n                      squot64(segred_group_sizze_223242,\n                              segment_sizze_nonzzero_235493) +\n                      sext_i32_i64(local_tid_235496), partition_sizze_203577 *\n                      t_n_m_203650) && slt64(sext_i32_i64(local_tid_235496),\n                                             squot64(segred_group_sizze_223242,\n                                                     segment_sizze_nonzzero_235493))) {\n                double tmp_235521;\n                \n                tmp_235521 = ((__local\n                               double *) red_arr_mem_235500)[(sext_i32_i64(local_tid_235496) +\n                             ",
                   "                                 (int64_t) 1) *\n                                                             segment_sizze_nonzzero_235493 -\n                                                             (int64_t) 1];\n                ((__global\n                  double *) mem_231037)[squot64(sext_i32_i64(virt_group_id_235504) *\n                                                squot64(segred_group_sizze_223242,\n                                                        segment_sizze_nonzzero_235493) +\n                                                sext_i32_i64(local_tid_235496),\n                                                t_n_m_203650) * t_n_m_203650 +\n                                        (sext_i32_i64(virt_group_id_235504) *\n                                         squot64(segred_group_sizze_223242,\n                                                 segment_sizze_nonzzero_235493) +\n                                         sext_i32_i64(local_tid_235496) -\n                                         squot64(sext_i32_i64(virt_group_id_235504) *\n                                                 squot64(segred_group_sizze_223242,\n                                                         segment_sizze_nonzzero_235493) +\n                                                 sext_i32_i64(local_tid_235496),\n                                                 t_n_m_203650) *\n                                         t_n_m_203650)] = tmp_235521;\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_223242\n}\n__kernel void mainzisegred_small_224235(__global int *global_failure,\n                                        __local volatile\n                                        int64_t *red_arr_mem_235653_backing_aligned_0,\n                                        __local volatile\n                                        int64_t *red_arr_mem_235651_backing_aligned_1,\n ",
                   "                                       __local volatile\n                                        int64_t *red_arr_mem_235649_backing_aligned_2,\n                                        int64_t n_203490, int64_t q_t_203494,\n                                        int64_t jump_t_203500,\n                                        int64_t partition_sizze_203577,\n                                        int64_t t_n_m_203650, int64_t i_203670,\n                                        int64_t num_groups_224227,\n                                        int64_t segment_sizze_nonzzero_235642,\n                                        __global unsigned char *ext_mem_229196,\n                                        __global unsigned char *ext_mem_229197,\n                                        __global unsigned char *ext_mem_229460,\n                                        __global unsigned char *ext_mem_229461,\n                                        __global unsigned char *mem_231151,\n                                        __global unsigned char *mem_231169,\n                                        __global unsigned char *mem_231173,\n                                        __global unsigned char *mem_231177)\n{\n    #define segred_group_sizze_224226 (mainzisegred_group_sizze_223755)\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_235653_backing_2 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_235653_backing_aligned_0;\n    __local volatile unsigned char *restrict red_arr_mem_235651_backing_1 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_235651_backing_aligned_1;\n    __local volatile unsigned char *restrict red_arr_mem_235649_backing_0 =\n                                   (__local volatile\n                                    unsigned char *) red",
                   "_arr_mem_235649_backing_aligned_2;\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_224235 = 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 *red_arr_mem_235651;\n    \n    red_arr_mem_235651 = (__local unsigned char *) red_arr_mem_235651_backing_1;\n    \n    __local unsigned char *red_arr_mem_235653;\n    \n    red_arr_mem_235653 = (__local unsigned char *) red_arr_mem_235653_backing_2;\n    \n    int32_t phys_group_id_235655;\n    \n    phys_group_id_235655 = get_group_id(0);\n    for (int32_t i_235656 = 0; i_235656 <\n         sdiv_up32(sext_i64_i32(sdiv_up64(partition_sizze_203577 * t_n_m_203650,\n                                          squot64(segred_group_sizze_224226,\n                                                  segment_sizze_nonzzero_235642))) -\n                   phys_group_id_235655, sext_i64_i32(num_groups_224227));\n         i_235656++) {\n        int32_t virt_group_id_235657 = phys_group_id_235655 + i_235656 *\n                sext_i64_i32(num_groups_224227);\n        int64_t slice_235658 = t_n_m_203650;\n        int64_t slice_235659 = partition_sizze_203577 * slice_235658;\n        int64_t gtid_224232 = squot64(squot64(sext_i32_i64(local_tid_235645),\n                                              segment_sizze_nonzzero_235642) +\n                                      sext_i32_i64(virt_group_id_235657) *\n                                      squot64(segred_group_sizze_224226,\n                                              segment_sizze_nonzzero",
                   "_235642),\n                                      slice_235658);\n        int64_t remnant_235660 = squot64(sext_i32_i64(local_tid_235645),\n                                         segment_sizze_nonzzero_235642) +\n                sext_i32_i64(virt_group_id_235657) *\n                squot64(segred_group_sizze_224226,\n                        segment_sizze_nonzzero_235642) - gtid_224232 *\n                slice_235658;\n        int64_t gtid_224233 = remnant_235660;\n        int64_t remnant_235661 = remnant_235660 - gtid_224233;\n        int64_t gtid_224234 = srem64(sext_i32_i64(local_tid_235645),\n                                     q_t_203494);\n        \n        // apply map function if in bounds\n        {\n            if (slt64((int64_t) 0, q_t_203494) && ((slt64(gtid_224232,\n                                                          partition_sizze_203577) &&\n                                                    slt64(gtid_224233,\n                                                          t_n_m_203650)) &&\n                                                   slt64(sext_i32_i64(local_tid_235645),\n                                                         q_t_203494 *\n                                                         squot64(segred_group_sizze_224226,\n                                                                 segment_sizze_nonzzero_235642)))) {\n                int64_t x_224246;\n                \n                x_224246 = ((__global int64_t *) ext_mem_229196)[gtid_224232];\n                \n                int64_t x_224251;\n                \n                x_224251 = ((__global int64_t *) ext_mem_229461)[gtid_224232 *\n                                                                 t_n_m_203650 +\n                                                                 gtid_224233];\n                \n                double x_224252;\n                \n                x_224252 = ((__global double *) ext_mem_229460)[gtid_224232 *\n                                                           ",
                   "     t_n_m_203650 +\n                                                                gtid_224233];\n                \n                int64_t binop_y_228674 = mul64(jump_t_203500, gtid_224233);\n                int64_t binop_y_228675 = smin64(i_203670, binop_y_228674);\n                int64_t index_primexp_228676 = add64((int64_t) 1,\n                                                     binop_y_228675);\n                bool cond_224255 = sle64(x_224246, gtid_224234);\n                int64_t defunc_0_f_res_224256;\n                \n                if (cond_224255) {\n                    defunc_0_f_res_224256 = (int64_t) 0;\n                } else {\n                    int64_t i_224257 = add64(gtid_224234, x_224251);\n                    int64_t defunc_0_add_arg_224258;\n                    \n                    defunc_0_add_arg_224258 = ((__global\n                                                int64_t *) ext_mem_229197)[gtid_224232 *\n                                                                           n_203490 +\n                                                                           i_224257];\n                    \n                    int64_t defunc_1_add_res_224259 = add64((int64_t) 1,\n                                                            defunc_0_add_arg_224258);\n                    \n                    defunc_0_f_res_224256 = defunc_1_add_res_224259;\n                }\n                \n                double defunc_0_f_res_224260;\n                \n                if (cond_224255) {\n                    defunc_0_f_res_224260 = 0.0;\n                } else {\n                    int64_t i_224261 = add64(gtid_224234, x_224251);\n                    double defunc_0_add_arg_224262;\n                    \n                    defunc_0_add_arg_224262 = ((__global\n                                                double *) mem_231151)[gtid_224232 *\n                                                                      n_203490 +\n                                                  ",
                   "                    i_224261];\n                    defunc_0_f_res_224260 = defunc_0_add_arg_224262;\n                }\n                \n                int64_t binop_p_224263 = sub64(defunc_0_f_res_224256,\n                                               index_primexp_228676);\n                double defunc_0_f_res_224264 = sitofp_i64_f64(binop_p_224263);\n                double abs_res_224265 = fabs(defunc_0_f_res_224264);\n                double tmp1_224266 = abs_res_224265 / x_224252;\n                double x_224267 = tmp1_224266 * tmp1_224266;\n                double y_224268 = tmp1_224266 * x_224267;\n                double tmp2_224269 = 1.0 - y_224268;\n                double x_224270 = tmp2_224269 * tmp2_224269;\n                double tmp3_224271 = tmp2_224269 * x_224270;\n                double w_j_224272 = defunc_0_f_res_224260 * tmp3_224271;\n                double xw_j_224273 = defunc_0_f_res_224264 * w_j_224272;\n                double x2w_j_224274 = defunc_0_f_res_224264 * xw_j_224273;\n                \n                // save map-out results\n                { }\n                // save results to be reduced\n                {\n                    ((__local\n                      double *) red_arr_mem_235649)[sext_i32_i64(local_tid_235645)] =\n                        w_j_224272;\n                    ((__local\n                      double *) red_arr_mem_235651)[sext_i32_i64(local_tid_235645)] =\n                        xw_j_224273;\n                    ((__local\n                      double *) red_arr_mem_235653)[sext_i32_i64(local_tid_235645)] =\n                        x2w_j_224274;\n                }\n            } else {\n                ((__local\n                  double *) red_arr_mem_235649)[sext_i32_i64(local_tid_235645)] =\n                    0.0;\n                ((__local\n                  double *) red_arr_mem_235651)[sext_i32_i64(local_tid_235645)] =\n                    0.0;\n                ((__local\n                  double *) red_arr_mem_235653)[sext_i32_i64(local_",
                   "tid_235645)] =\n                    0.0;\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        if (slt64((int64_t) 0, q_t_203494)) {\n            // perform segmented scan to imitate reduction\n            {\n                double x_224236;\n                double x_224237;\n                double x_224238;\n                double x_224239;\n                double x_224240;\n                double x_224241;\n                double x_235662;\n                double x_235663;\n                double x_235664;\n                double x_235665;\n                double x_235666;\n                double x_235667;\n                bool ltid_in_bounds_235671 =\n                     slt64(sext_i32_i64(local_tid_235645), q_t_203494 *\n                           squot64(segred_group_sizze_224226,\n                                   segment_sizze_nonzzero_235642));\n                int32_t skip_threads_235672;\n                \n                // read input for in-block scan\n                {\n                    if (ltid_in_bounds_235671) {\n                        x_224239 = ((volatile __local\n                                     double *) red_arr_mem_235649)[sext_i32_i64(local_tid_235645)];\n                        x_224240 = ((volatile __local\n                                     double *) red_arr_mem_235651)[sext_i32_i64(local_tid_235645)];\n                        x_224241 = ((volatile __local\n                                     double *) red_arr_mem_235653)[sext_i32_i64(local_tid_235645)];\n                        if ((local_tid_235645 - squot32(local_tid_235645, 32) *\n                             32) == 0) {\n                            x_224236 = x_224239;\n                            x_224237 = x_224240;\n                            x_224238 = x_224241;\n                        }\n                    }\n                }\n                // in-block scan (hopefully no barriers needed)\n                {\n                    skip_threads_235672 = 1;\n                    while (slt32(ski",
                   "p_threads_235672, 32)) {\n                        bool thread_active_235673 = sle32(skip_threads_235672,\n                                                          local_tid_235645 -\n                                                          squot32(local_tid_235645,\n                                                                  32) * 32) &&\n                             ltid_in_bounds_235671;\n                        \n                        if (thread_active_235673) {\n                            // read operands\n                            {\n                                x_224236 = ((volatile __local\n                                             double *) red_arr_mem_235649)[sext_i32_i64(local_tid_235645) -\n                                                                           sext_i32_i64(skip_threads_235672)];\n                                x_224237 = ((volatile __local\n                                             double *) red_arr_mem_235651)[sext_i32_i64(local_tid_235645) -\n                                                                           sext_i32_i64(skip_threads_235672)];\n                                x_224238 = ((volatile __local\n                                             double *) red_arr_mem_235653)[sext_i32_i64(local_tid_235645) -\n                                                                           sext_i32_i64(skip_threads_235672)];\n                            }\n                        }\n                        // perform operation\n                        {\n                            bool inactive_235674 =\n                                 slt64(srem64(sext_i32_i64(local_tid_235645),\n                                              q_t_203494),\n                                       sext_i32_i64(local_tid_235645) -\n                                       sext_i32_i64(local_tid_235645 -\n                                       skip_threads_235672));\n                            \n                            if (thread_active_235673 && inac",
                   "tive_235674) {\n                                x_224236 = x_224239;\n                                x_224237 = x_224240;\n                                x_224238 = x_224241;\n                            }\n                            if (thread_active_235673) {\n                                if (!inactive_235674) {\n                                    double defunc_1_op_res_224242 = x_224236 +\n                                           x_224239;\n                                    double defunc_1_op_res_224243 = x_224237 +\n                                           x_224240;\n                                    double defunc_1_op_res_224244 = x_224238 +\n                                           x_224241;\n                                    \n                                    x_224236 = defunc_1_op_res_224242;\n                                    x_224237 = defunc_1_op_res_224243;\n                                    x_224238 = defunc_1_op_res_224244;\n                                }\n                            }\n                        }\n                        if (sle32(wave_sizze_235647, skip_threads_235672)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        if (thread_active_235673) {\n                            // write result\n                            {\n                                ((volatile __local\n                                  double *) red_arr_mem_235649)[sext_i32_i64(local_tid_235645)] =\n                                    x_224236;\n                                x_224239 = x_224236;\n                                ((volatile __local\n                                  double *) red_arr_mem_235651)[sext_i32_i64(local_tid_235645)] =\n                                    x_224237;\n                                x_224240 = x_224237;\n                                ((volatile __local\n                                  double *) red_arr_mem_235653)[sext_i32_i64(local_tid_235645)] =\n                ",
                   "                    x_224238;\n                                x_224241 = x_224238;\n                            }\n                        }\n                        if (sle32(wave_sizze_235647, skip_threads_235672)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        skip_threads_235672 *= 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_235645 - squot32(local_tid_235645, 32) *\n                         32) == 31 && ltid_in_bounds_235671) {\n                        ((volatile __local\n                          double *) red_arr_mem_235649)[sext_i32_i64(squot32(local_tid_235645,\n                                                                             32))] =\n                            x_224236;\n                        ((volatile __local\n                          double *) red_arr_mem_235651)[sext_i32_i64(squot32(local_tid_235645,\n                                                                             32))] =\n                            x_224237;\n                        ((volatile __local\n                          double *) red_arr_mem_235653)[sext_i32_i64(squot32(local_tid_235645,\n                                                                             32))] =\n                            x_224238;\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_235675;\n                    \n                    // read input for in-block scan\n                    {\n                        if (squot32(local_tid_235645, 32) == 0 &&\n                            ltid_in_bounds_235671) {\n                            x_235665 = ((volatile __local\n                         ",
                   "                double *) red_arr_mem_235649)[sext_i32_i64(local_tid_235645)];\n                            x_235666 = ((volatile __local\n                                         double *) red_arr_mem_235651)[sext_i32_i64(local_tid_235645)];\n                            x_235667 = ((volatile __local\n                                         double *) red_arr_mem_235653)[sext_i32_i64(local_tid_235645)];\n                            if ((local_tid_235645 - squot32(local_tid_235645,\n                                                            32) * 32) == 0) {\n                                x_235662 = x_235665;\n                                x_235663 = x_235666;\n                                x_235664 = x_235667;\n                            }\n                        }\n                    }\n                    // in-block scan (hopefully no barriers needed)\n                    {\n                        skip_threads_235675 = 1;\n                        while (slt32(skip_threads_235675, 32)) {\n                            bool thread_active_235676 =\n                                 sle32(skip_threads_235675, local_tid_235645 -\n                                       squot32(local_tid_235645, 32) * 32) &&\n                                 (squot32(local_tid_235645, 32) == 0 &&\n                                  ltid_in_bounds_235671);\n                            \n                            if (thread_active_235676) {\n                                // read operands\n                                {\n                                    x_235662 = ((volatile __local\n                                                 double *) red_arr_mem_235649)[sext_i32_i64(local_tid_235645) -\n                                                                               sext_i32_i64(skip_threads_235675)];\n                                    x_235663 = ((volatile __local\n                                                 double *) red_arr_mem_235651)[sext_i32_i64(local_tid_235645) -\n                  ",
                   "                                                             sext_i32_i64(skip_threads_235675)];\n                                    x_235664 = ((volatile __local\n                                                 double *) red_arr_mem_235653)[sext_i32_i64(local_tid_235645) -\n                                                                               sext_i32_i64(skip_threads_235675)];\n                                }\n                            }\n                            // perform operation\n                            {\n                                bool inactive_235677 =\n                                     slt64(srem64(sext_i32_i64(local_tid_235645 *\n                                                  32 + 32 - 1), q_t_203494),\n                                           sext_i32_i64(local_tid_235645 * 32 +\n                                           32 - 1) -\n                                           sext_i32_i64((local_tid_235645 -\n                                                         skip_threads_235675) *\n                                           32 + 32 - 1));\n                                \n                                if (thread_active_235676 && inactive_235677) {\n                                    x_235662 = x_235665;\n                                    x_235663 = x_235666;\n                                    x_235664 = x_235667;\n                                }\n                                if (thread_active_235676) {\n                                    if (!inactive_235677) {\n                                        double defunc_1_op_res_235668 =\n                                               x_235662 + x_235665;\n                                        double defunc_1_op_res_235669 =\n                                               x_235663 + x_235666;\n                                        double defunc_1_op_res_235670 =\n                                               x_235664 + x_235667;\n                                        \n        ",
                   "                                x_235662 = defunc_1_op_res_235668;\n                                        x_235663 = defunc_1_op_res_235669;\n                                        x_235664 = defunc_1_op_res_235670;\n                                    }\n                                }\n                            }\n                            if (sle32(wave_sizze_235647, skip_threads_235675)) {\n                                barrier(CLK_LOCAL_MEM_FENCE);\n                            }\n                            if (thread_active_235676) {\n                                // write result\n                                {\n                                    ((volatile __local\n                                      double *) red_arr_mem_235649)[sext_i32_i64(local_tid_235645)] =\n                                        x_235662;\n                                    x_235665 = x_235662;\n                                    ((volatile __local\n                                      double *) red_arr_mem_235651)[sext_i32_i64(local_tid_235645)] =\n                                        x_235663;\n                                    x_235666 = x_235663;\n                                    ((volatile __local\n                                      double *) red_arr_mem_235653)[sext_i32_i64(local_tid_235645)] =\n                                        x_235664;\n                                    x_235667 = x_235664;\n                                }\n                            }\n                            if (sle32(wave_sizze_235647, skip_threads_235675)) {\n                                barrier(CLK_LOCAL_MEM_FENCE);\n                            }\n                            skip_threads_235675 *= 2;\n                        }\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                \n                bool no_carry_in_235678 = squot32(local_tid_235645, 32) == 0 ||\n                     !ltid_in_bounds_235671;\n                \n                ",
                   "// carry-in for every block except the first\n                {\n                    // read operands\n                    {\n                        if (!no_carry_in_235678) {\n                            x_224239 = x_224236;\n                            x_224240 = x_224237;\n                            x_224241 = x_224238;\n                            x_224236 = ((__local\n                                         double *) red_arr_mem_235649)[sext_i32_i64(squot32(local_tid_235645,\n                                                                                            32)) -\n                                                                       (int64_t) 1];\n                            x_224237 = ((__local\n                                         double *) red_arr_mem_235651)[sext_i32_i64(squot32(local_tid_235645,\n                                                                                            32)) -\n                                                                       (int64_t) 1];\n                            x_224238 = ((__local\n                                         double *) red_arr_mem_235653)[sext_i32_i64(squot32(local_tid_235645,\n                                                                                            32)) -\n                                                                       (int64_t) 1];\n                        }\n                    }\n                    // perform operation\n                    {\n                        bool inactive_235679 =\n                             slt64(srem64(sext_i32_i64(local_tid_235645),\n                                          q_t_203494),\n                                   sext_i32_i64(local_tid_235645) -\n                                   sext_i32_i64(squot32(local_tid_235645, 32) *\n                                   32 - 1));\n                        \n                        if (!no_carry_in_235678) {\n                            if (inactive_235679) {\n                                x_224236 = x",
                   "_224239;\n                                x_224237 = x_224240;\n                                x_224238 = x_224241;\n                            }\n                        }\n                        if (!no_carry_in_235678) {\n                            if (!inactive_235679) {\n                                double defunc_1_op_res_224242 = x_224236 +\n                                       x_224239;\n                                double defunc_1_op_res_224243 = x_224237 +\n                                       x_224240;\n                                double defunc_1_op_res_224244 = x_224238 +\n                                       x_224241;\n                                \n                                x_224236 = defunc_1_op_res_224242;\n                                x_224237 = defunc_1_op_res_224243;\n                                x_224238 = defunc_1_op_res_224244;\n                            }\n                        }\n                    }\n                    // write final result\n                    {\n                        if (!no_carry_in_235678) {\n                            ((__local\n                              double *) red_arr_mem_235649)[sext_i32_i64(local_tid_235645)] =\n                                x_224236;\n                            ((__local\n                              double *) red_arr_mem_235651)[sext_i32_i64(local_tid_235645)] =\n                                x_224237;\n                            ((__local\n                              double *) red_arr_mem_235653)[sext_i32_i64(local_tid_235645)] =\n                                x_224238;\n                        }\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // restore correct values for first block\n                {\n                    if (squot32(local_tid_235645, 32) == 0 &&\n                        ltid_in_bounds_235671) {\n                        ((__local\n                          double *) red_arr_mem_235649)[sext_i32_i64(loc",
                   "al_tid_235645)] =\n                            x_224239;\n                        ((__local\n                          double *) red_arr_mem_235651)[sext_i32_i64(local_tid_235645)] =\n                            x_224240;\n                        ((__local\n                          double *) red_arr_mem_235653)[sext_i32_i64(local_tid_235645)] =\n                            x_224241;\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_235657) *\n                      squot64(segred_group_sizze_224226,\n                              segment_sizze_nonzzero_235642) +\n                      sext_i32_i64(local_tid_235645), partition_sizze_203577 *\n                      t_n_m_203650) && slt64(sext_i32_i64(local_tid_235645),\n                                             squot64(segred_group_sizze_224226,\n                                                     segment_sizze_nonzzero_235642))) {\n                double tmp_235680;\n                \n                tmp_235680 = ((__local\n                               double *) red_arr_mem_235649)[(sext_i32_i64(local_tid_235645) +\n                                                              (int64_t) 1) *\n                                                             segment_sizze_nonzzero_235642 -\n                                                             (int64_t) 1];\n                ((__global\n                  double *) mem_231169)[squot64(sext_i32_i64(virt_group_id_235657) *\n                                                squot64(segred_group_sizze_224226,\n                                                        segment_sizze_nonzzero_235642) +\n                                                sext_i32_i64(local_tid_235645),\n                                                t_n_m_203650) * t_n_m_203650 +\n                                        (sex",
                   "t_i32_i64(virt_group_id_235657) *\n                                         squot64(segred_group_sizze_224226,\n                                                 segment_sizze_nonzzero_235642) +\n                                         sext_i32_i64(local_tid_235645) -\n                                         squot64(sext_i32_i64(virt_group_id_235657) *\n                                                 squot64(segred_group_sizze_224226,\n                                                         segment_sizze_nonzzero_235642) +\n                                                 sext_i32_i64(local_tid_235645),\n                                                 t_n_m_203650) *\n                                         t_n_m_203650)] = tmp_235680;\n                \n                double tmp_235681;\n                \n                tmp_235681 = ((__local\n                               double *) red_arr_mem_235651)[(sext_i32_i64(local_tid_235645) +\n                                                              (int64_t) 1) *\n                                                             segment_sizze_nonzzero_235642 -\n                                                             (int64_t) 1];\n                ((__global\n                  double *) mem_231173)[squot64(sext_i32_i64(virt_group_id_235657) *\n                                                squot64(segred_group_sizze_224226,\n                                                        segment_sizze_nonzzero_235642) +\n                                                sext_i32_i64(local_tid_235645),\n                                                t_n_m_203650) * t_n_m_203650 +\n                                        (sext_i32_i64(virt_group_id_235657) *\n                                         squot64(segred_group_sizze_224226,\n                                                 segment_sizze_nonzzero_235642) +\n                                         sext_i32_i64(local_tid_235645) -\n                                         squot64(sext_i32",
                   "_i64(virt_group_id_235657) *\n                                                 squot64(segred_group_sizze_224226,\n                                                         segment_sizze_nonzzero_235642) +\n                                                 sext_i32_i64(local_tid_235645),\n                                                 t_n_m_203650) *\n                                         t_n_m_203650)] = tmp_235681;\n                \n                double tmp_235682;\n                \n                tmp_235682 = ((__local\n                               double *) red_arr_mem_235653)[(sext_i32_i64(local_tid_235645) +\n                                                              (int64_t) 1) *\n                                                             segment_sizze_nonzzero_235642 -\n                                                             (int64_t) 1];\n                ((__global\n                  double *) mem_231177)[squot64(sext_i32_i64(virt_group_id_235657) *\n                                                squot64(segred_group_sizze_224226,\n                                                        segment_sizze_nonzzero_235642) +\n                                                sext_i32_i64(local_tid_235645),\n                                                t_n_m_203650) * t_n_m_203650 +\n                                        (sext_i32_i64(virt_group_id_235657) *\n                                         squot64(segred_group_sizze_224226,\n                                                 segment_sizze_nonzzero_235642) +\n                                         sext_i32_i64(local_tid_235645) -\n                                         squot64(sext_i32_i64(virt_group_id_235657) *\n                                                 squot64(segred_group_sizze_224226,\n                                                         segment_sizze_nonzzero_235642) +\n                                                 sext_i32_i64(local_tid_235645),\n                                       ",
                   "          t_n_m_203650) *\n                                         t_n_m_203650)] = tmp_235682;\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_224226\n}\n__kernel void mainzisegred_small_224307(__global int *global_failure,\n                                        __local volatile\n                                        int64_t *red_arr_mem_235761_backing_aligned_0,\n                                        __local volatile\n                                        int64_t *red_arr_mem_235759_backing_aligned_1,\n                                        int64_t n_203490, int64_t q_t_203494,\n                                        int64_t jump_t_203500,\n                                        int64_t partition_sizze_203577,\n                                        int64_t t_n_m_203650, int64_t i_203670,\n                                        int64_t num_groups_224300,\n                                        int64_t segment_sizze_nonzzero_235752,\n                                        __global unsigned char *ext_mem_229196,\n                                        __global unsigned char *ext_mem_229197,\n                                        __global unsigned char *ext_mem_229460,\n                                        __global unsigned char *ext_mem_229461,\n                                        __global unsigned char *mem_231151,\n                                        __global unsigned char *mem_231155,\n                                        __global unsigned char *mem_231182,\n                                        __global unsigned char *mem_231186,\n                                        __global unsigned char *mem_231190,\n                                        __global unsigned char *mem_231195,\n                                        __global unsigned char *mem_231199)\n{\n    #define segred_group_sizze_224299 (mainzisegred_group",
                   "_sizze_223658)\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_235761_backing_1 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_235761_backing_aligned_0;\n    __local volatile unsigned char *restrict red_arr_mem_235759_backing_0 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_235759_backing_aligned_1;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_235754;\n    int32_t local_tid_235755;\n    int64_t group_sizze_235758;\n    int32_t wave_sizze_235757;\n    int32_t group_tid_235756;\n    \n    global_tid_235754 = get_global_id(0);\n    local_tid_235755 = get_local_id(0);\n    group_sizze_235758 = get_local_size(0);\n    wave_sizze_235757 = LOCKSTEP_WIDTH;\n    group_tid_235756 = get_group_id(0);\n    \n    int32_t phys_tid_224307 = global_tid_235754;\n    __local unsigned char *red_arr_mem_235759;\n    \n    red_arr_mem_235759 = (__local unsigned char *) red_arr_mem_235759_backing_0;\n    \n    __local unsigned char *red_arr_mem_235761;\n    \n    red_arr_mem_235761 = (__local unsigned char *) red_arr_mem_235761_backing_1;\n    \n    int32_t phys_group_id_235763;\n    \n    phys_group_id_235763 = get_group_id(0);\n    for (int32_t i_235764 = 0; i_235764 <\n         sdiv_up32(sext_i64_i32(sdiv_up64(partition_sizze_203577 * t_n_m_203650,\n                                          squot64(segred_group_sizze_224299,\n                                                  segment_sizze_nonzzero_235752))) -\n                   phys_group_id_235763, sext_i64_i32(num_groups_224300));\n         i_235764++) {\n        int32_t virt_group_id_235765 = phys_group_id_235763 + i_235764 *\n                sext_i64_i32(num_groups_224300);\n        int64_t slice_235766 = t_n_m_203650;\n        int64_t slice_235767 = partition_sizze_203577 * slice_2357",
                   "66;\n        int64_t gtid_224304 = squot64(squot64(sext_i32_i64(local_tid_235755),\n                                              segment_sizze_nonzzero_235752) +\n                                      sext_i32_i64(virt_group_id_235765) *\n                                      squot64(segred_group_sizze_224299,\n                                              segment_sizze_nonzzero_235752),\n                                      slice_235766);\n        int64_t remnant_235768 = squot64(sext_i32_i64(local_tid_235755),\n                                         segment_sizze_nonzzero_235752) +\n                sext_i32_i64(virt_group_id_235765) *\n                squot64(segred_group_sizze_224299,\n                        segment_sizze_nonzzero_235752) - gtid_224304 *\n                slice_235766;\n        int64_t gtid_224305 = remnant_235768;\n        int64_t remnant_235769 = remnant_235768 - gtid_224305;\n        int64_t gtid_224306 = srem64(sext_i32_i64(local_tid_235755),\n                                     q_t_203494);\n        \n        // apply map function if in bounds\n        {\n            if (slt64((int64_t) 0, q_t_203494) && ((slt64(gtid_224304,\n                                                          partition_sizze_203577) &&\n                                                    slt64(gtid_224305,\n                                                          t_n_m_203650)) &&\n                                                   slt64(sext_i32_i64(local_tid_235755),\n                                                         q_t_203494 *\n                                                         squot64(segred_group_sizze_224299,\n                                                                 segment_sizze_nonzzero_235752)))) {\n                int64_t x_224315;\n                \n                x_224315 = ((__global int64_t *) ext_mem_229196)[gtid_224304];\n                \n                int64_t x_224324;\n                \n                x_224324 = ((__global int64_t *) ext_mem_229461)[",
                   "gtid_224304 *\n                                                                 t_n_m_203650 +\n                                                                 gtid_224305];\n                \n                double x_224325;\n                \n                x_224325 = ((__global double *) ext_mem_229460)[gtid_224304 *\n                                                                t_n_m_203650 +\n                                                                gtid_224305];\n                \n                int64_t binop_y_228669 = mul64(jump_t_203500, gtid_224305);\n                int64_t binop_y_228670 = smin64(i_203670, binop_y_228669);\n                int64_t index_primexp_228671 = add64((int64_t) 1,\n                                                     binop_y_228670);\n                double a11_224327;\n                \n                a11_224327 = ((__global double *) mem_231182)[gtid_224304 *\n                                                              t_n_m_203650 +\n                                                              gtid_224305];\n                \n                double b11_224328;\n                \n                b11_224328 = ((__global double *) mem_231186)[gtid_224304 *\n                                                              t_n_m_203650 +\n                                                              gtid_224305];\n                \n                double c11_224329;\n                \n                c11_224329 = ((__global double *) mem_231190)[gtid_224304 *\n                                                              t_n_m_203650 +\n                                                              gtid_224305];\n                \n                bool cond_224331 = sle64(x_224315, gtid_224306);\n                int64_t defunc_0_f_res_224332;\n                \n                if (cond_224331) {\n                    defunc_0_f_res_224332 = (int64_t) 0;\n                } else {\n                    int64_t i_224333 = add64(gtid_224306, x_224324);\n            ",
                   "        int64_t defunc_0_add_arg_224334;\n                    \n                    defunc_0_add_arg_224334 = ((__global\n                                                int64_t *) ext_mem_229197)[gtid_224304 *\n                                                                           n_203490 +\n                                                                           i_224333];\n                    \n                    int64_t defunc_1_add_res_224335 = add64((int64_t) 1,\n                                                            defunc_0_add_arg_224334);\n                    \n                    defunc_0_f_res_224332 = defunc_1_add_res_224335;\n                }\n                \n                double defunc_0_f_res_224336;\n                \n                if (cond_224331) {\n                    defunc_0_f_res_224336 = 0.0;\n                } else {\n                    int64_t i_224337 = add64(gtid_224306, x_224324);\n                    double defunc_0_add_arg_224338;\n                    \n                    defunc_0_add_arg_224338 = ((__global\n                                                double *) mem_231151)[gtid_224304 *\n                                                                      n_203490 +\n                                                                      i_224337];\n                    defunc_0_f_res_224336 = defunc_0_add_arg_224338;\n                }\n                \n                int64_t binop_p_224339 = sub64(defunc_0_f_res_224332,\n                                               index_primexp_228671);\n                double defunc_0_f_res_224340 = sitofp_i64_f64(binop_p_224339);\n                double abs_res_224341 = fabs(defunc_0_f_res_224340);\n                double tmp1_224342 = abs_res_224341 / x_224325;\n                double x_224343 = tmp1_224342 * tmp1_224342;\n                double y_224344 = tmp1_224342 * x_224343;\n                double tmp2_224345 = 1.0 - y_224344;\n                double x_224346 = tmp2_224345 * tmp2_224345;\n         ",
                   "       double tmp3_224347 = tmp2_224345 * x_224346;\n                double tmp4_224348 = defunc_0_f_res_224336 * tmp3_224347;\n                double defunc_1_f_res_224349 = defunc_0_f_res_224340 *\n                       tmp4_224348;\n                double defunc_0_f_res_224350;\n                \n                if (cond_224331) {\n                    defunc_0_f_res_224350 = 0.0;\n                } else {\n                    int64_t i_224351 = add64(gtid_224306, x_224324);\n                    double defunc_0_add_arg_224352;\n                    \n                    defunc_0_add_arg_224352 = ((__global\n                                                double *) mem_231155)[gtid_224304 *\n                                                                      n_203490 +\n                                                                      i_224351];\n                    defunc_0_f_res_224350 = defunc_0_add_arg_224352;\n                }\n                \n                double x_224353 = a11_224327 * tmp4_224348;\n                double y_224354 = b11_224328 * defunc_1_f_res_224349;\n                double x_224355 = x_224353 + y_224354;\n                double defunc_9_fit_fun_res_224356 = defunc_0_f_res_224350 *\n                       x_224355;\n                double x_224357 = b11_224328 * tmp4_224348;\n                double y_224358 = c11_224329 * defunc_1_f_res_224349;\n                double x_224359 = x_224357 + y_224358;\n                double defunc_9_slope_fun_res_224360 = defunc_0_f_res_224350 *\n                       x_224359;\n                \n                // save map-out results\n                { }\n                // save results to be reduced\n                {\n                    ((__local\n                      double *) red_arr_mem_235759)[sext_i32_i64(local_tid_235755)] =\n                        defunc_9_fit_fun_res_224356;\n                    ((__local\n                      double *) red_arr_mem_235761)[sext_i32_i64(local_tid_235755)] =\n                        defu",
                   "nc_9_slope_fun_res_224360;\n                }\n            } else {\n                ((__local\n                  double *) red_arr_mem_235759)[sext_i32_i64(local_tid_235755)] =\n                    0.0;\n                ((__local\n                  double *) red_arr_mem_235761)[sext_i32_i64(local_tid_235755)] =\n                    0.0;\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        if (slt64((int64_t) 0, q_t_203494)) {\n            // perform segmented scan to imitate reduction\n            {\n                double x_224308;\n                double x_224309;\n                double x_224310;\n                double x_224311;\n                double x_235770;\n                double x_235771;\n                double x_235772;\n                double x_235773;\n                bool ltid_in_bounds_235776 =\n                     slt64(sext_i32_i64(local_tid_235755), q_t_203494 *\n                           squot64(segred_group_sizze_224299,\n                                   segment_sizze_nonzzero_235752));\n                int32_t skip_threads_235777;\n                \n                // read input for in-block scan\n                {\n                    if (ltid_in_bounds_235776) {\n                        x_224310 = ((volatile __local\n                                     double *) red_arr_mem_235759)[sext_i32_i64(local_tid_235755)];\n                        x_224311 = ((volatile __local\n                                     double *) red_arr_mem_235761)[sext_i32_i64(local_tid_235755)];\n                        if ((local_tid_235755 - squot32(local_tid_235755, 32) *\n                             32) == 0) {\n                            x_224308 = x_224310;\n                            x_224309 = x_224311;\n                        }\n                    }\n                }\n                // in-block scan (hopefully no barriers needed)\n                {\n                    skip_threads_235777 = 1;\n                    while (slt32(skip_threads_235777, 32)) {\n                  ",
                   "      bool thread_active_235778 = sle32(skip_threads_235777,\n                                                          local_tid_235755 -\n                                                          squot32(local_tid_235755,\n                                                                  32) * 32) &&\n                             ltid_in_bounds_235776;\n                        \n                        if (thread_active_235778) {\n                            // read operands\n                            {\n                                x_224308 = ((volatile __local\n                                             double *) red_arr_mem_235759)[sext_i32_i64(local_tid_235755) -\n                                                                           sext_i32_i64(skip_threads_235777)];\n                                x_224309 = ((volatile __local\n                                             double *) red_arr_mem_235761)[sext_i32_i64(local_tid_235755) -\n                                                                           sext_i32_i64(skip_threads_235777)];\n                            }\n                        }\n                        // perform operation\n                        {\n                            bool inactive_235779 =\n                                 slt64(srem64(sext_i32_i64(local_tid_235755),\n                                              q_t_203494),\n                                       sext_i32_i64(local_tid_235755) -\n                                       sext_i32_i64(local_tid_235755 -\n                                       skip_threads_235777));\n                            \n                            if (thread_active_235778 && inactive_235779) {\n                                x_224308 = x_224310;\n                                x_224309 = x_224311;\n                            }\n                            if (thread_active_235778) {\n                                if (!inactive_235779) {\n                                    double defunc_1_op_res_22",
                   "4312 = x_224308 +\n                                           x_224310;\n                                    double defunc_1_op_res_224313 = x_224309 +\n                                           x_224311;\n                                    \n                                    x_224308 = defunc_1_op_res_224312;\n                                    x_224309 = defunc_1_op_res_224313;\n                                }\n                            }\n                        }\n                        if (sle32(wave_sizze_235757, skip_threads_235777)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        if (thread_active_235778) {\n                            // write result\n                            {\n                                ((volatile __local\n                                  double *) red_arr_mem_235759)[sext_i32_i64(local_tid_235755)] =\n                                    x_224308;\n                                x_224310 = x_224308;\n                                ((volatile __local\n                                  double *) red_arr_mem_235761)[sext_i32_i64(local_tid_235755)] =\n                                    x_224309;\n                                x_224311 = x_224309;\n                            }\n                        }\n                        if (sle32(wave_sizze_235757, skip_threads_235777)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        skip_threads_235777 *= 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_235755 - squot32(local_tid_235755, 32) *\n                         32) == 31 && ltid_in_bounds_235776) {\n                        ((volatile __local\n                          double *) red_arr_mem_235759)[sext_i32_i64(squot32(local_tid_235755,\n                     ",
                   "                                                        32))] =\n                            x_224308;\n                        ((volatile __local\n                          double *) red_arr_mem_235761)[sext_i32_i64(squot32(local_tid_235755,\n                                                                             32))] =\n                            x_224309;\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_235780;\n                    \n                    // read input for in-block scan\n                    {\n                        if (squot32(local_tid_235755, 32) == 0 &&\n                            ltid_in_bounds_235776) {\n                            x_235772 = ((volatile __local\n                                         double *) red_arr_mem_235759)[sext_i32_i64(local_tid_235755)];\n                            x_235773 = ((volatile __local\n                                         double *) red_arr_mem_235761)[sext_i32_i64(local_tid_235755)];\n                            if ((local_tid_235755 - squot32(local_tid_235755,\n                                                            32) * 32) == 0) {\n                                x_235770 = x_235772;\n                                x_235771 = x_235773;\n                            }\n                        }\n                    }\n                    // in-block scan (hopefully no barriers needed)\n                    {\n                        skip_threads_235780 = 1;\n                        while (slt32(skip_threads_235780, 32)) {\n                            bool thread_active_235781 =\n                                 sle32(skip_threads_235780, local_tid_235755 -\n                                       squot32(local_tid_235755, 32) * 32) &&\n                                 (squot32(local_tid_235755, 32) == 0 &&\n                   ",
                   "               ltid_in_bounds_235776);\n                            \n                            if (thread_active_235781) {\n                                // read operands\n                                {\n                                    x_235770 = ((volatile __local\n                                                 double *) red_arr_mem_235759)[sext_i32_i64(local_tid_235755) -\n                                                                               sext_i32_i64(skip_threads_235780)];\n                                    x_235771 = ((volatile __local\n                                                 double *) red_arr_mem_235761)[sext_i32_i64(local_tid_235755) -\n                                                                               sext_i32_i64(skip_threads_235780)];\n                                }\n                            }\n                            // perform operation\n                            {\n                                bool inactive_235782 =\n                                     slt64(srem64(sext_i32_i64(local_tid_235755 *\n                                                  32 + 32 - 1), q_t_203494),\n                                           sext_i32_i64(local_tid_235755 * 32 +\n                                           32 - 1) -\n                                           sext_i32_i64((local_tid_235755 -\n                                                         skip_threads_235780) *\n                                           32 + 32 - 1));\n                                \n                                if (thread_active_235781 && inactive_235782) {\n                                    x_235770 = x_235772;\n                                    x_235771 = x_235773;\n                                }\n                                if (thread_active_235781) {\n                                    if (!inactive_235782) {\n                                        double defunc_1_op_res_235774 =\n                                               x_23",
                   "5770 + x_235772;\n                                        double defunc_1_op_res_235775 =\n                                               x_235771 + x_235773;\n                                        \n                                        x_235770 = defunc_1_op_res_235774;\n                                        x_235771 = defunc_1_op_res_235775;\n                                    }\n                                }\n                            }\n                            if (sle32(wave_sizze_235757, skip_threads_235780)) {\n                                barrier(CLK_LOCAL_MEM_FENCE);\n                            }\n                            if (thread_active_235781) {\n                                // write result\n                                {\n                                    ((volatile __local\n                                      double *) red_arr_mem_235759)[sext_i32_i64(local_tid_235755)] =\n                                        x_235770;\n                                    x_235772 = x_235770;\n                                    ((volatile __local\n                                      double *) red_arr_mem_235761)[sext_i32_i64(local_tid_235755)] =\n                                        x_235771;\n                                    x_235773 = x_235771;\n                                }\n                            }\n                            if (sle32(wave_sizze_235757, skip_threads_235780)) {\n                                barrier(CLK_LOCAL_MEM_FENCE);\n                            }\n                            skip_threads_235780 *= 2;\n                        }\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                \n                bool no_carry_in_235783 = squot32(local_tid_235755, 32) == 0 ||\n                     !ltid_in_bounds_235776;\n                \n                // carry-in for every block except the first\n                {\n                    // read operands\n                    {\n           ",
                   "             if (!no_carry_in_235783) {\n                            x_224310 = x_224308;\n                            x_224311 = x_224309;\n                            x_224308 = ((__local\n                                         double *) red_arr_mem_235759)[sext_i32_i64(squot32(local_tid_235755,\n                                                                                            32)) -\n                                                                       (int64_t) 1];\n                            x_224309 = ((__local\n                                         double *) red_arr_mem_235761)[sext_i32_i64(squot32(local_tid_235755,\n                                                                                            32)) -\n                                                                       (int64_t) 1];\n                        }\n                    }\n                    // perform operation\n                    {\n                        bool inactive_235784 =\n                             slt64(srem64(sext_i32_i64(local_tid_235755),\n                                          q_t_203494),\n                                   sext_i32_i64(local_tid_235755) -\n                                   sext_i32_i64(squot32(local_tid_235755, 32) *\n                                   32 - 1));\n                        \n                        if (!no_carry_in_235783) {\n                            if (inactive_235784) {\n                                x_224308 = x_224310;\n                                x_224309 = x_224311;\n                            }\n                        }\n                        if (!no_carry_in_235783) {\n                            if (!inactive_235784) {\n                                double defunc_1_op_res_224312 = x_224308 +\n                                       x_224310;\n                                double defunc_1_op_res_224313 = x_224309 +\n                                       x_224311;\n                                \n                       ",
                   "         x_224308 = defunc_1_op_res_224312;\n                                x_224309 = defunc_1_op_res_224313;\n                            }\n                        }\n                    }\n                    // write final result\n                    {\n                        if (!no_carry_in_235783) {\n                            ((__local\n                              double *) red_arr_mem_235759)[sext_i32_i64(local_tid_235755)] =\n                                x_224308;\n                            ((__local\n                              double *) red_arr_mem_235761)[sext_i32_i64(local_tid_235755)] =\n                                x_224309;\n                        }\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // restore correct values for first block\n                {\n                    if (squot32(local_tid_235755, 32) == 0 &&\n                        ltid_in_bounds_235776) {\n                        ((__local\n                          double *) red_arr_mem_235759)[sext_i32_i64(local_tid_235755)] =\n                            x_224310;\n                        ((__local\n                          double *) red_arr_mem_235761)[sext_i32_i64(local_tid_235755)] =\n                            x_224311;\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_235765) *\n                      squot64(segred_group_sizze_224299,\n                              segment_sizze_nonzzero_235752) +\n                      sext_i32_i64(local_tid_235755), partition_sizze_203577 *\n                      t_n_m_203650) && slt64(sext_i32_i64(local_tid_235755),\n                                             squot64(segred_group_sizze_224299,\n                                                     segment_sizze_nonzzero_235752))) {\n                double ",
                   "tmp_235785;\n                \n                tmp_235785 = ((__local\n                               double *) red_arr_mem_235759)[(sext_i32_i64(local_tid_235755) +\n                                                              (int64_t) 1) *\n                                                             segment_sizze_nonzzero_235752 -\n                                                             (int64_t) 1];\n                ((__global\n                  double *) mem_231195)[squot64(sext_i32_i64(virt_group_id_235765) *\n                                                squot64(segred_group_sizze_224299,\n                                                        segment_sizze_nonzzero_235752) +\n                                                sext_i32_i64(local_tid_235755),\n                                                t_n_m_203650) * t_n_m_203650 +\n                                        (sext_i32_i64(virt_group_id_235765) *\n                                         squot64(segred_group_sizze_224299,\n                                                 segment_sizze_nonzzero_235752) +\n                                         sext_i32_i64(local_tid_235755) -\n                                         squot64(sext_i32_i64(virt_group_id_235765) *\n                                                 squot64(segred_group_sizze_224299,\n                                                         segment_sizze_nonzzero_235752) +\n                                                 sext_i32_i64(local_tid_235755),\n                                                 t_n_m_203650) *\n                                         t_n_m_203650)] = tmp_235785;\n                \n                double tmp_235786;\n                \n                tmp_235786 = ((__local\n                               double *) red_arr_mem_235761)[(sext_i32_i64(local_tid_235755) +\n                                                              (int64_t) 1) *\n                                                             segment_sizze_nonzzero",
                   "_235752 -\n                                                             (int64_t) 1];\n                ((__global\n                  double *) mem_231199)[squot64(sext_i32_i64(virt_group_id_235765) *\n                                                squot64(segred_group_sizze_224299,\n                                                        segment_sizze_nonzzero_235752) +\n                                                sext_i32_i64(local_tid_235755),\n                                                t_n_m_203650) * t_n_m_203650 +\n                                        (sext_i32_i64(virt_group_id_235765) *\n                                         squot64(segred_group_sizze_224299,\n                                                 segment_sizze_nonzzero_235752) +\n                                         sext_i32_i64(local_tid_235755) -\n                                         squot64(sext_i32_i64(virt_group_id_235765) *\n                                                 squot64(segred_group_sizze_224299,\n                                                         segment_sizze_nonzzero_235752) +\n                                                 sext_i32_i64(local_tid_235755),\n                                                 t_n_m_203650) *\n                                         t_n_m_203650)] = tmp_235786;\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_224299\n}\n__kernel void mainzisegred_small_225523(__global int *global_failure,\n                                        __local volatile\n                                        int64_t *red_arr_mem_235934_backing_aligned_0,\n                                        __local volatile\n                                        int64_t *red_arr_mem_235932_backing_aligned_1,\n                                        __local volatile\n                                        int64_t *red_arr_mem_235930_backing",
                   "_aligned_2,\n                                        __local volatile\n                                        int64_t *red_arr_mem_235928_backing_aligned_3,\n                                        __local volatile\n                                        int64_t *red_arr_mem_235926_backing_aligned_4,\n                                        int64_t n_203490, int64_t q_t_203494,\n                                        int64_t jump_t_203500,\n                                        int64_t partition_sizze_203577,\n                                        int64_t t_n_m_203650, int64_t i_203670,\n                                        int64_t num_groups_225513,\n                                        int64_t segment_sizze_nonzzero_235919,\n                                        __global unsigned char *ext_mem_229196,\n                                        __global unsigned char *ext_mem_229197,\n                                        __global unsigned char *ext_mem_229460,\n                                        __global unsigned char *ext_mem_229461,\n                                        __global unsigned char *mem_231320,\n                                        __global unsigned char *mem_231338,\n                                        __global unsigned char *mem_231342,\n                                        __global unsigned char *mem_231346,\n                                        __global unsigned char *mem_231350,\n                                        __global unsigned char *mem_231354)\n{\n    #define segred_group_sizze_225512 (mainzisegred_group_sizze_224961)\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_235934_backing_4 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_235934_backing_aligned_0;\n    __local volatile unsigned char *restrict red_arr_mem_235932_backing_3 =\n                    ",
                   "               (__local volatile\n                                    unsigned char *) red_arr_mem_235932_backing_aligned_1;\n    __local volatile unsigned char *restrict red_arr_mem_235930_backing_2 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_235930_backing_aligned_2;\n    __local volatile unsigned char *restrict red_arr_mem_235928_backing_1 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_235928_backing_aligned_3;\n    __local volatile unsigned char *restrict red_arr_mem_235926_backing_0 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_235926_backing_aligned_4;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_235921;\n    int32_t local_tid_235922;\n    int64_t group_sizze_235925;\n    int32_t wave_sizze_235924;\n    int32_t group_tid_235923;\n    \n    global_tid_235921 = get_global_id(0);\n    local_tid_235922 = get_local_id(0);\n    group_sizze_235925 = get_local_size(0);\n    wave_sizze_235924 = LOCKSTEP_WIDTH;\n    group_tid_235923 = get_group_id(0);\n    \n    int32_t phys_tid_225523 = global_tid_235921;\n    __local unsigned char *red_arr_mem_235926;\n    \n    red_arr_mem_235926 = (__local unsigned char *) red_arr_mem_235926_backing_0;\n    \n    __local unsigned char *red_arr_mem_235928;\n    \n    red_arr_mem_235928 = (__local unsigned char *) red_arr_mem_235928_backing_1;\n    \n    __local unsigned char *red_arr_mem_235930;\n    \n    red_arr_mem_235930 = (__local unsigned char *) red_arr_mem_235930_backing_2;\n    \n    __local unsigned char *red_arr_mem_235932;\n    \n    red_arr_mem_235932 = (__local unsigned char *) red_arr_mem_235932_backing_3;\n    \n    __local unsigned char *red_arr_mem_235934;\n    \n    red_arr_mem_235934 = (__local unsigned char *) red_arr_mem_235934_backing_4;\n    \n    int32_t phys_group_id_235936;\n    \n    phys_gro",
                   "up_id_235936 = get_group_id(0);\n    for (int32_t i_235937 = 0; i_235937 <\n         sdiv_up32(sext_i64_i32(sdiv_up64(partition_sizze_203577 * t_n_m_203650,\n                                          squot64(segred_group_sizze_225512,\n                                                  segment_sizze_nonzzero_235919))) -\n                   phys_group_id_235936, sext_i64_i32(num_groups_225513));\n         i_235937++) {\n        int32_t virt_group_id_235938 = phys_group_id_235936 + i_235937 *\n                sext_i64_i32(num_groups_225513);\n        int64_t slice_235939 = t_n_m_203650;\n        int64_t slice_235940 = partition_sizze_203577 * slice_235939;\n        int64_t gtid_225520 = squot64(squot64(sext_i32_i64(local_tid_235922),\n                                              segment_sizze_nonzzero_235919) +\n                                      sext_i32_i64(virt_group_id_235938) *\n                                      squot64(segred_group_sizze_225512,\n                                              segment_sizze_nonzzero_235919),\n                                      slice_235939);\n        int64_t remnant_235941 = squot64(sext_i32_i64(local_tid_235922),\n                                         segment_sizze_nonzzero_235919) +\n                sext_i32_i64(virt_group_id_235938) *\n                squot64(segred_group_sizze_225512,\n                        segment_sizze_nonzzero_235919) - gtid_225520 *\n                slice_235939;\n        int64_t gtid_225521 = remnant_235941;\n        int64_t remnant_235942 = remnant_235941 - gtid_225521;\n        int64_t gtid_225522 = srem64(sext_i32_i64(local_tid_235922),\n                                     q_t_203494);\n        \n        // apply map function if in bounds\n        {\n            if (slt64((int64_t) 0, q_t_203494) && ((slt64(gtid_225520,\n                                                          partition_sizze_203577) &&\n                                                    slt64(gtid_225521,\n                                           ",
                   "               t_n_m_203650)) &&\n                                                   slt64(sext_i32_i64(local_tid_235922),\n                                                         q_t_203494 *\n                                                         squot64(segred_group_sizze_225512,\n                                                                 segment_sizze_nonzzero_235919)))) {\n                int64_t x_225540;\n                \n                x_225540 = ((__global int64_t *) ext_mem_229196)[gtid_225520];\n                \n                int64_t x_225545;\n                \n                x_225545 = ((__global int64_t *) ext_mem_229461)[gtid_225520 *\n                                                                 t_n_m_203650 +\n                                                                 gtid_225521];\n                \n                double x_225546;\n                \n                x_225546 = ((__global double *) ext_mem_229460)[gtid_225520 *\n                                                                t_n_m_203650 +\n                                                                gtid_225521];\n                \n                int64_t binop_y_228684 = mul64(jump_t_203500, gtid_225521);\n                int64_t binop_y_228685 = smin64(i_203670, binop_y_228684);\n                int64_t index_primexp_228686 = add64((int64_t) 1,\n                                                     binop_y_228685);\n                bool cond_225549 = sle64(x_225540, gtid_225522);\n                int64_t defunc_0_f_res_225550;\n                \n                if (cond_225549) {\n                    defunc_0_f_res_225550 = (int64_t) 0;\n                } else {\n                    int64_t i_225551 = add64(gtid_225522, x_225545);\n                    int64_t defunc_0_add_arg_225552;\n                    \n                    defunc_0_add_arg_225552 = ((__global\n                                                int64_t *) ext_mem_229197)[gtid_225520 *\n                                      ",
                   "                                     n_203490 +\n                                                                           i_225551];\n                    \n                    int64_t defunc_1_add_res_225553 = add64((int64_t) 1,\n                                                            defunc_0_add_arg_225552);\n                    \n                    defunc_0_f_res_225550 = defunc_1_add_res_225553;\n                }\n                \n                double defunc_0_f_res_225554;\n                \n                if (cond_225549) {\n                    defunc_0_f_res_225554 = 0.0;\n                } else {\n                    int64_t i_225555 = add64(gtid_225522, x_225545);\n                    double defunc_0_add_arg_225556;\n                    \n                    defunc_0_add_arg_225556 = ((__global\n                                                double *) mem_231320)[gtid_225520 *\n                                                                      n_203490 +\n                                                                      i_225555];\n                    defunc_0_f_res_225554 = defunc_0_add_arg_225556;\n                }\n                \n                int64_t binop_p_225557 = sub64(defunc_0_f_res_225550,\n                                               index_primexp_228686);\n                double defunc_0_f_res_225558 = sitofp_i64_f64(binop_p_225557);\n                double abs_res_225559 = fabs(defunc_0_f_res_225558);\n                double tmp1_225560 = abs_res_225559 / x_225546;\n                double x_225561 = tmp1_225560 * tmp1_225560;\n                double y_225562 = tmp1_225560 * x_225561;\n                double tmp2_225563 = 1.0 - y_225562;\n                double x_225564 = tmp2_225563 * tmp2_225563;\n                double tmp3_225565 = tmp2_225563 * x_225564;\n                double w_j_225566 = defunc_0_f_res_225554 * tmp3_225565;\n                double xw_j_225567 = defunc_0_f_res_225558 * w_j_225566;\n                double x2w_j_225568 = defunc_0_f",
                   "_res_225558 * xw_j_225567;\n                double x3w_j_225569 = defunc_0_f_res_225558 * x2w_j_225568;\n                double x4w_j_225570 = defunc_0_f_res_225558 * x3w_j_225569;\n                \n                // save map-out results\n                { }\n                // save results to be reduced\n                {\n                    ((__local\n                      double *) red_arr_mem_235926)[sext_i32_i64(local_tid_235922)] =\n                        w_j_225566;\n                    ((__local\n                      double *) red_arr_mem_235928)[sext_i32_i64(local_tid_235922)] =\n                        xw_j_225567;\n                    ((__local\n                      double *) red_arr_mem_235930)[sext_i32_i64(local_tid_235922)] =\n                        x2w_j_225568;\n                    ((__local\n                      double *) red_arr_mem_235932)[sext_i32_i64(local_tid_235922)] =\n                        x3w_j_225569;\n                    ((__local\n                      double *) red_arr_mem_235934)[sext_i32_i64(local_tid_235922)] =\n                        x4w_j_225570;\n                }\n            } else {\n                ((__local\n                  double *) red_arr_mem_235926)[sext_i32_i64(local_tid_235922)] =\n                    0.0;\n                ((__local\n                  double *) red_arr_mem_235928)[sext_i32_i64(local_tid_235922)] =\n                    0.0;\n                ((__local\n                  double *) red_arr_mem_235930)[sext_i32_i64(local_tid_235922)] =\n                    0.0;\n                ((__local\n                  double *) red_arr_mem_235932)[sext_i32_i64(local_tid_235922)] =\n                    0.0;\n                ((__local\n                  double *) red_arr_mem_235934)[sext_i32_i64(local_tid_235922)] =\n                    0.0;\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        if (slt64((int64_t) 0, q_t_203494)) {\n            // perform segmented scan to imitate reduction\n            {\n                double x_225",
                   "524;\n                double x_225525;\n                double x_225526;\n                double x_225527;\n                double x_225528;\n                double x_225529;\n                double x_225530;\n                double x_225531;\n                double x_225532;\n                double x_225533;\n                double x_235943;\n                double x_235944;\n                double x_235945;\n                double x_235946;\n                double x_235947;\n                double x_235948;\n                double x_235949;\n                double x_235950;\n                double x_235951;\n                double x_235952;\n                bool ltid_in_bounds_235958 =\n                     slt64(sext_i32_i64(local_tid_235922), q_t_203494 *\n                           squot64(segred_group_sizze_225512,\n                                   segment_sizze_nonzzero_235919));\n                int32_t skip_threads_235959;\n                \n                // read input for in-block scan\n                {\n                    if (ltid_in_bounds_235958) {\n                        x_225529 = ((volatile __local\n                                     double *) red_arr_mem_235926)[sext_i32_i64(local_tid_235922)];\n                        x_225530 = ((volatile __local\n                                     double *) red_arr_mem_235928)[sext_i32_i64(local_tid_235922)];\n                        x_225531 = ((volatile __local\n                                     double *) red_arr_mem_235930)[sext_i32_i64(local_tid_235922)];\n                        x_225532 = ((volatile __local\n                                     double *) red_arr_mem_235932)[sext_i32_i64(local_tid_235922)];\n                        x_225533 = ((volatile __local\n                                     double *) red_arr_mem_235934)[sext_i32_i64(local_tid_235922)];\n                        if ((local_tid_235922 - squot32(local_tid_235922, 32) *\n                             32) == 0) {\n                            x_225524 = x_225529;\n    ",
                   "                        x_225525 = x_225530;\n                            x_225526 = x_225531;\n                            x_225527 = x_225532;\n                            x_225528 = x_225533;\n                        }\n                    }\n                }\n                // in-block scan (hopefully no barriers needed)\n                {\n                    skip_threads_235959 = 1;\n                    while (slt32(skip_threads_235959, 32)) {\n                        bool thread_active_235960 = sle32(skip_threads_235959,\n                                                          local_tid_235922 -\n                                                          squot32(local_tid_235922,\n                                                                  32) * 32) &&\n                             ltid_in_bounds_235958;\n                        \n                        if (thread_active_235960) {\n                            // read operands\n                            {\n                                x_225524 = ((volatile __local\n                                             double *) red_arr_mem_235926)[sext_i32_i64(local_tid_235922) -\n                                                                           sext_i32_i64(skip_threads_235959)];\n                                x_225525 = ((volatile __local\n                                             double *) red_arr_mem_235928)[sext_i32_i64(local_tid_235922) -\n                                                                           sext_i32_i64(skip_threads_235959)];\n                                x_225526 = ((volatile __local\n                                             double *) red_arr_mem_235930)[sext_i32_i64(local_tid_235922) -\n                                                                           sext_i32_i64(skip_threads_235959)];\n                                x_225527 = ((volatile __local\n                                             double *) red_arr_mem_235932)[sext_i32_i64(local_tid_235922) -\n                  ",
                   "                                                         sext_i32_i64(skip_threads_235959)];\n                                x_225528 = ((volatile __local\n                                             double *) red_arr_mem_235934)[sext_i32_i64(local_tid_235922) -\n                                                                           sext_i32_i64(skip_threads_235959)];\n                            }\n                        }\n                        // perform operation\n                        {\n                            bool inactive_235961 =\n                                 slt64(srem64(sext_i32_i64(local_tid_235922),\n                                              q_t_203494),\n                                       sext_i32_i64(local_tid_235922) -\n                                       sext_i32_i64(local_tid_235922 -\n                                       skip_threads_235959));\n                            \n                            if (thread_active_235960 && inactive_235961) {\n                                x_225524 = x_225529;\n                                x_225525 = x_225530;\n                                x_225526 = x_225531;\n                                x_225527 = x_225532;\n                                x_225528 = x_225533;\n                            }\n                            if (thread_active_235960) {\n                                if (!inactive_235961) {\n                                    double defunc_1_op_res_225534 = x_225524 +\n                                           x_225529;\n                                    double defunc_1_op_res_225535 = x_225525 +\n                                           x_225530;\n                                    double defunc_1_op_res_225536 = x_225526 +\n                                           x_225531;\n                                    double defunc_1_op_res_225537 = x_225527 +\n                                           x_225532;\n                                    double defunc_1_op_res_225538 =",
                   " x_225528 +\n                                           x_225533;\n                                    \n                                    x_225524 = defunc_1_op_res_225534;\n                                    x_225525 = defunc_1_op_res_225535;\n                                    x_225526 = defunc_1_op_res_225536;\n                                    x_225527 = defunc_1_op_res_225537;\n                                    x_225528 = defunc_1_op_res_225538;\n                                }\n                            }\n                        }\n                        if (sle32(wave_sizze_235924, skip_threads_235959)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        if (thread_active_235960) {\n                            // write result\n                            {\n                                ((volatile __local\n                                  double *) red_arr_mem_235926)[sext_i32_i64(local_tid_235922)] =\n                                    x_225524;\n                                x_225529 = x_225524;\n                                ((volatile __local\n                                  double *) red_arr_mem_235928)[sext_i32_i64(local_tid_235922)] =\n                                    x_225525;\n                                x_225530 = x_225525;\n                                ((volatile __local\n                                  double *) red_arr_mem_235930)[sext_i32_i64(local_tid_235922)] =\n                                    x_225526;\n                                x_225531 = x_225526;\n                                ((volatile __local\n                                  double *) red_arr_mem_235932)[sext_i32_i64(local_tid_235922)] =\n                                    x_225527;\n                                x_225532 = x_225527;\n                                ((volatile __local\n                                  double *) red_arr_mem_235934)[sext_i32_i64(local_tid_235922)] =\n                         ",
                   "           x_225528;\n                                x_225533 = x_225528;\n                            }\n                        }\n                        if (sle32(wave_sizze_235924, skip_threads_235959)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        skip_threads_235959 *= 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_235922 - squot32(local_tid_235922, 32) *\n                         32) == 31 && ltid_in_bounds_235958) {\n                        ((volatile __local\n                          double *) red_arr_mem_235926)[sext_i32_i64(squot32(local_tid_235922,\n                                                                             32))] =\n                            x_225524;\n                        ((volatile __local\n                          double *) red_arr_mem_235928)[sext_i32_i64(squot32(local_tid_235922,\n                                                                             32))] =\n                            x_225525;\n                        ((volatile __local\n                          double *) red_arr_mem_235930)[sext_i32_i64(squot32(local_tid_235922,\n                                                                             32))] =\n                            x_225526;\n                        ((volatile __local\n                          double *) red_arr_mem_235932)[sext_i32_i64(squot32(local_tid_235922,\n                                                                             32))] =\n                            x_225527;\n                        ((volatile __local\n                          double *) red_arr_mem_235934)[sext_i32_i64(squot32(local_tid_235922,\n                                                                             32))] =\n                            x_225528;\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_235962;\n                    \n                    // read input for in-block scan\n                    {\n                        if (squot32(local_tid_235922, 32) == 0 &&\n                            ltid_in_bounds_235958) {\n                            x_235948 = ((volatile __local\n                                         double *) red_arr_mem_235926)[sext_i32_i64(local_tid_235922)];\n                            x_235949 = ((volatile __local\n                                         double *) red_arr_mem_235928)[sext_i32_i64(local_tid_235922)];\n                            x_235950 = ((volatile __local\n                                         double *) red_arr_mem_235930)[sext_i32_i64(local_tid_235922)];\n                            x_235951 = ((volatile __local\n                                         double *) red_arr_mem_235932)[sext_i32_i64(local_tid_235922)];\n                            x_235952 = ((volatile __local\n                                         double *) red_arr_mem_235934)[sext_i32_i64(local_tid_235922)];\n                            if ((local_tid_235922 - squot32(local_tid_235922,\n                                                            32) * 32) == 0) {\n                                x_235943 = x_235948;\n                                x_235944 = x_235949;\n                                x_235945 = x_235950;\n                                x_235946 = x_235951;\n                                x_235947 = x_235952;\n                            }\n                        }\n                    }\n                    // in-block scan (hopefully no barriers needed)\n                    {\n                        skip_threads_235962 = 1;\n                        while (slt32(skip_threads_235962, 32)) {\n                            bool thread_active_235963 =\n ",
                   "                                sle32(skip_threads_235962, local_tid_235922 -\n                                       squot32(local_tid_235922, 32) * 32) &&\n                                 (squot32(local_tid_235922, 32) == 0 &&\n                                  ltid_in_bounds_235958);\n                            \n                            if (thread_active_235963) {\n                                // read operands\n                                {\n                                    x_235943 = ((volatile __local\n                                                 double *) red_arr_mem_235926)[sext_i32_i64(local_tid_235922) -\n                                                                               sext_i32_i64(skip_threads_235962)];\n                                    x_235944 = ((volatile __local\n                                                 double *) red_arr_mem_235928)[sext_i32_i64(local_tid_235922) -\n                                                                               sext_i32_i64(skip_threads_235962)];\n                                    x_235945 = ((volatile __local\n                                                 double *) red_arr_mem_235930)[sext_i32_i64(local_tid_235922) -\n                                                                               sext_i32_i64(skip_threads_235962)];\n                                    x_235946 = ((volatile __local\n                                                 double *) red_arr_mem_235932)[sext_i32_i64(local_tid_235922) -\n                                                                               sext_i32_i64(skip_threads_235962)];\n                                    x_235947 = ((volatile __local\n                                                 double *) red_arr_mem_235934)[sext_i32_i64(local_tid_235922) -\n                                                                               sext_i32_i64(skip_threads_235962)];\n                                }\n                            }\n                 ",
                   "           // perform operation\n                            {\n                                bool inactive_235964 =\n                                     slt64(srem64(sext_i32_i64(local_tid_235922 *\n                                                  32 + 32 - 1), q_t_203494),\n                                           sext_i32_i64(local_tid_235922 * 32 +\n                                           32 - 1) -\n                                           sext_i32_i64((local_tid_235922 -\n                                                         skip_threads_235962) *\n                                           32 + 32 - 1));\n                                \n                                if (thread_active_235963 && inactive_235964) {\n                                    x_235943 = x_235948;\n                                    x_235944 = x_235949;\n                                    x_235945 = x_235950;\n                                    x_235946 = x_235951;\n                                    x_235947 = x_235952;\n                                }\n                                if (thread_active_235963) {\n                                    if (!inactive_235964) {\n                                        double defunc_1_op_res_235953 =\n                                               x_235943 + x_235948;\n                                        double defunc_1_op_res_235954 =\n                                               x_235944 + x_235949;\n                                        double defunc_1_op_res_235955 =\n                                               x_235945 + x_235950;\n                                        double defunc_1_op_res_235956 =\n                                               x_235946 + x_235951;\n                                        double defunc_1_op_res_235957 =\n                                               x_235947 + x_235952;\n                                        \n                                        x_235943 = defunc_1_op_res_235953;\n          ",
                   "                              x_235944 = defunc_1_op_res_235954;\n                                        x_235945 = defunc_1_op_res_235955;\n                                        x_235946 = defunc_1_op_res_235956;\n                                        x_235947 = defunc_1_op_res_235957;\n                                    }\n                                }\n                            }\n                            if (sle32(wave_sizze_235924, skip_threads_235962)) {\n                                barrier(CLK_LOCAL_MEM_FENCE);\n                            }\n                            if (thread_active_235963) {\n                                // write result\n                                {\n                                    ((volatile __local\n                                      double *) red_arr_mem_235926)[sext_i32_i64(local_tid_235922)] =\n                                        x_235943;\n                                    x_235948 = x_235943;\n                                    ((volatile __local\n                                      double *) red_arr_mem_235928)[sext_i32_i64(local_tid_235922)] =\n                                        x_235944;\n                                    x_235949 = x_235944;\n                                    ((volatile __local\n                                      double *) red_arr_mem_235930)[sext_i32_i64(local_tid_235922)] =\n                                        x_235945;\n                                    x_235950 = x_235945;\n                                    ((volatile __local\n                                      double *) red_arr_mem_235932)[sext_i32_i64(local_tid_235922)] =\n                                        x_235946;\n                                    x_235951 = x_235946;\n                                    ((volatile __local\n                                      double *) red_arr_mem_235934)[sext_i32_i64(local_tid_235922)] =\n                                        x_235947;\n                                  ",
                   "  x_235952 = x_235947;\n                                }\n                            }\n                            if (sle32(wave_sizze_235924, skip_threads_235962)) {\n                                barrier(CLK_LOCAL_MEM_FENCE);\n                            }\n                            skip_threads_235962 *= 2;\n                        }\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                \n                bool no_carry_in_235965 = squot32(local_tid_235922, 32) == 0 ||\n                     !ltid_in_bounds_235958;\n                \n                // carry-in for every block except the first\n                {\n                    // read operands\n                    {\n                        if (!no_carry_in_235965) {\n                            x_225529 = x_225524;\n                            x_225530 = x_225525;\n                            x_225531 = x_225526;\n                            x_225532 = x_225527;\n                            x_225533 = x_225528;\n                            x_225524 = ((__local\n                                         double *) red_arr_mem_235926)[sext_i32_i64(squot32(local_tid_235922,\n                                                                                            32)) -\n                                                                       (int64_t) 1];\n                            x_225525 = ((__local\n                                         double *) red_arr_mem_235928)[sext_i32_i64(squot32(local_tid_235922,\n                                                                                            32)) -\n                                                                       (int64_t) 1];\n                            x_225526 = ((__local\n                                         double *) red_arr_mem_235930)[sext_i32_i64(squot32(local_tid_235922,\n                                                                                            32)) -\n                                     ",
                   "                                  (int64_t) 1];\n                            x_225527 = ((__local\n                                         double *) red_arr_mem_235932)[sext_i32_i64(squot32(local_tid_235922,\n                                                                                            32)) -\n                                                                       (int64_t) 1];\n                            x_225528 = ((__local\n                                         double *) red_arr_mem_235934)[sext_i32_i64(squot32(local_tid_235922,\n                                                                                            32)) -\n                                                                       (int64_t) 1];\n                        }\n                    }\n                    // perform operation\n                    {\n                        bool inactive_235966 =\n                             slt64(srem64(sext_i32_i64(local_tid_235922),\n                                          q_t_203494),\n                                   sext_i32_i64(local_tid_235922) -\n                                   sext_i32_i64(squot32(local_tid_235922, 32) *\n                                   32 - 1));\n                        \n                        if (!no_carry_in_235965) {\n                            if (inactive_235966) {\n                                x_225524 = x_225529;\n                                x_225525 = x_225530;\n                                x_225526 = x_225531;\n                                x_225527 = x_225532;\n                                x_225528 = x_225533;\n                            }\n                        }\n                        if (!no_carry_in_235965) {\n                            if (!inactive_235966) {\n                                double defunc_1_op_res_225534 = x_225524 +\n                                       x_225529;\n                                double defunc_1_op_res_225535 = x_225525 +\n                                    ",
                   "   x_225530;\n                                double defunc_1_op_res_225536 = x_225526 +\n                                       x_225531;\n                                double defunc_1_op_res_225537 = x_225527 +\n                                       x_225532;\n                                double defunc_1_op_res_225538 = x_225528 +\n                                       x_225533;\n                                \n                                x_225524 = defunc_1_op_res_225534;\n                                x_225525 = defunc_1_op_res_225535;\n                                x_225526 = defunc_1_op_res_225536;\n                                x_225527 = defunc_1_op_res_225537;\n                                x_225528 = defunc_1_op_res_225538;\n                            }\n                        }\n                    }\n                    // write final result\n                    {\n                        if (!no_carry_in_235965) {\n                            ((__local\n                              double *) red_arr_mem_235926)[sext_i32_i64(local_tid_235922)] =\n                                x_225524;\n                            ((__local\n                              double *) red_arr_mem_235928)[sext_i32_i64(local_tid_235922)] =\n                                x_225525;\n                            ((__local\n                              double *) red_arr_mem_235930)[sext_i32_i64(local_tid_235922)] =\n                                x_225526;\n                            ((__local\n                              double *) red_arr_mem_235932)[sext_i32_i64(local_tid_235922)] =\n                                x_225527;\n                            ((__local\n                              double *) red_arr_mem_235934)[sext_i32_i64(local_tid_235922)] =\n                                x_225528;\n                        }\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // restore correct values for first block\n              ",
                   "  {\n                    if (squot32(local_tid_235922, 32) == 0 &&\n                        ltid_in_bounds_235958) {\n                        ((__local\n                          double *) red_arr_mem_235926)[sext_i32_i64(local_tid_235922)] =\n                            x_225529;\n                        ((__local\n                          double *) red_arr_mem_235928)[sext_i32_i64(local_tid_235922)] =\n                            x_225530;\n                        ((__local\n                          double *) red_arr_mem_235930)[sext_i32_i64(local_tid_235922)] =\n                            x_225531;\n                        ((__local\n                          double *) red_arr_mem_235932)[sext_i32_i64(local_tid_235922)] =\n                            x_225532;\n                        ((__local\n                          double *) red_arr_mem_235934)[sext_i32_i64(local_tid_235922)] =\n                            x_225533;\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_235938) *\n                      squot64(segred_group_sizze_225512,\n                              segment_sizze_nonzzero_235919) +\n                      sext_i32_i64(local_tid_235922), partition_sizze_203577 *\n                      t_n_m_203650) && slt64(sext_i32_i64(local_tid_235922),\n                                             squot64(segred_group_sizze_225512,\n                                                     segment_sizze_nonzzero_235919))) {\n                double tmp_235967;\n                \n                tmp_235967 = ((__local\n                               double *) red_arr_mem_235926)[(sext_i32_i64(local_tid_235922) +\n                                                              (int64_t) 1) *\n                                                             segment_sizze_nonzzero_235919 -\n                 ",
                   "                                            (int64_t) 1];\n                ((__global\n                  double *) mem_231338)[squot64(sext_i32_i64(virt_group_id_235938) *\n                                                squot64(segred_group_sizze_225512,\n                                                        segment_sizze_nonzzero_235919) +\n                                                sext_i32_i64(local_tid_235922),\n                                                t_n_m_203650) * t_n_m_203650 +\n                                        (sext_i32_i64(virt_group_id_235938) *\n                                         squot64(segred_group_sizze_225512,\n                                                 segment_sizze_nonzzero_235919) +\n                                         sext_i32_i64(local_tid_235922) -\n                                         squot64(sext_i32_i64(virt_group_id_235938) *\n                                                 squot64(segred_group_sizze_225512,\n                                                         segment_sizze_nonzzero_235919) +\n                                                 sext_i32_i64(local_tid_235922),\n                                                 t_n_m_203650) *\n                                         t_n_m_203650)] = tmp_235967;\n                \n                double tmp_235968;\n                \n                tmp_235968 = ((__local\n                               double *) red_arr_mem_235928)[(sext_i32_i64(local_tid_235922) +\n                                                              (int64_t) 1) *\n                                                             segment_sizze_nonzzero_235919 -\n                                                             (int64_t) 1];\n                ((__global\n                  double *) mem_231342)[squot64(sext_i32_i64(virt_group_id_235938) *\n                                                squot64(segred_group_sizze_225512,\n                                                        segment_sizze_",
                   "nonzzero_235919) +\n                                                sext_i32_i64(local_tid_235922),\n                                                t_n_m_203650) * t_n_m_203650 +\n                                        (sext_i32_i64(virt_group_id_235938) *\n                                         squot64(segred_group_sizze_225512,\n                                                 segment_sizze_nonzzero_235919) +\n                                         sext_i32_i64(local_tid_235922) -\n                                         squot64(sext_i32_i64(virt_group_id_235938) *\n                                                 squot64(segred_group_sizze_225512,\n                                                         segment_sizze_nonzzero_235919) +\n                                                 sext_i32_i64(local_tid_235922),\n                                                 t_n_m_203650) *\n                                         t_n_m_203650)] = tmp_235968;\n                \n                double tmp_235969;\n                \n                tmp_235969 = ((__local\n                               double *) red_arr_mem_235930)[(sext_i32_i64(local_tid_235922) +\n                                                              (int64_t) 1) *\n                                                             segment_sizze_nonzzero_235919 -\n                                                             (int64_t) 1];\n                ((__global\n                  double *) mem_231346)[squot64(sext_i32_i64(virt_group_id_235938) *\n                                                squot64(segred_group_sizze_225512,\n                                                        segment_sizze_nonzzero_235919) +\n                                                sext_i32_i64(local_tid_235922),\n                                                t_n_m_203650) * t_n_m_203650 +\n                                        (sext_i32_i64(virt_group_id_235938) *\n                                         squot64(segred_group_sizze",
                   "_225512,\n                                                 segment_sizze_nonzzero_235919) +\n                                         sext_i32_i64(local_tid_235922) -\n                                         squot64(sext_i32_i64(virt_group_id_235938) *\n                                                 squot64(segred_group_sizze_225512,\n                                                         segment_sizze_nonzzero_235919) +\n                                                 sext_i32_i64(local_tid_235922),\n                                                 t_n_m_203650) *\n                                         t_n_m_203650)] = tmp_235969;\n                \n                double tmp_235970;\n                \n                tmp_235970 = ((__local\n                               double *) red_arr_mem_235932)[(sext_i32_i64(local_tid_235922) +\n                                                              (int64_t) 1) *\n                                                             segment_sizze_nonzzero_235919 -\n                                                             (int64_t) 1];\n                ((__global\n                  double *) mem_231350)[squot64(sext_i32_i64(virt_group_id_235938) *\n                                                squot64(segred_group_sizze_225512,\n                                                        segment_sizze_nonzzero_235919) +\n                                                sext_i32_i64(local_tid_235922),\n                                                t_n_m_203650) * t_n_m_203650 +\n                                        (sext_i32_i64(virt_group_id_235938) *\n                                         squot64(segred_group_sizze_225512,\n                                                 segment_sizze_nonzzero_235919) +\n                                         sext_i32_i64(local_tid_235922) -\n                                         squot64(sext_i32_i64(virt_group_id_235938) *\n                                                 squot64(segred_group_si",
                   "zze_225512,\n                                                         segment_sizze_nonzzero_235919) +\n                                                 sext_i32_i64(local_tid_235922),\n                                                 t_n_m_203650) *\n                                         t_n_m_203650)] = tmp_235970;\n                \n                double tmp_235971;\n                \n                tmp_235971 = ((__local\n                               double *) red_arr_mem_235934)[(sext_i32_i64(local_tid_235922) +\n                                                              (int64_t) 1) *\n                                                             segment_sizze_nonzzero_235919 -\n                                                             (int64_t) 1];\n                ((__global\n                  double *) mem_231354)[squot64(sext_i32_i64(virt_group_id_235938) *\n                                                squot64(segred_group_sizze_225512,\n                                                        segment_sizze_nonzzero_235919) +\n                                                sext_i32_i64(local_tid_235922),\n                                                t_n_m_203650) * t_n_m_203650 +\n                                        (sext_i32_i64(virt_group_id_235938) *\n                                         squot64(segred_group_sizze_225512,\n                                                 segment_sizze_nonzzero_235919) +\n                                         sext_i32_i64(local_tid_235922) -\n                                         squot64(sext_i32_i64(virt_group_id_235938) *\n                                                 squot64(segred_group_sizze_225512,\n                                                         segment_sizze_nonzzero_235919) +\n                                                 sext_i32_i64(local_tid_235922),\n                                                 t_n_m_203650) *\n                                         t_n_m_203650)] = tmp_235971;\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_225512\n}\n__kernel void mainzisegred_small_225624(__global int *global_failure,\n                                        __local volatile\n                                        int64_t *red_arr_mem_236066_backing_aligned_0,\n                                        __local volatile\n                                        int64_t *red_arr_mem_236064_backing_aligned_1,\n                                        int64_t n_203490, int64_t q_t_203494,\n                                        int64_t jump_t_203500,\n                                        int64_t partition_sizze_203577,\n                                        int64_t t_n_m_203650, int64_t i_203670,\n                                        int64_t num_groups_225617,\n                                        int64_t segment_sizze_nonzzero_236057,\n                                        __global unsigned char *ext_mem_229196,\n                                        __global unsigned char *ext_mem_229197,\n                                        __global unsigned char *ext_mem_229460,\n                                        __global unsigned char *ext_mem_229461,\n                                        __global unsigned char *mem_231320,\n                                        __global unsigned char *mem_231324,\n                                        __global unsigned char *mem_231359,\n                                        __global unsigned char *mem_231363,\n                                        __global unsigned char *mem_231367,\n                                        __global unsigned char *mem_231371,\n                                        __global unsigned char *mem_231375,\n                                        __global unsigned char *mem_231380,\n                                        __global unsigned char *mem_231384)\n{\n    #d",
                   "efine segred_group_sizze_225616 (mainzisegred_group_sizze_224832)\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_236066_backing_1 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_236066_backing_aligned_0;\n    __local volatile unsigned char *restrict red_arr_mem_236064_backing_0 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_236064_backing_aligned_1;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_236059;\n    int32_t local_tid_236060;\n    int64_t group_sizze_236063;\n    int32_t wave_sizze_236062;\n    int32_t group_tid_236061;\n    \n    global_tid_236059 = get_global_id(0);\n    local_tid_236060 = get_local_id(0);\n    group_sizze_236063 = get_local_size(0);\n    wave_sizze_236062 = LOCKSTEP_WIDTH;\n    group_tid_236061 = get_group_id(0);\n    \n    int32_t phys_tid_225624 = global_tid_236059;\n    __local unsigned char *red_arr_mem_236064;\n    \n    red_arr_mem_236064 = (__local unsigned char *) red_arr_mem_236064_backing_0;\n    \n    __local unsigned char *red_arr_mem_236066;\n    \n    red_arr_mem_236066 = (__local unsigned char *) red_arr_mem_236066_backing_1;\n    \n    int32_t phys_group_id_236068;\n    \n    phys_group_id_236068 = get_group_id(0);\n    for (int32_t i_236069 = 0; i_236069 <\n         sdiv_up32(sext_i64_i32(sdiv_up64(partition_sizze_203577 * t_n_m_203650,\n                                          squot64(segred_group_sizze_225616,\n                                                  segment_sizze_nonzzero_236057))) -\n                   phys_group_id_236068, sext_i64_i32(num_groups_225617));\n         i_236069++) {\n        int32_t virt_group_id_236070 = phys_group_id_236068 + i_236069 *\n                sext_i64_i32(num_groups_225617);\n        int64_t slice_236071 = t_n_m_203650;\n        int64_t",
                   " slice_236072 = partition_sizze_203577 * slice_236071;\n        int64_t gtid_225621 = squot64(squot64(sext_i32_i64(local_tid_236060),\n                                              segment_sizze_nonzzero_236057) +\n                                      sext_i32_i64(virt_group_id_236070) *\n                                      squot64(segred_group_sizze_225616,\n                                              segment_sizze_nonzzero_236057),\n                                      slice_236071);\n        int64_t remnant_236073 = squot64(sext_i32_i64(local_tid_236060),\n                                         segment_sizze_nonzzero_236057) +\n                sext_i32_i64(virt_group_id_236070) *\n                squot64(segred_group_sizze_225616,\n                        segment_sizze_nonzzero_236057) - gtid_225621 *\n                slice_236071;\n        int64_t gtid_225622 = remnant_236073;\n        int64_t remnant_236074 = remnant_236073 - gtid_225622;\n        int64_t gtid_225623 = srem64(sext_i32_i64(local_tid_236060),\n                                     q_t_203494);\n        \n        // apply map function if in bounds\n        {\n            if (slt64((int64_t) 0, q_t_203494) && ((slt64(gtid_225621,\n                                                          partition_sizze_203577) &&\n                                                    slt64(gtid_225622,\n                                                          t_n_m_203650)) &&\n                                                   slt64(sext_i32_i64(local_tid_236060),\n                                                         q_t_203494 *\n                                                         squot64(segred_group_sizze_225616,\n                                                                 segment_sizze_nonzzero_236057)))) {\n                int64_t x_225632;\n                \n                x_225632 = ((__global int64_t *) ext_mem_229196)[gtid_225621];\n                \n                int64_t x_225643;\n                \n              ",
                   "  x_225643 = ((__global int64_t *) ext_mem_229461)[gtid_225621 *\n                                                                 t_n_m_203650 +\n                                                                 gtid_225622];\n                \n                double x_225644;\n                \n                x_225644 = ((__global double *) ext_mem_229460)[gtid_225621 *\n                                                                t_n_m_203650 +\n                                                                gtid_225622];\n                \n                int64_t binop_y_228679 = mul64(jump_t_203500, gtid_225622);\n                int64_t binop_y_228680 = smin64(i_203670, binop_y_228679);\n                int64_t index_primexp_228681 = add64((int64_t) 1,\n                                                     binop_y_228680);\n                double a12_225646;\n                \n                a12_225646 = ((__global double *) mem_231359)[gtid_225621 *\n                                                              t_n_m_203650 +\n                                                              gtid_225622];\n                \n                double b12_225647;\n                \n                b12_225647 = ((__global double *) mem_231363)[gtid_225621 *\n                                                              t_n_m_203650 +\n                                                              gtid_225622];\n                \n                double c12_225648;\n                \n                c12_225648 = ((__global double *) mem_231367)[gtid_225621 *\n                                                              t_n_m_203650 +\n                                                              gtid_225622];\n                \n                double b2_225649;\n                \n                b2_225649 = ((__global double *) mem_231371)[gtid_225621 *\n                                                             t_n_m_203650 +\n                                                             gtid_225622];",
                   "\n                \n                double c2_225650;\n                \n                c2_225650 = ((__global double *) mem_231375)[gtid_225621 *\n                                                             t_n_m_203650 +\n                                                             gtid_225622];\n                \n                bool cond_225652 = sle64(x_225632, gtid_225623);\n                int64_t defunc_0_f_res_225653;\n                \n                if (cond_225652) {\n                    defunc_0_f_res_225653 = (int64_t) 0;\n                } else {\n                    int64_t i_225654 = add64(gtid_225623, x_225643);\n                    int64_t defunc_0_add_arg_225655;\n                    \n                    defunc_0_add_arg_225655 = ((__global\n                                                int64_t *) ext_mem_229197)[gtid_225621 *\n                                                                           n_203490 +\n                                                                           i_225654];\n                    \n                    int64_t defunc_1_add_res_225656 = add64((int64_t) 1,\n                                                            defunc_0_add_arg_225655);\n                    \n                    defunc_0_f_res_225653 = defunc_1_add_res_225656;\n                }\n                \n                double defunc_0_f_res_225657;\n                \n                if (cond_225652) {\n                    defunc_0_f_res_225657 = 0.0;\n                } else {\n                    int64_t i_225658 = add64(gtid_225623, x_225643);\n                    double defunc_0_add_arg_225659;\n                    \n                    defunc_0_add_arg_225659 = ((__global\n                                                double *) mem_231320)[gtid_225621 *\n                                                                      n_203490 +\n                                                                      i_225658];\n                    defunc_0_f_res_225657 = defunc_0_add_ar",
                   "g_225659;\n                }\n                \n                int64_t binop_p_225660 = sub64(defunc_0_f_res_225653,\n                                               index_primexp_228681);\n                double defunc_0_f_res_225661 = sitofp_i64_f64(binop_p_225660);\n                double abs_res_225662 = fabs(defunc_0_f_res_225661);\n                double tmp1_225663 = abs_res_225662 / x_225644;\n                double x_225664 = tmp1_225663 * tmp1_225663;\n                double y_225665 = tmp1_225663 * x_225664;\n                double tmp2_225666 = 1.0 - y_225665;\n                double x_225667 = tmp2_225666 * tmp2_225666;\n                double tmp3_225668 = tmp2_225666 * x_225667;\n                double tmp4_225669 = defunc_0_f_res_225657 * tmp3_225668;\n                double defunc_1_f_res_225670 = defunc_0_f_res_225661 *\n                       tmp4_225669;\n                double defunc_1_f_res_225671 = defunc_0_f_res_225661 *\n                       defunc_1_f_res_225670;\n                double defunc_0_f_res_225672;\n                \n                if (cond_225652) {\n                    defunc_0_f_res_225672 = 0.0;\n                } else {\n                    int64_t i_225673 = add64(gtid_225623, x_225643);\n                    double defunc_0_add_arg_225674;\n                    \n                    defunc_0_add_arg_225674 = ((__global\n                                                double *) mem_231324)[gtid_225621 *\n                                                                      n_203490 +\n                                                                      i_225673];\n                    defunc_0_f_res_225672 = defunc_0_add_arg_225674;\n                }\n                \n                double x_225675 = a12_225646 * tmp4_225669;\n                double y_225676 = b12_225647 * defunc_1_f_res_225670;\n                double x_225677 = x_225675 + y_225676;\n                double y_225678 = c12_225648 * defunc_1_f_res_225671;\n                double x_225679 = x",
                   "_225677 + y_225678;\n                double defunc_9_fit_fun_res_225680 = defunc_0_f_res_225672 *\n                       x_225679;\n                double x_225681 = b12_225647 * tmp4_225669;\n                double y_225682 = b2_225649 * defunc_1_f_res_225670;\n                double x_225683 = x_225681 + y_225682;\n                double y_225684 = c2_225650 * defunc_1_f_res_225671;\n                double x_225685 = x_225683 + y_225684;\n                double defunc_9_slope_fun_res_225686 = defunc_0_f_res_225672 *\n                       x_225685;\n                \n                // save map-out results\n                { }\n                // save results to be reduced\n                {\n                    ((__local\n                      double *) red_arr_mem_236064)[sext_i32_i64(local_tid_236060)] =\n                        defunc_9_fit_fun_res_225680;\n                    ((__local\n                      double *) red_arr_mem_236066)[sext_i32_i64(local_tid_236060)] =\n                        defunc_9_slope_fun_res_225686;\n                }\n            } else {\n                ((__local\n                  double *) red_arr_mem_236064)[sext_i32_i64(local_tid_236060)] =\n                    0.0;\n                ((__local\n                  double *) red_arr_mem_236066)[sext_i32_i64(local_tid_236060)] =\n                    0.0;\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        if (slt64((int64_t) 0, q_t_203494)) {\n            // perform segmented scan to imitate reduction\n            {\n                double x_225625;\n                double x_225626;\n                double x_225627;\n                double x_225628;\n                double x_236075;\n                double x_236076;\n                double x_236077;\n                double x_236078;\n                bool ltid_in_bounds_236081 =\n                     slt64(sext_i32_i64(local_tid_236060), q_t_203494 *\n                           squot64(segred_group_sizze_225616,\n                                   segme",
                   "nt_sizze_nonzzero_236057));\n                int32_t skip_threads_236082;\n                \n                // read input for in-block scan\n                {\n                    if (ltid_in_bounds_236081) {\n                        x_225627 = ((volatile __local\n                                     double *) red_arr_mem_236064)[sext_i32_i64(local_tid_236060)];\n                        x_225628 = ((volatile __local\n                                     double *) red_arr_mem_236066)[sext_i32_i64(local_tid_236060)];\n                        if ((local_tid_236060 - squot32(local_tid_236060, 32) *\n                             32) == 0) {\n                            x_225625 = x_225627;\n                            x_225626 = x_225628;\n                        }\n                    }\n                }\n                // in-block scan (hopefully no barriers needed)\n                {\n                    skip_threads_236082 = 1;\n                    while (slt32(skip_threads_236082, 32)) {\n                        bool thread_active_236083 = sle32(skip_threads_236082,\n                                                          local_tid_236060 -\n                                                          squot32(local_tid_236060,\n                                                                  32) * 32) &&\n                             ltid_in_bounds_236081;\n                        \n                        if (thread_active_236083) {\n                            // read operands\n                            {\n                                x_225625 = ((volatile __local\n                                             double *) red_arr_mem_236064)[sext_i32_i64(local_tid_236060) -\n                                                                           sext_i32_i64(skip_threads_236082)];\n                                x_225626 = ((volatile __local\n                                             double *) red_arr_mem_236066)[sext_i32_i64(local_tid_236060) -\n                                        ",
                   "                                   sext_i32_i64(skip_threads_236082)];\n                            }\n                        }\n                        // perform operation\n                        {\n                            bool inactive_236084 =\n                                 slt64(srem64(sext_i32_i64(local_tid_236060),\n                                              q_t_203494),\n                                       sext_i32_i64(local_tid_236060) -\n                                       sext_i32_i64(local_tid_236060 -\n                                       skip_threads_236082));\n                            \n                            if (thread_active_236083 && inactive_236084) {\n                                x_225625 = x_225627;\n                                x_225626 = x_225628;\n                            }\n                            if (thread_active_236083) {\n                                if (!inactive_236084) {\n                                    double defunc_1_op_res_225629 = x_225625 +\n                                           x_225627;\n                                    double defunc_1_op_res_225630 = x_225626 +\n                                           x_225628;\n                                    \n                                    x_225625 = defunc_1_op_res_225629;\n                                    x_225626 = defunc_1_op_res_225630;\n                                }\n                            }\n                        }\n                        if (sle32(wave_sizze_236062, skip_threads_236082)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        if (thread_active_236083) {\n                            // write result\n                            {\n                                ((volatile __local\n                                  double *) red_arr_mem_236064)[sext_i32_i64(local_tid_236060)] =\n                                    x_225625;\n                                x_225627 =",
                   " x_225625;\n                                ((volatile __local\n                                  double *) red_arr_mem_236066)[sext_i32_i64(local_tid_236060)] =\n                                    x_225626;\n                                x_225628 = x_225626;\n                            }\n                        }\n                        if (sle32(wave_sizze_236062, skip_threads_236082)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        skip_threads_236082 *= 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_236060 - squot32(local_tid_236060, 32) *\n                         32) == 31 && ltid_in_bounds_236081) {\n                        ((volatile __local\n                          double *) red_arr_mem_236064)[sext_i32_i64(squot32(local_tid_236060,\n                                                                             32))] =\n                            x_225625;\n                        ((volatile __local\n                          double *) red_arr_mem_236066)[sext_i32_i64(squot32(local_tid_236060,\n                                                                             32))] =\n                            x_225626;\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_236085;\n                    \n                    // read input for in-block scan\n                    {\n                        if (squot32(local_tid_236060, 32) == 0 &&\n                            ltid_in_bounds_236081) {\n                            x_236077 = ((volatile __local\n                                         double *) red_arr_mem_236064)[sext_i32_i64(local_tid_236060)];\n      ",
                   "                      x_236078 = ((volatile __local\n                                         double *) red_arr_mem_236066)[sext_i32_i64(local_tid_236060)];\n                            if ((local_tid_236060 - squot32(local_tid_236060,\n                                                            32) * 32) == 0) {\n                                x_236075 = x_236077;\n                                x_236076 = x_236078;\n                            }\n                        }\n                    }\n                    // in-block scan (hopefully no barriers needed)\n                    {\n                        skip_threads_236085 = 1;\n                        while (slt32(skip_threads_236085, 32)) {\n                            bool thread_active_236086 =\n                                 sle32(skip_threads_236085, local_tid_236060 -\n                                       squot32(local_tid_236060, 32) * 32) &&\n                                 (squot32(local_tid_236060, 32) == 0 &&\n                                  ltid_in_bounds_236081);\n                            \n                            if (thread_active_236086) {\n                                // read operands\n                                {\n                                    x_236075 = ((volatile __local\n                                                 double *) red_arr_mem_236064)[sext_i32_i64(local_tid_236060) -\n                                                                               sext_i32_i64(skip_threads_236085)];\n                                    x_236076 = ((volatile __local\n                                                 double *) red_arr_mem_236066)[sext_i32_i64(local_tid_236060) -\n                                                                               sext_i32_i64(skip_threads_236085)];\n                                }\n                            }\n                            // perform operation\n                            {\n                                bool inactive_236087 =\n     ",
                   "                                slt64(srem64(sext_i32_i64(local_tid_236060 *\n                                                  32 + 32 - 1), q_t_203494),\n                                           sext_i32_i64(local_tid_236060 * 32 +\n                                           32 - 1) -\n                                           sext_i32_i64((local_tid_236060 -\n                                                         skip_threads_236085) *\n                                           32 + 32 - 1));\n                                \n                                if (thread_active_236086 && inactive_236087) {\n                                    x_236075 = x_236077;\n                                    x_236076 = x_236078;\n                                }\n                                if (thread_active_236086) {\n                                    if (!inactive_236087) {\n                                        double defunc_1_op_res_236079 =\n                                               x_236075 + x_236077;\n                                        double defunc_1_op_res_236080 =\n                                               x_236076 + x_236078;\n                                        \n                                        x_236075 = defunc_1_op_res_236079;\n                                        x_236076 = defunc_1_op_res_236080;\n                                    }\n                                }\n                            }\n                            if (sle32(wave_sizze_236062, skip_threads_236085)) {\n                                barrier(CLK_LOCAL_MEM_FENCE);\n                            }\n                            if (thread_active_236086) {\n                                // write result\n                                {\n                                    ((volatile __local\n                                      double *) red_arr_mem_236064)[sext_i32_i64(local_tid_236060)] =\n                                        x_236075;\n                            ",
                   "        x_236077 = x_236075;\n                                    ((volatile __local\n                                      double *) red_arr_mem_236066)[sext_i32_i64(local_tid_236060)] =\n                                        x_236076;\n                                    x_236078 = x_236076;\n                                }\n                            }\n                            if (sle32(wave_sizze_236062, skip_threads_236085)) {\n                                barrier(CLK_LOCAL_MEM_FENCE);\n                            }\n                            skip_threads_236085 *= 2;\n                        }\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                \n                bool no_carry_in_236088 = squot32(local_tid_236060, 32) == 0 ||\n                     !ltid_in_bounds_236081;\n                \n                // carry-in for every block except the first\n                {\n                    // read operands\n                    {\n                        if (!no_carry_in_236088) {\n                            x_225627 = x_225625;\n                            x_225628 = x_225626;\n                            x_225625 = ((__local\n                                         double *) red_arr_mem_236064)[sext_i32_i64(squot32(local_tid_236060,\n                                                                                            32)) -\n                                                                       (int64_t) 1];\n                            x_225626 = ((__local\n                                         double *) red_arr_mem_236066)[sext_i32_i64(squot32(local_tid_236060,\n                                                                                            32)) -\n                                                                       (int64_t) 1];\n                        }\n                    }\n                    // perform operation\n                    {\n                        bool inactive_236089 =\n              ",
                   "               slt64(srem64(sext_i32_i64(local_tid_236060),\n                                          q_t_203494),\n                                   sext_i32_i64(local_tid_236060) -\n                                   sext_i32_i64(squot32(local_tid_236060, 32) *\n                                   32 - 1));\n                        \n                        if (!no_carry_in_236088) {\n                            if (inactive_236089) {\n                                x_225625 = x_225627;\n                                x_225626 = x_225628;\n                            }\n                        }\n                        if (!no_carry_in_236088) {\n                            if (!inactive_236089) {\n                                double defunc_1_op_res_225629 = x_225625 +\n                                       x_225627;\n                                double defunc_1_op_res_225630 = x_225626 +\n                                       x_225628;\n                                \n                                x_225625 = defunc_1_op_res_225629;\n                                x_225626 = defunc_1_op_res_225630;\n                            }\n                        }\n                    }\n                    // write final result\n                    {\n                        if (!no_carry_in_236088) {\n                            ((__local\n                              double *) red_arr_mem_236064)[sext_i32_i64(local_tid_236060)] =\n                                x_225625;\n                            ((__local\n                              double *) red_arr_mem_236066)[sext_i32_i64(local_tid_236060)] =\n                                x_225626;\n                        }\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // restore correct values for first block\n                {\n                    if (squot32(local_tid_236060, 32) == 0 &&\n                        ltid_in_bounds_236081) {\n                        ((__local\n           ",
                   "               double *) red_arr_mem_236064)[sext_i32_i64(local_tid_236060)] =\n                            x_225627;\n                        ((__local\n                          double *) red_arr_mem_236066)[sext_i32_i64(local_tid_236060)] =\n                            x_225628;\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_236070) *\n                      squot64(segred_group_sizze_225616,\n                              segment_sizze_nonzzero_236057) +\n                      sext_i32_i64(local_tid_236060), partition_sizze_203577 *\n                      t_n_m_203650) && slt64(sext_i32_i64(local_tid_236060),\n                                             squot64(segred_group_sizze_225616,\n                                                     segment_sizze_nonzzero_236057))) {\n                double tmp_236090;\n                \n                tmp_236090 = ((__local\n                               double *) red_arr_mem_236064)[(sext_i32_i64(local_tid_236060) +\n                                                              (int64_t) 1) *\n                                                             segment_sizze_nonzzero_236057 -\n                                                             (int64_t) 1];\n                ((__global\n                  double *) mem_231380)[squot64(sext_i32_i64(virt_group_id_236070) *\n                                                squot64(segred_group_sizze_225616,\n                                                        segment_sizze_nonzzero_236057) +\n                                                sext_i32_i64(local_tid_236060),\n                                                t_n_m_203650) * t_n_m_203650 +\n                                        (sext_i32_i64(virt_group_id_236070) *\n                                         squot64(segred_group_sizze",
                   "_225616,\n                                                 segment_sizze_nonzzero_236057) +\n                                         sext_i32_i64(local_tid_236060) -\n                                         squot64(sext_i32_i64(virt_group_id_236070) *\n                                                 squot64(segred_group_sizze_225616,\n                                                         segment_sizze_nonzzero_236057) +\n                                                 sext_i32_i64(local_tid_236060),\n                                                 t_n_m_203650) *\n                                         t_n_m_203650)] = tmp_236090;\n                \n                double tmp_236091;\n                \n                tmp_236091 = ((__local\n                               double *) red_arr_mem_236066)[(sext_i32_i64(local_tid_236060) +\n                                                              (int64_t) 1) *\n                                                             segment_sizze_nonzzero_236057 -\n                                                             (int64_t) 1];\n                ((__global\n                  double *) mem_231384)[squot64(sext_i32_i64(virt_group_id_236070) *\n                                                squot64(segred_group_sizze_225616,\n                                                        segment_sizze_nonzzero_236057) +\n                                                sext_i32_i64(local_tid_236060),\n                                                t_n_m_203650) * t_n_m_203650 +\n                                        (sext_i32_i64(virt_group_id_236070) *\n                                         squot64(segred_group_sizze_225616,\n                                                 segment_sizze_nonzzero_236057) +\n                                         sext_i32_i64(local_tid_236060) -\n                                         squot64(sext_i32_i64(virt_group_id_236070) *\n                                                 squot64(segred_group_si",
                   "zze_225616,\n                                                         segment_sizze_nonzzero_236057) +\n                                                 sext_i32_i64(local_tid_236060),\n                                                 t_n_m_203650) *\n                                         t_n_m_203650)] = tmp_236091;\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_225616\n}\n__kernel void mainzisegred_small_228090(__global int *global_failure,\n                                        __local volatile\n                                        int64_t *red_arr_mem_236585_backing_aligned_0,\n                                        int64_t n_203490,\n                                        int64_t partition_sizze_203577,\n                                        int64_t stl_res_203664,\n                                        int64_t j_m_i_204133,\n                                        int64_t num_groups_228085,\n                                        int64_t segment_sizze_nonzzero_236578,\n                                        __global unsigned char *ext_mem_231816,\n                                        __global unsigned char *mem_231833)\n{\n    #define segred_group_sizze_228084 (mainzisegred_group_sizze_228067)\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_236585_backing_0 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_236585_backing_aligned_0;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_236580;\n    int32_t local_tid_236581;\n    int64_t group_sizze_236584;\n    int32_t wave_sizze_236583;\n    int32_t group_tid_236582;\n    \n    global_tid_236580 = get_global_id(0);\n    local_tid_236581 = get_local_id(0);\n    group_sizze_236584 = get",
                   "_local_size(0);\n    wave_sizze_236583 = LOCKSTEP_WIDTH;\n    group_tid_236582 = get_group_id(0);\n    \n    int32_t phys_tid_228090 = global_tid_236580;\n    __local unsigned char *red_arr_mem_236585;\n    \n    red_arr_mem_236585 = (__local unsigned char *) red_arr_mem_236585_backing_0;\n    \n    int32_t phys_group_id_236587;\n    \n    phys_group_id_236587 = get_group_id(0);\n    for (int32_t i_236588 = 0; i_236588 <\n         sdiv_up32(sext_i64_i32(sdiv_up64(partition_sizze_203577,\n                                          squot64(segred_group_sizze_228084,\n                                                  segment_sizze_nonzzero_236578))) -\n                   phys_group_id_236587, sext_i64_i32(num_groups_228085));\n         i_236588++) {\n        int32_t virt_group_id_236589 = phys_group_id_236587 + i_236588 *\n                sext_i64_i32(num_groups_228085);\n        int64_t slice_236590 = partition_sizze_203577;\n        int64_t gtid_228088 = squot64(sext_i32_i64(local_tid_236581),\n                                      segment_sizze_nonzzero_236578) +\n                sext_i32_i64(virt_group_id_236589) *\n                squot64(segred_group_sizze_228084,\n                        segment_sizze_nonzzero_236578);\n        int64_t remnant_236591 = squot64(sext_i32_i64(local_tid_236581),\n                                         segment_sizze_nonzzero_236578) +\n                sext_i32_i64(virt_group_id_236589) *\n                squot64(segred_group_sizze_228084,\n                        segment_sizze_nonzzero_236578) - gtid_228088;\n        int64_t gtid_228089 = srem64(sext_i32_i64(local_tid_236581),\n                                     j_m_i_204133);\n        \n        // apply map function if in bounds\n        {\n            if (slt64((int64_t) 0, j_m_i_204133) && (slt64(gtid_228088,\n                                                           partition_sizze_203577) &&\n                                                     slt64(sext_i32_i64(local_tid_236581),\n                              ",
                   "                             j_m_i_204133 *\n                                                           squot64(segred_group_sizze_228084,\n                                                                   segment_sizze_nonzzero_236578)))) {\n                int64_t slice_228219 = stl_res_203664 + gtid_228089;\n                double x_228095;\n                \n                x_228095 = ((__global double *) ext_mem_231816)[gtid_228088 *\n                                                                n_203490 +\n                                                                slice_228219];\n                // save map-out results\n                { }\n                // save results to be reduced\n                {\n                    ((__local\n                      double *) red_arr_mem_236585)[sext_i32_i64(local_tid_236581)] =\n                        x_228095;\n                }\n            } else {\n                ((__local\n                  double *) red_arr_mem_236585)[sext_i32_i64(local_tid_236581)] =\n                    0.0;\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        if (slt64((int64_t) 0, j_m_i_204133)) {\n            // perform segmented scan to imitate reduction\n            {\n                double x_228091;\n                double x_228092;\n                double x_236592;\n                double x_236593;\n                bool ltid_in_bounds_236595 =\n                     slt64(sext_i32_i64(local_tid_236581), j_m_i_204133 *\n                           squot64(segred_group_sizze_228084,\n                                   segment_sizze_nonzzero_236578));\n                int32_t skip_threads_236596;\n                \n                // read input for in-block scan\n                {\n                    if (ltid_in_bounds_236595) {\n                        x_228092 = ((volatile __local\n                                     double *) red_arr_mem_236585)[sext_i32_i64(local_tid_236581)];\n                        if ((local_tid_236581 - squot32(local_tid_2",
                   "36581, 32) *\n                             32) == 0) {\n                            x_228091 = x_228092;\n                        }\n                    }\n                }\n                // in-block scan (hopefully no barriers needed)\n                {\n                    skip_threads_236596 = 1;\n                    while (slt32(skip_threads_236596, 32)) {\n                        bool thread_active_236597 = sle32(skip_threads_236596,\n                                                          local_tid_236581 -\n                                                          squot32(local_tid_236581,\n                                                                  32) * 32) &&\n                             ltid_in_bounds_236595;\n                        \n                        if (thread_active_236597) {\n                            // read operands\n                            {\n                                x_228091 = ((volatile __local\n                                             double *) red_arr_mem_236585)[sext_i32_i64(local_tid_236581) -\n                                                                           sext_i32_i64(skip_threads_236596)];\n                            }\n                        }\n                        // perform operation\n                        {\n                            bool inactive_236598 =\n                                 slt64(srem64(sext_i32_i64(local_tid_236581),\n                                              j_m_i_204133),\n                                       sext_i32_i64(local_tid_236581) -\n                                       sext_i32_i64(local_tid_236581 -\n                                       skip_threads_236596));\n                            \n                            if (thread_active_236597 && inactive_236598) {\n                                x_228091 = x_228092;\n                            }\n                            if (thread_active_236597) {\n                                if (!inactive_236598) {\n                  ",
                   "                  double defunc_1_op_res_228093 = x_228091 +\n                                           x_228092;\n                                    \n                                    x_228091 = defunc_1_op_res_228093;\n                                }\n                            }\n                        }\n                        if (sle32(wave_sizze_236583, skip_threads_236596)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        if (thread_active_236597) {\n                            // write result\n                            {\n                                ((volatile __local\n                                  double *) red_arr_mem_236585)[sext_i32_i64(local_tid_236581)] =\n                                    x_228091;\n                                x_228092 = x_228091;\n                            }\n                        }\n                        if (sle32(wave_sizze_236583, skip_threads_236596)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        skip_threads_236596 *= 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_236581 - squot32(local_tid_236581, 32) *\n                         32) == 31 && ltid_in_bounds_236595) {\n                        ((volatile __local\n                          double *) red_arr_mem_236585)[sext_i32_i64(squot32(local_tid_236581,\n                                                                             32))] =\n                            x_228091;\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_236599;\n                    \n                    // read input ",
                   "for in-block scan\n                    {\n                        if (squot32(local_tid_236581, 32) == 0 &&\n                            ltid_in_bounds_236595) {\n                            x_236593 = ((volatile __local\n                                         double *) red_arr_mem_236585)[sext_i32_i64(local_tid_236581)];\n                            if ((local_tid_236581 - squot32(local_tid_236581,\n                                                            32) * 32) == 0) {\n                                x_236592 = x_236593;\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 =\n                                 sle32(skip_threads_236599, local_tid_236581 -\n                                       squot32(local_tid_236581, 32) * 32) &&\n                                 (squot32(local_tid_236581, 32) == 0 &&\n                                  ltid_in_bounds_236595);\n                            \n                            if (thread_active_236600) {\n                                // read operands\n                                {\n                                    x_236592 = ((volatile __local\n                                                 double *) red_arr_mem_236585)[sext_i32_i64(local_tid_236581) -\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_236581 *\n                                                  32 + 32 - 1), j_m_i_204133),\n                         ",
                   "                  sext_i32_i64(local_tid_236581 * 32 +\n                                           32 - 1) -\n                                           sext_i32_i64((local_tid_236581 -\n                                                         skip_threads_236599) *\n                                           32 + 32 - 1));\n                                \n                                if (thread_active_236600 && inactive_236601) {\n                                    x_236592 = x_236593;\n                                }\n                                if (thread_active_236600) {\n                                    if (!inactive_236601) {\n                                        double defunc_1_op_res_236594 =\n                                               x_236592 + x_236593;\n                                        \n                                        x_236592 = defunc_1_op_res_236594;\n                                    }\n                                }\n                            }\n                            if (sle32(wave_sizze_236583, skip_threads_236599)) {\n                                barrier(CLK_LOCAL_MEM_FENCE);\n                            }\n                            if (thread_active_236600) {\n                                // write result\n                                {\n                                    ((volatile __local\n                                      double *) red_arr_mem_236585)[sext_i32_i64(local_tid_236581)] =\n                                        x_236592;\n                                    x_236593 = x_236592;\n                                }\n                            }\n                            if (sle32(wave_sizze_236583, skip_threads_236599)) {\n                                barrier(CLK_LOCAL_MEM_FENCE);\n                            }\n                            skip_threads_236599 *= 2;\n                        }\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                \n  ",
                   "              bool no_carry_in_236602 = squot32(local_tid_236581, 32) == 0 ||\n                     !ltid_in_bounds_236595;\n                \n                // carry-in for every block except the first\n                {\n                    // read operands\n                    {\n                        if (!no_carry_in_236602) {\n                            x_228092 = x_228091;\n                            x_228091 = ((__local\n                                         double *) red_arr_mem_236585)[sext_i32_i64(squot32(local_tid_236581,\n                                                                                            32)) -\n                                                                       (int64_t) 1];\n                        }\n                    }\n                    // perform operation\n                    {\n                        bool inactive_236603 =\n                             slt64(srem64(sext_i32_i64(local_tid_236581),\n                                          j_m_i_204133),\n                                   sext_i32_i64(local_tid_236581) -\n                                   sext_i32_i64(squot32(local_tid_236581, 32) *\n                                   32 - 1));\n                        \n                        if (!no_carry_in_236602) {\n                            if (inactive_236603) {\n                                x_228091 = x_228092;\n                            }\n                        }\n                        if (!no_carry_in_236602) {\n                            if (!inactive_236603) {\n                                double defunc_1_op_res_228093 = x_228091 +\n                                       x_228092;\n                                \n                                x_228091 = defunc_1_op_res_228093;\n                            }\n                        }\n                    }\n                    // write final result\n                    {\n                        if (!no_carry_in_236602) {\n                            ((__local\n   ",
                   "                           double *) red_arr_mem_236585)[sext_i32_i64(local_tid_236581)] =\n                                x_228091;\n                        }\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // restore correct values for first block\n                {\n                    if (squot32(local_tid_236581, 32) == 0 &&\n                        ltid_in_bounds_236595) {\n                        ((__local\n                          double *) red_arr_mem_236585)[sext_i32_i64(local_tid_236581)] =\n                            x_228092;\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_236589) *\n                      squot64(segred_group_sizze_228084,\n                              segment_sizze_nonzzero_236578) +\n                      sext_i32_i64(local_tid_236581), partition_sizze_203577) &&\n                slt64(sext_i32_i64(local_tid_236581),\n                      squot64(segred_group_sizze_228084,\n                              segment_sizze_nonzzero_236578))) {\n                double tmp_236604;\n                \n                tmp_236604 = ((__local\n                               double *) red_arr_mem_236585)[(sext_i32_i64(local_tid_236581) +\n                                                              (int64_t) 1) *\n                                                             segment_sizze_nonzzero_236578 -\n                                                             (int64_t) 1];\n                ((__global\n                  double *) mem_231833)[sext_i32_i64(virt_group_id_236589) *\n                                        squot64(segred_group_sizze_228084,\n                                                segment_sizze_nonzzero_236578) +\n                                        sext_i32_i64(local_tid_236581)] =\n      ",
                   "              tmp_236604;\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_228084\n}\n",
                   NULL};
static const char *tuning_param_names[] =
                  {"builtin#replicate_f64.group_size_232841",
                   "builtin#replicate_i64.group_size_232424",
                   "main.group_size_232442", "main.group_size_232601",
                   "main.group_size_234524", "main.group_size_234723",
                   "main.group_size_234973", "main.group_size_235351",
                   "main.group_size_235573", "main.group_size_235846",
                   "main.segmap_group_size_206871",
                   "main.segmap_group_size_206925",
                   "main.segmap_group_size_207082",
                   "main.segmap_group_size_207350",
                   "main.segmap_group_size_208205",
                   "main.segmap_group_size_208444",
                   "main.segmap_group_size_208475",
                   "main.segmap_group_size_209207",
                   "main.segmap_group_size_209411",
                   "main.segmap_group_size_209437",
                   "main.segmap_group_size_209833",
                   "main.segmap_group_size_210037",
                   "main.segmap_group_size_210063",
                   "main.segmap_group_size_210236",
                   "main.segmap_group_size_210299",
                   "main.segmap_group_size_210441",
                   "main.segmap_group_size_210636",
                   "main.segmap_group_size_210971",
                   "main.segmap_group_size_211146",
                   "main.segmap_group_size_211232",
                   "main.segmap_group_size_212133",
                   "main.segmap_group_size_212389",
                   "main.segmap_group_size_212822",
                   "main.segmap_group_size_213054",
                   "main.segmap_group_size_213157",
                   "main.segmap_group_size_214306",
                   "main.segmap_group_size_214626",
                   "main.segmap_group_size_215167",
                   "main.segmap_group_size_215454",
                   "main.segmap_group_size_215584",
                   "main.segmap_group_size_218115",
                   "main.segmap_group_size_218511",
                   "main.segmap_group_size_218582",
                   "main.segmap_group_size_218713",
                   "main.segmap_group_size_218844",
                   "main.segmap_group_size_218975",
                   "main.segmap_group_size_219116",
                   "main.segmap_group_size_219247",
                   "main.segmap_group_size_219608",
                   "main.segmap_group_size_219808",
                   "main.segmap_group_size_219990",
                   "main.segmap_group_size_220473",
                   "main.segmap_group_size_220737",
                   "main.segmap_group_size_220968",
                   "main.segmap_group_size_222226",
                   "main.segmap_group_size_222413",
                   "main.segmap_group_size_222454",
                   "main.segmap_group_size_222643",
                   "main.segmap_group_size_222781",
                   "main.segmap_group_size_222980",
                   "main.segmap_group_size_223036",
                   "main.segmap_group_size_223296",
                   "main.segmap_group_size_223544",
                   "main.segmap_group_size_223733",
                   "main.segmap_group_size_223986",
                   "main.segmap_group_size_224042",
                   "main.segmap_group_size_224370",
                   "main.segmap_group_size_224682",
                   "main.segmap_group_size_224920",
                   "main.segmap_group_size_225240",
                   "main.segmap_group_size_225296",
                   "main.segmap_group_size_225786",
                   "main.segmap_group_size_225842",
                   "main.segmap_group_size_226098",
                   "main.segmap_group_size_226154",
                   "main.segmap_group_size_226502",
                   "main.segmap_group_size_226558",
                   "main.segmap_group_size_226771",
                   "main.segmap_group_size_227027",
                   "main.segmap_group_size_227070",
                   "main.segmap_group_size_227158",
                   "main.segmap_group_size_227577",
                   "main.segmap_group_size_228020",
                   "main.segmap_group_size_228055",
                   "main.segmap_group_size_228124",
                   "main.segmap_group_size_228214",
                   "main.segmap_num_groups_206873",
                   "main.segmap_num_groups_210443",
                   "main.segmap_num_groups_210638",
                   "main.segmap_num_groups_212135",
                   "main.segmap_num_groups_212391",
                   "main.segmap_num_groups_214308",
                   "main.segmap_num_groups_214628",
                   "main.segmap_num_groups_218977",
                   "main.segmap_num_groups_219610",
                   "main.segmap_num_groups_220475",
                   "main.segmap_num_groups_222456",
                   "main.segmap_num_groups_223298",
                   "main.segmap_num_groups_224372",
                   "main.segmap_num_groups_227160",
                   "main.segmap_num_groups_228216",
                   "main.segred_group_size_211074",
                   "main.segred_group_size_211176",
                   "main.segred_group_size_212960",
                   "main.segred_group_size_213093",
                   "main.segred_group_size_215343",
                   "main.segred_group_size_215512",
                   "main.segred_group_size_218608",
                   "main.segred_group_size_218739",
                   "main.segred_group_size_218870",
                   "main.segred_group_size_219193",
                   "main.segred_group_size_219260",
                   "main.segred_group_size_219918",
                   "main.segred_group_size_220012",
                   "main.segred_group_size_220883",
                   "main.segred_group_size_221009",
                   "main.segred_group_size_222724",
                   "main.segred_group_size_222794",
                   "main.segred_group_size_223658",
                   "main.segred_group_size_223755",
                   "main.segred_group_size_224832",
                   "main.segred_group_size_224961",
                   "main.segred_group_size_228067",
                   "main.segred_num_groups_211076",
                   "main.segred_num_groups_211178",
                   "main.segred_num_groups_212962",
                   "main.segred_num_groups_213095",
                   "main.segred_num_groups_215345",
                   "main.segred_num_groups_215514",
                   "main.segred_num_groups_218610",
                   "main.segred_num_groups_218741",
                   "main.segred_num_groups_218872",
                   "main.segred_num_groups_219195",
                   "main.segred_num_groups_219262",
                   "main.segred_num_groups_219920",
                   "main.segred_num_groups_220014",
                   "main.segred_num_groups_220885",
                   "main.segred_num_groups_221011",
                   "main.segred_num_groups_222726",
                   "main.segred_num_groups_222796",
                   "main.segred_num_groups_223660",
                   "main.segred_num_groups_223757",
                   "main.segred_num_groups_224834",
                   "main.segred_num_groups_224963",
                   "main.segred_num_groups_228069",
                   "main.segscan_group_size_206861",
                   "main.segscan_group_size_206981",
                   "main.segscan_group_size_207419",
                   "main.segscan_group_size_218641",
                   "main.segscan_group_size_218772",
                   "main.segscan_group_size_218903",
                   "main.segscan_group_size_227625",
                   "main.segscan_num_groups_206863",
                   "main.segscan_num_groups_206983",
                   "main.segscan_num_groups_207421",
                   "main.segscan_num_groups_218643",
                   "main.segscan_num_groups_218774",
                   "main.segscan_num_groups_218905",
                   "main.segscan_num_groups_227627", "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_232841",
                   "builtinzhreplicate_i64zigroup_sizze_232424",
                   "mainzigroup_sizze_232442", "mainzigroup_sizze_232601",
                   "mainzigroup_sizze_234524", "mainzigroup_sizze_234723",
                   "mainzigroup_sizze_234973", "mainzigroup_sizze_235351",
                   "mainzigroup_sizze_235573", "mainzigroup_sizze_235846",
                   "mainzisegmap_group_sizze_206871",
                   "mainzisegmap_group_sizze_206925",
                   "mainzisegmap_group_sizze_207082",
                   "mainzisegmap_group_sizze_207350",
                   "mainzisegmap_group_sizze_208205",
                   "mainzisegmap_group_sizze_208444",
                   "mainzisegmap_group_sizze_208475",
                   "mainzisegmap_group_sizze_209207",
                   "mainzisegmap_group_sizze_209411",
                   "mainzisegmap_group_sizze_209437",
                   "mainzisegmap_group_sizze_209833",
                   "mainzisegmap_group_sizze_210037",
                   "mainzisegmap_group_sizze_210063",
                   "mainzisegmap_group_sizze_210236",
                   "mainzisegmap_group_sizze_210299",
                   "mainzisegmap_group_sizze_210441",
                   "mainzisegmap_group_sizze_210636",
                   "mainzisegmap_group_sizze_210971",
                   "mainzisegmap_group_sizze_211146",
                   "mainzisegmap_group_sizze_211232",
                   "mainzisegmap_group_sizze_212133",
                   "mainzisegmap_group_sizze_212389",
                   "mainzisegmap_group_sizze_212822",
                   "mainzisegmap_group_sizze_213054",
                   "mainzisegmap_group_sizze_213157",
                   "mainzisegmap_group_sizze_214306",
                   "mainzisegmap_group_sizze_214626",
                   "mainzisegmap_group_sizze_215167",
                   "mainzisegmap_group_sizze_215454",
                   "mainzisegmap_group_sizze_215584",
                   "mainzisegmap_group_sizze_218115",
                   "mainzisegmap_group_sizze_218511",
                   "mainzisegmap_group_sizze_218582",
                   "mainzisegmap_group_sizze_218713",
                   "mainzisegmap_group_sizze_218844",
                   "mainzisegmap_group_sizze_218975",
                   "mainzisegmap_group_sizze_219116",
                   "mainzisegmap_group_sizze_219247",
                   "mainzisegmap_group_sizze_219608",
                   "mainzisegmap_group_sizze_219808",
                   "mainzisegmap_group_sizze_219990",
                   "mainzisegmap_group_sizze_220473",
                   "mainzisegmap_group_sizze_220737",
                   "mainzisegmap_group_sizze_220968",
                   "mainzisegmap_group_sizze_222226",
                   "mainzisegmap_group_sizze_222413",
                   "mainzisegmap_group_sizze_222454",
                   "mainzisegmap_group_sizze_222643",
                   "mainzisegmap_group_sizze_222781",
                   "mainzisegmap_group_sizze_222980",
                   "mainzisegmap_group_sizze_223036",
                   "mainzisegmap_group_sizze_223296",
                   "mainzisegmap_group_sizze_223544",
                   "mainzisegmap_group_sizze_223733",
                   "mainzisegmap_group_sizze_223986",
                   "mainzisegmap_group_sizze_224042",
                   "mainzisegmap_group_sizze_224370",
                   "mainzisegmap_group_sizze_224682",
                   "mainzisegmap_group_sizze_224920",
                   "mainzisegmap_group_sizze_225240",
                   "mainzisegmap_group_sizze_225296",
                   "mainzisegmap_group_sizze_225786",
                   "mainzisegmap_group_sizze_225842",
                   "mainzisegmap_group_sizze_226098",
                   "mainzisegmap_group_sizze_226154",
                   "mainzisegmap_group_sizze_226502",
                   "mainzisegmap_group_sizze_226558",
                   "mainzisegmap_group_sizze_226771",
                   "mainzisegmap_group_sizze_227027",
                   "mainzisegmap_group_sizze_227070",
                   "mainzisegmap_group_sizze_227158",
                   "mainzisegmap_group_sizze_227577",
                   "mainzisegmap_group_sizze_228020",
                   "mainzisegmap_group_sizze_228055",
                   "mainzisegmap_group_sizze_228124",
                   "mainzisegmap_group_sizze_228214",
                   "mainzisegmap_num_groups_206873",
                   "mainzisegmap_num_groups_210443",
                   "mainzisegmap_num_groups_210638",
                   "mainzisegmap_num_groups_212135",
                   "mainzisegmap_num_groups_212391",
                   "mainzisegmap_num_groups_214308",
                   "mainzisegmap_num_groups_214628",
                   "mainzisegmap_num_groups_218977",
                   "mainzisegmap_num_groups_219610",
                   "mainzisegmap_num_groups_220475",
                   "mainzisegmap_num_groups_222456",
                   "mainzisegmap_num_groups_223298",
                   "mainzisegmap_num_groups_224372",
                   "mainzisegmap_num_groups_227160",
                   "mainzisegmap_num_groups_228216",
                   "mainzisegred_group_sizze_211074",
                   "mainzisegred_group_sizze_211176",
                   "mainzisegred_group_sizze_212960",
                   "mainzisegred_group_sizze_213093",
                   "mainzisegred_group_sizze_215343",
                   "mainzisegred_group_sizze_215512",
                   "mainzisegred_group_sizze_218608",
                   "mainzisegred_group_sizze_218739",
                   "mainzisegred_group_sizze_218870",
                   "mainzisegred_group_sizze_219193",
                   "mainzisegred_group_sizze_219260",
                   "mainzisegred_group_sizze_219918",
                   "mainzisegred_group_sizze_220012",
                   "mainzisegred_group_sizze_220883",
                   "mainzisegred_group_sizze_221009",
                   "mainzisegred_group_sizze_222724",
                   "mainzisegred_group_sizze_222794",
                   "mainzisegred_group_sizze_223658",
                   "mainzisegred_group_sizze_223755",
                   "mainzisegred_group_sizze_224832",
                   "mainzisegred_group_sizze_224961",
                   "mainzisegred_group_sizze_228067",
                   "mainzisegred_num_groups_211076",
                   "mainzisegred_num_groups_211178",
                   "mainzisegred_num_groups_212962",
                   "mainzisegred_num_groups_213095",
                   "mainzisegred_num_groups_215345",
                   "mainzisegred_num_groups_215514",
                   "mainzisegred_num_groups_218610",
                   "mainzisegred_num_groups_218741",
                   "mainzisegred_num_groups_218872",
                   "mainzisegred_num_groups_219195",
                   "mainzisegred_num_groups_219262",
                   "mainzisegred_num_groups_219920",
                   "mainzisegred_num_groups_220014",
                   "mainzisegred_num_groups_220885",
                   "mainzisegred_num_groups_221011",
                   "mainzisegred_num_groups_222726",
                   "mainzisegred_num_groups_222796",
                   "mainzisegred_num_groups_223660",
                   "mainzisegred_num_groups_223757",
                   "mainzisegred_num_groups_224834",
                   "mainzisegred_num_groups_224963",
                   "mainzisegred_num_groups_228069",
                   "mainzisegscan_group_sizze_206861",
                   "mainzisegscan_group_sizze_206981",
                   "mainzisegscan_group_sizze_207419",
                   "mainzisegscan_group_sizze_218641",
                   "mainzisegscan_group_sizze_218772",
                   "mainzisegscan_group_sizze_218903",
                   "mainzisegscan_group_sizze_227625",
                   "mainzisegscan_num_groups_206863",
                   "mainzisegscan_num_groups_206983",
                   "mainzisegscan_num_groups_207421",
                   "mainzisegscan_num_groups_218643",
                   "mainzisegscan_num_groups_218774",
                   "mainzisegscan_num_groups_218905",
                   "mainzisegscan_num_groups_227627", "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_232841;
    int64_t *builtinzhreplicate_i64zigroup_sizze_232424;
    int64_t *mainzigroup_sizze_232442;
    int64_t *mainzigroup_sizze_232601;
    int64_t *mainzigroup_sizze_234524;
    int64_t *mainzigroup_sizze_234723;
    int64_t *mainzigroup_sizze_234973;
    int64_t *mainzigroup_sizze_235351;
    int64_t *mainzigroup_sizze_235573;
    int64_t *mainzigroup_sizze_235846;
    int64_t *mainzisegmap_group_sizze_206871;
    int64_t *mainzisegmap_group_sizze_206925;
    int64_t *mainzisegmap_group_sizze_207082;
    int64_t *mainzisegmap_group_sizze_207350;
    int64_t *mainzisegmap_group_sizze_208205;
    int64_t *mainzisegmap_group_sizze_208444;
    int64_t *mainzisegmap_group_sizze_208475;
    int64_t *mainzisegmap_group_sizze_209207;
    int64_t *mainzisegmap_group_sizze_209411;
    int64_t *mainzisegmap_group_sizze_209437;
    int64_t *mainzisegmap_group_sizze_209833;
    int64_t *mainzisegmap_group_sizze_210037;
    int64_t *mainzisegmap_group_sizze_210063;
    int64_t *mainzisegmap_group_sizze_210236;
    int64_t *mainzisegmap_group_sizze_210299;
    int64_t *mainzisegmap_group_sizze_210441;
    int64_t *mainzisegmap_group_sizze_210636;
    int64_t *mainzisegmap_group_sizze_210971;
    int64_t *mainzisegmap_group_sizze_211146;
    int64_t *mainzisegmap_group_sizze_211232;
    int64_t *mainzisegmap_group_sizze_212133;
    int64_t *mainzisegmap_group_sizze_212389;
    int64_t *mainzisegmap_group_sizze_212822;
    int64_t *mainzisegmap_group_sizze_213054;
    int64_t *mainzisegmap_group_sizze_213157;
    int64_t *mainzisegmap_group_sizze_214306;
    int64_t *mainzisegmap_group_sizze_214626;
    int64_t *mainzisegmap_group_sizze_215167;
    int64_t *mainzisegmap_group_sizze_215454;
    int64_t *mainzisegmap_group_sizze_215584;
    int64_t *mainzisegmap_group_sizze_218115;
    int64_t *mainzisegmap_group_sizze_218511;
    int64_t *mainzisegmap_group_sizze_218582;
    int64_t *mainzisegmap_group_sizze_218713;
    int64_t *mainzisegmap_group_sizze_218844;
    int64_t *mainzisegmap_group_sizze_218975;
    int64_t *mainzisegmap_group_sizze_219116;
    int64_t *mainzisegmap_group_sizze_219247;
    int64_t *mainzisegmap_group_sizze_219608;
    int64_t *mainzisegmap_group_sizze_219808;
    int64_t *mainzisegmap_group_sizze_219990;
    int64_t *mainzisegmap_group_sizze_220473;
    int64_t *mainzisegmap_group_sizze_220737;
    int64_t *mainzisegmap_group_sizze_220968;
    int64_t *mainzisegmap_group_sizze_222226;
    int64_t *mainzisegmap_group_sizze_222413;
    int64_t *mainzisegmap_group_sizze_222454;
    int64_t *mainzisegmap_group_sizze_222643;
    int64_t *mainzisegmap_group_sizze_222781;
    int64_t *mainzisegmap_group_sizze_222980;
    int64_t *mainzisegmap_group_sizze_223036;
    int64_t *mainzisegmap_group_sizze_223296;
    int64_t *mainzisegmap_group_sizze_223544;
    int64_t *mainzisegmap_group_sizze_223733;
    int64_t *mainzisegmap_group_sizze_223986;
    int64_t *mainzisegmap_group_sizze_224042;
    int64_t *mainzisegmap_group_sizze_224370;
    int64_t *mainzisegmap_group_sizze_224682;
    int64_t *mainzisegmap_group_sizze_224920;
    int64_t *mainzisegmap_group_sizze_225240;
    int64_t *mainzisegmap_group_sizze_225296;
    int64_t *mainzisegmap_group_sizze_225786;
    int64_t *mainzisegmap_group_sizze_225842;
    int64_t *mainzisegmap_group_sizze_226098;
    int64_t *mainzisegmap_group_sizze_226154;
    int64_t *mainzisegmap_group_sizze_226502;
    int64_t *mainzisegmap_group_sizze_226558;
    int64_t *mainzisegmap_group_sizze_226771;
    int64_t *mainzisegmap_group_sizze_227027;
    int64_t *mainzisegmap_group_sizze_227070;
    int64_t *mainzisegmap_group_sizze_227158;
    int64_t *mainzisegmap_group_sizze_227577;
    int64_t *mainzisegmap_group_sizze_228020;
    int64_t *mainzisegmap_group_sizze_228055;
    int64_t *mainzisegmap_group_sizze_228124;
    int64_t *mainzisegmap_group_sizze_228214;
    int64_t *mainzisegmap_num_groups_206873;
    int64_t *mainzisegmap_num_groups_210443;
    int64_t *mainzisegmap_num_groups_210638;
    int64_t *mainzisegmap_num_groups_212135;
    int64_t *mainzisegmap_num_groups_212391;
    int64_t *mainzisegmap_num_groups_214308;
    int64_t *mainzisegmap_num_groups_214628;
    int64_t *mainzisegmap_num_groups_218977;
    int64_t *mainzisegmap_num_groups_219610;
    int64_t *mainzisegmap_num_groups_220475;
    int64_t *mainzisegmap_num_groups_222456;
    int64_t *mainzisegmap_num_groups_223298;
    int64_t *mainzisegmap_num_groups_224372;
    int64_t *mainzisegmap_num_groups_227160;
    int64_t *mainzisegmap_num_groups_228216;
    int64_t *mainzisegred_group_sizze_211074;
    int64_t *mainzisegred_group_sizze_211176;
    int64_t *mainzisegred_group_sizze_212960;
    int64_t *mainzisegred_group_sizze_213093;
    int64_t *mainzisegred_group_sizze_215343;
    int64_t *mainzisegred_group_sizze_215512;
    int64_t *mainzisegred_group_sizze_218608;
    int64_t *mainzisegred_group_sizze_218739;
    int64_t *mainzisegred_group_sizze_218870;
    int64_t *mainzisegred_group_sizze_219193;
    int64_t *mainzisegred_group_sizze_219260;
    int64_t *mainzisegred_group_sizze_219918;
    int64_t *mainzisegred_group_sizze_220012;
    int64_t *mainzisegred_group_sizze_220883;
    int64_t *mainzisegred_group_sizze_221009;
    int64_t *mainzisegred_group_sizze_222724;
    int64_t *mainzisegred_group_sizze_222794;
    int64_t *mainzisegred_group_sizze_223658;
    int64_t *mainzisegred_group_sizze_223755;
    int64_t *mainzisegred_group_sizze_224832;
    int64_t *mainzisegred_group_sizze_224961;
    int64_t *mainzisegred_group_sizze_228067;
    int64_t *mainzisegred_num_groups_211076;
    int64_t *mainzisegred_num_groups_211178;
    int64_t *mainzisegred_num_groups_212962;
    int64_t *mainzisegred_num_groups_213095;
    int64_t *mainzisegred_num_groups_215345;
    int64_t *mainzisegred_num_groups_215514;
    int64_t *mainzisegred_num_groups_218610;
    int64_t *mainzisegred_num_groups_218741;
    int64_t *mainzisegred_num_groups_218872;
    int64_t *mainzisegred_num_groups_219195;
    int64_t *mainzisegred_num_groups_219262;
    int64_t *mainzisegred_num_groups_219920;
    int64_t *mainzisegred_num_groups_220014;
    int64_t *mainzisegred_num_groups_220885;
    int64_t *mainzisegred_num_groups_221011;
    int64_t *mainzisegred_num_groups_222726;
    int64_t *mainzisegred_num_groups_222796;
    int64_t *mainzisegred_num_groups_223660;
    int64_t *mainzisegred_num_groups_223757;
    int64_t *mainzisegred_num_groups_224834;
    int64_t *mainzisegred_num_groups_224963;
    int64_t *mainzisegred_num_groups_228069;
    int64_t *mainzisegscan_group_sizze_206861;
    int64_t *mainzisegscan_group_sizze_206981;
    int64_t *mainzisegscan_group_sizze_207419;
    int64_t *mainzisegscan_group_sizze_218641;
    int64_t *mainzisegscan_group_sizze_218772;
    int64_t *mainzisegscan_group_sizze_218903;
    int64_t *mainzisegscan_group_sizze_227625;
    int64_t *mainzisegscan_num_groups_206863;
    int64_t *mainzisegscan_num_groups_206983;
    int64_t *mainzisegscan_num_groups_207421;
    int64_t *mainzisegscan_num_groups_218643;
    int64_t *mainzisegscan_num_groups_218774;
    int64_t *mainzisegscan_num_groups_218905;
    int64_t *mainzisegscan_num_groups_227627;
    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_233055;
    struct memblock_device mainzicounter_mem_233143;
    struct memblock_device mainzicounter_mem_233404;
    struct memblock_device mainzicounter_mem_233512;
    struct memblock_device mainzicounter_mem_233817;
    struct memblock_device mainzicounter_mem_233937;
    struct memblock_device mainzicounter_mem_234132;
    struct memblock_device mainzicounter_mem_234275;
    struct memblock_device mainzicounter_mem_234418;
    struct memblock_device mainzicounter_mem_234597;
    struct memblock_device mainzicounter_mem_234679;
    struct memblock_device mainzicounter_mem_234821;
    struct memblock_device mainzicounter_mem_234923;
    struct memblock_device mainzicounter_mem_235091;
    struct memblock_device mainzicounter_mem_235205;
    struct memblock_device mainzicounter_mem_235447;
    struct memblock_device mainzicounter_mem_235529;
    struct memblock_device mainzicounter_mem_235694;
    struct memblock_device mainzicounter_mem_235796;
    struct memblock_device mainzicounter_mem_235987;
    struct memblock_device mainzicounter_mem_236101;
    struct memblock_device mainzicounter_mem_236612;
    int total_runs;
    long total_runtime;
    cl_kernel builtinzhreplicate_f64zireplicate_232838;
    cl_kernel builtinzhreplicate_i64zireplicate_232421;
    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_232439;
    cl_kernel mainzicopy_232598;
    cl_kernel mainzicopy_234521;
    cl_kernel mainzicopy_234720;
    cl_kernel mainzicopy_234970;
    cl_kernel mainzicopy_235348;
    cl_kernel mainzicopy_235570;
    cl_kernel mainzicopy_235843;
    cl_kernel mainziscan_stage1_206867;
    cl_kernel mainziscan_stage1_207007;
    cl_kernel mainziscan_stage1_207559;
    cl_kernel mainziscan_stage1_218683;
    cl_kernel mainziscan_stage1_218814;
    cl_kernel mainziscan_stage1_218945;
    cl_kernel mainziscan_stage1_227915;
    cl_kernel mainziscan_stage2_206867;
    cl_kernel mainziscan_stage2_207007;
    cl_kernel mainziscan_stage2_207559;
    cl_kernel mainziscan_stage2_218683;
    cl_kernel mainziscan_stage2_218814;
    cl_kernel mainziscan_stage2_218945;
    cl_kernel mainziscan_stage2_227915;
    cl_kernel mainziscan_stage3_206867;
    cl_kernel mainziscan_stage3_207007;
    cl_kernel mainziscan_stage3_207559;
    cl_kernel mainziscan_stage3_218683;
    cl_kernel mainziscan_stage3_218814;
    cl_kernel mainziscan_stage3_218945;
    cl_kernel mainziscan_stage3_227915;
    cl_kernel mainzisegmap_206869;
    cl_kernel mainzisegmap_207045;
    cl_kernel mainzisegmap_207170;
    cl_kernel mainzisegmap_207605;
    cl_kernel mainzisegmap_208818;
    cl_kernel mainzisegmap_208832;
    cl_kernel mainzisegmap_208856;
    cl_kernel mainzisegmap_209466;
    cl_kernel mainzisegmap_209478;
    cl_kernel mainzisegmap_209499;
    cl_kernel mainzisegmap_210092;
    cl_kernel mainzisegmap_210104;
    cl_kernel mainzisegmap_210125;
    cl_kernel mainzisegmap_210267;
    cl_kernel mainzisegmap_210412;
    cl_kernel mainzisegmap_210542;
    cl_kernel mainzisegmap_211682;
    cl_kernel mainzisegmap_211890;
    cl_kernel mainzisegmap_211979;
    cl_kernel mainzisegmap_212051;
    cl_kernel mainzisegmap_212265;
    cl_kernel mainzisegmap_213719;
    cl_kernel mainzisegmap_213994;
    cl_kernel mainzisegmap_214111;
    cl_kernel mainzisegmap_214195;
    cl_kernel mainzisegmap_214470;
    cl_kernel mainzisegmap_216262;
    cl_kernel mainzisegmap_216607;
    cl_kernel mainzisegmap_216756;
    cl_kernel mainzisegmap_216852;
    cl_kernel mainzisegmap_218413;
    cl_kernel mainzisegmap_218562;
    cl_kernel mainzisegmap_218598;
    cl_kernel mainzisegmap_218729;
    cl_kernel mainzisegmap_218860;
    cl_kernel mainzisegmap_219049;
    cl_kernel mainzisegmap_219434;
    cl_kernel mainzisegmap_219551;
    cl_kernel mainzisegmap_219712;
    cl_kernel mainzisegmap_220233;
    cl_kernel mainzisegmap_220390;
    cl_kernel mainzisegmap_220609;
    cl_kernel mainzisegmap_221278;
    cl_kernel mainzisegmap_221479;
    cl_kernel mainzisegmap_222349;
    cl_kernel mainzisegmap_222444;
    cl_kernel mainzisegmap_222551;
    cl_kernel mainzisegmap_223067;
    cl_kernel mainzisegmap_223084;
    cl_kernel mainzisegmap_223112;
    cl_kernel mainzisegmap_223236;
    cl_kernel mainzisegmap_223423;
    cl_kernel mainzisegmap_224073;
    cl_kernel mainzisegmap_224090;
    cl_kernel mainzisegmap_224120;
    cl_kernel mainzisegmap_224284;
    cl_kernel mainzisegmap_224529;
    cl_kernel mainzisegmap_225327;
    cl_kernel mainzisegmap_225344;
    cl_kernel mainzisegmap_225374;
    cl_kernel mainzisegmap_225582;
    cl_kernel mainzisegmap_225873;
    cl_kernel mainzisegmap_225890;
    cl_kernel mainzisegmap_226185;
    cl_kernel mainzisegmap_226202;
    cl_kernel mainzisegmap_226589;
    cl_kernel mainzisegmap_226606;
    cl_kernel mainzisegmap_226894;
    cl_kernel mainzisegmap_227111;
    cl_kernel mainzisegmap_227132;
    cl_kernel mainzisegmap_227261;
    cl_kernel mainzisegmap_227986;
    cl_kernel mainzisegmap_228041;
    cl_kernel mainzisegmap_228103;
    cl_kernel mainzisegmap_228189;
    cl_kernel mainzisegmap_228212;
    cl_kernel mainzisegmap_intragroup_206893;
    cl_kernel mainzisegmap_intragroup_207248;
    cl_kernel mainzisegmap_intragroup_207524;
    cl_kernel mainzisegmap_intragroup_207777;
    cl_kernel mainzisegmap_intragroup_208681;
    cl_kernel mainzisegmap_intragroup_209082;
    cl_kernel mainzisegmap_intragroup_209708;
    cl_kernel mainzisegmap_intragroup_211768;
    cl_kernel mainzisegmap_intragroup_213836;
    cl_kernel mainzisegmap_intragroup_216411;
    cl_kernel mainzisegmap_intragroup_217183;
    cl_kernel mainzisegmap_intragroup_217504;
    cl_kernel mainzisegmap_intragroup_217955;
    cl_kernel mainzisegmap_intragroup_221669;
    cl_kernel mainzisegmap_intragroup_221836;
    cl_kernel mainzisegmap_intragroup_222093;
    cl_kernel mainzisegmap_intragroup_225917;
    cl_kernel mainzisegmap_intragroup_226230;
    cl_kernel mainzisegmap_intragroup_226634;
    cl_kernel mainzisegmap_intragroup_226984;
    cl_kernel mainzisegmap_intragroup_227359;
    cl_kernel mainzisegmap_intragroup_227815;
    cl_kernel mainzisegred_large_212003;
    cl_kernel mainzisegred_large_212077;
    cl_kernel mainzisegred_large_214137;
    cl_kernel mainzisegred_large_214231;
    cl_kernel mainzisegred_large_216784;
    cl_kernel mainzisegred_large_216907;
    cl_kernel mainzisegred_large_218631;
    cl_kernel mainzisegred_large_218762;
    cl_kernel mainzisegred_large_218893;
    cl_kernel mainzisegred_large_219515;
    cl_kernel mainzisegred_large_219564;
    cl_kernel mainzisegred_large_220344;
    cl_kernel mainzisegred_large_220413;
    cl_kernel mainzisegred_large_221423;
    cl_kernel mainzisegred_large_221521;
    cl_kernel mainzisegred_large_223197;
    cl_kernel mainzisegred_large_223249;
    cl_kernel mainzisegred_large_224235;
    cl_kernel mainzisegred_large_224307;
    cl_kernel mainzisegred_large_225523;
    cl_kernel mainzisegred_large_225624;
    cl_kernel mainzisegred_large_228090;
    cl_kernel mainzisegred_small_212003;
    cl_kernel mainzisegred_small_212077;
    cl_kernel mainzisegred_small_214137;
    cl_kernel mainzisegred_small_214231;
    cl_kernel mainzisegred_small_216784;
    cl_kernel mainzisegred_small_216907;
    cl_kernel mainzisegred_small_218631;
    cl_kernel mainzisegred_small_218762;
    cl_kernel mainzisegred_small_218893;
    cl_kernel mainzisegred_small_219515;
    cl_kernel mainzisegred_small_219564;
    cl_kernel mainzisegred_small_220344;
    cl_kernel mainzisegred_small_220413;
    cl_kernel mainzisegred_small_221423;
    cl_kernel mainzisegred_small_221521;
    cl_kernel mainzisegred_small_223197;
    cl_kernel mainzisegred_small_223249;
    cl_kernel mainzisegred_small_224235;
    cl_kernel mainzisegred_small_224307;
    cl_kernel mainzisegred_small_225523;
    cl_kernel mainzisegred_small_225624;
    cl_kernel mainzisegred_small_228090;
    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_232838_total_runtime;
    int builtinzhreplicate_f64zireplicate_232838_runs;
    int64_t builtinzhreplicate_i64zireplicate_232421_total_runtime;
    int builtinzhreplicate_i64zireplicate_232421_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_232439_total_runtime;
    int mainzicopy_232439_runs;
    int64_t mainzicopy_232598_total_runtime;
    int mainzicopy_232598_runs;
    int64_t mainzicopy_234521_total_runtime;
    int mainzicopy_234521_runs;
    int64_t mainzicopy_234720_total_runtime;
    int mainzicopy_234720_runs;
    int64_t mainzicopy_234970_total_runtime;
    int mainzicopy_234970_runs;
    int64_t mainzicopy_235348_total_runtime;
    int mainzicopy_235348_runs;
    int64_t mainzicopy_235570_total_runtime;
    int mainzicopy_235570_runs;
    int64_t mainzicopy_235843_total_runtime;
    int mainzicopy_235843_runs;
    int64_t mainziscan_stage1_206867_total_runtime;
    int mainziscan_stage1_206867_runs;
    int64_t mainziscan_stage1_207007_total_runtime;
    int mainziscan_stage1_207007_runs;
    int64_t mainziscan_stage1_207559_total_runtime;
    int mainziscan_stage1_207559_runs;
    int64_t mainziscan_stage1_218683_total_runtime;
    int mainziscan_stage1_218683_runs;
    int64_t mainziscan_stage1_218814_total_runtime;
    int mainziscan_stage1_218814_runs;
    int64_t mainziscan_stage1_218945_total_runtime;
    int mainziscan_stage1_218945_runs;
    int64_t mainziscan_stage1_227915_total_runtime;
    int mainziscan_stage1_227915_runs;
    int64_t mainziscan_stage2_206867_total_runtime;
    int mainziscan_stage2_206867_runs;
    int64_t mainziscan_stage2_207007_total_runtime;
    int mainziscan_stage2_207007_runs;
    int64_t mainziscan_stage2_207559_total_runtime;
    int mainziscan_stage2_207559_runs;
    int64_t mainziscan_stage2_218683_total_runtime;
    int mainziscan_stage2_218683_runs;
    int64_t mainziscan_stage2_218814_total_runtime;
    int mainziscan_stage2_218814_runs;
    int64_t mainziscan_stage2_218945_total_runtime;
    int mainziscan_stage2_218945_runs;
    int64_t mainziscan_stage2_227915_total_runtime;
    int mainziscan_stage2_227915_runs;
    int64_t mainziscan_stage3_206867_total_runtime;
    int mainziscan_stage3_206867_runs;
    int64_t mainziscan_stage3_207007_total_runtime;
    int mainziscan_stage3_207007_runs;
    int64_t mainziscan_stage3_207559_total_runtime;
    int mainziscan_stage3_207559_runs;
    int64_t mainziscan_stage3_218683_total_runtime;
    int mainziscan_stage3_218683_runs;
    int64_t mainziscan_stage3_218814_total_runtime;
    int mainziscan_stage3_218814_runs;
    int64_t mainziscan_stage3_218945_total_runtime;
    int mainziscan_stage3_218945_runs;
    int64_t mainziscan_stage3_227915_total_runtime;
    int mainziscan_stage3_227915_runs;
    int64_t mainzisegmap_206869_total_runtime;
    int mainzisegmap_206869_runs;
    int64_t mainzisegmap_207045_total_runtime;
    int mainzisegmap_207045_runs;
    int64_t mainzisegmap_207170_total_runtime;
    int mainzisegmap_207170_runs;
    int64_t mainzisegmap_207605_total_runtime;
    int mainzisegmap_207605_runs;
    int64_t mainzisegmap_208818_total_runtime;
    int mainzisegmap_208818_runs;
    int64_t mainzisegmap_208832_total_runtime;
    int mainzisegmap_208832_runs;
    int64_t mainzisegmap_208856_total_runtime;
    int mainzisegmap_208856_runs;
    int64_t mainzisegmap_209466_total_runtime;
    int mainzisegmap_209466_runs;
    int64_t mainzisegmap_209478_total_runtime;
    int mainzisegmap_209478_runs;
    int64_t mainzisegmap_209499_total_runtime;
    int mainzisegmap_209499_runs;
    int64_t mainzisegmap_210092_total_runtime;
    int mainzisegmap_210092_runs;
    int64_t mainzisegmap_210104_total_runtime;
    int mainzisegmap_210104_runs;
    int64_t mainzisegmap_210125_total_runtime;
    int mainzisegmap_210125_runs;
    int64_t mainzisegmap_210267_total_runtime;
    int mainzisegmap_210267_runs;
    int64_t mainzisegmap_210412_total_runtime;
    int mainzisegmap_210412_runs;
    int64_t mainzisegmap_210542_total_runtime;
    int mainzisegmap_210542_runs;
    int64_t mainzisegmap_211682_total_runtime;
    int mainzisegmap_211682_runs;
    int64_t mainzisegmap_211890_total_runtime;
    int mainzisegmap_211890_runs;
    int64_t mainzisegmap_211979_total_runtime;
    int mainzisegmap_211979_runs;
    int64_t mainzisegmap_212051_total_runtime;
    int mainzisegmap_212051_runs;
    int64_t mainzisegmap_212265_total_runtime;
    int mainzisegmap_212265_runs;
    int64_t mainzisegmap_213719_total_runtime;
    int mainzisegmap_213719_runs;
    int64_t mainzisegmap_213994_total_runtime;
    int mainzisegmap_213994_runs;
    int64_t mainzisegmap_214111_total_runtime;
    int mainzisegmap_214111_runs;
    int64_t mainzisegmap_214195_total_runtime;
    int mainzisegmap_214195_runs;
    int64_t mainzisegmap_214470_total_runtime;
    int mainzisegmap_214470_runs;
    int64_t mainzisegmap_216262_total_runtime;
    int mainzisegmap_216262_runs;
    int64_t mainzisegmap_216607_total_runtime;
    int mainzisegmap_216607_runs;
    int64_t mainzisegmap_216756_total_runtime;
    int mainzisegmap_216756_runs;
    int64_t mainzisegmap_216852_total_runtime;
    int mainzisegmap_216852_runs;
    int64_t mainzisegmap_218413_total_runtime;
    int mainzisegmap_218413_runs;
    int64_t mainzisegmap_218562_total_runtime;
    int mainzisegmap_218562_runs;
    int64_t mainzisegmap_218598_total_runtime;
    int mainzisegmap_218598_runs;
    int64_t mainzisegmap_218729_total_runtime;
    int mainzisegmap_218729_runs;
    int64_t mainzisegmap_218860_total_runtime;
    int mainzisegmap_218860_runs;
    int64_t mainzisegmap_219049_total_runtime;
    int mainzisegmap_219049_runs;
    int64_t mainzisegmap_219434_total_runtime;
    int mainzisegmap_219434_runs;
    int64_t mainzisegmap_219551_total_runtime;
    int mainzisegmap_219551_runs;
    int64_t mainzisegmap_219712_total_runtime;
    int mainzisegmap_219712_runs;
    int64_t mainzisegmap_220233_total_runtime;
    int mainzisegmap_220233_runs;
    int64_t mainzisegmap_220390_total_runtime;
    int mainzisegmap_220390_runs;
    int64_t mainzisegmap_220609_total_runtime;
    int mainzisegmap_220609_runs;
    int64_t mainzisegmap_221278_total_runtime;
    int mainzisegmap_221278_runs;
    int64_t mainzisegmap_221479_total_runtime;
    int mainzisegmap_221479_runs;
    int64_t mainzisegmap_222349_total_runtime;
    int mainzisegmap_222349_runs;
    int64_t mainzisegmap_222444_total_runtime;
    int mainzisegmap_222444_runs;
    int64_t mainzisegmap_222551_total_runtime;
    int mainzisegmap_222551_runs;
    int64_t mainzisegmap_223067_total_runtime;
    int mainzisegmap_223067_runs;
    int64_t mainzisegmap_223084_total_runtime;
    int mainzisegmap_223084_runs;
    int64_t mainzisegmap_223112_total_runtime;
    int mainzisegmap_223112_runs;
    int64_t mainzisegmap_223236_total_runtime;
    int mainzisegmap_223236_runs;
    int64_t mainzisegmap_223423_total_runtime;
    int mainzisegmap_223423_runs;
    int64_t mainzisegmap_224073_total_runtime;
    int mainzisegmap_224073_runs;
    int64_t mainzisegmap_224090_total_runtime;
    int mainzisegmap_224090_runs;
    int64_t mainzisegmap_224120_total_runtime;
    int mainzisegmap_224120_runs;
    int64_t mainzisegmap_224284_total_runtime;
    int mainzisegmap_224284_runs;
    int64_t mainzisegmap_224529_total_runtime;
    int mainzisegmap_224529_runs;
    int64_t mainzisegmap_225327_total_runtime;
    int mainzisegmap_225327_runs;
    int64_t mainzisegmap_225344_total_runtime;
    int mainzisegmap_225344_runs;
    int64_t mainzisegmap_225374_total_runtime;
    int mainzisegmap_225374_runs;
    int64_t mainzisegmap_225582_total_runtime;
    int mainzisegmap_225582_runs;
    int64_t mainzisegmap_225873_total_runtime;
    int mainzisegmap_225873_runs;
    int64_t mainzisegmap_225890_total_runtime;
    int mainzisegmap_225890_runs;
    int64_t mainzisegmap_226185_total_runtime;
    int mainzisegmap_226185_runs;
    int64_t mainzisegmap_226202_total_runtime;
    int mainzisegmap_226202_runs;
    int64_t mainzisegmap_226589_total_runtime;
    int mainzisegmap_226589_runs;
    int64_t mainzisegmap_226606_total_runtime;
    int mainzisegmap_226606_runs;
    int64_t mainzisegmap_226894_total_runtime;
    int mainzisegmap_226894_runs;
    int64_t mainzisegmap_227111_total_runtime;
    int mainzisegmap_227111_runs;
    int64_t mainzisegmap_227132_total_runtime;
    int mainzisegmap_227132_runs;
    int64_t mainzisegmap_227261_total_runtime;
    int mainzisegmap_227261_runs;
    int64_t mainzisegmap_227986_total_runtime;
    int mainzisegmap_227986_runs;
    int64_t mainzisegmap_228041_total_runtime;
    int mainzisegmap_228041_runs;
    int64_t mainzisegmap_228103_total_runtime;
    int mainzisegmap_228103_runs;
    int64_t mainzisegmap_228189_total_runtime;
    int mainzisegmap_228189_runs;
    int64_t mainzisegmap_228212_total_runtime;
    int mainzisegmap_228212_runs;
    int64_t mainzisegmap_intragroup_206893_total_runtime;
    int mainzisegmap_intragroup_206893_runs;
    int64_t mainzisegmap_intragroup_207248_total_runtime;
    int mainzisegmap_intragroup_207248_runs;
    int64_t mainzisegmap_intragroup_207524_total_runtime;
    int mainzisegmap_intragroup_207524_runs;
    int64_t mainzisegmap_intragroup_207777_total_runtime;
    int mainzisegmap_intragroup_207777_runs;
    int64_t mainzisegmap_intragroup_208681_total_runtime;
    int mainzisegmap_intragroup_208681_runs;
    int64_t mainzisegmap_intragroup_209082_total_runtime;
    int mainzisegmap_intragroup_209082_runs;
    int64_t mainzisegmap_intragroup_209708_total_runtime;
    int mainzisegmap_intragroup_209708_runs;
    int64_t mainzisegmap_intragroup_211768_total_runtime;
    int mainzisegmap_intragroup_211768_runs;
    int64_t mainzisegmap_intragroup_213836_total_runtime;
    int mainzisegmap_intragroup_213836_runs;
    int64_t mainzisegmap_intragroup_216411_total_runtime;
    int mainzisegmap_intragroup_216411_runs;
    int64_t mainzisegmap_intragroup_217183_total_runtime;
    int mainzisegmap_intragroup_217183_runs;
    int64_t mainzisegmap_intragroup_217504_total_runtime;
    int mainzisegmap_intragroup_217504_runs;
    int64_t mainzisegmap_intragroup_217955_total_runtime;
    int mainzisegmap_intragroup_217955_runs;
    int64_t mainzisegmap_intragroup_221669_total_runtime;
    int mainzisegmap_intragroup_221669_runs;
    int64_t mainzisegmap_intragroup_221836_total_runtime;
    int mainzisegmap_intragroup_221836_runs;
    int64_t mainzisegmap_intragroup_222093_total_runtime;
    int mainzisegmap_intragroup_222093_runs;
    int64_t mainzisegmap_intragroup_225917_total_runtime;
    int mainzisegmap_intragroup_225917_runs;
    int64_t mainzisegmap_intragroup_226230_total_runtime;
    int mainzisegmap_intragroup_226230_runs;
    int64_t mainzisegmap_intragroup_226634_total_runtime;
    int mainzisegmap_intragroup_226634_runs;
    int64_t mainzisegmap_intragroup_226984_total_runtime;
    int mainzisegmap_intragroup_226984_runs;
    int64_t mainzisegmap_intragroup_227359_total_runtime;
    int mainzisegmap_intragroup_227359_runs;
    int64_t mainzisegmap_intragroup_227815_total_runtime;
    int mainzisegmap_intragroup_227815_runs;
    int64_t mainzisegred_large_212003_total_runtime;
    int mainzisegred_large_212003_runs;
    int64_t mainzisegred_large_212077_total_runtime;
    int mainzisegred_large_212077_runs;
    int64_t mainzisegred_large_214137_total_runtime;
    int mainzisegred_large_214137_runs;
    int64_t mainzisegred_large_214231_total_runtime;
    int mainzisegred_large_214231_runs;
    int64_t mainzisegred_large_216784_total_runtime;
    int mainzisegred_large_216784_runs;
    int64_t mainzisegred_large_216907_total_runtime;
    int mainzisegred_large_216907_runs;
    int64_t mainzisegred_large_218631_total_runtime;
    int mainzisegred_large_218631_runs;
    int64_t mainzisegred_large_218762_total_runtime;
    int mainzisegred_large_218762_runs;
    int64_t mainzisegred_large_218893_total_runtime;
    int mainzisegred_large_218893_runs;
    int64_t mainzisegred_large_219515_total_runtime;
    int mainzisegred_large_219515_runs;
    int64_t mainzisegred_large_219564_total_runtime;
    int mainzisegred_large_219564_runs;
    int64_t mainzisegred_large_220344_total_runtime;
    int mainzisegred_large_220344_runs;
    int64_t mainzisegred_large_220413_total_runtime;
    int mainzisegred_large_220413_runs;
    int64_t mainzisegred_large_221423_total_runtime;
    int mainzisegred_large_221423_runs;
    int64_t mainzisegred_large_221521_total_runtime;
    int mainzisegred_large_221521_runs;
    int64_t mainzisegred_large_223197_total_runtime;
    int mainzisegred_large_223197_runs;
    int64_t mainzisegred_large_223249_total_runtime;
    int mainzisegred_large_223249_runs;
    int64_t mainzisegred_large_224235_total_runtime;
    int mainzisegred_large_224235_runs;
    int64_t mainzisegred_large_224307_total_runtime;
    int mainzisegred_large_224307_runs;
    int64_t mainzisegred_large_225523_total_runtime;
    int mainzisegred_large_225523_runs;
    int64_t mainzisegred_large_225624_total_runtime;
    int mainzisegred_large_225624_runs;
    int64_t mainzisegred_large_228090_total_runtime;
    int mainzisegred_large_228090_runs;
    int64_t mainzisegred_small_212003_total_runtime;
    int mainzisegred_small_212003_runs;
    int64_t mainzisegred_small_212077_total_runtime;
    int mainzisegred_small_212077_runs;
    int64_t mainzisegred_small_214137_total_runtime;
    int mainzisegred_small_214137_runs;
    int64_t mainzisegred_small_214231_total_runtime;
    int mainzisegred_small_214231_runs;
    int64_t mainzisegred_small_216784_total_runtime;
    int mainzisegred_small_216784_runs;
    int64_t mainzisegred_small_216907_total_runtime;
    int mainzisegred_small_216907_runs;
    int64_t mainzisegred_small_218631_total_runtime;
    int mainzisegred_small_218631_runs;
    int64_t mainzisegred_small_218762_total_runtime;
    int mainzisegred_small_218762_runs;
    int64_t mainzisegred_small_218893_total_runtime;
    int mainzisegred_small_218893_runs;
    int64_t mainzisegred_small_219515_total_runtime;
    int mainzisegred_small_219515_runs;
    int64_t mainzisegred_small_219564_total_runtime;
    int mainzisegred_small_219564_runs;
    int64_t mainzisegred_small_220344_total_runtime;
    int mainzisegred_small_220344_runs;
    int64_t mainzisegred_small_220413_total_runtime;
    int mainzisegred_small_220413_runs;
    int64_t mainzisegred_small_221423_total_runtime;
    int mainzisegred_small_221423_runs;
    int64_t mainzisegred_small_221521_total_runtime;
    int mainzisegred_small_221521_runs;
    int64_t mainzisegred_small_223197_total_runtime;
    int mainzisegred_small_223197_runs;
    int64_t mainzisegred_small_223249_total_runtime;
    int mainzisegred_small_223249_runs;
    int64_t mainzisegred_small_224235_total_runtime;
    int mainzisegred_small_224235_runs;
    int64_t mainzisegred_small_224307_total_runtime;
    int mainzisegred_small_224307_runs;
    int64_t mainzisegred_small_225523_total_runtime;
    int mainzisegred_small_225523_runs;
    int64_t mainzisegred_small_225624_total_runtime;
    int mainzisegred_small_225624_runs;
    int64_t mainzisegred_small_228090_total_runtime;
    int mainzisegred_small_228090_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_232838_total_runtime = 0;
    ctx->builtinzhreplicate_f64zireplicate_232838_runs = 0;
    ctx->builtinzhreplicate_i64zireplicate_232421_total_runtime = 0;
    ctx->builtinzhreplicate_i64zireplicate_232421_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_232439_total_runtime = 0;
    ctx->mainzicopy_232439_runs = 0;
    ctx->mainzicopy_232598_total_runtime = 0;
    ctx->mainzicopy_232598_runs = 0;
    ctx->mainzicopy_234521_total_runtime = 0;
    ctx->mainzicopy_234521_runs = 0;
    ctx->mainzicopy_234720_total_runtime = 0;
    ctx->mainzicopy_234720_runs = 0;
    ctx->mainzicopy_234970_total_runtime = 0;
    ctx->mainzicopy_234970_runs = 0;
    ctx->mainzicopy_235348_total_runtime = 0;
    ctx->mainzicopy_235348_runs = 0;
    ctx->mainzicopy_235570_total_runtime = 0;
    ctx->mainzicopy_235570_runs = 0;
    ctx->mainzicopy_235843_total_runtime = 0;
    ctx->mainzicopy_235843_runs = 0;
    ctx->mainziscan_stage1_206867_total_runtime = 0;
    ctx->mainziscan_stage1_206867_runs = 0;
    ctx->mainziscan_stage1_207007_total_runtime = 0;
    ctx->mainziscan_stage1_207007_runs = 0;
    ctx->mainziscan_stage1_207559_total_runtime = 0;
    ctx->mainziscan_stage1_207559_runs = 0;
    ctx->mainziscan_stage1_218683_total_runtime = 0;
    ctx->mainziscan_stage1_218683_runs = 0;
    ctx->mainziscan_stage1_218814_total_runtime = 0;
    ctx->mainziscan_stage1_218814_runs = 0;
    ctx->mainziscan_stage1_218945_total_runtime = 0;
    ctx->mainziscan_stage1_218945_runs = 0;
    ctx->mainziscan_stage1_227915_total_runtime = 0;
    ctx->mainziscan_stage1_227915_runs = 0;
    ctx->mainziscan_stage2_206867_total_runtime = 0;
    ctx->mainziscan_stage2_206867_runs = 0;
    ctx->mainziscan_stage2_207007_total_runtime = 0;
    ctx->mainziscan_stage2_207007_runs = 0;
    ctx->mainziscan_stage2_207559_total_runtime = 0;
    ctx->mainziscan_stage2_207559_runs = 0;
    ctx->mainziscan_stage2_218683_total_runtime = 0;
    ctx->mainziscan_stage2_218683_runs = 0;
    ctx->mainziscan_stage2_218814_total_runtime = 0;
    ctx->mainziscan_stage2_218814_runs = 0;
    ctx->mainziscan_stage2_218945_total_runtime = 0;
    ctx->mainziscan_stage2_218945_runs = 0;
    ctx->mainziscan_stage2_227915_total_runtime = 0;
    ctx->mainziscan_stage2_227915_runs = 0;
    ctx->mainziscan_stage3_206867_total_runtime = 0;
    ctx->mainziscan_stage3_206867_runs = 0;
    ctx->mainziscan_stage3_207007_total_runtime = 0;
    ctx->mainziscan_stage3_207007_runs = 0;
    ctx->mainziscan_stage3_207559_total_runtime = 0;
    ctx->mainziscan_stage3_207559_runs = 0;
    ctx->mainziscan_stage3_218683_total_runtime = 0;
    ctx->mainziscan_stage3_218683_runs = 0;
    ctx->mainziscan_stage3_218814_total_runtime = 0;
    ctx->mainziscan_stage3_218814_runs = 0;
    ctx->mainziscan_stage3_218945_total_runtime = 0;
    ctx->mainziscan_stage3_218945_runs = 0;
    ctx->mainziscan_stage3_227915_total_runtime = 0;
    ctx->mainziscan_stage3_227915_runs = 0;
    ctx->mainzisegmap_206869_total_runtime = 0;
    ctx->mainzisegmap_206869_runs = 0;
    ctx->mainzisegmap_207045_total_runtime = 0;
    ctx->mainzisegmap_207045_runs = 0;
    ctx->mainzisegmap_207170_total_runtime = 0;
    ctx->mainzisegmap_207170_runs = 0;
    ctx->mainzisegmap_207605_total_runtime = 0;
    ctx->mainzisegmap_207605_runs = 0;
    ctx->mainzisegmap_208818_total_runtime = 0;
    ctx->mainzisegmap_208818_runs = 0;
    ctx->mainzisegmap_208832_total_runtime = 0;
    ctx->mainzisegmap_208832_runs = 0;
    ctx->mainzisegmap_208856_total_runtime = 0;
    ctx->mainzisegmap_208856_runs = 0;
    ctx->mainzisegmap_209466_total_runtime = 0;
    ctx->mainzisegmap_209466_runs = 0;
    ctx->mainzisegmap_209478_total_runtime = 0;
    ctx->mainzisegmap_209478_runs = 0;
    ctx->mainzisegmap_209499_total_runtime = 0;
    ctx->mainzisegmap_209499_runs = 0;
    ctx->mainzisegmap_210092_total_runtime = 0;
    ctx->mainzisegmap_210092_runs = 0;
    ctx->mainzisegmap_210104_total_runtime = 0;
    ctx->mainzisegmap_210104_runs = 0;
    ctx->mainzisegmap_210125_total_runtime = 0;
    ctx->mainzisegmap_210125_runs = 0;
    ctx->mainzisegmap_210267_total_runtime = 0;
    ctx->mainzisegmap_210267_runs = 0;
    ctx->mainzisegmap_210412_total_runtime = 0;
    ctx->mainzisegmap_210412_runs = 0;
    ctx->mainzisegmap_210542_total_runtime = 0;
    ctx->mainzisegmap_210542_runs = 0;
    ctx->mainzisegmap_211682_total_runtime = 0;
    ctx->mainzisegmap_211682_runs = 0;
    ctx->mainzisegmap_211890_total_runtime = 0;
    ctx->mainzisegmap_211890_runs = 0;
    ctx->mainzisegmap_211979_total_runtime = 0;
    ctx->mainzisegmap_211979_runs = 0;
    ctx->mainzisegmap_212051_total_runtime = 0;
    ctx->mainzisegmap_212051_runs = 0;
    ctx->mainzisegmap_212265_total_runtime = 0;
    ctx->mainzisegmap_212265_runs = 0;
    ctx->mainzisegmap_213719_total_runtime = 0;
    ctx->mainzisegmap_213719_runs = 0;
    ctx->mainzisegmap_213994_total_runtime = 0;
    ctx->mainzisegmap_213994_runs = 0;
    ctx->mainzisegmap_214111_total_runtime = 0;
    ctx->mainzisegmap_214111_runs = 0;
    ctx->mainzisegmap_214195_total_runtime = 0;
    ctx->mainzisegmap_214195_runs = 0;
    ctx->mainzisegmap_214470_total_runtime = 0;
    ctx->mainzisegmap_214470_runs = 0;
    ctx->mainzisegmap_216262_total_runtime = 0;
    ctx->mainzisegmap_216262_runs = 0;
    ctx->mainzisegmap_216607_total_runtime = 0;
    ctx->mainzisegmap_216607_runs = 0;
    ctx->mainzisegmap_216756_total_runtime = 0;
    ctx->mainzisegmap_216756_runs = 0;
    ctx->mainzisegmap_216852_total_runtime = 0;
    ctx->mainzisegmap_216852_runs = 0;
    ctx->mainzisegmap_218413_total_runtime = 0;
    ctx->mainzisegmap_218413_runs = 0;
    ctx->mainzisegmap_218562_total_runtime = 0;
    ctx->mainzisegmap_218562_runs = 0;
    ctx->mainzisegmap_218598_total_runtime = 0;
    ctx->mainzisegmap_218598_runs = 0;
    ctx->mainzisegmap_218729_total_runtime = 0;
    ctx->mainzisegmap_218729_runs = 0;
    ctx->mainzisegmap_218860_total_runtime = 0;
    ctx->mainzisegmap_218860_runs = 0;
    ctx->mainzisegmap_219049_total_runtime = 0;
    ctx->mainzisegmap_219049_runs = 0;
    ctx->mainzisegmap_219434_total_runtime = 0;
    ctx->mainzisegmap_219434_runs = 0;
    ctx->mainzisegmap_219551_total_runtime = 0;
    ctx->mainzisegmap_219551_runs = 0;
    ctx->mainzisegmap_219712_total_runtime = 0;
    ctx->mainzisegmap_219712_runs = 0;
    ctx->mainzisegmap_220233_total_runtime = 0;
    ctx->mainzisegmap_220233_runs = 0;
    ctx->mainzisegmap_220390_total_runtime = 0;
    ctx->mainzisegmap_220390_runs = 0;
    ctx->mainzisegmap_220609_total_runtime = 0;
    ctx->mainzisegmap_220609_runs = 0;
    ctx->mainzisegmap_221278_total_runtime = 0;
    ctx->mainzisegmap_221278_runs = 0;
    ctx->mainzisegmap_221479_total_runtime = 0;
    ctx->mainzisegmap_221479_runs = 0;
    ctx->mainzisegmap_222349_total_runtime = 0;
    ctx->mainzisegmap_222349_runs = 0;
    ctx->mainzisegmap_222444_total_runtime = 0;
    ctx->mainzisegmap_222444_runs = 0;
    ctx->mainzisegmap_222551_total_runtime = 0;
    ctx->mainzisegmap_222551_runs = 0;
    ctx->mainzisegmap_223067_total_runtime = 0;
    ctx->mainzisegmap_223067_runs = 0;
    ctx->mainzisegmap_223084_total_runtime = 0;
    ctx->mainzisegmap_223084_runs = 0;
    ctx->mainzisegmap_223112_total_runtime = 0;
    ctx->mainzisegmap_223112_runs = 0;
    ctx->mainzisegmap_223236_total_runtime = 0;
    ctx->mainzisegmap_223236_runs = 0;
    ctx->mainzisegmap_223423_total_runtime = 0;
    ctx->mainzisegmap_223423_runs = 0;
    ctx->mainzisegmap_224073_total_runtime = 0;
    ctx->mainzisegmap_224073_runs = 0;
    ctx->mainzisegmap_224090_total_runtime = 0;
    ctx->mainzisegmap_224090_runs = 0;
    ctx->mainzisegmap_224120_total_runtime = 0;
    ctx->mainzisegmap_224120_runs = 0;
    ctx->mainzisegmap_224284_total_runtime = 0;
    ctx->mainzisegmap_224284_runs = 0;
    ctx->mainzisegmap_224529_total_runtime = 0;
    ctx->mainzisegmap_224529_runs = 0;
    ctx->mainzisegmap_225327_total_runtime = 0;
    ctx->mainzisegmap_225327_runs = 0;
    ctx->mainzisegmap_225344_total_runtime = 0;
    ctx->mainzisegmap_225344_runs = 0;
    ctx->mainzisegmap_225374_total_runtime = 0;
    ctx->mainzisegmap_225374_runs = 0;
    ctx->mainzisegmap_225582_total_runtime = 0;
    ctx->mainzisegmap_225582_runs = 0;
    ctx->mainzisegmap_225873_total_runtime = 0;
    ctx->mainzisegmap_225873_runs = 0;
    ctx->mainzisegmap_225890_total_runtime = 0;
    ctx->mainzisegmap_225890_runs = 0;
    ctx->mainzisegmap_226185_total_runtime = 0;
    ctx->mainzisegmap_226185_runs = 0;
    ctx->mainzisegmap_226202_total_runtime = 0;
    ctx->mainzisegmap_226202_runs = 0;
    ctx->mainzisegmap_226589_total_runtime = 0;
    ctx->mainzisegmap_226589_runs = 0;
    ctx->mainzisegmap_226606_total_runtime = 0;
    ctx->mainzisegmap_226606_runs = 0;
    ctx->mainzisegmap_226894_total_runtime = 0;
    ctx->mainzisegmap_226894_runs = 0;
    ctx->mainzisegmap_227111_total_runtime = 0;
    ctx->mainzisegmap_227111_runs = 0;
    ctx->mainzisegmap_227132_total_runtime = 0;
    ctx->mainzisegmap_227132_runs = 0;
    ctx->mainzisegmap_227261_total_runtime = 0;
    ctx->mainzisegmap_227261_runs = 0;
    ctx->mainzisegmap_227986_total_runtime = 0;
    ctx->mainzisegmap_227986_runs = 0;
    ctx->mainzisegmap_228041_total_runtime = 0;
    ctx->mainzisegmap_228041_runs = 0;
    ctx->mainzisegmap_228103_total_runtime = 0;
    ctx->mainzisegmap_228103_runs = 0;
    ctx->mainzisegmap_228189_total_runtime = 0;
    ctx->mainzisegmap_228189_runs = 0;
    ctx->mainzisegmap_228212_total_runtime = 0;
    ctx->mainzisegmap_228212_runs = 0;
    ctx->mainzisegmap_intragroup_206893_total_runtime = 0;
    ctx->mainzisegmap_intragroup_206893_runs = 0;
    ctx->mainzisegmap_intragroup_207248_total_runtime = 0;
    ctx->mainzisegmap_intragroup_207248_runs = 0;
    ctx->mainzisegmap_intragroup_207524_total_runtime = 0;
    ctx->mainzisegmap_intragroup_207524_runs = 0;
    ctx->mainzisegmap_intragroup_207777_total_runtime = 0;
    ctx->mainzisegmap_intragroup_207777_runs = 0;
    ctx->mainzisegmap_intragroup_208681_total_runtime = 0;
    ctx->mainzisegmap_intragroup_208681_runs = 0;
    ctx->mainzisegmap_intragroup_209082_total_runtime = 0;
    ctx->mainzisegmap_intragroup_209082_runs = 0;
    ctx->mainzisegmap_intragroup_209708_total_runtime = 0;
    ctx->mainzisegmap_intragroup_209708_runs = 0;
    ctx->mainzisegmap_intragroup_211768_total_runtime = 0;
    ctx->mainzisegmap_intragroup_211768_runs = 0;
    ctx->mainzisegmap_intragroup_213836_total_runtime = 0;
    ctx->mainzisegmap_intragroup_213836_runs = 0;
    ctx->mainzisegmap_intragroup_216411_total_runtime = 0;
    ctx->mainzisegmap_intragroup_216411_runs = 0;
    ctx->mainzisegmap_intragroup_217183_total_runtime = 0;
    ctx->mainzisegmap_intragroup_217183_runs = 0;
    ctx->mainzisegmap_intragroup_217504_total_runtime = 0;
    ctx->mainzisegmap_intragroup_217504_runs = 0;
    ctx->mainzisegmap_intragroup_217955_total_runtime = 0;
    ctx->mainzisegmap_intragroup_217955_runs = 0;
    ctx->mainzisegmap_intragroup_221669_total_runtime = 0;
    ctx->mainzisegmap_intragroup_221669_runs = 0;
    ctx->mainzisegmap_intragroup_221836_total_runtime = 0;
    ctx->mainzisegmap_intragroup_221836_runs = 0;
    ctx->mainzisegmap_intragroup_222093_total_runtime = 0;
    ctx->mainzisegmap_intragroup_222093_runs = 0;
    ctx->mainzisegmap_intragroup_225917_total_runtime = 0;
    ctx->mainzisegmap_intragroup_225917_runs = 0;
    ctx->mainzisegmap_intragroup_226230_total_runtime = 0;
    ctx->mainzisegmap_intragroup_226230_runs = 0;
    ctx->mainzisegmap_intragroup_226634_total_runtime = 0;
    ctx->mainzisegmap_intragroup_226634_runs = 0;
    ctx->mainzisegmap_intragroup_226984_total_runtime = 0;
    ctx->mainzisegmap_intragroup_226984_runs = 0;
    ctx->mainzisegmap_intragroup_227359_total_runtime = 0;
    ctx->mainzisegmap_intragroup_227359_runs = 0;
    ctx->mainzisegmap_intragroup_227815_total_runtime = 0;
    ctx->mainzisegmap_intragroup_227815_runs = 0;
    ctx->mainzisegred_large_212003_total_runtime = 0;
    ctx->mainzisegred_large_212003_runs = 0;
    ctx->mainzisegred_large_212077_total_runtime = 0;
    ctx->mainzisegred_large_212077_runs = 0;
    ctx->mainzisegred_large_214137_total_runtime = 0;
    ctx->mainzisegred_large_214137_runs = 0;
    ctx->mainzisegred_large_214231_total_runtime = 0;
    ctx->mainzisegred_large_214231_runs = 0;
    ctx->mainzisegred_large_216784_total_runtime = 0;
    ctx->mainzisegred_large_216784_runs = 0;
    ctx->mainzisegred_large_216907_total_runtime = 0;
    ctx->mainzisegred_large_216907_runs = 0;
    ctx->mainzisegred_large_218631_total_runtime = 0;
    ctx->mainzisegred_large_218631_runs = 0;
    ctx->mainzisegred_large_218762_total_runtime = 0;
    ctx->mainzisegred_large_218762_runs = 0;
    ctx->mainzisegred_large_218893_total_runtime = 0;
    ctx->mainzisegred_large_218893_runs = 0;
    ctx->mainzisegred_large_219515_total_runtime = 0;
    ctx->mainzisegred_large_219515_runs = 0;
    ctx->mainzisegred_large_219564_total_runtime = 0;
    ctx->mainzisegred_large_219564_runs = 0;
    ctx->mainzisegred_large_220344_total_runtime = 0;
    ctx->mainzisegred_large_220344_runs = 0;
    ctx->mainzisegred_large_220413_total_runtime = 0;
    ctx->mainzisegred_large_220413_runs = 0;
    ctx->mainzisegred_large_221423_total_runtime = 0;
    ctx->mainzisegred_large_221423_runs = 0;
    ctx->mainzisegred_large_221521_total_runtime = 0;
    ctx->mainzisegred_large_221521_runs = 0;
    ctx->mainzisegred_large_223197_total_runtime = 0;
    ctx->mainzisegred_large_223197_runs = 0;
    ctx->mainzisegred_large_223249_total_runtime = 0;
    ctx->mainzisegred_large_223249_runs = 0;
    ctx->mainzisegred_large_224235_total_runtime = 0;
    ctx->mainzisegred_large_224235_runs = 0;
    ctx->mainzisegred_large_224307_total_runtime = 0;
    ctx->mainzisegred_large_224307_runs = 0;
    ctx->mainzisegred_large_225523_total_runtime = 0;
    ctx->mainzisegred_large_225523_runs = 0;
    ctx->mainzisegred_large_225624_total_runtime = 0;
    ctx->mainzisegred_large_225624_runs = 0;
    ctx->mainzisegred_large_228090_total_runtime = 0;
    ctx->mainzisegred_large_228090_runs = 0;
    ctx->mainzisegred_small_212003_total_runtime = 0;
    ctx->mainzisegred_small_212003_runs = 0;
    ctx->mainzisegred_small_212077_total_runtime = 0;
    ctx->mainzisegred_small_212077_runs = 0;
    ctx->mainzisegred_small_214137_total_runtime = 0;
    ctx->mainzisegred_small_214137_runs = 0;
    ctx->mainzisegred_small_214231_total_runtime = 0;
    ctx->mainzisegred_small_214231_runs = 0;
    ctx->mainzisegred_small_216784_total_runtime = 0;
    ctx->mainzisegred_small_216784_runs = 0;
    ctx->mainzisegred_small_216907_total_runtime = 0;
    ctx->mainzisegred_small_216907_runs = 0;
    ctx->mainzisegred_small_218631_total_runtime = 0;
    ctx->mainzisegred_small_218631_runs = 0;
    ctx->mainzisegred_small_218762_total_runtime = 0;
    ctx->mainzisegred_small_218762_runs = 0;
    ctx->mainzisegred_small_218893_total_runtime = 0;
    ctx->mainzisegred_small_218893_runs = 0;
    ctx->mainzisegred_small_219515_total_runtime = 0;
    ctx->mainzisegred_small_219515_runs = 0;
    ctx->mainzisegred_small_219564_total_runtime = 0;
    ctx->mainzisegred_small_219564_runs = 0;
    ctx->mainzisegred_small_220344_total_runtime = 0;
    ctx->mainzisegred_small_220344_runs = 0;
    ctx->mainzisegred_small_220413_total_runtime = 0;
    ctx->mainzisegred_small_220413_runs = 0;
    ctx->mainzisegred_small_221423_total_runtime = 0;
    ctx->mainzisegred_small_221423_runs = 0;
    ctx->mainzisegred_small_221521_total_runtime = 0;
    ctx->mainzisegred_small_221521_runs = 0;
    ctx->mainzisegred_small_223197_total_runtime = 0;
    ctx->mainzisegred_small_223197_runs = 0;
    ctx->mainzisegred_small_223249_total_runtime = 0;
    ctx->mainzisegred_small_223249_runs = 0;
    ctx->mainzisegred_small_224235_total_runtime = 0;
    ctx->mainzisegred_small_224235_runs = 0;
    ctx->mainzisegred_small_224307_total_runtime = 0;
    ctx->mainzisegred_small_224307_runs = 0;
    ctx->mainzisegred_small_225523_total_runtime = 0;
    ctx->mainzisegred_small_225523_runs = 0;
    ctx->mainzisegred_small_225624_total_runtime = 0;
    ctx->mainzisegred_small_225624_runs = 0;
    ctx->mainzisegred_small_228090_total_runtime = 0;
    ctx->mainzisegred_small_228090_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_232838 = clCreateKernel(prog,
                                                                       "builtinzhreplicate_f64zireplicate_232838",
                                                                       &error);
        OPENCL_SUCCEED_FATAL(error);
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "builtin#replicate_f64.replicate_232838");
    }
    {
        ctx->builtinzhreplicate_i64zireplicate_232421 = clCreateKernel(prog,
                                                                       "builtinzhreplicate_i64zireplicate_232421",
                                                                       &error);
        OPENCL_SUCCEED_FATAL(error);
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "builtin#replicate_i64.replicate_232421");
    }
    {
        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_232439 = clCreateKernel(prog, "mainzicopy_232439",
                                                &error);
        OPENCL_SUCCEED_FATAL(error);
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.copy_232439");
    }
    {
        ctx->mainzicopy_232598 = clCreateKernel(prog, "mainzicopy_232598",
                                                &error);
        OPENCL_SUCCEED_FATAL(error);
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.copy_232598");
    }
    {
        ctx->mainzicopy_234521 = clCreateKernel(prog, "mainzicopy_234521",
                                                &error);
        OPENCL_SUCCEED_FATAL(error);
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.copy_234521");
    }
    {
        ctx->mainzicopy_234720 = clCreateKernel(prog, "mainzicopy_234720",
                                                &error);
        OPENCL_SUCCEED_FATAL(error);
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.copy_234720");
    }
    {
        ctx->mainzicopy_234970 = clCreateKernel(prog, "mainzicopy_234970",
                                                &error);
        OPENCL_SUCCEED_FATAL(error);
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.copy_234970");
    }
    {
        ctx->mainzicopy_235348 = clCreateKernel(prog, "mainzicopy_235348",
                                                &error);
        OPENCL_SUCCEED_FATAL(error);
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.copy_235348");
    }
    {
        ctx->mainzicopy_235570 = clCreateKernel(prog, "mainzicopy_235570",
                                                &error);
        OPENCL_SUCCEED_FATAL(error);
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.copy_235570");
    }
    {
        ctx->mainzicopy_235843 = clCreateKernel(prog, "mainzicopy_235843",
                                                &error);
        OPENCL_SUCCEED_FATAL(error);
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.copy_235843");
    }
    {
        ctx->mainziscan_stage1_206867 = clCreateKernel(prog,
                                                       "mainziscan_stage1_206867",
                                                       &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainziscan_stage1_206867, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainziscan_stage1_206867, 2,
                                            sizeof(cl_mem),
                                            &ctx->global_failure_args));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.scan_stage1_206867");
    }
    {
        ctx->mainziscan_stage1_207007 = clCreateKernel(prog,
                                                       "mainziscan_stage1_207007",
                                                       &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainziscan_stage1_207007, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.scan_stage1_207007");
    }
    {
        ctx->mainziscan_stage1_207559 = clCreateKernel(prog,
                                                       "mainziscan_stage1_207559",
                                                       &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainziscan_stage1_207559, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.scan_stage1_207559");
    }
    {
        ctx->mainziscan_stage1_218683 = clCreateKernel(prog,
                                                       "mainziscan_stage1_218683",
                                                       &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainziscan_stage1_218683, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainziscan_stage1_218683, 2,
                                            sizeof(cl_mem),
                                            &ctx->global_failure_args));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.scan_stage1_218683");
    }
    {
        ctx->mainziscan_stage1_218814 = clCreateKernel(prog,
                                                       "mainziscan_stage1_218814",
                                                       &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainziscan_stage1_218814, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainziscan_stage1_218814, 2,
                                            sizeof(cl_mem),
                                            &ctx->global_failure_args));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.scan_stage1_218814");
    }
    {
        ctx->mainziscan_stage1_218945 = clCreateKernel(prog,
                                                       "mainziscan_stage1_218945",
                                                       &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainziscan_stage1_218945, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainziscan_stage1_218945, 2,
                                            sizeof(cl_mem),
                                            &ctx->global_failure_args));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.scan_stage1_218945");
    }
    {
        ctx->mainziscan_stage1_227915 = clCreateKernel(prog,
                                                       "mainziscan_stage1_227915",
                                                       &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainziscan_stage1_227915, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.scan_stage1_227915");
    }
    {
        ctx->mainziscan_stage2_206867 = clCreateKernel(prog,
                                                       "mainziscan_stage2_206867",
                                                       &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainziscan_stage2_206867, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.scan_stage2_206867");
    }
    {
        ctx->mainziscan_stage2_207007 = clCreateKernel(prog,
                                                       "mainziscan_stage2_207007",
                                                       &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainziscan_stage2_207007, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.scan_stage2_207007");
    }
    {
        ctx->mainziscan_stage2_207559 = clCreateKernel(prog,
                                                       "mainziscan_stage2_207559",
                                                       &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainziscan_stage2_207559, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.scan_stage2_207559");
    }
    {
        ctx->mainziscan_stage2_218683 = clCreateKernel(prog,
                                                       "mainziscan_stage2_218683",
                                                       &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainziscan_stage2_218683, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.scan_stage2_218683");
    }
    {
        ctx->mainziscan_stage2_218814 = clCreateKernel(prog,
                                                       "mainziscan_stage2_218814",
                                                       &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainziscan_stage2_218814, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.scan_stage2_218814");
    }
    {
        ctx->mainziscan_stage2_218945 = clCreateKernel(prog,
                                                       "mainziscan_stage2_218945",
                                                       &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainziscan_stage2_218945, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.scan_stage2_218945");
    }
    {
        ctx->mainziscan_stage2_227915 = clCreateKernel(prog,
                                                       "mainziscan_stage2_227915",
                                                       &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainziscan_stage2_227915, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.scan_stage2_227915");
    }
    {
        ctx->mainziscan_stage3_206867 = clCreateKernel(prog,
                                                       "mainziscan_stage3_206867",
                                                       &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainziscan_stage3_206867, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.scan_stage3_206867");
    }
    {
        ctx->mainziscan_stage3_207007 = clCreateKernel(prog,
                                                       "mainziscan_stage3_207007",
                                                       &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainziscan_stage3_207007, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.scan_stage3_207007");
    }
    {
        ctx->mainziscan_stage3_207559 = clCreateKernel(prog,
                                                       "mainziscan_stage3_207559",
                                                       &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainziscan_stage3_207559, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.scan_stage3_207559");
    }
    {
        ctx->mainziscan_stage3_218683 = clCreateKernel(prog,
                                                       "mainziscan_stage3_218683",
                                                       &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainziscan_stage3_218683, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.scan_stage3_218683");
    }
    {
        ctx->mainziscan_stage3_218814 = clCreateKernel(prog,
                                                       "mainziscan_stage3_218814",
                                                       &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainziscan_stage3_218814, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.scan_stage3_218814");
    }
    {
        ctx->mainziscan_stage3_218945 = clCreateKernel(prog,
                                                       "mainziscan_stage3_218945",
                                                       &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainziscan_stage3_218945, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.scan_stage3_218945");
    }
    {
        ctx->mainziscan_stage3_227915 = clCreateKernel(prog,
                                                       "mainziscan_stage3_227915",
                                                       &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainziscan_stage3_227915, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.scan_stage3_227915");
    }
    {
        ctx->mainzisegmap_206869 = clCreateKernel(prog, "mainzisegmap_206869",
                                                  &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_206869, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.segmap_206869");
    }
    {
        ctx->mainzisegmap_207045 = clCreateKernel(prog, "mainzisegmap_207045",
                                                  &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_207045, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.segmap_207045");
    }
    {
        ctx->mainzisegmap_207170 = clCreateKernel(prog, "mainzisegmap_207170",
                                                  &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_207170, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_207170, 2,
                                            sizeof(cl_mem),
                                            &ctx->global_failure_args));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.segmap_207170");
    }
    {
        ctx->mainzisegmap_207605 = clCreateKernel(prog, "mainzisegmap_207605",
                                                  &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_207605, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.segmap_207605");
    }
    {
        ctx->mainzisegmap_208818 = clCreateKernel(prog, "mainzisegmap_208818",
                                                  &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_208818, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.segmap_208818");
    }
    {
        ctx->mainzisegmap_208832 = clCreateKernel(prog, "mainzisegmap_208832",
                                                  &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_208832, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.segmap_208832");
    }
    {
        ctx->mainzisegmap_208856 = clCreateKernel(prog, "mainzisegmap_208856",
                                                  &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_208856, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_208856, 2,
                                            sizeof(cl_mem),
                                            &ctx->global_failure_args));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.segmap_208856");
    }
    {
        ctx->mainzisegmap_209466 = clCreateKernel(prog, "mainzisegmap_209466",
                                                  &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_209466, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.segmap_209466");
    }
    {
        ctx->mainzisegmap_209478 = clCreateKernel(prog, "mainzisegmap_209478",
                                                  &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_209478, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.segmap_209478");
    }
    {
        ctx->mainzisegmap_209499 = clCreateKernel(prog, "mainzisegmap_209499",
                                                  &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_209499, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_209499, 2,
                                            sizeof(cl_mem),
                                            &ctx->global_failure_args));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.segmap_209499");
    }
    {
        ctx->mainzisegmap_210092 = clCreateKernel(prog, "mainzisegmap_210092",
                                                  &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_210092, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.segmap_210092");
    }
    {
        ctx->mainzisegmap_210104 = clCreateKernel(prog, "mainzisegmap_210104",
                                                  &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_210104, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.segmap_210104");
    }
    {
        ctx->mainzisegmap_210125 = clCreateKernel(prog, "mainzisegmap_210125",
                                                  &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_210125, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_210125, 2,
                                            sizeof(cl_mem),
                                            &ctx->global_failure_args));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.segmap_210125");
    }
    {
        ctx->mainzisegmap_210267 = clCreateKernel(prog, "mainzisegmap_210267",
                                                  &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_210267, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.segmap_210267");
    }
    {
        ctx->mainzisegmap_210412 = clCreateKernel(prog, "mainzisegmap_210412",
                                                  &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_210412, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_210412, 2,
                                            sizeof(cl_mem),
                                            &ctx->global_failure_args));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.segmap_210412");
    }
    {
        ctx->mainzisegmap_210542 = clCreateKernel(prog, "mainzisegmap_210542",
                                                  &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_210542, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.segmap_210542");
    }
    {
        ctx->mainzisegmap_211682 = clCreateKernel(prog, "mainzisegmap_211682",
                                                  &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_211682, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.segmap_211682");
    }
    {
        ctx->mainzisegmap_211890 = clCreateKernel(prog, "mainzisegmap_211890",
                                                  &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_211890, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.segmap_211890");
    }
    {
        ctx->mainzisegmap_211979 = clCreateKernel(prog, "mainzisegmap_211979",
                                                  &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_211979, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.segmap_211979");
    }
    {
        ctx->mainzisegmap_212051 = clCreateKernel(prog, "mainzisegmap_212051",
                                                  &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_212051, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.segmap_212051");
    }
    {
        ctx->mainzisegmap_212265 = clCreateKernel(prog, "mainzisegmap_212265",
                                                  &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_212265, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.segmap_212265");
    }
    {
        ctx->mainzisegmap_213719 = clCreateKernel(prog, "mainzisegmap_213719",
                                                  &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_213719, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.segmap_213719");
    }
    {
        ctx->mainzisegmap_213994 = clCreateKernel(prog, "mainzisegmap_213994",
                                                  &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_213994, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.segmap_213994");
    }
    {
        ctx->mainzisegmap_214111 = clCreateKernel(prog, "mainzisegmap_214111",
                                                  &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_214111, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.segmap_214111");
    }
    {
        ctx->mainzisegmap_214195 = clCreateKernel(prog, "mainzisegmap_214195",
                                                  &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_214195, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.segmap_214195");
    }
    {
        ctx->mainzisegmap_214470 = clCreateKernel(prog, "mainzisegmap_214470",
                                                  &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_214470, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.segmap_214470");
    }
    {
        ctx->mainzisegmap_216262 = clCreateKernel(prog, "mainzisegmap_216262",
                                                  &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_216262, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.segmap_216262");
    }
    {
        ctx->mainzisegmap_216607 = clCreateKernel(prog, "mainzisegmap_216607",
                                                  &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_216607, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.segmap_216607");
    }
    {
        ctx->mainzisegmap_216756 = clCreateKernel(prog, "mainzisegmap_216756",
                                                  &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_216756, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.segmap_216756");
    }
    {
        ctx->mainzisegmap_216852 = clCreateKernel(prog, "mainzisegmap_216852",
                                                  &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_216852, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.segmap_216852");
    }
    {
        ctx->mainzisegmap_218413 = clCreateKernel(prog, "mainzisegmap_218413",
                                                  &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_218413, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_218413, 2,
                                            sizeof(cl_mem),
                                            &ctx->global_failure_args));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.segmap_218413");
    }
    {
        ctx->mainzisegmap_218562 = clCreateKernel(prog, "mainzisegmap_218562",
                                                  &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_218562, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_218562, 2,
                                            sizeof(cl_mem),
                                            &ctx->global_failure_args));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.segmap_218562");
    }
    {
        ctx->mainzisegmap_218598 = clCreateKernel(prog, "mainzisegmap_218598",
                                                  &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_218598, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.segmap_218598");
    }
    {
        ctx->mainzisegmap_218729 = clCreateKernel(prog, "mainzisegmap_218729",
                                                  &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_218729, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.segmap_218729");
    }
    {
        ctx->mainzisegmap_218860 = clCreateKernel(prog, "mainzisegmap_218860",
                                                  &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_218860, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.segmap_218860");
    }
    {
        ctx->mainzisegmap_219049 = clCreateKernel(prog, "mainzisegmap_219049",
                                                  &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_219049, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.segmap_219049");
    }
    {
        ctx->mainzisegmap_219434 = clCreateKernel(prog, "mainzisegmap_219434",
                                                  &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_219434, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.segmap_219434");
    }
    {
        ctx->mainzisegmap_219551 = clCreateKernel(prog, "mainzisegmap_219551",
                                                  &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_219551, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.segmap_219551");
    }
    {
        ctx->mainzisegmap_219712 = clCreateKernel(prog, "mainzisegmap_219712",
                                                  &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_219712, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.segmap_219712");
    }
    {
        ctx->mainzisegmap_220233 = clCreateKernel(prog, "mainzisegmap_220233",
                                                  &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_220233, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.segmap_220233");
    }
    {
        ctx->mainzisegmap_220390 = clCreateKernel(prog, "mainzisegmap_220390",
                                                  &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_220390, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.segmap_220390");
    }
    {
        ctx->mainzisegmap_220609 = clCreateKernel(prog, "mainzisegmap_220609",
                                                  &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_220609, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.segmap_220609");
    }
    {
        ctx->mainzisegmap_221278 = clCreateKernel(prog, "mainzisegmap_221278",
                                                  &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_221278, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.segmap_221278");
    }
    {
        ctx->mainzisegmap_221479 = clCreateKernel(prog, "mainzisegmap_221479",
                                                  &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_221479, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.segmap_221479");
    }
    {
        ctx->mainzisegmap_222349 = clCreateKernel(prog, "mainzisegmap_222349",
                                                  &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_222349, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_222349, 2,
                                            sizeof(cl_mem),
                                            &ctx->global_failure_args));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.segmap_222349");
    }
    {
        ctx->mainzisegmap_222444 = clCreateKernel(prog, "mainzisegmap_222444",
                                                  &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_222444, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.segmap_222444");
    }
    {
        ctx->mainzisegmap_222551 = clCreateKernel(prog, "mainzisegmap_222551",
                                                  &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_222551, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_222551, 2,
                                            sizeof(cl_mem),
                                            &ctx->global_failure_args));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.segmap_222551");
    }
    {
        ctx->mainzisegmap_223067 = clCreateKernel(prog, "mainzisegmap_223067",
                                                  &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_223067, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.segmap_223067");
    }
    {
        ctx->mainzisegmap_223084 = clCreateKernel(prog, "mainzisegmap_223084",
                                                  &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_223084, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_223084, 2,
                                            sizeof(cl_mem),
                                            &ctx->global_failure_args));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.segmap_223084");
    }
    {
        ctx->mainzisegmap_223112 = clCreateKernel(prog, "mainzisegmap_223112",
                                                  &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_223112, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.segmap_223112");
    }
    {
        ctx->mainzisegmap_223236 = clCreateKernel(prog, "mainzisegmap_223236",
                                                  &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_223236, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.segmap_223236");
    }
    {
        ctx->mainzisegmap_223423 = clCreateKernel(prog, "mainzisegmap_223423",
                                                  &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_223423, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_223423, 2,
                                            sizeof(cl_mem),
                                            &ctx->global_failure_args));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.segmap_223423");
    }
    {
        ctx->mainzisegmap_224073 = clCreateKernel(prog, "mainzisegmap_224073",
                                                  &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_224073, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.segmap_224073");
    }
    {
        ctx->mainzisegmap_224090 = clCreateKernel(prog, "mainzisegmap_224090",
                                                  &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_224090, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_224090, 2,
                                            sizeof(cl_mem),
                                            &ctx->global_failure_args));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.segmap_224090");
    }
    {
        ctx->mainzisegmap_224120 = clCreateKernel(prog, "mainzisegmap_224120",
                                                  &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_224120, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.segmap_224120");
    }
    {
        ctx->mainzisegmap_224284 = clCreateKernel(prog, "mainzisegmap_224284",
                                                  &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_224284, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.segmap_224284");
    }
    {
        ctx->mainzisegmap_224529 = clCreateKernel(prog, "mainzisegmap_224529",
                                                  &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_224529, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_224529, 2,
                                            sizeof(cl_mem),
                                            &ctx->global_failure_args));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.segmap_224529");
    }
    {
        ctx->mainzisegmap_225327 = clCreateKernel(prog, "mainzisegmap_225327",
                                                  &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_225327, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.segmap_225327");
    }
    {
        ctx->mainzisegmap_225344 = clCreateKernel(prog, "mainzisegmap_225344",
                                                  &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_225344, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_225344, 2,
                                            sizeof(cl_mem),
                                            &ctx->global_failure_args));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.segmap_225344");
    }
    {
        ctx->mainzisegmap_225374 = clCreateKernel(prog, "mainzisegmap_225374",
                                                  &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_225374, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.segmap_225374");
    }
    {
        ctx->mainzisegmap_225582 = clCreateKernel(prog, "mainzisegmap_225582",
                                                  &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_225582, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.segmap_225582");
    }
    {
        ctx->mainzisegmap_225873 = clCreateKernel(prog, "mainzisegmap_225873",
                                                  &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_225873, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.segmap_225873");
    }
    {
        ctx->mainzisegmap_225890 = clCreateKernel(prog, "mainzisegmap_225890",
                                                  &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_225890, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_225890, 2,
                                            sizeof(cl_mem),
                                            &ctx->global_failure_args));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.segmap_225890");
    }
    {
        ctx->mainzisegmap_226185 = clCreateKernel(prog, "mainzisegmap_226185",
                                                  &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_226185, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.segmap_226185");
    }
    {
        ctx->mainzisegmap_226202 = clCreateKernel(prog, "mainzisegmap_226202",
                                                  &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_226202, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_226202, 2,
                                            sizeof(cl_mem),
                                            &ctx->global_failure_args));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.segmap_226202");
    }
    {
        ctx->mainzisegmap_226589 = clCreateKernel(prog, "mainzisegmap_226589",
                                                  &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_226589, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.segmap_226589");
    }
    {
        ctx->mainzisegmap_226606 = clCreateKernel(prog, "mainzisegmap_226606",
                                                  &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_226606, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_226606, 2,
                                            sizeof(cl_mem),
                                            &ctx->global_failure_args));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.segmap_226606");
    }
    {
        ctx->mainzisegmap_226894 = clCreateKernel(prog, "mainzisegmap_226894",
                                                  &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_226894, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_226894, 2,
                                            sizeof(cl_mem),
                                            &ctx->global_failure_args));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.segmap_226894");
    }
    {
        ctx->mainzisegmap_227111 = clCreateKernel(prog, "mainzisegmap_227111",
                                                  &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_227111, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.segmap_227111");
    }
    {
        ctx->mainzisegmap_227132 = clCreateKernel(prog, "mainzisegmap_227132",
                                                  &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_227132, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_227132, 2,
                                            sizeof(cl_mem),
                                            &ctx->global_failure_args));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.segmap_227132");
    }
    {
        ctx->mainzisegmap_227261 = clCreateKernel(prog, "mainzisegmap_227261",
                                                  &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_227261, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.segmap_227261");
    }
    {
        ctx->mainzisegmap_227986 = clCreateKernel(prog, "mainzisegmap_227986",
                                                  &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_227986, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.segmap_227986");
    }
    {
        ctx->mainzisegmap_228041 = clCreateKernel(prog, "mainzisegmap_228041",
                                                  &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_228041, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.segmap_228041");
    }
    {
        ctx->mainzisegmap_228103 = clCreateKernel(prog, "mainzisegmap_228103",
                                                  &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_228103, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.segmap_228103");
    }
    {
        ctx->mainzisegmap_228189 = clCreateKernel(prog, "mainzisegmap_228189",
                                                  &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_228189, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.segmap_228189");
    }
    {
        ctx->mainzisegmap_228212 = clCreateKernel(prog, "mainzisegmap_228212",
                                                  &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_228212, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.segmap_228212");
    }
    {
        ctx->mainzisegmap_intragroup_206893 = clCreateKernel(prog,
                                                             "mainzisegmap_intragroup_206893",
                                                             &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_intragroup_206893,
                                            0, sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.segmap_intragroup_206893");
    }
    {
        ctx->mainzisegmap_intragroup_207248 = clCreateKernel(prog,
                                                             "mainzisegmap_intragroup_207248",
                                                             &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_intragroup_207248,
                                            0, sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.segmap_intragroup_207248");
    }
    {
        ctx->mainzisegmap_intragroup_207524 = clCreateKernel(prog,
                                                             "mainzisegmap_intragroup_207524",
                                                             &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_intragroup_207524,
                                            0, sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.segmap_intragroup_207524");
    }
    {
        ctx->mainzisegmap_intragroup_207777 = clCreateKernel(prog,
                                                             "mainzisegmap_intragroup_207777",
                                                             &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_intragroup_207777,
                                            0, sizeof(cl_mem),
                                            &ctx->global_failure));
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_intragroup_207777,
                                            2, sizeof(cl_mem),
                                            &ctx->global_failure_args));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.segmap_intragroup_207777");
    }
    {
        ctx->mainzisegmap_intragroup_208681 = clCreateKernel(prog,
                                                             "mainzisegmap_intragroup_208681",
                                                             &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_intragroup_208681,
                                            0, sizeof(cl_mem),
                                            &ctx->global_failure));
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_intragroup_208681,
                                            2, sizeof(cl_mem),
                                            &ctx->global_failure_args));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.segmap_intragroup_208681");
    }
    {
        ctx->mainzisegmap_intragroup_209082 = clCreateKernel(prog,
                                                             "mainzisegmap_intragroup_209082",
                                                             &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_intragroup_209082,
                                            0, sizeof(cl_mem),
                                            &ctx->global_failure));
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_intragroup_209082,
                                            2, sizeof(cl_mem),
                                            &ctx->global_failure_args));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.segmap_intragroup_209082");
    }
    {
        ctx->mainzisegmap_intragroup_209708 = clCreateKernel(prog,
                                                             "mainzisegmap_intragroup_209708",
                                                             &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_intragroup_209708,
                                            0, sizeof(cl_mem),
                                            &ctx->global_failure));
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_intragroup_209708,
                                            2, sizeof(cl_mem),
                                            &ctx->global_failure_args));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.segmap_intragroup_209708");
    }
    {
        ctx->mainzisegmap_intragroup_211768 = clCreateKernel(prog,
                                                             "mainzisegmap_intragroup_211768",
                                                             &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_intragroup_211768,
                                            0, sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.segmap_intragroup_211768");
    }
    {
        ctx->mainzisegmap_intragroup_213836 = clCreateKernel(prog,
                                                             "mainzisegmap_intragroup_213836",
                                                             &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_intragroup_213836,
                                            0, sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.segmap_intragroup_213836");
    }
    {
        ctx->mainzisegmap_intragroup_216411 = clCreateKernel(prog,
                                                             "mainzisegmap_intragroup_216411",
                                                             &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_intragroup_216411,
                                            0, sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.segmap_intragroup_216411");
    }
    {
        ctx->mainzisegmap_intragroup_217183 = clCreateKernel(prog,
                                                             "mainzisegmap_intragroup_217183",
                                                             &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_intragroup_217183,
                                            0, sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.segmap_intragroup_217183");
    }
    {
        ctx->mainzisegmap_intragroup_217504 = clCreateKernel(prog,
                                                             "mainzisegmap_intragroup_217504",
                                                             &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_intragroup_217504,
                                            0, sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.segmap_intragroup_217504");
    }
    {
        ctx->mainzisegmap_intragroup_217955 = clCreateKernel(prog,
                                                             "mainzisegmap_intragroup_217955",
                                                             &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_intragroup_217955,
                                            0, sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.segmap_intragroup_217955");
    }
    {
        ctx->mainzisegmap_intragroup_221669 = clCreateKernel(prog,
                                                             "mainzisegmap_intragroup_221669",
                                                             &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_intragroup_221669,
                                            0, sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.segmap_intragroup_221669");
    }
    {
        ctx->mainzisegmap_intragroup_221836 = clCreateKernel(prog,
                                                             "mainzisegmap_intragroup_221836",
                                                             &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_intragroup_221836,
                                            0, sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.segmap_intragroup_221836");
    }
    {
        ctx->mainzisegmap_intragroup_222093 = clCreateKernel(prog,
                                                             "mainzisegmap_intragroup_222093",
                                                             &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_intragroup_222093,
                                            0, sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.segmap_intragroup_222093");
    }
    {
        ctx->mainzisegmap_intragroup_225917 = clCreateKernel(prog,
                                                             "mainzisegmap_intragroup_225917",
                                                             &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_intragroup_225917,
                                            0, sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.segmap_intragroup_225917");
    }
    {
        ctx->mainzisegmap_intragroup_226230 = clCreateKernel(prog,
                                                             "mainzisegmap_intragroup_226230",
                                                             &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_intragroup_226230,
                                            0, sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.segmap_intragroup_226230");
    }
    {
        ctx->mainzisegmap_intragroup_226634 = clCreateKernel(prog,
                                                             "mainzisegmap_intragroup_226634",
                                                             &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_intragroup_226634,
                                            0, sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.segmap_intragroup_226634");
    }
    {
        ctx->mainzisegmap_intragroup_226984 = clCreateKernel(prog,
                                                             "mainzisegmap_intragroup_226984",
                                                             &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_intragroup_226984,
                                            0, sizeof(cl_mem),
                                            &ctx->global_failure));
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_intragroup_226984,
                                            2, sizeof(cl_mem),
                                            &ctx->global_failure_args));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.segmap_intragroup_226984");
    }
    {
        ctx->mainzisegmap_intragroup_227359 = clCreateKernel(prog,
                                                             "mainzisegmap_intragroup_227359",
                                                             &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_intragroup_227359,
                                            0, sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.segmap_intragroup_227359");
    }
    {
        ctx->mainzisegmap_intragroup_227815 = clCreateKernel(prog,
                                                             "mainzisegmap_intragroup_227815",
                                                             &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_intragroup_227815,
                                            0, sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.segmap_intragroup_227815");
    }
    {
        ctx->mainzisegred_large_212003 = clCreateKernel(prog,
                                                        "mainzisegred_large_212003",
                                                        &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegred_large_212003, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.segred_large_212003");
    }
    {
        ctx->mainzisegred_large_212077 = clCreateKernel(prog,
                                                        "mainzisegred_large_212077",
                                                        &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegred_large_212077, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.segred_large_212077");
    }
    {
        ctx->mainzisegred_large_214137 = clCreateKernel(prog,
                                                        "mainzisegred_large_214137",
                                                        &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegred_large_214137, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.segred_large_214137");
    }
    {
        ctx->mainzisegred_large_214231 = clCreateKernel(prog,
                                                        "mainzisegred_large_214231",
                                                        &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegred_large_214231, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.segred_large_214231");
    }
    {
        ctx->mainzisegred_large_216784 = clCreateKernel(prog,
                                                        "mainzisegred_large_216784",
                                                        &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegred_large_216784, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.segred_large_216784");
    }
    {
        ctx->mainzisegred_large_216907 = clCreateKernel(prog,
                                                        "mainzisegred_large_216907",
                                                        &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegred_large_216907, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.segred_large_216907");
    }
    {
        ctx->mainzisegred_large_218631 = clCreateKernel(prog,
                                                        "mainzisegred_large_218631",
                                                        &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegred_large_218631, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.segred_large_218631");
    }
    {
        ctx->mainzisegred_large_218762 = clCreateKernel(prog,
                                                        "mainzisegred_large_218762",
                                                        &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegred_large_218762, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.segred_large_218762");
    }
    {
        ctx->mainzisegred_large_218893 = clCreateKernel(prog,
                                                        "mainzisegred_large_218893",
                                                        &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegred_large_218893, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.segred_large_218893");
    }
    {
        ctx->mainzisegred_large_219515 = clCreateKernel(prog,
                                                        "mainzisegred_large_219515",
                                                        &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegred_large_219515, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.segred_large_219515");
    }
    {
        ctx->mainzisegred_large_219564 = clCreateKernel(prog,
                                                        "mainzisegred_large_219564",
                                                        &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegred_large_219564, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.segred_large_219564");
    }
    {
        ctx->mainzisegred_large_220344 = clCreateKernel(prog,
                                                        "mainzisegred_large_220344",
                                                        &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegred_large_220344, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.segred_large_220344");
    }
    {
        ctx->mainzisegred_large_220413 = clCreateKernel(prog,
                                                        "mainzisegred_large_220413",
                                                        &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegred_large_220413, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.segred_large_220413");
    }
    {
        ctx->mainzisegred_large_221423 = clCreateKernel(prog,
                                                        "mainzisegred_large_221423",
                                                        &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegred_large_221423, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.segred_large_221423");
    }
    {
        ctx->mainzisegred_large_221521 = clCreateKernel(prog,
                                                        "mainzisegred_large_221521",
                                                        &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegred_large_221521, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.segred_large_221521");
    }
    {
        ctx->mainzisegred_large_223197 = clCreateKernel(prog,
                                                        "mainzisegred_large_223197",
                                                        &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegred_large_223197, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.segred_large_223197");
    }
    {
        ctx->mainzisegred_large_223249 = clCreateKernel(prog,
                                                        "mainzisegred_large_223249",
                                                        &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegred_large_223249, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.segred_large_223249");
    }
    {
        ctx->mainzisegred_large_224235 = clCreateKernel(prog,
                                                        "mainzisegred_large_224235",
                                                        &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegred_large_224235, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.segred_large_224235");
    }
    {
        ctx->mainzisegred_large_224307 = clCreateKernel(prog,
                                                        "mainzisegred_large_224307",
                                                        &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegred_large_224307, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.segred_large_224307");
    }
    {
        ctx->mainzisegred_large_225523 = clCreateKernel(prog,
                                                        "mainzisegred_large_225523",
                                                        &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegred_large_225523, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.segred_large_225523");
    }
    {
        ctx->mainzisegred_large_225624 = clCreateKernel(prog,
                                                        "mainzisegred_large_225624",
                                                        &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegred_large_225624, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.segred_large_225624");
    }
    {
        ctx->mainzisegred_large_228090 = clCreateKernel(prog,
                                                        "mainzisegred_large_228090",
                                                        &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegred_large_228090, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.segred_large_228090");
    }
    {
        ctx->mainzisegred_small_212003 = clCreateKernel(prog,
                                                        "mainzisegred_small_212003",
                                                        &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegred_small_212003, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.segred_small_212003");
    }
    {
        ctx->mainzisegred_small_212077 = clCreateKernel(prog,
                                                        "mainzisegred_small_212077",
                                                        &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegred_small_212077, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.segred_small_212077");
    }
    {
        ctx->mainzisegred_small_214137 = clCreateKernel(prog,
                                                        "mainzisegred_small_214137",
                                                        &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegred_small_214137, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.segred_small_214137");
    }
    {
        ctx->mainzisegred_small_214231 = clCreateKernel(prog,
                                                        "mainzisegred_small_214231",
                                                        &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegred_small_214231, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.segred_small_214231");
    }
    {
        ctx->mainzisegred_small_216784 = clCreateKernel(prog,
                                                        "mainzisegred_small_216784",
                                                        &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegred_small_216784, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.segred_small_216784");
    }
    {
        ctx->mainzisegred_small_216907 = clCreateKernel(prog,
                                                        "mainzisegred_small_216907",
                                                        &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegred_small_216907, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.segred_small_216907");
    }
    {
        ctx->mainzisegred_small_218631 = clCreateKernel(prog,
                                                        "mainzisegred_small_218631",
                                                        &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegred_small_218631, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.segred_small_218631");
    }
    {
        ctx->mainzisegred_small_218762 = clCreateKernel(prog,
                                                        "mainzisegred_small_218762",
                                                        &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegred_small_218762, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.segred_small_218762");
    }
    {
        ctx->mainzisegred_small_218893 = clCreateKernel(prog,
                                                        "mainzisegred_small_218893",
                                                        &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegred_small_218893, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.segred_small_218893");
    }
    {
        ctx->mainzisegred_small_219515 = clCreateKernel(prog,
                                                        "mainzisegred_small_219515",
                                                        &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegred_small_219515, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.segred_small_219515");
    }
    {
        ctx->mainzisegred_small_219564 = clCreateKernel(prog,
                                                        "mainzisegred_small_219564",
                                                        &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegred_small_219564, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.segred_small_219564");
    }
    {
        ctx->mainzisegred_small_220344 = clCreateKernel(prog,
                                                        "mainzisegred_small_220344",
                                                        &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegred_small_220344, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.segred_small_220344");
    }
    {
        ctx->mainzisegred_small_220413 = clCreateKernel(prog,
                                                        "mainzisegred_small_220413",
                                                        &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegred_small_220413, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.segred_small_220413");
    }
    {
        ctx->mainzisegred_small_221423 = clCreateKernel(prog,
                                                        "mainzisegred_small_221423",
                                                        &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegred_small_221423, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.segred_small_221423");
    }
    {
        ctx->mainzisegred_small_221521 = clCreateKernel(prog,
                                                        "mainzisegred_small_221521",
                                                        &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegred_small_221521, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.segred_small_221521");
    }
    {
        ctx->mainzisegred_small_223197 = clCreateKernel(prog,
                                                        "mainzisegred_small_223197",
                                                        &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegred_small_223197, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.segred_small_223197");
    }
    {
        ctx->mainzisegred_small_223249 = clCreateKernel(prog,
                                                        "mainzisegred_small_223249",
                                                        &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegred_small_223249, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.segred_small_223249");
    }
    {
        ctx->mainzisegred_small_224235 = clCreateKernel(prog,
                                                        "mainzisegred_small_224235",
                                                        &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegred_small_224235, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.segred_small_224235");
    }
    {
        ctx->mainzisegred_small_224307 = clCreateKernel(prog,
                                                        "mainzisegred_small_224307",
                                                        &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegred_small_224307, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.segred_small_224307");
    }
    {
        ctx->mainzisegred_small_225523 = clCreateKernel(prog,
                                                        "mainzisegred_small_225523",
                                                        &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegred_small_225523, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.segred_small_225523");
    }
    {
        ctx->mainzisegred_small_225624 = clCreateKernel(prog,
                                                        "mainzisegred_small_225624",
                                                        &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegred_small_225624, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.segred_small_225624");
    }
    {
        ctx->mainzisegred_small_228090 = clCreateKernel(prog,
                                                        "mainzisegred_small_228090",
                                                        &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegred_small_228090, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.segred_small_228090");
    }
    {
        cl_int success;
        
        ctx->mainzicounter_mem_233055.references = NULL;
        ctx->mainzicounter_mem_233055.size = 0;
        ctx->mainzicounter_mem_233055.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_233055.mem,
                                                          CL_TRUE, 0, 10240 *
                                                          sizeof(int32_t),
                                                          mainzicounter_mem_realtype_236933,
                                                          0, NULL, NULL));
    }
    {
        cl_int success;
        
        ctx->mainzicounter_mem_233143.references = NULL;
        ctx->mainzicounter_mem_233143.size = 0;
        ctx->mainzicounter_mem_233143.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_233143.mem,
                                                          CL_TRUE, 0, 10240 *
                                                          sizeof(int32_t),
                                                          mainzicounter_mem_realtype_236949,
                                                          0, NULL, NULL));
    }
    {
        cl_int success;
        
        ctx->mainzicounter_mem_233404.references = NULL;
        ctx->mainzicounter_mem_233404.size = 0;
        ctx->mainzicounter_mem_233404.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_233404.mem,
                                                          CL_TRUE, 0, 10240 *
                                                          sizeof(int32_t),
                                                          mainzicounter_mem_realtype_236985,
                                                          0, NULL, NULL));
    }
    {
        cl_int success;
        
        ctx->mainzicounter_mem_233512.references = NULL;
        ctx->mainzicounter_mem_233512.size = 0;
        ctx->mainzicounter_mem_233512.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_233512.mem,
                                                          CL_TRUE, 0, 10240 *
                                                          sizeof(int32_t),
                                                          mainzicounter_mem_realtype_237001,
                                                          0, NULL, NULL));
    }
    {
        cl_int success;
        
        ctx->mainzicounter_mem_233817.references = NULL;
        ctx->mainzicounter_mem_233817.size = 0;
        ctx->mainzicounter_mem_233817.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_233817.mem,
                                                          CL_TRUE, 0, 10240 *
                                                          sizeof(int32_t),
                                                          mainzicounter_mem_realtype_237037,
                                                          0, NULL, NULL));
    }
    {
        cl_int success;
        
        ctx->mainzicounter_mem_233937.references = NULL;
        ctx->mainzicounter_mem_233937.size = 0;
        ctx->mainzicounter_mem_233937.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_233937.mem,
                                                          CL_TRUE, 0, 10240 *
                                                          sizeof(int32_t),
                                                          mainzicounter_mem_realtype_237053,
                                                          0, NULL, NULL));
    }
    {
        cl_int success;
        
        ctx->mainzicounter_mem_234132.references = NULL;
        ctx->mainzicounter_mem_234132.size = 0;
        ctx->mainzicounter_mem_234132.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_234132.mem,
                                                          CL_TRUE, 0, 10240 *
                                                          sizeof(int32_t),
                                                          mainzicounter_mem_realtype_237094,
                                                          0, NULL, NULL));
    }
    {
        cl_int success;
        
        ctx->mainzicounter_mem_234275.references = NULL;
        ctx->mainzicounter_mem_234275.size = 0;
        ctx->mainzicounter_mem_234275.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_234275.mem,
                                                          CL_TRUE, 0, 10240 *
                                                          sizeof(int32_t),
                                                          mainzicounter_mem_realtype_237125,
                                                          0, NULL, NULL));
    }
    {
        cl_int success;
        
        ctx->mainzicounter_mem_234418.references = NULL;
        ctx->mainzicounter_mem_234418.size = 0;
        ctx->mainzicounter_mem_234418.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_234418.mem,
                                                          CL_TRUE, 0, 10240 *
                                                          sizeof(int32_t),
                                                          mainzicounter_mem_realtype_237156,
                                                          0, NULL, NULL));
    }
    {
        cl_int success;
        
        ctx->mainzicounter_mem_234597.references = NULL;
        ctx->mainzicounter_mem_234597.size = 0;
        ctx->mainzicounter_mem_234597.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_234597.mem,
                                                          CL_TRUE, 0, 10240 *
                                                          sizeof(int32_t),
                                                          mainzicounter_mem_realtype_237197,
                                                          0, NULL, NULL));
    }
    {
        cl_int success;
        
        ctx->mainzicounter_mem_234679.references = NULL;
        ctx->mainzicounter_mem_234679.size = 0;
        ctx->mainzicounter_mem_234679.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_234679.mem,
                                                          CL_TRUE, 0, 10240 *
                                                          sizeof(int32_t),
                                                          mainzicounter_mem_realtype_237213,
                                                          0, NULL, NULL));
    }
    {
        cl_int success;
        
        ctx->mainzicounter_mem_234821.references = NULL;
        ctx->mainzicounter_mem_234821.size = 0;
        ctx->mainzicounter_mem_234821.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_234821.mem,
                                                          CL_TRUE, 0, 10240 *
                                                          sizeof(int32_t),
                                                          mainzicounter_mem_realtype_237239,
                                                          0, NULL, NULL));
    }
    {
        cl_int success;
        
        ctx->mainzicounter_mem_234923.references = NULL;
        ctx->mainzicounter_mem_234923.size = 0;
        ctx->mainzicounter_mem_234923.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_234923.mem,
                                                          CL_TRUE, 0, 10240 *
                                                          sizeof(int32_t),
                                                          mainzicounter_mem_realtype_237255,
                                                          0, NULL, NULL));
    }
    {
        cl_int success;
        
        ctx->mainzicounter_mem_235091.references = NULL;
        ctx->mainzicounter_mem_235091.size = 0;
        ctx->mainzicounter_mem_235091.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_235091.mem,
                                                          CL_TRUE, 0, 10240 *
                                                          sizeof(int32_t),
                                                          mainzicounter_mem_realtype_237281,
                                                          0, NULL, NULL));
    }
    {
        cl_int success;
        
        ctx->mainzicounter_mem_235205.references = NULL;
        ctx->mainzicounter_mem_235205.size = 0;
        ctx->mainzicounter_mem_235205.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_235205.mem,
                                                          CL_TRUE, 0, 10240 *
                                                          sizeof(int32_t),
                                                          mainzicounter_mem_realtype_237297,
                                                          0, NULL, NULL));
    }
    {
        cl_int success;
        
        ctx->mainzicounter_mem_235447.references = NULL;
        ctx->mainzicounter_mem_235447.size = 0;
        ctx->mainzicounter_mem_235447.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_235447.mem,
                                                          CL_TRUE, 0, 10240 *
                                                          sizeof(int32_t),
                                                          mainzicounter_mem_realtype_237358,
                                                          0, NULL, NULL));
    }
    {
        cl_int success;
        
        ctx->mainzicounter_mem_235529.references = NULL;
        ctx->mainzicounter_mem_235529.size = 0;
        ctx->mainzicounter_mem_235529.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_235529.mem,
                                                          CL_TRUE, 0, 10240 *
                                                          sizeof(int32_t),
                                                          mainzicounter_mem_realtype_237374,
                                                          0, NULL, NULL));
    }
    {
        cl_int success;
        
        ctx->mainzicounter_mem_235694.references = NULL;
        ctx->mainzicounter_mem_235694.size = 0;
        ctx->mainzicounter_mem_235694.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_235694.mem,
                                                          CL_TRUE, 0, 10240 *
                                                          sizeof(int32_t),
                                                          mainzicounter_mem_realtype_237410,
                                                          0, NULL, NULL));
    }
    {
        cl_int success;
        
        ctx->mainzicounter_mem_235796.references = NULL;
        ctx->mainzicounter_mem_235796.size = 0;
        ctx->mainzicounter_mem_235796.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_235796.mem,
                                                          CL_TRUE, 0, 10240 *
                                                          sizeof(int32_t),
                                                          mainzicounter_mem_realtype_237426,
                                                          0, NULL, NULL));
    }
    {
        cl_int success;
        
        ctx->mainzicounter_mem_235987.references = NULL;
        ctx->mainzicounter_mem_235987.size = 0;
        ctx->mainzicounter_mem_235987.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_235987.mem,
                                                          CL_TRUE, 0, 10240 *
                                                          sizeof(int32_t),
                                                          mainzicounter_mem_realtype_237462,
                                                          0, NULL, NULL));
    }
    {
        cl_int success;
        
        ctx->mainzicounter_mem_236101.references = NULL;
        ctx->mainzicounter_mem_236101.size = 0;
        ctx->mainzicounter_mem_236101.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_236101.mem,
                                                          CL_TRUE, 0, 10240 *
                                                          sizeof(int32_t),
                                                          mainzicounter_mem_realtype_237478,
                                                          0, NULL, NULL));
    }
    {
        cl_int success;
        
        ctx->mainzicounter_mem_236612.references = NULL;
        ctx->mainzicounter_mem_236612.size = 0;
        ctx->mainzicounter_mem_236612.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_236612.mem,
                                                          CL_TRUE, 0, 10240 *
                                                          sizeof(int32_t),
                                                          mainzicounter_mem_realtype_237594,
                                                          0, NULL, NULL));
    }
    ctx->tuning_params.builtinzhreplicate_f64zigroup_sizze_232841 =
        &cfg->tuning_params[0];
    ctx->tuning_params.builtinzhreplicate_i64zigroup_sizze_232424 =
        &cfg->tuning_params[1];
    ctx->tuning_params.mainzigroup_sizze_232442 = &cfg->tuning_params[2];
    ctx->tuning_params.mainzigroup_sizze_232601 = &cfg->tuning_params[3];
    ctx->tuning_params.mainzigroup_sizze_234524 = &cfg->tuning_params[4];
    ctx->tuning_params.mainzigroup_sizze_234723 = &cfg->tuning_params[5];
    ctx->tuning_params.mainzigroup_sizze_234973 = &cfg->tuning_params[6];
    ctx->tuning_params.mainzigroup_sizze_235351 = &cfg->tuning_params[7];
    ctx->tuning_params.mainzigroup_sizze_235573 = &cfg->tuning_params[8];
    ctx->tuning_params.mainzigroup_sizze_235846 = &cfg->tuning_params[9];
    ctx->tuning_params.mainzisegmap_group_sizze_206871 =
        &cfg->tuning_params[10];
    ctx->tuning_params.mainzisegmap_group_sizze_206925 =
        &cfg->tuning_params[11];
    ctx->tuning_params.mainzisegmap_group_sizze_207082 =
        &cfg->tuning_params[12];
    ctx->tuning_params.mainzisegmap_group_sizze_207350 =
        &cfg->tuning_params[13];
    ctx->tuning_params.mainzisegmap_group_sizze_208205 =
        &cfg->tuning_params[14];
    ctx->tuning_params.mainzisegmap_group_sizze_208444 =
        &cfg->tuning_params[15];
    ctx->tuning_params.mainzisegmap_group_sizze_208475 =
        &cfg->tuning_params[16];
    ctx->tuning_params.mainzisegmap_group_sizze_209207 =
        &cfg->tuning_params[17];
    ctx->tuning_params.mainzisegmap_group_sizze_209411 =
        &cfg->tuning_params[18];
    ctx->tuning_params.mainzisegmap_group_sizze_209437 =
        &cfg->tuning_params[19];
    ctx->tuning_params.mainzisegmap_group_sizze_209833 =
        &cfg->tuning_params[20];
    ctx->tuning_params.mainzisegmap_group_sizze_210037 =
        &cfg->tuning_params[21];
    ctx->tuning_params.mainzisegmap_group_sizze_210063 =
        &cfg->tuning_params[22];
    ctx->tuning_params.mainzisegmap_group_sizze_210236 =
        &cfg->tuning_params[23];
    ctx->tuning_params.mainzisegmap_group_sizze_210299 =
        &cfg->tuning_params[24];
    ctx->tuning_params.mainzisegmap_group_sizze_210441 =
        &cfg->tuning_params[25];
    ctx->tuning_params.mainzisegmap_group_sizze_210636 =
        &cfg->tuning_params[26];
    ctx->tuning_params.mainzisegmap_group_sizze_210971 =
        &cfg->tuning_params[27];
    ctx->tuning_params.mainzisegmap_group_sizze_211146 =
        &cfg->tuning_params[28];
    ctx->tuning_params.mainzisegmap_group_sizze_211232 =
        &cfg->tuning_params[29];
    ctx->tuning_params.mainzisegmap_group_sizze_212133 =
        &cfg->tuning_params[30];
    ctx->tuning_params.mainzisegmap_group_sizze_212389 =
        &cfg->tuning_params[31];
    ctx->tuning_params.mainzisegmap_group_sizze_212822 =
        &cfg->tuning_params[32];
    ctx->tuning_params.mainzisegmap_group_sizze_213054 =
        &cfg->tuning_params[33];
    ctx->tuning_params.mainzisegmap_group_sizze_213157 =
        &cfg->tuning_params[34];
    ctx->tuning_params.mainzisegmap_group_sizze_214306 =
        &cfg->tuning_params[35];
    ctx->tuning_params.mainzisegmap_group_sizze_214626 =
        &cfg->tuning_params[36];
    ctx->tuning_params.mainzisegmap_group_sizze_215167 =
        &cfg->tuning_params[37];
    ctx->tuning_params.mainzisegmap_group_sizze_215454 =
        &cfg->tuning_params[38];
    ctx->tuning_params.mainzisegmap_group_sizze_215584 =
        &cfg->tuning_params[39];
    ctx->tuning_params.mainzisegmap_group_sizze_218115 =
        &cfg->tuning_params[40];
    ctx->tuning_params.mainzisegmap_group_sizze_218511 =
        &cfg->tuning_params[41];
    ctx->tuning_params.mainzisegmap_group_sizze_218582 =
        &cfg->tuning_params[42];
    ctx->tuning_params.mainzisegmap_group_sizze_218713 =
        &cfg->tuning_params[43];
    ctx->tuning_params.mainzisegmap_group_sizze_218844 =
        &cfg->tuning_params[44];
    ctx->tuning_params.mainzisegmap_group_sizze_218975 =
        &cfg->tuning_params[45];
    ctx->tuning_params.mainzisegmap_group_sizze_219116 =
        &cfg->tuning_params[46];
    ctx->tuning_params.mainzisegmap_group_sizze_219247 =
        &cfg->tuning_params[47];
    ctx->tuning_params.mainzisegmap_group_sizze_219608 =
        &cfg->tuning_params[48];
    ctx->tuning_params.mainzisegmap_group_sizze_219808 =
        &cfg->tuning_params[49];
    ctx->tuning_params.mainzisegmap_group_sizze_219990 =
        &cfg->tuning_params[50];
    ctx->tuning_params.mainzisegmap_group_sizze_220473 =
        &cfg->tuning_params[51];
    ctx->tuning_params.mainzisegmap_group_sizze_220737 =
        &cfg->tuning_params[52];
    ctx->tuning_params.mainzisegmap_group_sizze_220968 =
        &cfg->tuning_params[53];
    ctx->tuning_params.mainzisegmap_group_sizze_222226 =
        &cfg->tuning_params[54];
    ctx->tuning_params.mainzisegmap_group_sizze_222413 =
        &cfg->tuning_params[55];
    ctx->tuning_params.mainzisegmap_group_sizze_222454 =
        &cfg->tuning_params[56];
    ctx->tuning_params.mainzisegmap_group_sizze_222643 =
        &cfg->tuning_params[57];
    ctx->tuning_params.mainzisegmap_group_sizze_222781 =
        &cfg->tuning_params[58];
    ctx->tuning_params.mainzisegmap_group_sizze_222980 =
        &cfg->tuning_params[59];
    ctx->tuning_params.mainzisegmap_group_sizze_223036 =
        &cfg->tuning_params[60];
    ctx->tuning_params.mainzisegmap_group_sizze_223296 =
        &cfg->tuning_params[61];
    ctx->tuning_params.mainzisegmap_group_sizze_223544 =
        &cfg->tuning_params[62];
    ctx->tuning_params.mainzisegmap_group_sizze_223733 =
        &cfg->tuning_params[63];
    ctx->tuning_params.mainzisegmap_group_sizze_223986 =
        &cfg->tuning_params[64];
    ctx->tuning_params.mainzisegmap_group_sizze_224042 =
        &cfg->tuning_params[65];
    ctx->tuning_params.mainzisegmap_group_sizze_224370 =
        &cfg->tuning_params[66];
    ctx->tuning_params.mainzisegmap_group_sizze_224682 =
        &cfg->tuning_params[67];
    ctx->tuning_params.mainzisegmap_group_sizze_224920 =
        &cfg->tuning_params[68];
    ctx->tuning_params.mainzisegmap_group_sizze_225240 =
        &cfg->tuning_params[69];
    ctx->tuning_params.mainzisegmap_group_sizze_225296 =
        &cfg->tuning_params[70];
    ctx->tuning_params.mainzisegmap_group_sizze_225786 =
        &cfg->tuning_params[71];
    ctx->tuning_params.mainzisegmap_group_sizze_225842 =
        &cfg->tuning_params[72];
    ctx->tuning_params.mainzisegmap_group_sizze_226098 =
        &cfg->tuning_params[73];
    ctx->tuning_params.mainzisegmap_group_sizze_226154 =
        &cfg->tuning_params[74];
    ctx->tuning_params.mainzisegmap_group_sizze_226502 =
        &cfg->tuning_params[75];
    ctx->tuning_params.mainzisegmap_group_sizze_226558 =
        &cfg->tuning_params[76];
    ctx->tuning_params.mainzisegmap_group_sizze_226771 =
        &cfg->tuning_params[77];
    ctx->tuning_params.mainzisegmap_group_sizze_227027 =
        &cfg->tuning_params[78];
    ctx->tuning_params.mainzisegmap_group_sizze_227070 =
        &cfg->tuning_params[79];
    ctx->tuning_params.mainzisegmap_group_sizze_227158 =
        &cfg->tuning_params[80];
    ctx->tuning_params.mainzisegmap_group_sizze_227577 =
        &cfg->tuning_params[81];
    ctx->tuning_params.mainzisegmap_group_sizze_228020 =
        &cfg->tuning_params[82];
    ctx->tuning_params.mainzisegmap_group_sizze_228055 =
        &cfg->tuning_params[83];
    ctx->tuning_params.mainzisegmap_group_sizze_228124 =
        &cfg->tuning_params[84];
    ctx->tuning_params.mainzisegmap_group_sizze_228214 =
        &cfg->tuning_params[85];
    ctx->tuning_params.mainzisegmap_num_groups_206873 = &cfg->tuning_params[86];
    ctx->tuning_params.mainzisegmap_num_groups_210443 = &cfg->tuning_params[87];
    ctx->tuning_params.mainzisegmap_num_groups_210638 = &cfg->tuning_params[88];
    ctx->tuning_params.mainzisegmap_num_groups_212135 = &cfg->tuning_params[89];
    ctx->tuning_params.mainzisegmap_num_groups_212391 = &cfg->tuning_params[90];
    ctx->tuning_params.mainzisegmap_num_groups_214308 = &cfg->tuning_params[91];
    ctx->tuning_params.mainzisegmap_num_groups_214628 = &cfg->tuning_params[92];
    ctx->tuning_params.mainzisegmap_num_groups_218977 = &cfg->tuning_params[93];
    ctx->tuning_params.mainzisegmap_num_groups_219610 = &cfg->tuning_params[94];
    ctx->tuning_params.mainzisegmap_num_groups_220475 = &cfg->tuning_params[95];
    ctx->tuning_params.mainzisegmap_num_groups_222456 = &cfg->tuning_params[96];
    ctx->tuning_params.mainzisegmap_num_groups_223298 = &cfg->tuning_params[97];
    ctx->tuning_params.mainzisegmap_num_groups_224372 = &cfg->tuning_params[98];
    ctx->tuning_params.mainzisegmap_num_groups_227160 = &cfg->tuning_params[99];
    ctx->tuning_params.mainzisegmap_num_groups_228216 =
        &cfg->tuning_params[100];
    ctx->tuning_params.mainzisegred_group_sizze_211074 =
        &cfg->tuning_params[101];
    ctx->tuning_params.mainzisegred_group_sizze_211176 =
        &cfg->tuning_params[102];
    ctx->tuning_params.mainzisegred_group_sizze_212960 =
        &cfg->tuning_params[103];
    ctx->tuning_params.mainzisegred_group_sizze_213093 =
        &cfg->tuning_params[104];
    ctx->tuning_params.mainzisegred_group_sizze_215343 =
        &cfg->tuning_params[105];
    ctx->tuning_params.mainzisegred_group_sizze_215512 =
        &cfg->tuning_params[106];
    ctx->tuning_params.mainzisegred_group_sizze_218608 =
        &cfg->tuning_params[107];
    ctx->tuning_params.mainzisegred_group_sizze_218739 =
        &cfg->tuning_params[108];
    ctx->tuning_params.mainzisegred_group_sizze_218870 =
        &cfg->tuning_params[109];
    ctx->tuning_params.mainzisegred_group_sizze_219193 =
        &cfg->tuning_params[110];
    ctx->tuning_params.mainzisegred_group_sizze_219260 =
        &cfg->tuning_params[111];
    ctx->tuning_params.mainzisegred_group_sizze_219918 =
        &cfg->tuning_params[112];
    ctx->tuning_params.mainzisegred_group_sizze_220012 =
        &cfg->tuning_params[113];
    ctx->tuning_params.mainzisegred_group_sizze_220883 =
        &cfg->tuning_params[114];
    ctx->tuning_params.mainzisegred_group_sizze_221009 =
        &cfg->tuning_params[115];
    ctx->tuning_params.mainzisegred_group_sizze_222724 =
        &cfg->tuning_params[116];
    ctx->tuning_params.mainzisegred_group_sizze_222794 =
        &cfg->tuning_params[117];
    ctx->tuning_params.mainzisegred_group_sizze_223658 =
        &cfg->tuning_params[118];
    ctx->tuning_params.mainzisegred_group_sizze_223755 =
        &cfg->tuning_params[119];
    ctx->tuning_params.mainzisegred_group_sizze_224832 =
        &cfg->tuning_params[120];
    ctx->tuning_params.mainzisegred_group_sizze_224961 =
        &cfg->tuning_params[121];
    ctx->tuning_params.mainzisegred_group_sizze_228067 =
        &cfg->tuning_params[122];
    ctx->tuning_params.mainzisegred_num_groups_211076 =
        &cfg->tuning_params[123];
    ctx->tuning_params.mainzisegred_num_groups_211178 =
        &cfg->tuning_params[124];
    ctx->tuning_params.mainzisegred_num_groups_212962 =
        &cfg->tuning_params[125];
    ctx->tuning_params.mainzisegred_num_groups_213095 =
        &cfg->tuning_params[126];
    ctx->tuning_params.mainzisegred_num_groups_215345 =
        &cfg->tuning_params[127];
    ctx->tuning_params.mainzisegred_num_groups_215514 =
        &cfg->tuning_params[128];
    ctx->tuning_params.mainzisegred_num_groups_218610 =
        &cfg->tuning_params[129];
    ctx->tuning_params.mainzisegred_num_groups_218741 =
        &cfg->tuning_params[130];
    ctx->tuning_params.mainzisegred_num_groups_218872 =
        &cfg->tuning_params[131];
    ctx->tuning_params.mainzisegred_num_groups_219195 =
        &cfg->tuning_params[132];
    ctx->tuning_params.mainzisegred_num_groups_219262 =
        &cfg->tuning_params[133];
    ctx->tuning_params.mainzisegred_num_groups_219920 =
        &cfg->tuning_params[134];
    ctx->tuning_params.mainzisegred_num_groups_220014 =
        &cfg->tuning_params[135];
    ctx->tuning_params.mainzisegred_num_groups_220885 =
        &cfg->tuning_params[136];
    ctx->tuning_params.mainzisegred_num_groups_221011 =
        &cfg->tuning_params[137];
    ctx->tuning_params.mainzisegred_num_groups_222726 =
        &cfg->tuning_params[138];
    ctx->tuning_params.mainzisegred_num_groups_222796 =
        &cfg->tuning_params[139];
    ctx->tuning_params.mainzisegred_num_groups_223660 =
        &cfg->tuning_params[140];
    ctx->tuning_params.mainzisegred_num_groups_223757 =
        &cfg->tuning_params[141];
    ctx->tuning_params.mainzisegred_num_groups_224834 =
        &cfg->tuning_params[142];
    ctx->tuning_params.mainzisegred_num_groups_224963 =
        &cfg->tuning_params[143];
    ctx->tuning_params.mainzisegred_num_groups_228069 =
        &cfg->tuning_params[144];
    ctx->tuning_params.mainzisegscan_group_sizze_206861 =
        &cfg->tuning_params[145];
    ctx->tuning_params.mainzisegscan_group_sizze_206981 =
        &cfg->tuning_params[146];
    ctx->tuning_params.mainzisegscan_group_sizze_207419 =
        &cfg->tuning_params[147];
    ctx->tuning_params.mainzisegscan_group_sizze_218641 =
        &cfg->tuning_params[148];
    ctx->tuning_params.mainzisegscan_group_sizze_218772 =
        &cfg->tuning_params[149];
    ctx->tuning_params.mainzisegscan_group_sizze_218903 =
        &cfg->tuning_params[150];
    ctx->tuning_params.mainzisegscan_group_sizze_227625 =
        &cfg->tuning_params[151];
    ctx->tuning_params.mainzisegscan_num_groups_206863 =
        &cfg->tuning_params[152];
    ctx->tuning_params.mainzisegscan_num_groups_206983 =
        &cfg->tuning_params[153];
    ctx->tuning_params.mainzisegscan_num_groups_207421 =
        &cfg->tuning_params[154];
    ctx->tuning_params.mainzisegscan_num_groups_218643 =
        &cfg->tuning_params[155];
    ctx->tuning_params.mainzisegscan_num_groups_218774 =
        &cfg->tuning_params[156];
    ctx->tuning_params.mainzisegscan_num_groups_218905 =
        &cfg->tuning_params[157];
    ctx->tuning_params.mainzisegscan_num_groups_227627 =
        &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_232838));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->builtinzhreplicate_i64zireplicate_232421));
    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_232439));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzicopy_232598));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzicopy_234521));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzicopy_234720));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzicopy_234970));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzicopy_235348));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzicopy_235570));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzicopy_235843));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainziscan_stage1_206867));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainziscan_stage1_207007));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainziscan_stage1_207559));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainziscan_stage1_218683));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainziscan_stage1_218814));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainziscan_stage1_218945));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainziscan_stage1_227915));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainziscan_stage2_206867));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainziscan_stage2_207007));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainziscan_stage2_207559));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainziscan_stage2_218683));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainziscan_stage2_218814));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainziscan_stage2_218945));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainziscan_stage2_227915));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainziscan_stage3_206867));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainziscan_stage3_207007));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainziscan_stage3_207559));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainziscan_stage3_218683));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainziscan_stage3_218814));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainziscan_stage3_218945));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainziscan_stage3_227915));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_206869));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_207045));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_207170));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_207605));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_208818));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_208832));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_208856));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_209466));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_209478));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_209499));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_210092));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_210104));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_210125));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_210267));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_210412));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_210542));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_211682));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_211890));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_211979));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_212051));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_212265));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_213719));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_213994));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_214111));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_214195));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_214470));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_216262));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_216607));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_216756));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_216852));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_218413));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_218562));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_218598));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_218729));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_218860));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_219049));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_219434));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_219551));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_219712));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_220233));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_220390));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_220609));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_221278));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_221479));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_222349));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_222444));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_222551));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_223067));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_223084));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_223112));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_223236));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_223423));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_224073));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_224090));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_224120));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_224284));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_224529));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_225327));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_225344));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_225374));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_225582));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_225873));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_225890));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_226185));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_226202));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_226589));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_226606));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_226894));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_227111));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_227132));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_227261));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_227986));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_228041));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_228103));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_228189));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_228212));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_intragroup_206893));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_intragroup_207248));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_intragroup_207524));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_intragroup_207777));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_intragroup_208681));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_intragroup_209082));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_intragroup_209708));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_intragroup_211768));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_intragroup_213836));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_intragroup_216411));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_intragroup_217183));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_intragroup_217504));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_intragroup_217955));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_intragroup_221669));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_intragroup_221836));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_intragroup_222093));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_intragroup_225917));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_intragroup_226230));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_intragroup_226634));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_intragroup_226984));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_intragroup_227359));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_intragroup_227815));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegred_large_212003));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegred_large_212077));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegred_large_214137));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegred_large_214231));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegred_large_216784));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegred_large_216907));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegred_large_218631));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegred_large_218762));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegred_large_218893));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegred_large_219515));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegred_large_219564));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegred_large_220344));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegred_large_220413));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegred_large_221423));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegred_large_221521));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegred_large_223197));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegred_large_223249));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegred_large_224235));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegred_large_224307));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegred_large_225523));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegred_large_225624));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegred_large_228090));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegred_small_212003));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegred_small_212077));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegred_small_214137));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegred_small_214231));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegred_small_216784));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegred_small_216907));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegred_small_218631));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegred_small_218762));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegred_small_218893));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegred_small_219515));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegred_small_219564));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegred_small_220344));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegred_small_220413));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegred_small_221423));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegred_small_221521));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegred_small_223197));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegred_small_223249));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegred_small_224235));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegred_small_224307));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegred_small_225523));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegred_small_225624));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegred_small_228090));
    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:65-70\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_232838 ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->builtinzhreplicate_f64zireplicate_232838_runs,
                    (long) ctx->builtinzhreplicate_f64zireplicate_232838_total_runtime /
                    (ctx->builtinzhreplicate_f64zireplicate_232838_runs !=
                     0 ? ctx->builtinzhreplicate_f64zireplicate_232838_runs : 1),
                    (long) ctx->builtinzhreplicate_f64zireplicate_232838_total_runtime);
        ctx->total_runtime +=
            ctx->builtinzhreplicate_f64zireplicate_232838_total_runtime;
        ctx->total_runs += ctx->builtinzhreplicate_f64zireplicate_232838_runs;
        str_builder(&builder,
                    "builtin#replicate_i64.replicate_232421 ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->builtinzhreplicate_i64zireplicate_232421_runs,
                    (long) ctx->builtinzhreplicate_i64zireplicate_232421_total_runtime /
                    (ctx->builtinzhreplicate_i64zireplicate_232421_runs !=
                     0 ? ctx->builtinzhreplicate_i64zireplicate_232421_runs : 1),
                    (long) ctx->builtinzhreplicate_i64zireplicate_232421_total_runtime);
        ctx->total_runtime +=
            ctx->builtinzhreplicate_i64zireplicate_232421_total_runtime;
        ctx->total_runs += ctx->builtinzhreplicate_i64zireplicate_232421_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_232439                       ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzicopy_232439_runs,
                    (long) ctx->mainzicopy_232439_total_runtime /
                    (ctx->mainzicopy_232439_runs !=
                     0 ? ctx->mainzicopy_232439_runs : 1),
                    (long) ctx->mainzicopy_232439_total_runtime);
        ctx->total_runtime += ctx->mainzicopy_232439_total_runtime;
        ctx->total_runs += ctx->mainzicopy_232439_runs;
        str_builder(&builder,
                    "main.copy_232598                       ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzicopy_232598_runs,
                    (long) ctx->mainzicopy_232598_total_runtime /
                    (ctx->mainzicopy_232598_runs !=
                     0 ? ctx->mainzicopy_232598_runs : 1),
                    (long) ctx->mainzicopy_232598_total_runtime);
        ctx->total_runtime += ctx->mainzicopy_232598_total_runtime;
        ctx->total_runs += ctx->mainzicopy_232598_runs;
        str_builder(&builder,
                    "main.copy_234521                       ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzicopy_234521_runs,
                    (long) ctx->mainzicopy_234521_total_runtime /
                    (ctx->mainzicopy_234521_runs !=
                     0 ? ctx->mainzicopy_234521_runs : 1),
                    (long) ctx->mainzicopy_234521_total_runtime);
        ctx->total_runtime += ctx->mainzicopy_234521_total_runtime;
        ctx->total_runs += ctx->mainzicopy_234521_runs;
        str_builder(&builder,
                    "main.copy_234720                       ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzicopy_234720_runs,
                    (long) ctx->mainzicopy_234720_total_runtime /
                    (ctx->mainzicopy_234720_runs !=
                     0 ? ctx->mainzicopy_234720_runs : 1),
                    (long) ctx->mainzicopy_234720_total_runtime);
        ctx->total_runtime += ctx->mainzicopy_234720_total_runtime;
        ctx->total_runs += ctx->mainzicopy_234720_runs;
        str_builder(&builder,
                    "main.copy_234970                       ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzicopy_234970_runs,
                    (long) ctx->mainzicopy_234970_total_runtime /
                    (ctx->mainzicopy_234970_runs !=
                     0 ? ctx->mainzicopy_234970_runs : 1),
                    (long) ctx->mainzicopy_234970_total_runtime);
        ctx->total_runtime += ctx->mainzicopy_234970_total_runtime;
        ctx->total_runs += ctx->mainzicopy_234970_runs;
        str_builder(&builder,
                    "main.copy_235348                       ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzicopy_235348_runs,
                    (long) ctx->mainzicopy_235348_total_runtime /
                    (ctx->mainzicopy_235348_runs !=
                     0 ? ctx->mainzicopy_235348_runs : 1),
                    (long) ctx->mainzicopy_235348_total_runtime);
        ctx->total_runtime += ctx->mainzicopy_235348_total_runtime;
        ctx->total_runs += ctx->mainzicopy_235348_runs;
        str_builder(&builder,
                    "main.copy_235570                       ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzicopy_235570_runs,
                    (long) ctx->mainzicopy_235570_total_runtime /
                    (ctx->mainzicopy_235570_runs !=
                     0 ? ctx->mainzicopy_235570_runs : 1),
                    (long) ctx->mainzicopy_235570_total_runtime);
        ctx->total_runtime += ctx->mainzicopy_235570_total_runtime;
        ctx->total_runs += ctx->mainzicopy_235570_runs;
        str_builder(&builder,
                    "main.copy_235843                       ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzicopy_235843_runs,
                    (long) ctx->mainzicopy_235843_total_runtime /
                    (ctx->mainzicopy_235843_runs !=
                     0 ? ctx->mainzicopy_235843_runs : 1),
                    (long) ctx->mainzicopy_235843_total_runtime);
        ctx->total_runtime += ctx->mainzicopy_235843_total_runtime;
        ctx->total_runs += ctx->mainzicopy_235843_runs;
        str_builder(&builder,
                    "main.scan_stage1_206867                ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainziscan_stage1_206867_runs,
                    (long) ctx->mainziscan_stage1_206867_total_runtime /
                    (ctx->mainziscan_stage1_206867_runs !=
                     0 ? ctx->mainziscan_stage1_206867_runs : 1),
                    (long) ctx->mainziscan_stage1_206867_total_runtime);
        ctx->total_runtime += ctx->mainziscan_stage1_206867_total_runtime;
        ctx->total_runs += ctx->mainziscan_stage1_206867_runs;
        str_builder(&builder,
                    "main.scan_stage1_207007                ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainziscan_stage1_207007_runs,
                    (long) ctx->mainziscan_stage1_207007_total_runtime /
                    (ctx->mainziscan_stage1_207007_runs !=
                     0 ? ctx->mainziscan_stage1_207007_runs : 1),
                    (long) ctx->mainziscan_stage1_207007_total_runtime);
        ctx->total_runtime += ctx->mainziscan_stage1_207007_total_runtime;
        ctx->total_runs += ctx->mainziscan_stage1_207007_runs;
        str_builder(&builder,
                    "main.scan_stage1_207559                ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainziscan_stage1_207559_runs,
                    (long) ctx->mainziscan_stage1_207559_total_runtime /
                    (ctx->mainziscan_stage1_207559_runs !=
                     0 ? ctx->mainziscan_stage1_207559_runs : 1),
                    (long) ctx->mainziscan_stage1_207559_total_runtime);
        ctx->total_runtime += ctx->mainziscan_stage1_207559_total_runtime;
        ctx->total_runs += ctx->mainziscan_stage1_207559_runs;
        str_builder(&builder,
                    "main.scan_stage1_218683                ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainziscan_stage1_218683_runs,
                    (long) ctx->mainziscan_stage1_218683_total_runtime /
                    (ctx->mainziscan_stage1_218683_runs !=
                     0 ? ctx->mainziscan_stage1_218683_runs : 1),
                    (long) ctx->mainziscan_stage1_218683_total_runtime);
        ctx->total_runtime += ctx->mainziscan_stage1_218683_total_runtime;
        ctx->total_runs += ctx->mainziscan_stage1_218683_runs;
        str_builder(&builder,
                    "main.scan_stage1_218814                ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainziscan_stage1_218814_runs,
                    (long) ctx->mainziscan_stage1_218814_total_runtime /
                    (ctx->mainziscan_stage1_218814_runs !=
                     0 ? ctx->mainziscan_stage1_218814_runs : 1),
                    (long) ctx->mainziscan_stage1_218814_total_runtime);
        ctx->total_runtime += ctx->mainziscan_stage1_218814_total_runtime;
        ctx->total_runs += ctx->mainziscan_stage1_218814_runs;
        str_builder(&builder,
                    "main.scan_stage1_218945                ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainziscan_stage1_218945_runs,
                    (long) ctx->mainziscan_stage1_218945_total_runtime /
                    (ctx->mainziscan_stage1_218945_runs !=
                     0 ? ctx->mainziscan_stage1_218945_runs : 1),
                    (long) ctx->mainziscan_stage1_218945_total_runtime);
        ctx->total_runtime += ctx->mainziscan_stage1_218945_total_runtime;
        ctx->total_runs += ctx->mainziscan_stage1_218945_runs;
        str_builder(&builder,
                    "main.scan_stage1_227915                ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainziscan_stage1_227915_runs,
                    (long) ctx->mainziscan_stage1_227915_total_runtime /
                    (ctx->mainziscan_stage1_227915_runs !=
                     0 ? ctx->mainziscan_stage1_227915_runs : 1),
                    (long) ctx->mainziscan_stage1_227915_total_runtime);
        ctx->total_runtime += ctx->mainziscan_stage1_227915_total_runtime;
        ctx->total_runs += ctx->mainziscan_stage1_227915_runs;
        str_builder(&builder,
                    "main.scan_stage2_206867                ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainziscan_stage2_206867_runs,
                    (long) ctx->mainziscan_stage2_206867_total_runtime /
                    (ctx->mainziscan_stage2_206867_runs !=
                     0 ? ctx->mainziscan_stage2_206867_runs : 1),
                    (long) ctx->mainziscan_stage2_206867_total_runtime);
        ctx->total_runtime += ctx->mainziscan_stage2_206867_total_runtime;
        ctx->total_runs += ctx->mainziscan_stage2_206867_runs;
        str_builder(&builder,
                    "main.scan_stage2_207007                ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainziscan_stage2_207007_runs,
                    (long) ctx->mainziscan_stage2_207007_total_runtime /
                    (ctx->mainziscan_stage2_207007_runs !=
                     0 ? ctx->mainziscan_stage2_207007_runs : 1),
                    (long) ctx->mainziscan_stage2_207007_total_runtime);
        ctx->total_runtime += ctx->mainziscan_stage2_207007_total_runtime;
        ctx->total_runs += ctx->mainziscan_stage2_207007_runs;
        str_builder(&builder,
                    "main.scan_stage2_207559                ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainziscan_stage2_207559_runs,
                    (long) ctx->mainziscan_stage2_207559_total_runtime /
                    (ctx->mainziscan_stage2_207559_runs !=
                     0 ? ctx->mainziscan_stage2_207559_runs : 1),
                    (long) ctx->mainziscan_stage2_207559_total_runtime);
        ctx->total_runtime += ctx->mainziscan_stage2_207559_total_runtime;
        ctx->total_runs += ctx->mainziscan_stage2_207559_runs;
        str_builder(&builder,
                    "main.scan_stage2_218683                ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainziscan_stage2_218683_runs,
                    (long) ctx->mainziscan_stage2_218683_total_runtime /
                    (ctx->mainziscan_stage2_218683_runs !=
                     0 ? ctx->mainziscan_stage2_218683_runs : 1),
                    (long) ctx->mainziscan_stage2_218683_total_runtime);
        ctx->total_runtime += ctx->mainziscan_stage2_218683_total_runtime;
        ctx->total_runs += ctx->mainziscan_stage2_218683_runs;
        str_builder(&builder,
                    "main.scan_stage2_218814                ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainziscan_stage2_218814_runs,
                    (long) ctx->mainziscan_stage2_218814_total_runtime /
                    (ctx->mainziscan_stage2_218814_runs !=
                     0 ? ctx->mainziscan_stage2_218814_runs : 1),
                    (long) ctx->mainziscan_stage2_218814_total_runtime);
        ctx->total_runtime += ctx->mainziscan_stage2_218814_total_runtime;
        ctx->total_runs += ctx->mainziscan_stage2_218814_runs;
        str_builder(&builder,
                    "main.scan_stage2_218945                ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainziscan_stage2_218945_runs,
                    (long) ctx->mainziscan_stage2_218945_total_runtime /
                    (ctx->mainziscan_stage2_218945_runs !=
                     0 ? ctx->mainziscan_stage2_218945_runs : 1),
                    (long) ctx->mainziscan_stage2_218945_total_runtime);
        ctx->total_runtime += ctx->mainziscan_stage2_218945_total_runtime;
        ctx->total_runs += ctx->mainziscan_stage2_218945_runs;
        str_builder(&builder,
                    "main.scan_stage2_227915                ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainziscan_stage2_227915_runs,
                    (long) ctx->mainziscan_stage2_227915_total_runtime /
                    (ctx->mainziscan_stage2_227915_runs !=
                     0 ? ctx->mainziscan_stage2_227915_runs : 1),
                    (long) ctx->mainziscan_stage2_227915_total_runtime);
        ctx->total_runtime += ctx->mainziscan_stage2_227915_total_runtime;
        ctx->total_runs += ctx->mainziscan_stage2_227915_runs;
        str_builder(&builder,
                    "main.scan_stage3_206867                ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainziscan_stage3_206867_runs,
                    (long) ctx->mainziscan_stage3_206867_total_runtime /
                    (ctx->mainziscan_stage3_206867_runs !=
                     0 ? ctx->mainziscan_stage3_206867_runs : 1),
                    (long) ctx->mainziscan_stage3_206867_total_runtime);
        ctx->total_runtime += ctx->mainziscan_stage3_206867_total_runtime;
        ctx->total_runs += ctx->mainziscan_stage3_206867_runs;
        str_builder(&builder,
                    "main.scan_stage3_207007                ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainziscan_stage3_207007_runs,
                    (long) ctx->mainziscan_stage3_207007_total_runtime /
                    (ctx->mainziscan_stage3_207007_runs !=
                     0 ? ctx->mainziscan_stage3_207007_runs : 1),
                    (long) ctx->mainziscan_stage3_207007_total_runtime);
        ctx->total_runtime += ctx->mainziscan_stage3_207007_total_runtime;
        ctx->total_runs += ctx->mainziscan_stage3_207007_runs;
        str_builder(&builder,
                    "main.scan_stage3_207559                ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainziscan_stage3_207559_runs,
                    (long) ctx->mainziscan_stage3_207559_total_runtime /
                    (ctx->mainziscan_stage3_207559_runs !=
                     0 ? ctx->mainziscan_stage3_207559_runs : 1),
                    (long) ctx->mainziscan_stage3_207559_total_runtime);
        ctx->total_runtime += ctx->mainziscan_stage3_207559_total_runtime;
        ctx->total_runs += ctx->mainziscan_stage3_207559_runs;
        str_builder(&builder,
                    "main.scan_stage3_218683                ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainziscan_stage3_218683_runs,
                    (long) ctx->mainziscan_stage3_218683_total_runtime /
                    (ctx->mainziscan_stage3_218683_runs !=
                     0 ? ctx->mainziscan_stage3_218683_runs : 1),
                    (long) ctx->mainziscan_stage3_218683_total_runtime);
        ctx->total_runtime += ctx->mainziscan_stage3_218683_total_runtime;
        ctx->total_runs += ctx->mainziscan_stage3_218683_runs;
        str_builder(&builder,
                    "main.scan_stage3_218814                ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainziscan_stage3_218814_runs,
                    (long) ctx->mainziscan_stage3_218814_total_runtime /
                    (ctx->mainziscan_stage3_218814_runs !=
                     0 ? ctx->mainziscan_stage3_218814_runs : 1),
                    (long) ctx->mainziscan_stage3_218814_total_runtime);
        ctx->total_runtime += ctx->mainziscan_stage3_218814_total_runtime;
        ctx->total_runs += ctx->mainziscan_stage3_218814_runs;
        str_builder(&builder,
                    "main.scan_stage3_218945                ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainziscan_stage3_218945_runs,
                    (long) ctx->mainziscan_stage3_218945_total_runtime /
                    (ctx->mainziscan_stage3_218945_runs !=
                     0 ? ctx->mainziscan_stage3_218945_runs : 1),
                    (long) ctx->mainziscan_stage3_218945_total_runtime);
        ctx->total_runtime += ctx->mainziscan_stage3_218945_total_runtime;
        ctx->total_runs += ctx->mainziscan_stage3_218945_runs;
        str_builder(&builder,
                    "main.scan_stage3_227915                ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainziscan_stage3_227915_runs,
                    (long) ctx->mainziscan_stage3_227915_total_runtime /
                    (ctx->mainziscan_stage3_227915_runs !=
                     0 ? ctx->mainziscan_stage3_227915_runs : 1),
                    (long) ctx->mainziscan_stage3_227915_total_runtime);
        ctx->total_runtime += ctx->mainziscan_stage3_227915_total_runtime;
        ctx->total_runs += ctx->mainziscan_stage3_227915_runs;
        str_builder(&builder,
                    "main.segmap_206869                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_206869_runs,
                    (long) ctx->mainzisegmap_206869_total_runtime /
                    (ctx->mainzisegmap_206869_runs !=
                     0 ? ctx->mainzisegmap_206869_runs : 1),
                    (long) ctx->mainzisegmap_206869_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_206869_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_206869_runs;
        str_builder(&builder,
                    "main.segmap_207045                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_207045_runs,
                    (long) ctx->mainzisegmap_207045_total_runtime /
                    (ctx->mainzisegmap_207045_runs !=
                     0 ? ctx->mainzisegmap_207045_runs : 1),
                    (long) ctx->mainzisegmap_207045_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_207045_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_207045_runs;
        str_builder(&builder,
                    "main.segmap_207170                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_207170_runs,
                    (long) ctx->mainzisegmap_207170_total_runtime /
                    (ctx->mainzisegmap_207170_runs !=
                     0 ? ctx->mainzisegmap_207170_runs : 1),
                    (long) ctx->mainzisegmap_207170_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_207170_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_207170_runs;
        str_builder(&builder,
                    "main.segmap_207605                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_207605_runs,
                    (long) ctx->mainzisegmap_207605_total_runtime /
                    (ctx->mainzisegmap_207605_runs !=
                     0 ? ctx->mainzisegmap_207605_runs : 1),
                    (long) ctx->mainzisegmap_207605_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_207605_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_207605_runs;
        str_builder(&builder,
                    "main.segmap_208818                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_208818_runs,
                    (long) ctx->mainzisegmap_208818_total_runtime /
                    (ctx->mainzisegmap_208818_runs !=
                     0 ? ctx->mainzisegmap_208818_runs : 1),
                    (long) ctx->mainzisegmap_208818_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_208818_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_208818_runs;
        str_builder(&builder,
                    "main.segmap_208832                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_208832_runs,
                    (long) ctx->mainzisegmap_208832_total_runtime /
                    (ctx->mainzisegmap_208832_runs !=
                     0 ? ctx->mainzisegmap_208832_runs : 1),
                    (long) ctx->mainzisegmap_208832_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_208832_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_208832_runs;
        str_builder(&builder,
                    "main.segmap_208856                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_208856_runs,
                    (long) ctx->mainzisegmap_208856_total_runtime /
                    (ctx->mainzisegmap_208856_runs !=
                     0 ? ctx->mainzisegmap_208856_runs : 1),
                    (long) ctx->mainzisegmap_208856_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_208856_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_208856_runs;
        str_builder(&builder,
                    "main.segmap_209466                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_209466_runs,
                    (long) ctx->mainzisegmap_209466_total_runtime /
                    (ctx->mainzisegmap_209466_runs !=
                     0 ? ctx->mainzisegmap_209466_runs : 1),
                    (long) ctx->mainzisegmap_209466_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_209466_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_209466_runs;
        str_builder(&builder,
                    "main.segmap_209478                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_209478_runs,
                    (long) ctx->mainzisegmap_209478_total_runtime /
                    (ctx->mainzisegmap_209478_runs !=
                     0 ? ctx->mainzisegmap_209478_runs : 1),
                    (long) ctx->mainzisegmap_209478_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_209478_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_209478_runs;
        str_builder(&builder,
                    "main.segmap_209499                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_209499_runs,
                    (long) ctx->mainzisegmap_209499_total_runtime /
                    (ctx->mainzisegmap_209499_runs !=
                     0 ? ctx->mainzisegmap_209499_runs : 1),
                    (long) ctx->mainzisegmap_209499_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_209499_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_209499_runs;
        str_builder(&builder,
                    "main.segmap_210092                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_210092_runs,
                    (long) ctx->mainzisegmap_210092_total_runtime /
                    (ctx->mainzisegmap_210092_runs !=
                     0 ? ctx->mainzisegmap_210092_runs : 1),
                    (long) ctx->mainzisegmap_210092_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_210092_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_210092_runs;
        str_builder(&builder,
                    "main.segmap_210104                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_210104_runs,
                    (long) ctx->mainzisegmap_210104_total_runtime /
                    (ctx->mainzisegmap_210104_runs !=
                     0 ? ctx->mainzisegmap_210104_runs : 1),
                    (long) ctx->mainzisegmap_210104_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_210104_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_210104_runs;
        str_builder(&builder,
                    "main.segmap_210125                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_210125_runs,
                    (long) ctx->mainzisegmap_210125_total_runtime /
                    (ctx->mainzisegmap_210125_runs !=
                     0 ? ctx->mainzisegmap_210125_runs : 1),
                    (long) ctx->mainzisegmap_210125_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_210125_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_210125_runs;
        str_builder(&builder,
                    "main.segmap_210267                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_210267_runs,
                    (long) ctx->mainzisegmap_210267_total_runtime /
                    (ctx->mainzisegmap_210267_runs !=
                     0 ? ctx->mainzisegmap_210267_runs : 1),
                    (long) ctx->mainzisegmap_210267_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_210267_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_210267_runs;
        str_builder(&builder,
                    "main.segmap_210412                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_210412_runs,
                    (long) ctx->mainzisegmap_210412_total_runtime /
                    (ctx->mainzisegmap_210412_runs !=
                     0 ? ctx->mainzisegmap_210412_runs : 1),
                    (long) ctx->mainzisegmap_210412_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_210412_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_210412_runs;
        str_builder(&builder,
                    "main.segmap_210542                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_210542_runs,
                    (long) ctx->mainzisegmap_210542_total_runtime /
                    (ctx->mainzisegmap_210542_runs !=
                     0 ? ctx->mainzisegmap_210542_runs : 1),
                    (long) ctx->mainzisegmap_210542_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_210542_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_210542_runs;
        str_builder(&builder,
                    "main.segmap_211682                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_211682_runs,
                    (long) ctx->mainzisegmap_211682_total_runtime /
                    (ctx->mainzisegmap_211682_runs !=
                     0 ? ctx->mainzisegmap_211682_runs : 1),
                    (long) ctx->mainzisegmap_211682_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_211682_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_211682_runs;
        str_builder(&builder,
                    "main.segmap_211890                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_211890_runs,
                    (long) ctx->mainzisegmap_211890_total_runtime /
                    (ctx->mainzisegmap_211890_runs !=
                     0 ? ctx->mainzisegmap_211890_runs : 1),
                    (long) ctx->mainzisegmap_211890_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_211890_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_211890_runs;
        str_builder(&builder,
                    "main.segmap_211979                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_211979_runs,
                    (long) ctx->mainzisegmap_211979_total_runtime /
                    (ctx->mainzisegmap_211979_runs !=
                     0 ? ctx->mainzisegmap_211979_runs : 1),
                    (long) ctx->mainzisegmap_211979_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_211979_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_211979_runs;
        str_builder(&builder,
                    "main.segmap_212051                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_212051_runs,
                    (long) ctx->mainzisegmap_212051_total_runtime /
                    (ctx->mainzisegmap_212051_runs !=
                     0 ? ctx->mainzisegmap_212051_runs : 1),
                    (long) ctx->mainzisegmap_212051_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_212051_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_212051_runs;
        str_builder(&builder,
                    "main.segmap_212265                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_212265_runs,
                    (long) ctx->mainzisegmap_212265_total_runtime /
                    (ctx->mainzisegmap_212265_runs !=
                     0 ? ctx->mainzisegmap_212265_runs : 1),
                    (long) ctx->mainzisegmap_212265_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_212265_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_212265_runs;
        str_builder(&builder,
                    "main.segmap_213719                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_213719_runs,
                    (long) ctx->mainzisegmap_213719_total_runtime /
                    (ctx->mainzisegmap_213719_runs !=
                     0 ? ctx->mainzisegmap_213719_runs : 1),
                    (long) ctx->mainzisegmap_213719_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_213719_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_213719_runs;
        str_builder(&builder,
                    "main.segmap_213994                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_213994_runs,
                    (long) ctx->mainzisegmap_213994_total_runtime /
                    (ctx->mainzisegmap_213994_runs !=
                     0 ? ctx->mainzisegmap_213994_runs : 1),
                    (long) ctx->mainzisegmap_213994_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_213994_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_213994_runs;
        str_builder(&builder,
                    "main.segmap_214111                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_214111_runs,
                    (long) ctx->mainzisegmap_214111_total_runtime /
                    (ctx->mainzisegmap_214111_runs !=
                     0 ? ctx->mainzisegmap_214111_runs : 1),
                    (long) ctx->mainzisegmap_214111_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_214111_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_214111_runs;
        str_builder(&builder,
                    "main.segmap_214195                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_214195_runs,
                    (long) ctx->mainzisegmap_214195_total_runtime /
                    (ctx->mainzisegmap_214195_runs !=
                     0 ? ctx->mainzisegmap_214195_runs : 1),
                    (long) ctx->mainzisegmap_214195_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_214195_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_214195_runs;
        str_builder(&builder,
                    "main.segmap_214470                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_214470_runs,
                    (long) ctx->mainzisegmap_214470_total_runtime /
                    (ctx->mainzisegmap_214470_runs !=
                     0 ? ctx->mainzisegmap_214470_runs : 1),
                    (long) ctx->mainzisegmap_214470_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_214470_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_214470_runs;
        str_builder(&builder,
                    "main.segmap_216262                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_216262_runs,
                    (long) ctx->mainzisegmap_216262_total_runtime /
                    (ctx->mainzisegmap_216262_runs !=
                     0 ? ctx->mainzisegmap_216262_runs : 1),
                    (long) ctx->mainzisegmap_216262_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_216262_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_216262_runs;
        str_builder(&builder,
                    "main.segmap_216607                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_216607_runs,
                    (long) ctx->mainzisegmap_216607_total_runtime /
                    (ctx->mainzisegmap_216607_runs !=
                     0 ? ctx->mainzisegmap_216607_runs : 1),
                    (long) ctx->mainzisegmap_216607_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_216607_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_216607_runs;
        str_builder(&builder,
                    "main.segmap_216756                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_216756_runs,
                    (long) ctx->mainzisegmap_216756_total_runtime /
                    (ctx->mainzisegmap_216756_runs !=
                     0 ? ctx->mainzisegmap_216756_runs : 1),
                    (long) ctx->mainzisegmap_216756_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_216756_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_216756_runs;
        str_builder(&builder,
                    "main.segmap_216852                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_216852_runs,
                    (long) ctx->mainzisegmap_216852_total_runtime /
                    (ctx->mainzisegmap_216852_runs !=
                     0 ? ctx->mainzisegmap_216852_runs : 1),
                    (long) ctx->mainzisegmap_216852_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_216852_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_216852_runs;
        str_builder(&builder,
                    "main.segmap_218413                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_218413_runs,
                    (long) ctx->mainzisegmap_218413_total_runtime /
                    (ctx->mainzisegmap_218413_runs !=
                     0 ? ctx->mainzisegmap_218413_runs : 1),
                    (long) ctx->mainzisegmap_218413_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_218413_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_218413_runs;
        str_builder(&builder,
                    "main.segmap_218562                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_218562_runs,
                    (long) ctx->mainzisegmap_218562_total_runtime /
                    (ctx->mainzisegmap_218562_runs !=
                     0 ? ctx->mainzisegmap_218562_runs : 1),
                    (long) ctx->mainzisegmap_218562_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_218562_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_218562_runs;
        str_builder(&builder,
                    "main.segmap_218598                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_218598_runs,
                    (long) ctx->mainzisegmap_218598_total_runtime /
                    (ctx->mainzisegmap_218598_runs !=
                     0 ? ctx->mainzisegmap_218598_runs : 1),
                    (long) ctx->mainzisegmap_218598_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_218598_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_218598_runs;
        str_builder(&builder,
                    "main.segmap_218729                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_218729_runs,
                    (long) ctx->mainzisegmap_218729_total_runtime /
                    (ctx->mainzisegmap_218729_runs !=
                     0 ? ctx->mainzisegmap_218729_runs : 1),
                    (long) ctx->mainzisegmap_218729_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_218729_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_218729_runs;
        str_builder(&builder,
                    "main.segmap_218860                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_218860_runs,
                    (long) ctx->mainzisegmap_218860_total_runtime /
                    (ctx->mainzisegmap_218860_runs !=
                     0 ? ctx->mainzisegmap_218860_runs : 1),
                    (long) ctx->mainzisegmap_218860_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_218860_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_218860_runs;
        str_builder(&builder,
                    "main.segmap_219049                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_219049_runs,
                    (long) ctx->mainzisegmap_219049_total_runtime /
                    (ctx->mainzisegmap_219049_runs !=
                     0 ? ctx->mainzisegmap_219049_runs : 1),
                    (long) ctx->mainzisegmap_219049_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_219049_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_219049_runs;
        str_builder(&builder,
                    "main.segmap_219434                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_219434_runs,
                    (long) ctx->mainzisegmap_219434_total_runtime /
                    (ctx->mainzisegmap_219434_runs !=
                     0 ? ctx->mainzisegmap_219434_runs : 1),
                    (long) ctx->mainzisegmap_219434_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_219434_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_219434_runs;
        str_builder(&builder,
                    "main.segmap_219551                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_219551_runs,
                    (long) ctx->mainzisegmap_219551_total_runtime /
                    (ctx->mainzisegmap_219551_runs !=
                     0 ? ctx->mainzisegmap_219551_runs : 1),
                    (long) ctx->mainzisegmap_219551_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_219551_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_219551_runs;
        str_builder(&builder,
                    "main.segmap_219712                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_219712_runs,
                    (long) ctx->mainzisegmap_219712_total_runtime /
                    (ctx->mainzisegmap_219712_runs !=
                     0 ? ctx->mainzisegmap_219712_runs : 1),
                    (long) ctx->mainzisegmap_219712_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_219712_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_219712_runs;
        str_builder(&builder,
                    "main.segmap_220233                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_220233_runs,
                    (long) ctx->mainzisegmap_220233_total_runtime /
                    (ctx->mainzisegmap_220233_runs !=
                     0 ? ctx->mainzisegmap_220233_runs : 1),
                    (long) ctx->mainzisegmap_220233_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_220233_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_220233_runs;
        str_builder(&builder,
                    "main.segmap_220390                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_220390_runs,
                    (long) ctx->mainzisegmap_220390_total_runtime /
                    (ctx->mainzisegmap_220390_runs !=
                     0 ? ctx->mainzisegmap_220390_runs : 1),
                    (long) ctx->mainzisegmap_220390_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_220390_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_220390_runs;
        str_builder(&builder,
                    "main.segmap_220609                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_220609_runs,
                    (long) ctx->mainzisegmap_220609_total_runtime /
                    (ctx->mainzisegmap_220609_runs !=
                     0 ? ctx->mainzisegmap_220609_runs : 1),
                    (long) ctx->mainzisegmap_220609_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_220609_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_220609_runs;
        str_builder(&builder,
                    "main.segmap_221278                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_221278_runs,
                    (long) ctx->mainzisegmap_221278_total_runtime /
                    (ctx->mainzisegmap_221278_runs !=
                     0 ? ctx->mainzisegmap_221278_runs : 1),
                    (long) ctx->mainzisegmap_221278_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_221278_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_221278_runs;
        str_builder(&builder,
                    "main.segmap_221479                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_221479_runs,
                    (long) ctx->mainzisegmap_221479_total_runtime /
                    (ctx->mainzisegmap_221479_runs !=
                     0 ? ctx->mainzisegmap_221479_runs : 1),
                    (long) ctx->mainzisegmap_221479_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_221479_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_221479_runs;
        str_builder(&builder,
                    "main.segmap_222349                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_222349_runs,
                    (long) ctx->mainzisegmap_222349_total_runtime /
                    (ctx->mainzisegmap_222349_runs !=
                     0 ? ctx->mainzisegmap_222349_runs : 1),
                    (long) ctx->mainzisegmap_222349_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_222349_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_222349_runs;
        str_builder(&builder,
                    "main.segmap_222444                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_222444_runs,
                    (long) ctx->mainzisegmap_222444_total_runtime /
                    (ctx->mainzisegmap_222444_runs !=
                     0 ? ctx->mainzisegmap_222444_runs : 1),
                    (long) ctx->mainzisegmap_222444_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_222444_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_222444_runs;
        str_builder(&builder,
                    "main.segmap_222551                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_222551_runs,
                    (long) ctx->mainzisegmap_222551_total_runtime /
                    (ctx->mainzisegmap_222551_runs !=
                     0 ? ctx->mainzisegmap_222551_runs : 1),
                    (long) ctx->mainzisegmap_222551_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_222551_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_222551_runs;
        str_builder(&builder,
                    "main.segmap_223067                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_223067_runs,
                    (long) ctx->mainzisegmap_223067_total_runtime /
                    (ctx->mainzisegmap_223067_runs !=
                     0 ? ctx->mainzisegmap_223067_runs : 1),
                    (long) ctx->mainzisegmap_223067_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_223067_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_223067_runs;
        str_builder(&builder,
                    "main.segmap_223084                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_223084_runs,
                    (long) ctx->mainzisegmap_223084_total_runtime /
                    (ctx->mainzisegmap_223084_runs !=
                     0 ? ctx->mainzisegmap_223084_runs : 1),
                    (long) ctx->mainzisegmap_223084_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_223084_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_223084_runs;
        str_builder(&builder,
                    "main.segmap_223112                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_223112_runs,
                    (long) ctx->mainzisegmap_223112_total_runtime /
                    (ctx->mainzisegmap_223112_runs !=
                     0 ? ctx->mainzisegmap_223112_runs : 1),
                    (long) ctx->mainzisegmap_223112_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_223112_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_223112_runs;
        str_builder(&builder,
                    "main.segmap_223236                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_223236_runs,
                    (long) ctx->mainzisegmap_223236_total_runtime /
                    (ctx->mainzisegmap_223236_runs !=
                     0 ? ctx->mainzisegmap_223236_runs : 1),
                    (long) ctx->mainzisegmap_223236_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_223236_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_223236_runs;
        str_builder(&builder,
                    "main.segmap_223423                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_223423_runs,
                    (long) ctx->mainzisegmap_223423_total_runtime /
                    (ctx->mainzisegmap_223423_runs !=
                     0 ? ctx->mainzisegmap_223423_runs : 1),
                    (long) ctx->mainzisegmap_223423_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_223423_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_223423_runs;
        str_builder(&builder,
                    "main.segmap_224073                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_224073_runs,
                    (long) ctx->mainzisegmap_224073_total_runtime /
                    (ctx->mainzisegmap_224073_runs !=
                     0 ? ctx->mainzisegmap_224073_runs : 1),
                    (long) ctx->mainzisegmap_224073_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_224073_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_224073_runs;
        str_builder(&builder,
                    "main.segmap_224090                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_224090_runs,
                    (long) ctx->mainzisegmap_224090_total_runtime /
                    (ctx->mainzisegmap_224090_runs !=
                     0 ? ctx->mainzisegmap_224090_runs : 1),
                    (long) ctx->mainzisegmap_224090_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_224090_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_224090_runs;
        str_builder(&builder,
                    "main.segmap_224120                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_224120_runs,
                    (long) ctx->mainzisegmap_224120_total_runtime /
                    (ctx->mainzisegmap_224120_runs !=
                     0 ? ctx->mainzisegmap_224120_runs : 1),
                    (long) ctx->mainzisegmap_224120_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_224120_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_224120_runs;
        str_builder(&builder,
                    "main.segmap_224284                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_224284_runs,
                    (long) ctx->mainzisegmap_224284_total_runtime /
                    (ctx->mainzisegmap_224284_runs !=
                     0 ? ctx->mainzisegmap_224284_runs : 1),
                    (long) ctx->mainzisegmap_224284_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_224284_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_224284_runs;
        str_builder(&builder,
                    "main.segmap_224529                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_224529_runs,
                    (long) ctx->mainzisegmap_224529_total_runtime /
                    (ctx->mainzisegmap_224529_runs !=
                     0 ? ctx->mainzisegmap_224529_runs : 1),
                    (long) ctx->mainzisegmap_224529_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_224529_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_224529_runs;
        str_builder(&builder,
                    "main.segmap_225327                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_225327_runs,
                    (long) ctx->mainzisegmap_225327_total_runtime /
                    (ctx->mainzisegmap_225327_runs !=
                     0 ? ctx->mainzisegmap_225327_runs : 1),
                    (long) ctx->mainzisegmap_225327_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_225327_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_225327_runs;
        str_builder(&builder,
                    "main.segmap_225344                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_225344_runs,
                    (long) ctx->mainzisegmap_225344_total_runtime /
                    (ctx->mainzisegmap_225344_runs !=
                     0 ? ctx->mainzisegmap_225344_runs : 1),
                    (long) ctx->mainzisegmap_225344_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_225344_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_225344_runs;
        str_builder(&builder,
                    "main.segmap_225374                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_225374_runs,
                    (long) ctx->mainzisegmap_225374_total_runtime /
                    (ctx->mainzisegmap_225374_runs !=
                     0 ? ctx->mainzisegmap_225374_runs : 1),
                    (long) ctx->mainzisegmap_225374_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_225374_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_225374_runs;
        str_builder(&builder,
                    "main.segmap_225582                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_225582_runs,
                    (long) ctx->mainzisegmap_225582_total_runtime /
                    (ctx->mainzisegmap_225582_runs !=
                     0 ? ctx->mainzisegmap_225582_runs : 1),
                    (long) ctx->mainzisegmap_225582_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_225582_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_225582_runs;
        str_builder(&builder,
                    "main.segmap_225873                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_225873_runs,
                    (long) ctx->mainzisegmap_225873_total_runtime /
                    (ctx->mainzisegmap_225873_runs !=
                     0 ? ctx->mainzisegmap_225873_runs : 1),
                    (long) ctx->mainzisegmap_225873_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_225873_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_225873_runs;
        str_builder(&builder,
                    "main.segmap_225890                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_225890_runs,
                    (long) ctx->mainzisegmap_225890_total_runtime /
                    (ctx->mainzisegmap_225890_runs !=
                     0 ? ctx->mainzisegmap_225890_runs : 1),
                    (long) ctx->mainzisegmap_225890_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_225890_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_225890_runs;
        str_builder(&builder,
                    "main.segmap_226185                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_226185_runs,
                    (long) ctx->mainzisegmap_226185_total_runtime /
                    (ctx->mainzisegmap_226185_runs !=
                     0 ? ctx->mainzisegmap_226185_runs : 1),
                    (long) ctx->mainzisegmap_226185_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_226185_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_226185_runs;
        str_builder(&builder,
                    "main.segmap_226202                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_226202_runs,
                    (long) ctx->mainzisegmap_226202_total_runtime /
                    (ctx->mainzisegmap_226202_runs !=
                     0 ? ctx->mainzisegmap_226202_runs : 1),
                    (long) ctx->mainzisegmap_226202_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_226202_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_226202_runs;
        str_builder(&builder,
                    "main.segmap_226589                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_226589_runs,
                    (long) ctx->mainzisegmap_226589_total_runtime /
                    (ctx->mainzisegmap_226589_runs !=
                     0 ? ctx->mainzisegmap_226589_runs : 1),
                    (long) ctx->mainzisegmap_226589_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_226589_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_226589_runs;
        str_builder(&builder,
                    "main.segmap_226606                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_226606_runs,
                    (long) ctx->mainzisegmap_226606_total_runtime /
                    (ctx->mainzisegmap_226606_runs !=
                     0 ? ctx->mainzisegmap_226606_runs : 1),
                    (long) ctx->mainzisegmap_226606_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_226606_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_226606_runs;
        str_builder(&builder,
                    "main.segmap_226894                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_226894_runs,
                    (long) ctx->mainzisegmap_226894_total_runtime /
                    (ctx->mainzisegmap_226894_runs !=
                     0 ? ctx->mainzisegmap_226894_runs : 1),
                    (long) ctx->mainzisegmap_226894_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_226894_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_226894_runs;
        str_builder(&builder,
                    "main.segmap_227111                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_227111_runs,
                    (long) ctx->mainzisegmap_227111_total_runtime /
                    (ctx->mainzisegmap_227111_runs !=
                     0 ? ctx->mainzisegmap_227111_runs : 1),
                    (long) ctx->mainzisegmap_227111_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_227111_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_227111_runs;
        str_builder(&builder,
                    "main.segmap_227132                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_227132_runs,
                    (long) ctx->mainzisegmap_227132_total_runtime /
                    (ctx->mainzisegmap_227132_runs !=
                     0 ? ctx->mainzisegmap_227132_runs : 1),
                    (long) ctx->mainzisegmap_227132_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_227132_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_227132_runs;
        str_builder(&builder,
                    "main.segmap_227261                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_227261_runs,
                    (long) ctx->mainzisegmap_227261_total_runtime /
                    (ctx->mainzisegmap_227261_runs !=
                     0 ? ctx->mainzisegmap_227261_runs : 1),
                    (long) ctx->mainzisegmap_227261_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_227261_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_227261_runs;
        str_builder(&builder,
                    "main.segmap_227986                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_227986_runs,
                    (long) ctx->mainzisegmap_227986_total_runtime /
                    (ctx->mainzisegmap_227986_runs !=
                     0 ? ctx->mainzisegmap_227986_runs : 1),
                    (long) ctx->mainzisegmap_227986_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_227986_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_227986_runs;
        str_builder(&builder,
                    "main.segmap_228041                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_228041_runs,
                    (long) ctx->mainzisegmap_228041_total_runtime /
                    (ctx->mainzisegmap_228041_runs !=
                     0 ? ctx->mainzisegmap_228041_runs : 1),
                    (long) ctx->mainzisegmap_228041_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_228041_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_228041_runs;
        str_builder(&builder,
                    "main.segmap_228103                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_228103_runs,
                    (long) ctx->mainzisegmap_228103_total_runtime /
                    (ctx->mainzisegmap_228103_runs !=
                     0 ? ctx->mainzisegmap_228103_runs : 1),
                    (long) ctx->mainzisegmap_228103_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_228103_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_228103_runs;
        str_builder(&builder,
                    "main.segmap_228189                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_228189_runs,
                    (long) ctx->mainzisegmap_228189_total_runtime /
                    (ctx->mainzisegmap_228189_runs !=
                     0 ? ctx->mainzisegmap_228189_runs : 1),
                    (long) ctx->mainzisegmap_228189_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_228189_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_228189_runs;
        str_builder(&builder,
                    "main.segmap_228212                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_228212_runs,
                    (long) ctx->mainzisegmap_228212_total_runtime /
                    (ctx->mainzisegmap_228212_runs !=
                     0 ? ctx->mainzisegmap_228212_runs : 1),
                    (long) ctx->mainzisegmap_228212_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_228212_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_228212_runs;
        str_builder(&builder,
                    "main.segmap_intragroup_206893          ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_intragroup_206893_runs,
                    (long) ctx->mainzisegmap_intragroup_206893_total_runtime /
                    (ctx->mainzisegmap_intragroup_206893_runs !=
                     0 ? ctx->mainzisegmap_intragroup_206893_runs : 1),
                    (long) ctx->mainzisegmap_intragroup_206893_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_intragroup_206893_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_intragroup_206893_runs;
        str_builder(&builder,
                    "main.segmap_intragroup_207248          ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_intragroup_207248_runs,
                    (long) ctx->mainzisegmap_intragroup_207248_total_runtime /
                    (ctx->mainzisegmap_intragroup_207248_runs !=
                     0 ? ctx->mainzisegmap_intragroup_207248_runs : 1),
                    (long) ctx->mainzisegmap_intragroup_207248_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_intragroup_207248_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_intragroup_207248_runs;
        str_builder(&builder,
                    "main.segmap_intragroup_207524          ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_intragroup_207524_runs,
                    (long) ctx->mainzisegmap_intragroup_207524_total_runtime /
                    (ctx->mainzisegmap_intragroup_207524_runs !=
                     0 ? ctx->mainzisegmap_intragroup_207524_runs : 1),
                    (long) ctx->mainzisegmap_intragroup_207524_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_intragroup_207524_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_intragroup_207524_runs;
        str_builder(&builder,
                    "main.segmap_intragroup_207777          ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_intragroup_207777_runs,
                    (long) ctx->mainzisegmap_intragroup_207777_total_runtime /
                    (ctx->mainzisegmap_intragroup_207777_runs !=
                     0 ? ctx->mainzisegmap_intragroup_207777_runs : 1),
                    (long) ctx->mainzisegmap_intragroup_207777_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_intragroup_207777_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_intragroup_207777_runs;
        str_builder(&builder,
                    "main.segmap_intragroup_208681          ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_intragroup_208681_runs,
                    (long) ctx->mainzisegmap_intragroup_208681_total_runtime /
                    (ctx->mainzisegmap_intragroup_208681_runs !=
                     0 ? ctx->mainzisegmap_intragroup_208681_runs : 1),
                    (long) ctx->mainzisegmap_intragroup_208681_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_intragroup_208681_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_intragroup_208681_runs;
        str_builder(&builder,
                    "main.segmap_intragroup_209082          ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_intragroup_209082_runs,
                    (long) ctx->mainzisegmap_intragroup_209082_total_runtime /
                    (ctx->mainzisegmap_intragroup_209082_runs !=
                     0 ? ctx->mainzisegmap_intragroup_209082_runs : 1),
                    (long) ctx->mainzisegmap_intragroup_209082_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_intragroup_209082_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_intragroup_209082_runs;
        str_builder(&builder,
                    "main.segmap_intragroup_209708          ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_intragroup_209708_runs,
                    (long) ctx->mainzisegmap_intragroup_209708_total_runtime /
                    (ctx->mainzisegmap_intragroup_209708_runs !=
                     0 ? ctx->mainzisegmap_intragroup_209708_runs : 1),
                    (long) ctx->mainzisegmap_intragroup_209708_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_intragroup_209708_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_intragroup_209708_runs;
        str_builder(&builder,
                    "main.segmap_intragroup_211768          ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_intragroup_211768_runs,
                    (long) ctx->mainzisegmap_intragroup_211768_total_runtime /
                    (ctx->mainzisegmap_intragroup_211768_runs !=
                     0 ? ctx->mainzisegmap_intragroup_211768_runs : 1),
                    (long) ctx->mainzisegmap_intragroup_211768_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_intragroup_211768_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_intragroup_211768_runs;
        str_builder(&builder,
                    "main.segmap_intragroup_213836          ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_intragroup_213836_runs,
                    (long) ctx->mainzisegmap_intragroup_213836_total_runtime /
                    (ctx->mainzisegmap_intragroup_213836_runs !=
                     0 ? ctx->mainzisegmap_intragroup_213836_runs : 1),
                    (long) ctx->mainzisegmap_intragroup_213836_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_intragroup_213836_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_intragroup_213836_runs;
        str_builder(&builder,
                    "main.segmap_intragroup_216411          ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_intragroup_216411_runs,
                    (long) ctx->mainzisegmap_intragroup_216411_total_runtime /
                    (ctx->mainzisegmap_intragroup_216411_runs !=
                     0 ? ctx->mainzisegmap_intragroup_216411_runs : 1),
                    (long) ctx->mainzisegmap_intragroup_216411_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_intragroup_216411_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_intragroup_216411_runs;
        str_builder(&builder,
                    "main.segmap_intragroup_217183          ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_intragroup_217183_runs,
                    (long) ctx->mainzisegmap_intragroup_217183_total_runtime /
                    (ctx->mainzisegmap_intragroup_217183_runs !=
                     0 ? ctx->mainzisegmap_intragroup_217183_runs : 1),
                    (long) ctx->mainzisegmap_intragroup_217183_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_intragroup_217183_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_intragroup_217183_runs;
        str_builder(&builder,
                    "main.segmap_intragroup_217504          ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_intragroup_217504_runs,
                    (long) ctx->mainzisegmap_intragroup_217504_total_runtime /
                    (ctx->mainzisegmap_intragroup_217504_runs !=
                     0 ? ctx->mainzisegmap_intragroup_217504_runs : 1),
                    (long) ctx->mainzisegmap_intragroup_217504_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_intragroup_217504_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_intragroup_217504_runs;
        str_builder(&builder,
                    "main.segmap_intragroup_217955          ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_intragroup_217955_runs,
                    (long) ctx->mainzisegmap_intragroup_217955_total_runtime /
                    (ctx->mainzisegmap_intragroup_217955_runs !=
                     0 ? ctx->mainzisegmap_intragroup_217955_runs : 1),
                    (long) ctx->mainzisegmap_intragroup_217955_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_intragroup_217955_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_intragroup_217955_runs;
        str_builder(&builder,
                    "main.segmap_intragroup_221669          ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_intragroup_221669_runs,
                    (long) ctx->mainzisegmap_intragroup_221669_total_runtime /
                    (ctx->mainzisegmap_intragroup_221669_runs !=
                     0 ? ctx->mainzisegmap_intragroup_221669_runs : 1),
                    (long) ctx->mainzisegmap_intragroup_221669_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_intragroup_221669_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_intragroup_221669_runs;
        str_builder(&builder,
                    "main.segmap_intragroup_221836          ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_intragroup_221836_runs,
                    (long) ctx->mainzisegmap_intragroup_221836_total_runtime /
                    (ctx->mainzisegmap_intragroup_221836_runs !=
                     0 ? ctx->mainzisegmap_intragroup_221836_runs : 1),
                    (long) ctx->mainzisegmap_intragroup_221836_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_intragroup_221836_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_intragroup_221836_runs;
        str_builder(&builder,
                    "main.segmap_intragroup_222093          ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_intragroup_222093_runs,
                    (long) ctx->mainzisegmap_intragroup_222093_total_runtime /
                    (ctx->mainzisegmap_intragroup_222093_runs !=
                     0 ? ctx->mainzisegmap_intragroup_222093_runs : 1),
                    (long) ctx->mainzisegmap_intragroup_222093_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_intragroup_222093_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_intragroup_222093_runs;
        str_builder(&builder,
                    "main.segmap_intragroup_225917          ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_intragroup_225917_runs,
                    (long) ctx->mainzisegmap_intragroup_225917_total_runtime /
                    (ctx->mainzisegmap_intragroup_225917_runs !=
                     0 ? ctx->mainzisegmap_intragroup_225917_runs : 1),
                    (long) ctx->mainzisegmap_intragroup_225917_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_intragroup_225917_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_intragroup_225917_runs;
        str_builder(&builder,
                    "main.segmap_intragroup_226230          ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_intragroup_226230_runs,
                    (long) ctx->mainzisegmap_intragroup_226230_total_runtime /
                    (ctx->mainzisegmap_intragroup_226230_runs !=
                     0 ? ctx->mainzisegmap_intragroup_226230_runs : 1),
                    (long) ctx->mainzisegmap_intragroup_226230_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_intragroup_226230_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_intragroup_226230_runs;
        str_builder(&builder,
                    "main.segmap_intragroup_226634          ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_intragroup_226634_runs,
                    (long) ctx->mainzisegmap_intragroup_226634_total_runtime /
                    (ctx->mainzisegmap_intragroup_226634_runs !=
                     0 ? ctx->mainzisegmap_intragroup_226634_runs : 1),
                    (long) ctx->mainzisegmap_intragroup_226634_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_intragroup_226634_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_intragroup_226634_runs;
        str_builder(&builder,
                    "main.segmap_intragroup_226984          ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_intragroup_226984_runs,
                    (long) ctx->mainzisegmap_intragroup_226984_total_runtime /
                    (ctx->mainzisegmap_intragroup_226984_runs !=
                     0 ? ctx->mainzisegmap_intragroup_226984_runs : 1),
                    (long) ctx->mainzisegmap_intragroup_226984_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_intragroup_226984_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_intragroup_226984_runs;
        str_builder(&builder,
                    "main.segmap_intragroup_227359          ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_intragroup_227359_runs,
                    (long) ctx->mainzisegmap_intragroup_227359_total_runtime /
                    (ctx->mainzisegmap_intragroup_227359_runs !=
                     0 ? ctx->mainzisegmap_intragroup_227359_runs : 1),
                    (long) ctx->mainzisegmap_intragroup_227359_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_intragroup_227359_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_intragroup_227359_runs;
        str_builder(&builder,
                    "main.segmap_intragroup_227815          ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_intragroup_227815_runs,
                    (long) ctx->mainzisegmap_intragroup_227815_total_runtime /
                    (ctx->mainzisegmap_intragroup_227815_runs !=
                     0 ? ctx->mainzisegmap_intragroup_227815_runs : 1),
                    (long) ctx->mainzisegmap_intragroup_227815_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_intragroup_227815_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_intragroup_227815_runs;
        str_builder(&builder,
                    "main.segred_large_212003               ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegred_large_212003_runs,
                    (long) ctx->mainzisegred_large_212003_total_runtime /
                    (ctx->mainzisegred_large_212003_runs !=
                     0 ? ctx->mainzisegred_large_212003_runs : 1),
                    (long) ctx->mainzisegred_large_212003_total_runtime);
        ctx->total_runtime += ctx->mainzisegred_large_212003_total_runtime;
        ctx->total_runs += ctx->mainzisegred_large_212003_runs;
        str_builder(&builder,
                    "main.segred_large_212077               ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegred_large_212077_runs,
                    (long) ctx->mainzisegred_large_212077_total_runtime /
                    (ctx->mainzisegred_large_212077_runs !=
                     0 ? ctx->mainzisegred_large_212077_runs : 1),
                    (long) ctx->mainzisegred_large_212077_total_runtime);
        ctx->total_runtime += ctx->mainzisegred_large_212077_total_runtime;
        ctx->total_runs += ctx->mainzisegred_large_212077_runs;
        str_builder(&builder,
                    "main.segred_large_214137               ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegred_large_214137_runs,
                    (long) ctx->mainzisegred_large_214137_total_runtime /
                    (ctx->mainzisegred_large_214137_runs !=
                     0 ? ctx->mainzisegred_large_214137_runs : 1),
                    (long) ctx->mainzisegred_large_214137_total_runtime);
        ctx->total_runtime += ctx->mainzisegred_large_214137_total_runtime;
        ctx->total_runs += ctx->mainzisegred_large_214137_runs;
        str_builder(&builder,
                    "main.segred_large_214231               ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegred_large_214231_runs,
                    (long) ctx->mainzisegred_large_214231_total_runtime /
                    (ctx->mainzisegred_large_214231_runs !=
                     0 ? ctx->mainzisegred_large_214231_runs : 1),
                    (long) ctx->mainzisegred_large_214231_total_runtime);
        ctx->total_runtime += ctx->mainzisegred_large_214231_total_runtime;
        ctx->total_runs += ctx->mainzisegred_large_214231_runs;
        str_builder(&builder,
                    "main.segred_large_216784               ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegred_large_216784_runs,
                    (long) ctx->mainzisegred_large_216784_total_runtime /
                    (ctx->mainzisegred_large_216784_runs !=
                     0 ? ctx->mainzisegred_large_216784_runs : 1),
                    (long) ctx->mainzisegred_large_216784_total_runtime);
        ctx->total_runtime += ctx->mainzisegred_large_216784_total_runtime;
        ctx->total_runs += ctx->mainzisegred_large_216784_runs;
        str_builder(&builder,
                    "main.segred_large_216907               ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegred_large_216907_runs,
                    (long) ctx->mainzisegred_large_216907_total_runtime /
                    (ctx->mainzisegred_large_216907_runs !=
                     0 ? ctx->mainzisegred_large_216907_runs : 1),
                    (long) ctx->mainzisegred_large_216907_total_runtime);
        ctx->total_runtime += ctx->mainzisegred_large_216907_total_runtime;
        ctx->total_runs += ctx->mainzisegred_large_216907_runs;
        str_builder(&builder,
                    "main.segred_large_218631               ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegred_large_218631_runs,
                    (long) ctx->mainzisegred_large_218631_total_runtime /
                    (ctx->mainzisegred_large_218631_runs !=
                     0 ? ctx->mainzisegred_large_218631_runs : 1),
                    (long) ctx->mainzisegred_large_218631_total_runtime);
        ctx->total_runtime += ctx->mainzisegred_large_218631_total_runtime;
        ctx->total_runs += ctx->mainzisegred_large_218631_runs;
        str_builder(&builder,
                    "main.segred_large_218762               ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegred_large_218762_runs,
                    (long) ctx->mainzisegred_large_218762_total_runtime /
                    (ctx->mainzisegred_large_218762_runs !=
                     0 ? ctx->mainzisegred_large_218762_runs : 1),
                    (long) ctx->mainzisegred_large_218762_total_runtime);
        ctx->total_runtime += ctx->mainzisegred_large_218762_total_runtime;
        ctx->total_runs += ctx->mainzisegred_large_218762_runs;
        str_builder(&builder,
                    "main.segred_large_218893               ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegred_large_218893_runs,
                    (long) ctx->mainzisegred_large_218893_total_runtime /
                    (ctx->mainzisegred_large_218893_runs !=
                     0 ? ctx->mainzisegred_large_218893_runs : 1),
                    (long) ctx->mainzisegred_large_218893_total_runtime);
        ctx->total_runtime += ctx->mainzisegred_large_218893_total_runtime;
        ctx->total_runs += ctx->mainzisegred_large_218893_runs;
        str_builder(&builder,
                    "main.segred_large_219515               ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegred_large_219515_runs,
                    (long) ctx->mainzisegred_large_219515_total_runtime /
                    (ctx->mainzisegred_large_219515_runs !=
                     0 ? ctx->mainzisegred_large_219515_runs : 1),
                    (long) ctx->mainzisegred_large_219515_total_runtime);
        ctx->total_runtime += ctx->mainzisegred_large_219515_total_runtime;
        ctx->total_runs += ctx->mainzisegred_large_219515_runs;
        str_builder(&builder,
                    "main.segred_large_219564               ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegred_large_219564_runs,
                    (long) ctx->mainzisegred_large_219564_total_runtime /
                    (ctx->mainzisegred_large_219564_runs !=
                     0 ? ctx->mainzisegred_large_219564_runs : 1),
                    (long) ctx->mainzisegred_large_219564_total_runtime);
        ctx->total_runtime += ctx->mainzisegred_large_219564_total_runtime;
        ctx->total_runs += ctx->mainzisegred_large_219564_runs;
        str_builder(&builder,
                    "main.segred_large_220344               ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegred_large_220344_runs,
                    (long) ctx->mainzisegred_large_220344_total_runtime /
                    (ctx->mainzisegred_large_220344_runs !=
                     0 ? ctx->mainzisegred_large_220344_runs : 1),
                    (long) ctx->mainzisegred_large_220344_total_runtime);
        ctx->total_runtime += ctx->mainzisegred_large_220344_total_runtime;
        ctx->total_runs += ctx->mainzisegred_large_220344_runs;
        str_builder(&builder,
                    "main.segred_large_220413               ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegred_large_220413_runs,
                    (long) ctx->mainzisegred_large_220413_total_runtime /
                    (ctx->mainzisegred_large_220413_runs !=
                     0 ? ctx->mainzisegred_large_220413_runs : 1),
                    (long) ctx->mainzisegred_large_220413_total_runtime);
        ctx->total_runtime += ctx->mainzisegred_large_220413_total_runtime;
        ctx->total_runs += ctx->mainzisegred_large_220413_runs;
        str_builder(&builder,
                    "main.segred_large_221423               ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegred_large_221423_runs,
                    (long) ctx->mainzisegred_large_221423_total_runtime /
                    (ctx->mainzisegred_large_221423_runs !=
                     0 ? ctx->mainzisegred_large_221423_runs : 1),
                    (long) ctx->mainzisegred_large_221423_total_runtime);
        ctx->total_runtime += ctx->mainzisegred_large_221423_total_runtime;
        ctx->total_runs += ctx->mainzisegred_large_221423_runs;
        str_builder(&builder,
                    "main.segred_large_221521               ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegred_large_221521_runs,
                    (long) ctx->mainzisegred_large_221521_total_runtime /
                    (ctx->mainzisegred_large_221521_runs !=
                     0 ? ctx->mainzisegred_large_221521_runs : 1),
                    (long) ctx->mainzisegred_large_221521_total_runtime);
        ctx->total_runtime += ctx->mainzisegred_large_221521_total_runtime;
        ctx->total_runs += ctx->mainzisegred_large_221521_runs;
        str_builder(&builder,
                    "main.segred_large_223197               ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegred_large_223197_runs,
                    (long) ctx->mainzisegred_large_223197_total_runtime /
                    (ctx->mainzisegred_large_223197_runs !=
                     0 ? ctx->mainzisegred_large_223197_runs : 1),
                    (long) ctx->mainzisegred_large_223197_total_runtime);
        ctx->total_runtime += ctx->mainzisegred_large_223197_total_runtime;
        ctx->total_runs += ctx->mainzisegred_large_223197_runs;
        str_builder(&builder,
                    "main.segred_large_223249               ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegred_large_223249_runs,
                    (long) ctx->mainzisegred_large_223249_total_runtime /
                    (ctx->mainzisegred_large_223249_runs !=
                     0 ? ctx->mainzisegred_large_223249_runs : 1),
                    (long) ctx->mainzisegred_large_223249_total_runtime);
        ctx->total_runtime += ctx->mainzisegred_large_223249_total_runtime;
        ctx->total_runs += ctx->mainzisegred_large_223249_runs;
        str_builder(&builder,
                    "main.segred_large_224235               ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegred_large_224235_runs,
                    (long) ctx->mainzisegred_large_224235_total_runtime /
                    (ctx->mainzisegred_large_224235_runs !=
                     0 ? ctx->mainzisegred_large_224235_runs : 1),
                    (long) ctx->mainzisegred_large_224235_total_runtime);
        ctx->total_runtime += ctx->mainzisegred_large_224235_total_runtime;
        ctx->total_runs += ctx->mainzisegred_large_224235_runs;
        str_builder(&builder,
                    "main.segred_large_224307               ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegred_large_224307_runs,
                    (long) ctx->mainzisegred_large_224307_total_runtime /
                    (ctx->mainzisegred_large_224307_runs !=
                     0 ? ctx->mainzisegred_large_224307_runs : 1),
                    (long) ctx->mainzisegred_large_224307_total_runtime);
        ctx->total_runtime += ctx->mainzisegred_large_224307_total_runtime;
        ctx->total_runs += ctx->mainzisegred_large_224307_runs;
        str_builder(&builder,
                    "main.segred_large_225523               ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegred_large_225523_runs,
                    (long) ctx->mainzisegred_large_225523_total_runtime /
                    (ctx->mainzisegred_large_225523_runs !=
                     0 ? ctx->mainzisegred_large_225523_runs : 1),
                    (long) ctx->mainzisegred_large_225523_total_runtime);
        ctx->total_runtime += ctx->mainzisegred_large_225523_total_runtime;
        ctx->total_runs += ctx->mainzisegred_large_225523_runs;
        str_builder(&builder,
                    "main.segred_large_225624               ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegred_large_225624_runs,
                    (long) ctx->mainzisegred_large_225624_total_runtime /
                    (ctx->mainzisegred_large_225624_runs !=
                     0 ? ctx->mainzisegred_large_225624_runs : 1),
                    (long) ctx->mainzisegred_large_225624_total_runtime);
        ctx->total_runtime += ctx->mainzisegred_large_225624_total_runtime;
        ctx->total_runs += ctx->mainzisegred_large_225624_runs;
        str_builder(&builder,
                    "main.segred_large_228090               ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegred_large_228090_runs,
                    (long) ctx->mainzisegred_large_228090_total_runtime /
                    (ctx->mainzisegred_large_228090_runs !=
                     0 ? ctx->mainzisegred_large_228090_runs : 1),
                    (long) ctx->mainzisegred_large_228090_total_runtime);
        ctx->total_runtime += ctx->mainzisegred_large_228090_total_runtime;
        ctx->total_runs += ctx->mainzisegred_large_228090_runs;
        str_builder(&builder,
                    "main.segred_small_212003               ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegred_small_212003_runs,
                    (long) ctx->mainzisegred_small_212003_total_runtime /
                    (ctx->mainzisegred_small_212003_runs !=
                     0 ? ctx->mainzisegred_small_212003_runs : 1),
                    (long) ctx->mainzisegred_small_212003_total_runtime);
        ctx->total_runtime += ctx->mainzisegred_small_212003_total_runtime;
        ctx->total_runs += ctx->mainzisegred_small_212003_runs;
        str_builder(&builder,
                    "main.segred_small_212077               ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegred_small_212077_runs,
                    (long) ctx->mainzisegred_small_212077_total_runtime /
                    (ctx->mainzisegred_small_212077_runs !=
                     0 ? ctx->mainzisegred_small_212077_runs : 1),
                    (long) ctx->mainzisegred_small_212077_total_runtime);
        ctx->total_runtime += ctx->mainzisegred_small_212077_total_runtime;
        ctx->total_runs += ctx->mainzisegred_small_212077_runs;
        str_builder(&builder,
                    "main.segred_small_214137               ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegred_small_214137_runs,
                    (long) ctx->mainzisegred_small_214137_total_runtime /
                    (ctx->mainzisegred_small_214137_runs !=
                     0 ? ctx->mainzisegred_small_214137_runs : 1),
                    (long) ctx->mainzisegred_small_214137_total_runtime);
        ctx->total_runtime += ctx->mainzisegred_small_214137_total_runtime;
        ctx->total_runs += ctx->mainzisegred_small_214137_runs;
        str_builder(&builder,
                    "main.segred_small_214231               ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegred_small_214231_runs,
                    (long) ctx->mainzisegred_small_214231_total_runtime /
                    (ctx->mainzisegred_small_214231_runs !=
                     0 ? ctx->mainzisegred_small_214231_runs : 1),
                    (long) ctx->mainzisegred_small_214231_total_runtime);
        ctx->total_runtime += ctx->mainzisegred_small_214231_total_runtime;
        ctx->total_runs += ctx->mainzisegred_small_214231_runs;
        str_builder(&builder,
                    "main.segred_small_216784               ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegred_small_216784_runs,
                    (long) ctx->mainzisegred_small_216784_total_runtime /
                    (ctx->mainzisegred_small_216784_runs !=
                     0 ? ctx->mainzisegred_small_216784_runs : 1),
                    (long) ctx->mainzisegred_small_216784_total_runtime);
        ctx->total_runtime += ctx->mainzisegred_small_216784_total_runtime;
        ctx->total_runs += ctx->mainzisegred_small_216784_runs;
        str_builder(&builder,
                    "main.segred_small_216907               ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegred_small_216907_runs,
                    (long) ctx->mainzisegred_small_216907_total_runtime /
                    (ctx->mainzisegred_small_216907_runs !=
                     0 ? ctx->mainzisegred_small_216907_runs : 1),
                    (long) ctx->mainzisegred_small_216907_total_runtime);
        ctx->total_runtime += ctx->mainzisegred_small_216907_total_runtime;
        ctx->total_runs += ctx->mainzisegred_small_216907_runs;
        str_builder(&builder,
                    "main.segred_small_218631               ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegred_small_218631_runs,
                    (long) ctx->mainzisegred_small_218631_total_runtime /
                    (ctx->mainzisegred_small_218631_runs !=
                     0 ? ctx->mainzisegred_small_218631_runs : 1),
                    (long) ctx->mainzisegred_small_218631_total_runtime);
        ctx->total_runtime += ctx->mainzisegred_small_218631_total_runtime;
        ctx->total_runs += ctx->mainzisegred_small_218631_runs;
        str_builder(&builder,
                    "main.segred_small_218762               ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegred_small_218762_runs,
                    (long) ctx->mainzisegred_small_218762_total_runtime /
                    (ctx->mainzisegred_small_218762_runs !=
                     0 ? ctx->mainzisegred_small_218762_runs : 1),
                    (long) ctx->mainzisegred_small_218762_total_runtime);
        ctx->total_runtime += ctx->mainzisegred_small_218762_total_runtime;
        ctx->total_runs += ctx->mainzisegred_small_218762_runs;
        str_builder(&builder,
                    "main.segred_small_218893               ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegred_small_218893_runs,
                    (long) ctx->mainzisegred_small_218893_total_runtime /
                    (ctx->mainzisegred_small_218893_runs !=
                     0 ? ctx->mainzisegred_small_218893_runs : 1),
                    (long) ctx->mainzisegred_small_218893_total_runtime);
        ctx->total_runtime += ctx->mainzisegred_small_218893_total_runtime;
        ctx->total_runs += ctx->mainzisegred_small_218893_runs;
        str_builder(&builder,
                    "main.segred_small_219515               ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegred_small_219515_runs,
                    (long) ctx->mainzisegred_small_219515_total_runtime /
                    (ctx->mainzisegred_small_219515_runs !=
                     0 ? ctx->mainzisegred_small_219515_runs : 1),
                    (long) ctx->mainzisegred_small_219515_total_runtime);
        ctx->total_runtime += ctx->mainzisegred_small_219515_total_runtime;
        ctx->total_runs += ctx->mainzisegred_small_219515_runs;
        str_builder(&builder,
                    "main.segred_small_219564               ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegred_small_219564_runs,
                    (long) ctx->mainzisegred_small_219564_total_runtime /
                    (ctx->mainzisegred_small_219564_runs !=
                     0 ? ctx->mainzisegred_small_219564_runs : 1),
                    (long) ctx->mainzisegred_small_219564_total_runtime);
        ctx->total_runtime += ctx->mainzisegred_small_219564_total_runtime;
        ctx->total_runs += ctx->mainzisegred_small_219564_runs;
        str_builder(&builder,
                    "main.segred_small_220344               ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegred_small_220344_runs,
                    (long) ctx->mainzisegred_small_220344_total_runtime /
                    (ctx->mainzisegred_small_220344_runs !=
                     0 ? ctx->mainzisegred_small_220344_runs : 1),
                    (long) ctx->mainzisegred_small_220344_total_runtime);
        ctx->total_runtime += ctx->mainzisegred_small_220344_total_runtime;
        ctx->total_runs += ctx->mainzisegred_small_220344_runs;
        str_builder(&builder,
                    "main.segred_small_220413               ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegred_small_220413_runs,
                    (long) ctx->mainzisegred_small_220413_total_runtime /
                    (ctx->mainzisegred_small_220413_runs !=
                     0 ? ctx->mainzisegred_small_220413_runs : 1),
                    (long) ctx->mainzisegred_small_220413_total_runtime);
        ctx->total_runtime += ctx->mainzisegred_small_220413_total_runtime;
        ctx->total_runs += ctx->mainzisegred_small_220413_runs;
        str_builder(&builder,
                    "main.segred_small_221423               ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegred_small_221423_runs,
                    (long) ctx->mainzisegred_small_221423_total_runtime /
                    (ctx->mainzisegred_small_221423_runs !=
                     0 ? ctx->mainzisegred_small_221423_runs : 1),
                    (long) ctx->mainzisegred_small_221423_total_runtime);
        ctx->total_runtime += ctx->mainzisegred_small_221423_total_runtime;
        ctx->total_runs += ctx->mainzisegred_small_221423_runs;
        str_builder(&builder,
                    "main.segred_small_221521               ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegred_small_221521_runs,
                    (long) ctx->mainzisegred_small_221521_total_runtime /
                    (ctx->mainzisegred_small_221521_runs !=
                     0 ? ctx->mainzisegred_small_221521_runs : 1),
                    (long) ctx->mainzisegred_small_221521_total_runtime);
        ctx->total_runtime += ctx->mainzisegred_small_221521_total_runtime;
        ctx->total_runs += ctx->mainzisegred_small_221521_runs;
        str_builder(&builder,
                    "main.segred_small_223197               ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegred_small_223197_runs,
                    (long) ctx->mainzisegred_small_223197_total_runtime /
                    (ctx->mainzisegred_small_223197_runs !=
                     0 ? ctx->mainzisegred_small_223197_runs : 1),
                    (long) ctx->mainzisegred_small_223197_total_runtime);
        ctx->total_runtime += ctx->mainzisegred_small_223197_total_runtime;
        ctx->total_runs += ctx->mainzisegred_small_223197_runs;
        str_builder(&builder,
                    "main.segred_small_223249               ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegred_small_223249_runs,
                    (long) ctx->mainzisegred_small_223249_total_runtime /
                    (ctx->mainzisegred_small_223249_runs !=
                     0 ? ctx->mainzisegred_small_223249_runs : 1),
                    (long) ctx->mainzisegred_small_223249_total_runtime);
        ctx->total_runtime += ctx->mainzisegred_small_223249_total_runtime;
        ctx->total_runs += ctx->mainzisegred_small_223249_runs;
        str_builder(&builder,
                    "main.segred_small_224235               ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegred_small_224235_runs,
                    (long) ctx->mainzisegred_small_224235_total_runtime /
                    (ctx->mainzisegred_small_224235_runs !=
                     0 ? ctx->mainzisegred_small_224235_runs : 1),
                    (long) ctx->mainzisegred_small_224235_total_runtime);
        ctx->total_runtime += ctx->mainzisegred_small_224235_total_runtime;
        ctx->total_runs += ctx->mainzisegred_small_224235_runs;
        str_builder(&builder,
                    "main.segred_small_224307               ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegred_small_224307_runs,
                    (long) ctx->mainzisegred_small_224307_total_runtime /
                    (ctx->mainzisegred_small_224307_runs !=
                     0 ? ctx->mainzisegred_small_224307_runs : 1),
                    (long) ctx->mainzisegred_small_224307_total_runtime);
        ctx->total_runtime += ctx->mainzisegred_small_224307_total_runtime;
        ctx->total_runs += ctx->mainzisegred_small_224307_runs;
        str_builder(&builder,
                    "main.segred_small_225523               ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegred_small_225523_runs,
                    (long) ctx->mainzisegred_small_225523_total_runtime /
                    (ctx->mainzisegred_small_225523_runs !=
                     0 ? ctx->mainzisegred_small_225523_runs : 1),
                    (long) ctx->mainzisegred_small_225523_total_runtime);
        ctx->total_runtime += ctx->mainzisegred_small_225523_total_runtime;
        ctx->total_runs += ctx->mainzisegred_small_225523_runs;
        str_builder(&builder,
                    "main.segred_small_225624               ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegred_small_225624_runs,
                    (long) ctx->mainzisegred_small_225624_total_runtime /
                    (ctx->mainzisegred_small_225624_runs !=
                     0 ? ctx->mainzisegred_small_225624_runs : 1),
                    (long) ctx->mainzisegred_small_225624_total_runtime);
        ctx->total_runtime += ctx->mainzisegred_small_225624_total_runtime;
        ctx->total_runs += ctx->mainzisegred_small_225624_runs;
        str_builder(&builder,
                    "main.segred_small_228090               ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegred_small_228090_runs,
                    (long) ctx->mainzisegred_small_228090_total_runtime /
                    (ctx->mainzisegred_small_228090_runs !=
                     0 ? ctx->mainzisegred_small_228090_runs : 1),
                    (long) ctx->mainzisegred_small_228090_total_runtime);
        ctx->total_runtime += ctx->mainzisegred_small_228090_total_runtime;
        ctx->total_runs += ctx->mainzisegred_small_228090_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_232834,
                                         int32_t num_elems_232835,
                                         double val_232836);
static int futrts_builtinzhreplicate_i64(struct futhark_context *ctx,
                                         struct memblock_device mem_232417,
                                         int32_t num_elems_232418,
                                         int64_t val_232419);
static int futrts_entry_main(struct futhark_context *ctx,
                             struct memblock_device *mem_out_p_236734,
                             struct memblock_device *mem_out_p_236735,
                             struct memblock_device *mem_out_p_236736,
                             struct memblock_device Y_mem_229145,
                             int64_t m_203489, int64_t n_203490,
                             int64_t n_p_203492, int64_t q_s_203493,
                             int64_t q_t_203494, int64_t q_l_203495,
                             int64_t d_s_203496, int64_t d_t_203497,
                             int64_t d_l_203498, int64_t jump_s_203499,
                             int64_t jump_t_203500, int64_t jump_l_203501,
                             int64_t n_inner_203502, int64_t n_outer_203503,
                             int64_t jump_threshold_203504,
                             int64_t q_threshold_203505);

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_236684[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_236688[3] = {(size_t) 16,
                                                               (size_t) 16,
                                                               (size_t) 1};
                    int64_t time_start_236685 = 0, time_end_236686 = 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_236684[0],
                                global_work_sizze_236684[1],
                                global_work_sizze_236684[2],
                                local_work_sizze_236688[0],
                                local_work_sizze_236688[1],
                                local_work_sizze_236688[2], (int) (0 +
                                                                   (int64_t) 2176));
                        time_start_236685 = get_wall_time();
                    }
                    OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                    ctx->gpu_map_transpose_f64_low_width,
                                                                    3, NULL,
                                                                    global_work_sizze_236684,
                                                                    local_work_sizze_236688,
                                                                    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_236686 = get_wall_time();
                        
                        long time_diff_236687 = time_end_236686 -
                             time_start_236685;
                        
                        fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                                "gpu_map_transpose_f64_low_width",
                                time_diff_236687);
                    }
                }
            } 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_236689[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_236693[3] = {(size_t) 16,
                                                                   (size_t) 16,
                                                                   (size_t) 1};
                        int64_t time_start_236690 = 0, time_end_236691 = 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_236689[0],
                                    global_work_sizze_236689[1],
                                    global_work_sizze_236689[2],
                                    local_work_sizze_236693[0],
                                    local_work_sizze_236693[1],
                                    local_work_sizze_236693[2], (int) (0 +
                                                                       (int64_t) 2176));
                            time_start_236690 = get_wall_time();
                        }
                        OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                        ctx->gpu_map_transpose_f64_low_height,
                                                                        3, NULL,
                                                                        global_work_sizze_236689,
                                                                        local_work_sizze_236693,
                                                                        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_236691 = get_wall_time();
                            
                            long time_diff_236692 = time_end_236691 -
                                 time_start_236690;
                            
                            fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                                    "gpu_map_transpose_f64_low_height",
                                    time_diff_236692);
                        }
                    }
                } 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_236694[1] =
                                         {(size_t) sdiv_up32(num_arrays_4 *
                                                             x_elems_5 *
                                                             y_elems_6, 256) *
                                         (size_t) 256};
                            const size_t local_work_sizze_236698[1] =
                                         {(size_t) 256};
                            int64_t time_start_236695 = 0, time_end_236696 = 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_236694[0],
                                        local_work_sizze_236698[0], (int) (0 +
                                                                           (int64_t) 1));
                                time_start_236695 = get_wall_time();
                            }
                            OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                            ctx->gpu_map_transpose_f64_small,
                                                                            1,
                                                                            NULL,
                                                                            global_work_sizze_236694,
                                                                            local_work_sizze_236698,
                                                                            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_236696 = get_wall_time();
                                
                                long time_diff_236697 = time_end_236696 -
                                     time_start_236695;
                                
                                fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                                        "gpu_map_transpose_f64_small",
                                        time_diff_236697);
                            }
                        }
                    } 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_236699[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_236703[3] =
                                         {(size_t) 32, (size_t) 8, (size_t) 1};
                            int64_t time_start_236700 = 0, time_end_236701 = 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_236699[0],
                                        global_work_sizze_236699[1],
                                        global_work_sizze_236699[2],
                                        local_work_sizze_236703[0],
                                        local_work_sizze_236703[1],
                                        local_work_sizze_236703[2], (int) (0 +
                                                                           (int64_t) 8448));
                                time_start_236700 = get_wall_time();
                            }
                            OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                            ctx->gpu_map_transpose_f64,
                                                                            3,
                                                                            NULL,
                                                                            global_work_sizze_236699,
                                                                            local_work_sizze_236703,
                                                                            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_236701 = get_wall_time();
                                
                                long time_diff_236702 = time_end_236701 -
                                     time_start_236700;
                                
                                fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                                        "gpu_map_transpose_f64",
                                        time_diff_236702);
                            }
                        }
                    }
                }
            }
        }
    }
    
  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_236704[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_236708[3] = {(size_t) 16,
                                                               (size_t) 16,
                                                               (size_t) 1};
                    int64_t time_start_236705 = 0, time_end_236706 = 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_236704[0],
                                global_work_sizze_236704[1],
                                global_work_sizze_236704[2],
                                local_work_sizze_236708[0],
                                local_work_sizze_236708[1],
                                local_work_sizze_236708[2], (int) (0 +
                                                                   (int64_t) 2176));
                        time_start_236705 = get_wall_time();
                    }
                    OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                    ctx->gpu_map_transpose_i64_low_width,
                                                                    3, NULL,
                                                                    global_work_sizze_236704,
                                                                    local_work_sizze_236708,
                                                                    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_236706 = get_wall_time();
                        
                        long time_diff_236707 = time_end_236706 -
                             time_start_236705;
                        
                        fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                                "gpu_map_transpose_i64_low_width",
                                time_diff_236707);
                    }
                }
            } 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_236709[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_236713[3] = {(size_t) 16,
                                                                   (size_t) 16,
                                                                   (size_t) 1};
                        int64_t time_start_236710 = 0, time_end_236711 = 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_236709[0],
                                    global_work_sizze_236709[1],
                                    global_work_sizze_236709[2],
                                    local_work_sizze_236713[0],
                                    local_work_sizze_236713[1],
                                    local_work_sizze_236713[2], (int) (0 +
                                                                       (int64_t) 2176));
                            time_start_236710 = get_wall_time();
                        }
                        OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                        ctx->gpu_map_transpose_i64_low_height,
                                                                        3, NULL,
                                                                        global_work_sizze_236709,
                                                                        local_work_sizze_236713,
                                                                        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_236711 = get_wall_time();
                            
                            long time_diff_236712 = time_end_236711 -
                                 time_start_236710;
                            
                            fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                                    "gpu_map_transpose_i64_low_height",
                                    time_diff_236712);
                        }
                    }
                } 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_236714[1] =
                                         {(size_t) sdiv_up32(num_arrays_4 *
                                                             x_elems_5 *
                                                             y_elems_6, 256) *
                                         (size_t) 256};
                            const size_t local_work_sizze_236718[1] =
                                         {(size_t) 256};
                            int64_t time_start_236715 = 0, time_end_236716 = 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_236714[0],
                                        local_work_sizze_236718[0], (int) (0 +
                                                                           (int64_t) 1));
                                time_start_236715 = get_wall_time();
                            }
                            OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                            ctx->gpu_map_transpose_i64_small,
                                                                            1,
                                                                            NULL,
                                                                            global_work_sizze_236714,
                                                                            local_work_sizze_236718,
                                                                            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_236716 = get_wall_time();
                                
                                long time_diff_236717 = time_end_236716 -
                                     time_start_236715;
                                
                                fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                                        "gpu_map_transpose_i64_small",
                                        time_diff_236717);
                            }
                        }
                    } 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_236719[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_236723[3] =
                                         {(size_t) 32, (size_t) 8, (size_t) 1};
                            int64_t time_start_236720 = 0, time_end_236721 = 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_236719[0],
                                        global_work_sizze_236719[1],
                                        global_work_sizze_236719[2],
                                        local_work_sizze_236723[0],
                                        local_work_sizze_236723[1],
                                        local_work_sizze_236723[2], (int) (0 +
                                                                           (int64_t) 8448));
                                time_start_236720 = get_wall_time();
                            }
                            OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                            ctx->gpu_map_transpose_i64,
                                                                            3,
                                                                            NULL,
                                                                            global_work_sizze_236719,
                                                                            local_work_sizze_236723,
                                                                            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_236721 = get_wall_time();
                                
                                long time_diff_236722 = time_end_236721 -
                                     time_start_236720;
                                
                                fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                                        "gpu_map_transpose_i64",
                                        time_diff_236722);
                            }
                        }
                    }
                }
            }
        }
    }
    
  cleanup:
    { }
    return err;
}
static int futrts_builtinzhreplicate_f64(struct futhark_context *ctx,
                                         struct memblock_device mem_232834,
                                         int32_t num_elems_232835,
                                         double val_232836)
{
    (void) ctx;
    
    int err = 0;
    int64_t group_sizze_232841;
    
    group_sizze_232841 =
        *ctx->tuning_params.builtinzhreplicate_f64zigroup_sizze_232841;
    
    int64_t num_groups_232842 = sdiv_up64(num_elems_232835, group_sizze_232841);
    
    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->builtinzhreplicate_f64zireplicate_232838,
                                            0, sizeof(num_elems_232835),
                                            &num_elems_232835));
    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->builtinzhreplicate_f64zireplicate_232838,
                                            1, sizeof(val_232836),
                                            &val_232836));
    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->builtinzhreplicate_f64zireplicate_232838,
                                            2, sizeof(mem_232834.mem),
                                            &mem_232834.mem));
    if (1 * ((size_t) num_groups_232842 * (size_t) group_sizze_232841) != 0) {
        const size_t global_work_sizze_236724[1] = {(size_t) num_groups_232842 *
                     (size_t) group_sizze_232841};
        const size_t local_work_sizze_236728[1] = {(size_t) group_sizze_232841};
        int64_t time_start_236725 = 0, time_end_236726 = 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_232838",
                    global_work_sizze_236724[0], local_work_sizze_236728[0],
                    (int) 0);
            time_start_236725 = get_wall_time();
        }
        OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                        ctx->builtinzhreplicate_f64zireplicate_232838,
                                                        1, NULL,
                                                        global_work_sizze_236724,
                                                        local_work_sizze_236728,
                                                        0, NULL,
                                                        ctx->profiling_paused ||
                                                        !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                  &ctx->builtinzhreplicate_f64zireplicate_232838_runs,
                                                                                                  &ctx->builtinzhreplicate_f64zireplicate_232838_total_runtime)));
        if (ctx->debugging) {
            OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
            time_end_236726 = get_wall_time();
            
            long time_diff_236727 = time_end_236726 - time_start_236725;
            
            fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                    "builtin#replicate_f64.replicate_232838", time_diff_236727);
        }
    }
    
  cleanup:
    { }
    return err;
}
static int futrts_builtinzhreplicate_i64(struct futhark_context *ctx,
                                         struct memblock_device mem_232417,
                                         int32_t num_elems_232418,
                                         int64_t val_232419)
{
    (void) ctx;
    
    int err = 0;
    int64_t group_sizze_232424;
    
    group_sizze_232424 =
        *ctx->tuning_params.builtinzhreplicate_i64zigroup_sizze_232424;
    
    int64_t num_groups_232425 = sdiv_up64(num_elems_232418, group_sizze_232424);
    
    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->builtinzhreplicate_i64zireplicate_232421,
                                            0, sizeof(num_elems_232418),
                                            &num_elems_232418));
    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->builtinzhreplicate_i64zireplicate_232421,
                                            1, sizeof(val_232419),
                                            &val_232419));
    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->builtinzhreplicate_i64zireplicate_232421,
                                            2, sizeof(mem_232417.mem),
                                            &mem_232417.mem));
    if (1 * ((size_t) num_groups_232425 * (size_t) group_sizze_232424) != 0) {
        const size_t global_work_sizze_236729[1] = {(size_t) num_groups_232425 *
                     (size_t) group_sizze_232424};
        const size_t local_work_sizze_236733[1] = {(size_t) group_sizze_232424};
        int64_t time_start_236730 = 0, time_end_236731 = 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_232421",
                    global_work_sizze_236729[0], local_work_sizze_236733[0],
                    (int) 0);
            time_start_236730 = get_wall_time();
        }
        OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                        ctx->builtinzhreplicate_i64zireplicate_232421,
                                                        1, NULL,
                                                        global_work_sizze_236729,
                                                        local_work_sizze_236733,
                                                        0, NULL,
                                                        ctx->profiling_paused ||
                                                        !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                  &ctx->builtinzhreplicate_i64zireplicate_232421_runs,
                                                                                                  &ctx->builtinzhreplicate_i64zireplicate_232421_total_runtime)));
        if (ctx->debugging) {
            OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
            time_end_236731 = get_wall_time();
            
            long time_diff_236732 = time_end_236731 - time_start_236730;
            
            fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                    "builtin#replicate_i64.replicate_232421", time_diff_236732);
        }
    }
    
  cleanup:
    { }
    return err;
}
static int futrts_entry_main(struct futhark_context *ctx,
                             struct memblock_device *mem_out_p_236734,
                             struct memblock_device *mem_out_p_236735,
                             struct memblock_device *mem_out_p_236736,
                             struct memblock_device Y_mem_229145,
                             int64_t m_203489, int64_t n_203490,
                             int64_t n_p_203492, int64_t q_s_203493,
                             int64_t q_t_203494, int64_t q_l_203495,
                             int64_t d_s_203496, int64_t d_t_203497,
                             int64_t d_l_203498, int64_t jump_s_203499,
                             int64_t jump_t_203500, int64_t jump_l_203501,
                             int64_t n_inner_203502, int64_t n_outer_203503,
                             int64_t jump_threshold_203504,
                             int64_t q_threshold_203505)
{
    (void) ctx;
    
    int err = 0;
    struct memblock_device mem_out_232247;
    
    mem_out_232247.references = NULL;
    
    struct memblock_device mem_out_232248;
    
    mem_out_232248.references = NULL;
    
    struct memblock_device mem_out_232249;
    
    mem_out_232249.references = NULL;
    
    double i64_res_203506 = sitofp_i64_f64(n_203490);
    double i64_res_203507 = sitofp_i64_f64(n_p_203492);
    double ceil_arg_203508 = i64_res_203506 / i64_res_203507;
    double ceil_res_203509;
    
    ceil_res_203509 = futrts_ceil64(ceil_arg_203508);
    
    int64_t defunc_0_f_res_203510 = fptosi_f64_i64(ceil_res_203509);
    bool bounds_invalid_upwards_203511 = slt64(n_p_203492, (int64_t) 0);
    bool valid_203512 = !bounds_invalid_upwards_203511;
    bool range_valid_c_203513;
    
    if (!valid_203512) {
        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_203492, " 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_232249, "mem_out_232249") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232248, "mem_out_232248") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232247, "mem_out_232247") != 0)
            return 1;
        err = 1;
        goto cleanup;
    }
    
    bool bounds_invalid_upwards_203515 = slt64(defunc_0_f_res_203510,
                                               (int64_t) 0);
    bool valid_203516 = !bounds_invalid_upwards_203515;
    bool range_valid_c_203517;
    
    if (!valid_203516) {
        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_203510,
                               " 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_232249, "mem_out_232249") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232248, "mem_out_232248") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232247, "mem_out_232247") != 0)
            return 1;
        err = 1;
        goto cleanup;
    }
    
    int64_t segscan_group_sizze_206862;
    
    segscan_group_sizze_206862 =
        *ctx->tuning_params.mainzisegscan_group_sizze_206861;
    
    int64_t num_groups_206864;
    int32_t max_num_groups_232250;
    
    max_num_groups_232250 = *ctx->tuning_params.mainzisegscan_num_groups_206863;
    num_groups_206864 = sext_i64_i32(smax64((int64_t) 1,
                                            smin64(sdiv_up64(m_203489,
                                                             segscan_group_sizze_206862),
                                                   sext_i32_i64(max_num_groups_232250))));
    
    int64_t binop_x_229146 = m_203489 * n_203490;
    int64_t bytes_229147 = (int64_t) 8 * binop_x_229146;
    struct memblock_device mem_229148;
    
    mem_229148.references = NULL;
    if (memblock_alloc_device(ctx, &mem_229148, bytes_229147, "mem_229148")) {
        err = 1;
        goto cleanup;
    }
    if (futrts_builtinzhgpu_map_transpose_f64(ctx, mem_229148, (int64_t) 0,
                                              Y_mem_229145, (int64_t) 0,
                                              (int64_t) 1, n_203490,
                                              m_203489) != 0) {
        if (memblock_unref_device(ctx, &mem_229148, "mem_229148") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232249, "mem_out_232249") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232248, "mem_out_232248") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232247, "mem_out_232247") != 0)
            return 1;
        err = 1;
        goto cleanup;
    }
    
    int64_t binop_y_229150 = (int64_t) 8 * m_203489;
    int64_t bytes_229151 = smax64((int64_t) 0, binop_y_229150);
    struct memblock_device mem_229152;
    
    mem_229152.references = NULL;
    if (memblock_alloc_device(ctx, &mem_229152, bytes_229151, "mem_229152")) {
        err = 1;
        goto cleanup;
    }
    
    struct memblock_device mem_229155;
    
    mem_229155.references = NULL;
    if (memblock_alloc_device(ctx, &mem_229155, bytes_229151, "mem_229155")) {
        err = 1;
        goto cleanup;
    }
    
    int64_t bytes_229156 = smax64((int64_t) 0, m_203489);
    struct memblock_device mem_229157;
    
    mem_229157.references = NULL;
    if (memblock_alloc_device(ctx, &mem_229157, bytes_229156, "mem_229157")) {
        err = 1;
        goto cleanup;
    }
    if (slt64((int64_t) 0, m_203489)) {
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "\n# SegScan");
        
        int64_t stage1_max_num_groups_232251;
        
        stage1_max_num_groups_232251 = ctx->opencl.max_group_size;
        
        int64_t stage1_num_groups_232252 = smin64(stage1_max_num_groups_232251,
                                                  num_groups_206864);
        int32_t num_threads_232253 = sext_i64_i32(stage1_num_groups_232252 *
                segscan_group_sizze_206862);
        
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage1_206867,
                                                1,
                                                sizeof(ctx->failure_is_an_option),
                                                &ctx->failure_is_an_option));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage1_206867,
                                                3, (size_t) smax64((int64_t) 1,
                                                                   (int64_t) 8 *
                                                                   segscan_group_sizze_206862),
                                                NULL));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage1_206867,
                                                4, sizeof(m_203489),
                                                &m_203489));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage1_206867,
                                                5, sizeof(n_203490),
                                                &n_203490));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage1_206867,
                                                6, sizeof(n_p_203492),
                                                &n_p_203492));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage1_206867,
                                                7,
                                                sizeof(defunc_0_f_res_203510),
                                                &defunc_0_f_res_203510));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage1_206867,
                                                8, sizeof(num_threads_232253),
                                                &num_threads_232253));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage1_206867,
                                                9, sizeof(mem_229148.mem),
                                                &mem_229148.mem));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage1_206867,
                                                10, sizeof(mem_229152.mem),
                                                &mem_229152.mem));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage1_206867,
                                                11, sizeof(mem_229155.mem),
                                                &mem_229155.mem));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage1_206867,
                                                12, sizeof(mem_229157.mem),
                                                &mem_229157.mem));
        if (1 * ((size_t) stage1_num_groups_232252 *
                 (size_t) segscan_group_sizze_206862) != 0) {
            const size_t global_work_sizze_236737[1] =
                         {(size_t) stage1_num_groups_232252 *
                         (size_t) segscan_group_sizze_206862};
            const size_t local_work_sizze_236741[1] =
                         {(size_t) segscan_group_sizze_206862};
            int64_t time_start_236738 = 0, time_end_236739 = 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_206867", global_work_sizze_236737[0],
                        local_work_sizze_236741[0], (int) (0 +
                                                           smax64((int64_t) 1,
                                                                  (int64_t) 8 *
                                                                  segscan_group_sizze_206862)));
                time_start_236738 = get_wall_time();
            }
            OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                            ctx->mainziscan_stage1_206867,
                                                            1, NULL,
                                                            global_work_sizze_236737,
                                                            local_work_sizze_236741,
                                                            0, NULL,
                                                            ctx->profiling_paused ||
                                                            !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                      &ctx->mainziscan_stage1_206867_runs,
                                                                                                      &ctx->mainziscan_stage1_206867_total_runtime)));
            if (ctx->debugging) {
                OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                time_end_236739 = get_wall_time();
                
                long time_diff_236740 = time_end_236739 - time_start_236738;
                
                fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                        "main.scan_stage1_206867", time_diff_236740);
            }
        }
        ctx->failure_is_an_option = 1;
        if (ctx->debugging)
            fprintf(ctx->log, "%s: %llu%c", "elems_per_group",
                    (long long) (segscan_group_sizze_206862 *
                                 sdiv_up64(m_203489,
                                           sext_i32_i64(num_threads_232253))),
                    '\n');
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage2_206867,
                                                1, (size_t) smax64((int64_t) 1,
                                                                   (int64_t) 8 *
                                                                   stage1_num_groups_232252),
                                                NULL));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage2_206867,
                                                2, sizeof(m_203489),
                                                &m_203489));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage2_206867,
                                                3,
                                                sizeof(stage1_num_groups_232252),
                                                &stage1_num_groups_232252));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage2_206867,
                                                4, sizeof(num_threads_232253),
                                                &num_threads_232253));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage2_206867,
                                                5, sizeof(mem_229152.mem),
                                                &mem_229152.mem));
        if (1 * ((size_t) (int64_t) 1 * (size_t) stage1_num_groups_232252) !=
            0) {
            const size_t global_work_sizze_236742[1] = {(size_t) (int64_t) 1 *
                         (size_t) stage1_num_groups_232252};
            const size_t local_work_sizze_236746[1] =
                         {(size_t) stage1_num_groups_232252};
            int64_t time_start_236743 = 0, time_end_236744 = 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_206867", global_work_sizze_236742[0],
                        local_work_sizze_236746[0], (int) (0 +
                                                           smax64((int64_t) 1,
                                                                  (int64_t) 8 *
                                                                  stage1_num_groups_232252)));
                time_start_236743 = get_wall_time();
            }
            OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                            ctx->mainziscan_stage2_206867,
                                                            1, NULL,
                                                            global_work_sizze_236742,
                                                            local_work_sizze_236746,
                                                            0, NULL,
                                                            ctx->profiling_paused ||
                                                            !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                      &ctx->mainziscan_stage2_206867_runs,
                                                                                                      &ctx->mainziscan_stage2_206867_total_runtime)));
            if (ctx->debugging) {
                OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                time_end_236744 = get_wall_time();
                
                long time_diff_236745 = time_end_236744 - time_start_236743;
                
                fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                        "main.scan_stage2_206867", time_diff_236745);
            }
        }
        
        int32_t required_groups_232300 = sext_i64_i32(sdiv_up64(m_203489,
                                                                segscan_group_sizze_206862));
        
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage3_206867,
                                                1, sizeof(m_203489),
                                                &m_203489));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage3_206867,
                                                2, sizeof(num_groups_206864),
                                                &num_groups_206864));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage3_206867,
                                                3, sizeof(num_threads_232253),
                                                &num_threads_232253));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage3_206867,
                                                4,
                                                sizeof(required_groups_232300),
                                                &required_groups_232300));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage3_206867,
                                                5, sizeof(mem_229152.mem),
                                                &mem_229152.mem));
        if (1 * ((size_t) num_groups_206864 *
                 (size_t) segscan_group_sizze_206862) != 0) {
            const size_t global_work_sizze_236747[1] =
                         {(size_t) num_groups_206864 *
                         (size_t) segscan_group_sizze_206862};
            const size_t local_work_sizze_236751[1] =
                         {(size_t) segscan_group_sizze_206862};
            int64_t time_start_236748 = 0, time_end_236749 = 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_206867", global_work_sizze_236747[0],
                        local_work_sizze_236751[0], (int) 0);
                time_start_236748 = get_wall_time();
            }
            OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                            ctx->mainziscan_stage3_206867,
                                                            1, NULL,
                                                            global_work_sizze_236747,
                                                            local_work_sizze_236751,
                                                            0, NULL,
                                                            ctx->profiling_paused ||
                                                            !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                      &ctx->mainziscan_stage3_206867_runs,
                                                                                                      &ctx->mainziscan_stage3_206867_total_runtime)));
            if (ctx->debugging) {
                OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                time_end_236749 = get_wall_time();
                
                long time_diff_236750 = time_end_236749 - time_start_236748;
                
                fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                        "main.scan_stage3_206867", time_diff_236750);
            }
        }
    }
    if (memblock_unref_device(ctx, &mem_229157, "mem_229157") != 0)
        return 1;
    
    int64_t last_index_203575 = m_203489 - (int64_t) 1;
    bool is_empty_203576 = m_203489 == (int64_t) 0;
    int64_t partition_sizze_203577;
    
    if (is_empty_203576) {
        partition_sizze_203577 = (int64_t) 0;
    } else {
        int64_t last_offset_203578;
        int64_t read_res_236752;
        
        OPENCL_SUCCEED_OR_RETURN(clEnqueueReadBuffer(ctx->opencl.queue,
                                                     mem_229152.mem,
                                                     ctx->failure_is_an_option ? CL_FALSE : CL_TRUE,
                                                     last_index_203575 *
                                                     sizeof(int64_t),
                                                     sizeof(int64_t),
                                                     &read_res_236752, 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_203578 = read_res_236752;
        partition_sizze_203577 = last_offset_203578;
    }
    
    int64_t bytes_229160 = smax64((int64_t) 0, bytes_229147);
    struct memblock_device mem_229161;
    
    mem_229161.references = NULL;
    if (memblock_alloc_device(ctx, &mem_229161, bytes_229160, "mem_229161")) {
        err = 1;
        goto cleanup;
    }
    
    struct memblock_device mem_229164;
    
    mem_229164.references = NULL;
    if (memblock_alloc_device(ctx, &mem_229164, bytes_229151, "mem_229164")) {
        err = 1;
        goto cleanup;
    }
    
    int64_t segmap_group_sizze_206872;
    
    segmap_group_sizze_206872 =
        *ctx->tuning_params.mainzisegmap_group_sizze_206871;
    
    int64_t num_groups_206874;
    int32_t max_num_groups_232312;
    
    max_num_groups_232312 = *ctx->tuning_params.mainzisegmap_num_groups_206873;
    num_groups_206874 = sext_i64_i32(smax64((int64_t) 1,
                                            smin64(sdiv_up64(m_203489,
                                                             segmap_group_sizze_206872),
                                                   sext_i32_i64(max_num_groups_232312))));
    if (ctx->debugging)
        fprintf(ctx->log, "%s\n", "\n# SegMap");
    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_206869, 1,
                                            sizeof(m_203489), &m_203489));
    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_206869, 2,
                                            sizeof(n_203490), &n_203490));
    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_206869, 3,
                                            sizeof(num_groups_206874),
                                            &num_groups_206874));
    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_206869, 4,
                                            sizeof(mem_229148.mem),
                                            &mem_229148.mem));
    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_206869, 5,
                                            sizeof(mem_229152.mem),
                                            &mem_229152.mem));
    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_206869, 6,
                                            sizeof(mem_229155.mem),
                                            &mem_229155.mem));
    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_206869, 7,
                                            sizeof(mem_229161.mem),
                                            &mem_229161.mem));
    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_206869, 8,
                                            sizeof(mem_229164.mem),
                                            &mem_229164.mem));
    if (1 * ((size_t) num_groups_206874 * (size_t) segmap_group_sizze_206872) !=
        0) {
        const size_t global_work_sizze_236753[1] = {(size_t) num_groups_206874 *
                     (size_t) segmap_group_sizze_206872};
        const size_t local_work_sizze_236757[1] =
                     {(size_t) segmap_group_sizze_206872};
        int64_t time_start_236754 = 0, time_end_236755 = 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_206869", global_work_sizze_236753[0],
                    local_work_sizze_236757[0], (int) 0);
            time_start_236754 = get_wall_time();
        }
        OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                        ctx->mainzisegmap_206869,
                                                        1, NULL,
                                                        global_work_sizze_236753,
                                                        local_work_sizze_236757,
                                                        0, NULL,
                                                        ctx->profiling_paused ||
                                                        !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                  &ctx->mainzisegmap_206869_runs,
                                                                                                  &ctx->mainzisegmap_206869_total_runtime)));
        if (ctx->debugging) {
            OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
            time_end_236755 = get_wall_time();
            
            long time_diff_236756 = time_end_236755 - time_start_236754;
            
            fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                    "main.segmap_206869", time_diff_236756);
        }
    }
    if (ctx->debugging)
        fprintf(ctx->log, "%s\n", "");
    if (memblock_unref_device(ctx, &mem_229148, "mem_229148") != 0)
        return 1;
    if (memblock_unref_device(ctx, &mem_229152, "mem_229152") != 0)
        return 1;
    if (memblock_unref_device(ctx, &mem_229155, "mem_229155") != 0)
        return 1;
    
    bool empty_slice_203591 = partition_sizze_203577 == (int64_t) 0;
    int64_t m_203592 = sub64(partition_sizze_203577, (int64_t) 1);
    bool zzero_leq_i_p_m_t_s_203593 = sle64((int64_t) 0, m_203592);
    bool i_p_m_t_s_leq_w_203594 = slt64(m_203592, m_203489);
    bool i_lte_j_203595 = sle64((int64_t) 0, partition_sizze_203577);
    bool y_203596 = zzero_leq_i_p_m_t_s_203593 && i_p_m_t_s_leq_w_203594;
    bool y_203597 = i_lte_j_203595 && y_203596;
    bool ok_or_empty_203598 = empty_slice_203591 || y_203597;
    bool index_certs_203599;
    
    if (!ok_or_empty_203598) {
        ctx->error = msgprintf("Error: %s%lld%s%lld%s\n\nBacktrace:\n%s",
                               "Index [:", (long long) partition_sizze_203577,
                               "] out of bounds for array of shape [",
                               (long long) m_203489, "].",
                               "-> #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_229164, "mem_229164") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229161, "mem_229161") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229157, "mem_229157") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229155, "mem_229155") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229152, "mem_229152") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229148, "mem_229148") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232249, "mem_out_232249") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232248, "mem_out_232248") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232247, "mem_out_232247") != 0)
            return 1;
        err = 1;
        goto cleanup;
    }
    
    bool assert_cond_203602 = sle64((int64_t) 4, n_p_203492);
    bool assert_c_203603;
    
    if (!assert_cond_203602) {
        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_229164, "mem_229164") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229161, "mem_229161") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229157, "mem_229157") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229155, "mem_229155") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229152, "mem_229152") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229148, "mem_229148") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232249, "mem_out_232249") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232248, "mem_out_232248") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232247, "mem_out_232247") != 0)
            return 1;
        err = 1;
        goto cleanup;
    }
    
    int64_t x_203604 = smod64(q_t_203494, (int64_t) 2);
    bool assert_cond_203605 = x_203604 == (int64_t) 1;
    bool assert_c_203606;
    
    if (!assert_cond_203605) {
        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_229164, "mem_229164") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229161, "mem_229161") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229157, "mem_229157") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229155, "mem_229155") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229152, "mem_229152") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229148, "mem_229148") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232249, "mem_out_232249") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232248, "mem_out_232248") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232247, "mem_out_232247") != 0)
            return 1;
        err = 1;
        goto cleanup;
    }
    
    bool assert_cond_203607 = slt64((int64_t) 0, q_t_203494);
    bool assert_c_203608;
    
    if (!assert_cond_203607) {
        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_229164, "mem_229164") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229161, "mem_229161") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229157, "mem_229157") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229155, "mem_229155") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229152, "mem_229152") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229148, "mem_229148") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232249, "mem_out_232249") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232248, "mem_out_232248") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232247, "mem_out_232247") != 0)
            return 1;
        err = 1;
        goto cleanup;
    }
    
    int64_t x_203609 = smod64(q_l_203495, (int64_t) 2);
    bool assert_cond_203610 = x_203609 == (int64_t) 1;
    bool assert_c_203611;
    
    if (!assert_cond_203610) {
        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_229164, "mem_229164") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229161, "mem_229161") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229157, "mem_229157") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229155, "mem_229155") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229152, "mem_229152") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229148, "mem_229148") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232249, "mem_out_232249") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232248, "mem_out_232248") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232247, "mem_out_232247") != 0)
            return 1;
        err = 1;
        goto cleanup;
    }
    
    bool assert_cond_203612 = slt64((int64_t) 0, q_l_203495);
    bool assert_c_203613;
    
    if (!assert_cond_203612) {
        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_229164, "mem_229164") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229161, "mem_229161") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229157, "mem_229157") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229155, "mem_229155") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229152, "mem_229152") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229148, "mem_229148") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232249, "mem_out_232249") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232248, "mem_out_232248") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232247, "mem_out_232247") != 0)
            return 1;
        err = 1;
        goto cleanup;
    }
    
    bool cond_203614 = sle64((int64_t) 0, d_t_203497);
    bool assert_cond_t_res_203615 = sle64(d_t_203497, (int64_t) 2);
    bool x_203616 = cond_203614 && assert_cond_t_res_203615;
    bool assert_c_203617;
    
    if (!x_203616) {
        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_229164, "mem_229164") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229161, "mem_229161") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229157, "mem_229157") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229155, "mem_229155") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229152, "mem_229152") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229148, "mem_229148") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232249, "mem_out_232249") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232248, "mem_out_232248") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232247, "mem_out_232247") != 0)
            return 1;
        err = 1;
        goto cleanup;
    }
    
    bool cond_203618 = sle64((int64_t) 0, d_l_203498);
    bool assert_cond_t_res_203619 = sle64(d_l_203498, (int64_t) 2);
    bool x_203620 = cond_203618 && assert_cond_t_res_203619;
    bool assert_c_203621;
    
    if (!x_203620) {
        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_229164, "mem_229164") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229161, "mem_229161") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229157, "mem_229157") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229155, "mem_229155") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229152, "mem_229152") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229148, "mem_229148") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232249, "mem_out_232249") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232248, "mem_out_232248") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232247, "mem_out_232247") != 0)
            return 1;
        err = 1;
        goto cleanup;
    }
    
    bool assert_cond_203622 = slt64((int64_t) 0, jump_t_203500);
    bool assert_c_203623;
    
    if (!assert_cond_203622) {
        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_229164, "mem_229164") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229161, "mem_229161") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229157, "mem_229157") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229155, "mem_229155") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229152, "mem_229152") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229148, "mem_229148") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232249, "mem_out_232249") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232248, "mem_out_232248") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232247, "mem_out_232247") != 0)
            return 1;
        err = 1;
        goto cleanup;
    }
    
    bool assert_cond_203624 = slt64((int64_t) 0, jump_l_203501);
    bool assert_c_203625;
    
    if (!assert_cond_203624) {
        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_229164, "mem_229164") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229161, "mem_229161") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229157, "mem_229157") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229155, "mem_229155") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229152, "mem_229152") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229148, "mem_229148") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232249, "mem_out_232249") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232248, "mem_out_232248") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232247, "mem_out_232247") != 0)
            return 1;
        err = 1;
        goto cleanup;
    }
    
    bool assert_cond_203626 = slt64((int64_t) 0, n_inner_203502);
    bool assert_c_203627;
    
    if (!assert_cond_203626) {
        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_229164, "mem_229164") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229161, "mem_229161") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229157, "mem_229157") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229155, "mem_229155") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229152, "mem_229152") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229148, "mem_229148") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232249, "mem_out_232249") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232248, "mem_out_232248") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232247, "mem_out_232247") != 0)
            return 1;
        err = 1;
        goto cleanup;
    }
    
    bool assert_cond_203628 = slt64((int64_t) 0, n_outer_203503);
    bool assert_c_203629;
    
    if (!assert_cond_203628) {
        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_229164, "mem_229164") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229161, "mem_229161") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229157, "mem_229157") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229155, "mem_229155") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229152, "mem_229152") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229148, "mem_229148") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232249, "mem_out_232249") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232248, "mem_out_232248") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232247, "mem_out_232247") != 0)
            return 1;
        err = 1;
        goto cleanup;
    }
    
    double ceil_res_203630;
    
    ceil_res_203630 = futrts_ceil64(ceil_arg_203508);
    
    int64_t defunc_0_f_res_203631 = fptosi_f64_i64(ceil_res_203630);
    int64_t pad_css_len_203632 = add64((int64_t) 2, defunc_0_f_res_203631);
    int64_t y_203633 = mul64((int64_t) 2, n_p_203492);
    int64_t C_len_203634 = add64(n_203490, y_203633);
    bool cond_203635 = jump_s_203499 == (int64_t) 1;
    int64_t s_n_m_203636;
    
    if (cond_203635) {
        s_n_m_203636 = pad_css_len_203632;
    } else {
        bool zzero_203637 = jump_s_203499 == (int64_t) 0;
        bool nonzzero_203638 = !zzero_203637;
        bool nonzzero_cert_203639;
        
        if (!nonzzero_203638) {
            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_229164, "mem_229164") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_229161, "mem_229161") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_229157, "mem_229157") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_229155, "mem_229155") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_229152, "mem_229152") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_229148, "mem_229148") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_out_232249, "mem_out_232249") !=
                0)
                return 1;
            if (memblock_unref_device(ctx, &mem_out_232248, "mem_out_232248") !=
                0)
                return 1;
            if (memblock_unref_device(ctx, &mem_out_232247, "mem_out_232247") !=
                0)
                return 1;
            err = 1;
            goto cleanup;
        }
        
        int64_t x_203640 = sdiv64(defunc_0_f_res_203631, jump_s_203499);
        int64_t s_n_m_f_res_203641 = add64((int64_t) 3, x_203640);
        
        s_n_m_203636 = s_n_m_f_res_203641;
    }
    
    bool cond_203642 = jump_l_203501 == (int64_t) 1;
    int64_t l_n_m_203643;
    
    if (cond_203642) {
        l_n_m_203643 = n_203490;
    } else {
        bool zzero_203644 = jump_l_203501 == (int64_t) 0;
        bool nonzzero_203645 = !zzero_203644;
        bool nonzzero_cert_203646;
        
        if (!nonzzero_203645) {
            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_229164, "mem_229164") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_229161, "mem_229161") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_229157, "mem_229157") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_229155, "mem_229155") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_229152, "mem_229152") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_229148, "mem_229148") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_out_232249, "mem_out_232249") !=
                0)
                return 1;
            if (memblock_unref_device(ctx, &mem_out_232248, "mem_out_232248") !=
                0)
                return 1;
            if (memblock_unref_device(ctx, &mem_out_232247, "mem_out_232247") !=
                0)
                return 1;
            err = 1;
            goto cleanup;
        }
        
        int64_t x_203647 = sdiv64(n_203490, jump_l_203501);
        int64_t l_n_m_f_res_203648 = add64((int64_t) 1, x_203647);
        
        l_n_m_203643 = l_n_m_f_res_203648;
    }
    
    bool cond_203649 = jump_t_203500 == (int64_t) 1;
    int64_t t_n_m_203650;
    
    if (cond_203649) {
        t_n_m_203650 = n_203490;
    } else {
        bool zzero_203651 = jump_t_203500 == (int64_t) 0;
        bool nonzzero_203652 = !zzero_203651;
        bool nonzzero_cert_203653;
        
        if (!nonzzero_203652) {
            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_229164, "mem_229164") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_229161, "mem_229161") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_229157, "mem_229157") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_229155, "mem_229155") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_229152, "mem_229152") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_229148, "mem_229148") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_out_232249, "mem_out_232249") !=
                0)
                return 1;
            if (memblock_unref_device(ctx, &mem_out_232248, "mem_out_232248") !=
                0)
                return 1;
            if (memblock_unref_device(ctx, &mem_out_232247, "mem_out_232247") !=
                0)
                return 1;
            err = 1;
            goto cleanup;
        }
        
        int64_t x_203654 = sdiv64(n_203490, jump_t_203500);
        int64_t t_n_m_f_res_203655 = add64((int64_t) 1, x_203654);
        
        t_n_m_203650 = t_n_m_f_res_203655;
    }
    
    double x_203656 = i64_res_203506 / 2.0;
    double floor_arg_203657 = 1.0 + x_203656;
    double floor_res_203658;
    
    floor_res_203658 = futrts_floor64(floor_arg_203657);
    
    int64_t defunc_0_f_res_203659 = fptosi_f64_i64(floor_res_203658);
    int64_t x_203660 = sub64(n_203490, defunc_0_f_res_203659);
    int64_t mid2_203661 = add64((int64_t) 1, x_203660);
    bool cond_203662 = defunc_0_f_res_203659 == mid2_203661;
    int64_t stl_res_t_res_203663 = sub64(defunc_0_f_res_203659, (int64_t) 1);
    int64_t stl_res_203664;
    int64_t stl_res_203665;
    
    if (cond_203662) {
        stl_res_203664 = stl_res_t_res_203663;
        stl_res_203665 = defunc_0_f_res_203659;
    } else {
        int64_t min_res_203666 = smin64(defunc_0_f_res_203659, mid2_203661);
        int64_t stl_res_f_res_203667 = sub64(min_res_203666, (int64_t) 1);
        int64_t max_res_203668 = smax64(defunc_0_f_res_203659, mid2_203661);
        
        stl_res_203664 = stl_res_f_res_203667;
        stl_res_203665 = max_res_203668;
    }
    
    int64_t i_203670 = sub64(n_203490, (int64_t) 1);
    bool x_203671 = sle64((int64_t) 0, i_203670);
    bool y_203672 = slt64(i_203670, n_203490);
    bool bounds_check_203673 = x_203671 && y_203672;
    bool index_certs_203674;
    
    if (!bounds_check_203673) {
        ctx->error = msgprintf("Error: %s%lld%s%lld%s\n\nBacktrace:\n%s",
                               "Index [", (long long) i_203670,
                               "] out of bounds for array of shape [",
                               (long long) n_203490, "].",
                               "-> #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_229164, "mem_229164") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229161, "mem_229161") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229157, "mem_229157") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229155, "mem_229155") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229152, "mem_229152") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229148, "mem_229148") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232249, "mem_out_232249") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232248, "mem_out_232248") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232247, "mem_out_232247") != 0)
            return 1;
        err = 1;
        goto cleanup;
    }
    
    int64_t max_group_sizze_206887;
    
    max_group_sizze_206887 = ctx->opencl.max_group_size;
    
    bool fits_206888 = sle64(n_203490, max_group_sizze_206887);
    bool suff_intra_par_206886;
    
    suff_intra_par_206886 = *ctx->tuning_params.mainzisuff_intra_par_0 <=
        n_203490;
    if (ctx->logging)
        fprintf(ctx->log, "Compared %s <= %ld: %s.\n", "main.suff_intra_par_0",
                (long) n_203490, suff_intra_par_206886 ? "true" : "false");
    
    bool intra_suff_and_fits_206889 = suff_intra_par_206886 && fits_206888;
    int64_t nest_sizze_207000 = n_203490 * partition_sizze_203577;
    int64_t segscan_group_sizze_207001;
    
    segscan_group_sizze_207001 =
        *ctx->tuning_params.mainzisegscan_group_sizze_206981;
    
    int64_t num_groups_207002;
    int32_t max_num_groups_232326;
    
    max_num_groups_232326 = *ctx->tuning_params.mainzisegscan_num_groups_206983;
    num_groups_207002 = sext_i64_i32(smax64((int64_t) 1,
                                            smin64(sdiv_up64(nest_sizze_207000,
                                                             segscan_group_sizze_207001),
                                                   sext_i32_i64(max_num_groups_232326))));
    
    int64_t segmap_group_sizze_207040;
    
    segmap_group_sizze_207040 =
        *ctx->tuning_params.mainzisegmap_group_sizze_206925;
    
    int64_t binop_y_229176 = (int64_t) 8 * nest_sizze_207000;
    int64_t bytes_229177 = smax64((int64_t) 0, binop_y_229176);
    int64_t binop_y_229179 = (int64_t) 8 * partition_sizze_203577;
    int64_t bytes_229180 = smax64((int64_t) 0, binop_y_229179);
    int64_t binop_y_229168 = (int64_t) 8 * n_203490;
    int64_t bytes_229169 = smax64((int64_t) 0, binop_y_229168);
    struct memblock_device ext_mem_229197;
    
    ext_mem_229197.references = NULL;
    
    struct memblock_device ext_mem_229196;
    
    ext_mem_229196.references = NULL;
    
    int32_t local_memory_capacity_232448;
    
    local_memory_capacity_232448 = ctx->opencl.max_local_memory;
    if (sle64(bytes_229169 + srem64((int64_t) 8 - srem64(bytes_229169,
                                                         (int64_t) 8),
                                    (int64_t) 8) + (bytes_229169 +
                                                    srem64((int64_t) 8 -
                                                           srem64(bytes_229169,
                                                                  (int64_t) 8),
                                                           (int64_t) 8)),
              sext_i32_i64(local_memory_capacity_232448)) &&
        intra_suff_and_fits_206889) {
        struct memblock_device mem_229178;
        
        mem_229178.references = NULL;
        if (memblock_alloc_device(ctx, &mem_229178, bytes_229177,
                                  "mem_229178")) {
            err = 1;
            goto cleanup;
        }
        
        struct memblock_device mem_229181;
        
        mem_229181.references = NULL;
        if (memblock_alloc_device(ctx, &mem_229181, bytes_229180,
                                  "mem_229181")) {
            err = 1;
            goto cleanup;
        }
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "\n# SegMap");
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_206893,
                                                1, (size_t) bytes_229169,
                                                NULL));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_206893,
                                                2, (size_t) bytes_229169,
                                                NULL));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_206893,
                                                3, sizeof(n_203490),
                                                &n_203490));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_206893,
                                                4,
                                                sizeof(partition_sizze_203577),
                                                &partition_sizze_203577));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_206893,
                                                5, sizeof(i_203670),
                                                &i_203670));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_206893,
                                                6, sizeof(mem_229161.mem),
                                                &mem_229161.mem));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_206893,
                                                7, sizeof(mem_229178.mem),
                                                &mem_229178.mem));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_206893,
                                                8, sizeof(mem_229181.mem),
                                                &mem_229181.mem));
        if (1 * ((size_t) partition_sizze_203577 * (size_t) n_203490) != 0) {
            const size_t global_work_sizze_236758[1] =
                         {(size_t) partition_sizze_203577 * (size_t) n_203490};
            const size_t local_work_sizze_236762[1] = {(size_t) n_203490};
            int64_t time_start_236759 = 0, time_end_236760 = 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_206893",
                        global_work_sizze_236758[0], local_work_sizze_236762[0],
                        (int) (0 + bytes_229169 + bytes_229169));
                time_start_236759 = get_wall_time();
            }
            OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                            ctx->mainzisegmap_intragroup_206893,
                                                            1, NULL,
                                                            global_work_sizze_236758,
                                                            local_work_sizze_236762,
                                                            0, NULL,
                                                            ctx->profiling_paused ||
                                                            !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                      &ctx->mainzisegmap_intragroup_206893_runs,
                                                                                                      &ctx->mainzisegmap_intragroup_206893_total_runtime)));
            if (ctx->debugging) {
                OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                time_end_236760 = get_wall_time();
                
                long time_diff_236761 = time_end_236760 - time_start_236759;
                
                fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                        "main.segmap_intragroup_206893", time_diff_236761);
            }
        }
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "");
        if (memblock_set_device(ctx, &ext_mem_229197, &mem_229178,
                                "mem_229178") != 0)
            return 1;
        if (memblock_set_device(ctx, &ext_mem_229196, &mem_229181,
                                "mem_229181") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229181, "mem_229181") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229178, "mem_229178") != 0)
            return 1;
    } else {
        struct memblock_device mem_229186;
        
        mem_229186.references = NULL;
        if (memblock_alloc_device(ctx, &mem_229186, bytes_229177,
                                  "mem_229186")) {
            err = 1;
            goto cleanup;
        }
        if (slt64((int64_t) 0, partition_sizze_203577 * n_203490)) {
            if (ctx->debugging)
                fprintf(ctx->log, "%s\n", "\n# SegScan");
            
            int64_t stage1_max_num_groups_232352;
            
            stage1_max_num_groups_232352 = ctx->opencl.max_group_size;
            
            int64_t stage1_num_groups_232353 =
                    smin64(stage1_max_num_groups_232352, num_groups_207002);
            int32_t num_threads_232354 = sext_i64_i32(stage1_num_groups_232353 *
                    segscan_group_sizze_207001);
            
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage1_207007,
                                                    1,
                                                    (size_t) smax64((int64_t) 1,
                                                                    (int64_t) 8 *
                                                                    segscan_group_sizze_207001),
                                                    NULL));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage1_207007,
                                                    2, sizeof(n_203490),
                                                    &n_203490));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage1_207007,
                                                    3,
                                                    sizeof(partition_sizze_203577),
                                                    &partition_sizze_203577));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage1_207007,
                                                    4,
                                                    sizeof(num_threads_232354),
                                                    &num_threads_232354));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage1_207007,
                                                    5, sizeof(mem_229161.mem),
                                                    &mem_229161.mem));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage1_207007,
                                                    6, sizeof(mem_229186.mem),
                                                    &mem_229186.mem));
            if (1 * ((size_t) stage1_num_groups_232353 *
                     (size_t) segscan_group_sizze_207001) != 0) {
                const size_t global_work_sizze_236763[1] =
                             {(size_t) stage1_num_groups_232353 *
                             (size_t) segscan_group_sizze_207001};
                const size_t local_work_sizze_236767[1] =
                             {(size_t) segscan_group_sizze_207001};
                int64_t time_start_236764 = 0, time_end_236765 = 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_207007",
                            global_work_sizze_236763[0],
                            local_work_sizze_236767[0], (int) (0 +
                                                               smax64((int64_t) 1,
                                                                      (int64_t) 8 *
                                                                      segscan_group_sizze_207001)));
                    time_start_236764 = get_wall_time();
                }
                OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                ctx->mainziscan_stage1_207007,
                                                                1, NULL,
                                                                global_work_sizze_236763,
                                                                local_work_sizze_236767,
                                                                0, NULL,
                                                                ctx->profiling_paused ||
                                                                !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                          &ctx->mainziscan_stage1_207007_runs,
                                                                                                          &ctx->mainziscan_stage1_207007_total_runtime)));
                if (ctx->debugging) {
                    OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                    time_end_236765 = get_wall_time();
                    
                    long time_diff_236766 = time_end_236765 - time_start_236764;
                    
                    fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                            "main.scan_stage1_207007", time_diff_236766);
                }
            }
            if (ctx->debugging)
                fprintf(ctx->log, "%s: %llu%c", "elems_per_group",
                        (long long) (segscan_group_sizze_207001 *
                                     sdiv_up64(partition_sizze_203577 *
                                               n_203490,
                                               sext_i32_i64(num_threads_232354))),
                        '\n');
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage2_207007,
                                                    1,
                                                    (size_t) smax64((int64_t) 1,
                                                                    (int64_t) 8 *
                                                                    stage1_num_groups_232353),
                                                    NULL));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage2_207007,
                                                    2, sizeof(n_203490),
                                                    &n_203490));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage2_207007,
                                                    3,
                                                    sizeof(partition_sizze_203577),
                                                    &partition_sizze_203577));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage2_207007,
                                                    4,
                                                    sizeof(stage1_num_groups_232353),
                                                    &stage1_num_groups_232353));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage2_207007,
                                                    5,
                                                    sizeof(num_threads_232354),
                                                    &num_threads_232354));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage2_207007,
                                                    6, sizeof(mem_229186.mem),
                                                    &mem_229186.mem));
            if (1 * ((size_t) (int64_t) 1 *
                     (size_t) stage1_num_groups_232353) != 0) {
                const size_t global_work_sizze_236768[1] =
                             {(size_t) (int64_t) 1 *
                             (size_t) stage1_num_groups_232353};
                const size_t local_work_sizze_236772[1] =
                             {(size_t) stage1_num_groups_232353};
                int64_t time_start_236769 = 0, time_end_236770 = 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_207007",
                            global_work_sizze_236768[0],
                            local_work_sizze_236772[0], (int) (0 +
                                                               smax64((int64_t) 1,
                                                                      (int64_t) 8 *
                                                                      stage1_num_groups_232353)));
                    time_start_236769 = get_wall_time();
                }
                OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                ctx->mainziscan_stage2_207007,
                                                                1, NULL,
                                                                global_work_sizze_236768,
                                                                local_work_sizze_236772,
                                                                0, NULL,
                                                                ctx->profiling_paused ||
                                                                !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                          &ctx->mainziscan_stage2_207007_runs,
                                                                                                          &ctx->mainziscan_stage2_207007_total_runtime)));
                if (ctx->debugging) {
                    OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                    time_end_236770 = get_wall_time();
                    
                    long time_diff_236771 = time_end_236770 - time_start_236769;
                    
                    fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                            "main.scan_stage2_207007", time_diff_236771);
                }
            }
            
            int32_t required_groups_232405 =
                    sext_i64_i32(sdiv_up64(partition_sizze_203577 * n_203490,
                                           segscan_group_sizze_207001));
            
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage3_207007,
                                                    1, sizeof(n_203490),
                                                    &n_203490));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage3_207007,
                                                    2,
                                                    sizeof(partition_sizze_203577),
                                                    &partition_sizze_203577));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage3_207007,
                                                    3,
                                                    sizeof(num_groups_207002),
                                                    &num_groups_207002));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage3_207007,
                                                    4,
                                                    sizeof(num_threads_232354),
                                                    &num_threads_232354));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage3_207007,
                                                    5,
                                                    sizeof(required_groups_232405),
                                                    &required_groups_232405));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage3_207007,
                                                    6, sizeof(mem_229186.mem),
                                                    &mem_229186.mem));
            if (1 * ((size_t) num_groups_207002 *
                     (size_t) segscan_group_sizze_207001) != 0) {
                const size_t global_work_sizze_236773[1] =
                             {(size_t) num_groups_207002 *
                             (size_t) segscan_group_sizze_207001};
                const size_t local_work_sizze_236777[1] =
                             {(size_t) segscan_group_sizze_207001};
                int64_t time_start_236774 = 0, time_end_236775 = 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_207007",
                            global_work_sizze_236773[0],
                            local_work_sizze_236777[0], (int) 0);
                    time_start_236774 = get_wall_time();
                }
                OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                ctx->mainziscan_stage3_207007,
                                                                1, NULL,
                                                                global_work_sizze_236773,
                                                                local_work_sizze_236777,
                                                                0, NULL,
                                                                ctx->profiling_paused ||
                                                                !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                          &ctx->mainziscan_stage3_207007_runs,
                                                                                                          &ctx->mainziscan_stage3_207007_total_runtime)));
                if (ctx->debugging) {
                    OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                    time_end_236775 = get_wall_time();
                    
                    long time_diff_236776 = time_end_236775 - time_start_236774;
                    
                    fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                            "main.scan_stage3_207007", time_diff_236776);
                }
            }
        }
        
        struct memblock_device mem_229190;
        
        mem_229190.references = NULL;
        if (memblock_alloc_device(ctx, &mem_229190, bytes_229177,
                                  "mem_229190")) {
            err = 1;
            goto cleanup;
        }
        if (futrts_builtinzhreplicate_i64(ctx, mem_229190,
                                          partition_sizze_203577 * n_203490,
                                          (int64_t) -1) != 0) {
            if (memblock_unref_device(ctx, &mem_229190, "mem_229190") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_229186, "mem_229186") != 0)
                return 1;
            if (memblock_unref_device(ctx, &ext_mem_229196, "ext_mem_229196") !=
                0)
                return 1;
            if (memblock_unref_device(ctx, &ext_mem_229197, "ext_mem_229197") !=
                0)
                return 1;
            if (memblock_unref_device(ctx, &mem_229164, "mem_229164") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_229161, "mem_229161") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_229157, "mem_229157") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_229155, "mem_229155") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_229152, "mem_229152") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_229148, "mem_229148") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_out_232249, "mem_out_232249") !=
                0)
                return 1;
            if (memblock_unref_device(ctx, &mem_out_232248, "mem_out_232248") !=
                0)
                return 1;
            if (memblock_unref_device(ctx, &mem_out_232247, "mem_out_232247") !=
                0)
                return 1;
            err = 1;
            goto cleanup;
        }
        
        int64_t segmap_usable_groups_207041 = sdiv_up64(nest_sizze_207000,
                                                        segmap_group_sizze_207040);
        
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "\n# SegMap");
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_207045, 1,
                                                sizeof(n_203490), &n_203490));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_207045, 2,
                                                sizeof(partition_sizze_203577),
                                                &partition_sizze_203577));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_207045, 3,
                                                sizeof(mem_229161.mem),
                                                &mem_229161.mem));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_207045, 4,
                                                sizeof(mem_229186.mem),
                                                &mem_229186.mem));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_207045, 5,
                                                sizeof(mem_229190.mem),
                                                &mem_229190.mem));
        if (1 * ((size_t) segmap_usable_groups_207041 *
                 (size_t) segmap_group_sizze_207040) != 0) {
            const size_t global_work_sizze_236778[1] =
                         {(size_t) segmap_usable_groups_207041 *
                         (size_t) segmap_group_sizze_207040};
            const size_t local_work_sizze_236782[1] =
                         {(size_t) segmap_group_sizze_207040};
            int64_t time_start_236779 = 0, time_end_236780 = 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_207045", global_work_sizze_236778[0],
                        local_work_sizze_236782[0], (int) 0);
                time_start_236779 = get_wall_time();
            }
            OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                            ctx->mainzisegmap_207045,
                                                            1, NULL,
                                                            global_work_sizze_236778,
                                                            local_work_sizze_236782,
                                                            0, NULL,
                                                            ctx->profiling_paused ||
                                                            !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                      &ctx->mainzisegmap_207045_runs,
                                                                                                      &ctx->mainzisegmap_207045_total_runtime)));
            if (ctx->debugging) {
                OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                time_end_236780 = get_wall_time();
                
                long time_diff_236781 = time_end_236780 - time_start_236779;
                
                fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                        "main.segmap_207045", time_diff_236781);
            }
        }
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "");
        
        struct memblock_device mem_229194;
        
        mem_229194.references = NULL;
        if (memblock_alloc_device(ctx, &mem_229194, bytes_229180,
                                  "mem_229194")) {
            err = 1;
            goto cleanup;
        }
        
        int64_t group_sizze_232442;
        
        group_sizze_232442 = *ctx->tuning_params.mainzigroup_sizze_232442;
        
        int64_t num_groups_232443 = sdiv_up64(partition_sizze_203577,
                                              group_sizze_232442);
        
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzicopy_232439, 0,
                                                sizeof(n_203490), &n_203490));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzicopy_232439, 1,
                                                sizeof(partition_sizze_203577),
                                                &partition_sizze_203577));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzicopy_232439, 2,
                                                sizeof(i_203670), &i_203670));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzicopy_232439, 3,
                                                sizeof(mem_229186.mem),
                                                &mem_229186.mem));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzicopy_232439, 4,
                                                sizeof(mem_229194.mem),
                                                &mem_229194.mem));
        if (1 * ((size_t) num_groups_232443 * (size_t) group_sizze_232442) !=
            0) {
            const size_t global_work_sizze_236783[1] =
                         {(size_t) num_groups_232443 *
                         (size_t) group_sizze_232442};
            const size_t local_work_sizze_236787[1] =
                         {(size_t) group_sizze_232442};
            int64_t time_start_236784 = 0, time_end_236785 = 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_232439", global_work_sizze_236783[0],
                        local_work_sizze_236787[0], (int) 0);
                time_start_236784 = get_wall_time();
            }
            OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                            ctx->mainzicopy_232439,
                                                            1, NULL,
                                                            global_work_sizze_236783,
                                                            local_work_sizze_236787,
                                                            0, NULL,
                                                            ctx->profiling_paused ||
                                                            !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                      &ctx->mainzicopy_232439_runs,
                                                                                                      &ctx->mainzicopy_232439_total_runtime)));
            if (ctx->debugging) {
                OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                time_end_236785 = get_wall_time();
                
                long time_diff_236786 = time_end_236785 - time_start_236784;
                
                fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                        "main.copy_232439", time_diff_236786);
            }
        }
        if (memblock_unref_device(ctx, &mem_229186, "mem_229186") != 0)
            return 1;
        if (memblock_set_device(ctx, &ext_mem_229197, &mem_229190,
                                "mem_229190") != 0)
            return 1;
        if (memblock_set_device(ctx, &ext_mem_229196, &mem_229194,
                                "mem_229194") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229194, "mem_229194") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229190, "mem_229190") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229186, "mem_229186") != 0)
            return 1;
    }
    
    bool bounds_invalid_upwards_203698 = slt64(defunc_0_f_res_203631,
                                               (int64_t) 0);
    bool valid_203699 = !bounds_invalid_upwards_203698;
    bool range_valid_c_203700;
    
    if (!valid_203699) {
        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_203631,
                               " 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_229196, "ext_mem_229196") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229197, "ext_mem_229197") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229164, "mem_229164") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229161, "mem_229161") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229157, "mem_229157") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229155, "mem_229155") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229152, "mem_229152") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229148, "mem_229148") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232249, "mem_out_232249") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232248, "mem_out_232248") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232247, "mem_out_232247") != 0)
            return 1;
        err = 1;
        goto cleanup;
    }
    
    int64_t y_207162 = n_p_203492 * defunc_0_f_res_203631;
    int64_t nest_sizze_207163 = partition_sizze_203577 * y_207162;
    int64_t segmap_group_sizze_207164;
    
    segmap_group_sizze_207164 =
        *ctx->tuning_params.mainzisegmap_group_sizze_207082;
    
    int64_t segmap_usable_groups_207165 = sdiv_up64(nest_sizze_207163,
                                                    segmap_group_sizze_207164);
    struct memblock_device mem_229200;
    
    mem_229200.references = NULL;
    if (memblock_alloc_device(ctx, &mem_229200, bytes_229147, "mem_229200")) {
        err = 1;
        goto cleanup;
    }
    if (m_203489 * n_203490 * (int64_t) 8 > 0) {
        OPENCL_SUCCEED_OR_RETURN(clEnqueueCopyBuffer(ctx->opencl.queue,
                                                     mem_229161.mem,
                                                     mem_229200.mem,
                                                     (size_t) (int64_t) 0,
                                                     (size_t) (int64_t) 0,
                                                     (size_t) (m_203489 *
                                                               n_203490 *
                                                               (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_229202 = n_p_203492 * partition_sizze_203577;
    int64_t binop_x_229203 = defunc_0_f_res_203631 * binop_x_229202;
    int64_t binop_y_229204 = (int64_t) 8 * binop_x_229203;
    int64_t bytes_229205 = smax64((int64_t) 0, binop_y_229204);
    struct memblock_device mem_229206;
    
    mem_229206.references = NULL;
    if (memblock_alloc_device(ctx, &mem_229206, bytes_229205, "mem_229206")) {
        err = 1;
        goto cleanup;
    }
    if (ctx->debugging)
        fprintf(ctx->log, "%s\n", "\n# SegMap");
    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_207170, 1,
                                            sizeof(ctx->failure_is_an_option),
                                            &ctx->failure_is_an_option));
    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_207170, 3,
                                            sizeof(n_203490), &n_203490));
    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_207170, 4,
                                            sizeof(n_p_203492), &n_p_203492));
    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_207170, 5,
                                            sizeof(partition_sizze_203577),
                                            &partition_sizze_203577));
    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_207170, 6,
                                            sizeof(defunc_0_f_res_203631),
                                            &defunc_0_f_res_203631));
    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_207170, 7,
                                            sizeof(i_203670), &i_203670));
    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_207170, 8,
                                            sizeof(mem_229200.mem),
                                            &mem_229200.mem));
    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_207170, 9,
                                            sizeof(mem_229206.mem),
                                            &mem_229206.mem));
    if (1 * ((size_t) segmap_usable_groups_207165 *
             (size_t) segmap_group_sizze_207164) != 0) {
        const size_t global_work_sizze_236788[1] =
                     {(size_t) segmap_usable_groups_207165 *
                     (size_t) segmap_group_sizze_207164};
        const size_t local_work_sizze_236792[1] =
                     {(size_t) segmap_group_sizze_207164};
        int64_t time_start_236789 = 0, time_end_236790 = 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_207170", global_work_sizze_236788[0],
                    local_work_sizze_236792[0], (int) 0);
            time_start_236789 = get_wall_time();
        }
        OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                        ctx->mainzisegmap_207170,
                                                        1, NULL,
                                                        global_work_sizze_236788,
                                                        local_work_sizze_236792,
                                                        0, NULL,
                                                        ctx->profiling_paused ||
                                                        !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                  &ctx->mainzisegmap_207170_runs,
                                                                                                  &ctx->mainzisegmap_207170_total_runtime)));
        if (ctx->debugging) {
            OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
            time_end_236790 = get_wall_time();
            
            long time_diff_236791 = time_end_236790 - time_start_236789;
            
            fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                    "main.segmap_207170", time_diff_236791);
        }
    }
    ctx->failure_is_an_option = 1;
    if (ctx->debugging)
        fprintf(ctx->log, "%s\n", "");
    if (memblock_unref_device(ctx, &mem_229200, "mem_229200") != 0)
        return 1;
    
    int64_t i_203718 = sub64(defunc_0_f_res_203631, (int64_t) 1);
    bool x_203719 = sle64((int64_t) 0, i_203718);
    bool y_203720 = slt64(i_203718, defunc_0_f_res_203631);
    bool bounds_check_203721 = x_203719 && y_203720;
    bool index_certs_203722;
    
    if (!bounds_check_203721) {
        ctx->error = msgprintf("Error: %s%lld%s%lld%s\n\nBacktrace:\n%s",
                               "Index [", (long long) i_203718,
                               "] out of bounds for array of shape [",
                               (long long) defunc_0_f_res_203631, "].",
                               "-> #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_229206, "mem_229206") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229200, "mem_229200") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229196, "ext_mem_229196") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229197, "ext_mem_229197") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229164, "mem_229164") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229161, "mem_229161") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229157, "mem_229157") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229155, "mem_229155") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229152, "mem_229152") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229148, "mem_229148") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232249, "mem_out_232249") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232248, "mem_out_232248") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232247, "mem_out_232247") != 0)
            return 1;
        err = 1;
        goto cleanup;
    }
    
    int64_t y_207235 = smin64(n_p_203492, y_207162);
    int64_t intra_avail_par_207236 = smin64(y_207162, y_207235);
    int64_t computed_group_sizze_207187 = smax64(n_p_203492, y_207162);
    bool fits_207243 = sle64(computed_group_sizze_207187,
                             max_group_sizze_206887);
    bool suff_intra_par_207241;
    
    suff_intra_par_207241 = *ctx->tuning_params.mainzisuff_intra_par_1 <=
        intra_avail_par_207236;
    if (ctx->logging)
        fprintf(ctx->log, "Compared %s <= %ld: %s.\n", "main.suff_intra_par_1",
                (long) intra_avail_par_207236,
                suff_intra_par_207241 ? "true" : "false");
    
    bool intra_suff_and_fits_207244 = suff_intra_par_207241 && fits_207243;
    bool fits_207514 = sle64(defunc_0_f_res_203631, max_group_sizze_206887);
    bool suff_intra_par_207516;
    
    suff_intra_par_207516 = *ctx->tuning_params.mainzisuff_intra_par_2 <=
        defunc_0_f_res_203631;
    if (ctx->logging)
        fprintf(ctx->log, "Compared %s <= %ld: %s.\n", "main.suff_intra_par_2",
                (long) defunc_0_f_res_203631,
                suff_intra_par_207516 ? "true" : "false");
    
    bool intra_suff_and_fits_207517 = fits_207514 && suff_intra_par_207516;
    int64_t segscan_group_sizze_207552;
    
    segscan_group_sizze_207552 =
        *ctx->tuning_params.mainzisegscan_group_sizze_207419;
    
    int64_t num_groups_207553;
    int32_t max_num_groups_232461;
    
    max_num_groups_232461 = *ctx->tuning_params.mainzisegscan_num_groups_207421;
    num_groups_207553 = sext_i64_i32(smax64((int64_t) 1,
                                            smin64(sdiv_up64(binop_x_229203,
                                                             segscan_group_sizze_207552),
                                                   sext_i32_i64(max_num_groups_232461))));
    
    int64_t segmap_group_sizze_207599;
    
    segmap_group_sizze_207599 =
        *ctx->tuning_params.mainzisegmap_group_sizze_207350;
    
    int64_t binop_y_229224 = (int64_t) 8 * binop_x_229202;
    int64_t bytes_229225 = smax64((int64_t) 0, binop_y_229224);
    int64_t binop_y_229210 = (int64_t) 8 * y_207162;
    int64_t bytes_229211 = smax64((int64_t) 0, binop_y_229210);
    int64_t binop_y_229229 = (int64_t) 8 * defunc_0_f_res_203631;
    int64_t bytes_229230 = smax64((int64_t) 0, binop_y_229229);
    struct memblock_device ext_mem_229265;
    
    ext_mem_229265.references = NULL;
    
    struct memblock_device ext_mem_229264;
    
    ext_mem_229264.references = NULL;
    
    int32_t local_memory_capacity_232611;
    
    local_memory_capacity_232611 = ctx->opencl.max_local_memory;
    if (sle64(bytes_229211 + srem64((int64_t) 8 - srem64(bytes_229211,
                                                         (int64_t) 8),
                                    (int64_t) 8) + (bytes_229211 +
                                                    srem64((int64_t) 8 -
                                                           srem64(bytes_229211,
                                                                  (int64_t) 8),
                                                           (int64_t) 8)),
              sext_i32_i64(local_memory_capacity_232611)) &&
        intra_suff_and_fits_207244) {
        struct memblock_device mem_229222;
        
        mem_229222.references = NULL;
        if (memblock_alloc_device(ctx, &mem_229222, bytes_229205,
                                  "mem_229222")) {
            err = 1;
            goto cleanup;
        }
        
        struct memblock_device mem_229226;
        
        mem_229226.references = NULL;
        if (memblock_alloc_device(ctx, &mem_229226, bytes_229225,
                                  "mem_229226")) {
            err = 1;
            goto cleanup;
        }
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "\n# SegMap");
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_207248,
                                                1, (size_t) bytes_229211,
                                                NULL));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_207248,
                                                2, (size_t) bytes_229211,
                                                NULL));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_207248,
                                                3, sizeof(n_p_203492),
                                                &n_p_203492));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_207248,
                                                4,
                                                sizeof(partition_sizze_203577),
                                                &partition_sizze_203577));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_207248,
                                                5,
                                                sizeof(defunc_0_f_res_203631),
                                                &defunc_0_f_res_203631));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_207248,
                                                6, sizeof(i_203718),
                                                &i_203718));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_207248,
                                                7,
                                                sizeof(computed_group_sizze_207187),
                                                &computed_group_sizze_207187));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_207248,
                                                8, sizeof(mem_229206.mem),
                                                &mem_229206.mem));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_207248,
                                                9, sizeof(mem_229222.mem),
                                                &mem_229222.mem));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_207248,
                                                10, sizeof(mem_229226.mem),
                                                &mem_229226.mem));
        if (1 * ((size_t) partition_sizze_203577 *
                 (size_t) computed_group_sizze_207187) != 0) {
            const size_t global_work_sizze_236793[1] =
                         {(size_t) partition_sizze_203577 *
                         (size_t) computed_group_sizze_207187};
            const size_t local_work_sizze_236797[1] =
                         {(size_t) computed_group_sizze_207187};
            int64_t time_start_236794 = 0, time_end_236795 = 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_207248",
                        global_work_sizze_236793[0], local_work_sizze_236797[0],
                        (int) (0 + bytes_229211 + bytes_229211));
                time_start_236794 = get_wall_time();
            }
            OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                            ctx->mainzisegmap_intragroup_207248,
                                                            1, NULL,
                                                            global_work_sizze_236793,
                                                            local_work_sizze_236797,
                                                            0, NULL,
                                                            ctx->profiling_paused ||
                                                            !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                      &ctx->mainzisegmap_intragroup_207248_runs,
                                                                                                      &ctx->mainzisegmap_intragroup_207248_total_runtime)));
            if (ctx->debugging) {
                OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                time_end_236795 = get_wall_time();
                
                long time_diff_236796 = time_end_236795 - time_start_236794;
                
                fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                        "main.segmap_intragroup_207248", time_diff_236796);
            }
        }
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "");
        if (memblock_set_device(ctx, &ext_mem_229265, &mem_229222,
                                "mem_229222") != 0)
            return 1;
        if (memblock_set_device(ctx, &ext_mem_229264, &mem_229226,
                                "mem_229226") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229226, "mem_229226") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229222, "mem_229222") != 0)
            return 1;
    } else {
        struct memblock_device ext_mem_229263;
        
        ext_mem_229263.references = NULL;
        
        struct memblock_device ext_mem_229262;
        
        ext_mem_229262.references = NULL;
        
        int32_t local_memory_capacity_232610;
        
        local_memory_capacity_232610 = ctx->opencl.max_local_memory;
        if (sle64(bytes_229230 + srem64((int64_t) 8 - srem64(bytes_229230,
                                                             (int64_t) 8),
                                        (int64_t) 8) + (bytes_229230 +
                                                        srem64((int64_t) 8 -
                                                               srem64(bytes_229230,
                                                                      (int64_t) 8),
                                                               (int64_t) 8)),
                  sext_i32_i64(local_memory_capacity_232610)) &&
            intra_suff_and_fits_207517) {
            struct memblock_device mem_229240;
            
            mem_229240.references = NULL;
            if (memblock_alloc_device(ctx, &mem_229240, bytes_229205,
                                      "mem_229240")) {
                err = 1;
                goto cleanup;
            }
            
            struct memblock_device mem_229244;
            
            mem_229244.references = NULL;
            if (memblock_alloc_device(ctx, &mem_229244, bytes_229225,
                                      "mem_229244")) {
                err = 1;
                goto cleanup;
            }
            if (ctx->debugging)
                fprintf(ctx->log, "%s\n", "\n# SegMap");
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_207524,
                                                    1, (size_t) bytes_229230,
                                                    NULL));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_207524,
                                                    2, (size_t) bytes_229230,
                                                    NULL));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_207524,
                                                    3, sizeof(n_p_203492),
                                                    &n_p_203492));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_207524,
                                                    4,
                                                    sizeof(partition_sizze_203577),
                                                    &partition_sizze_203577));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_207524,
                                                    5,
                                                    sizeof(defunc_0_f_res_203631),
                                                    &defunc_0_f_res_203631));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_207524,
                                                    6, sizeof(i_203718),
                                                    &i_203718));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_207524,
                                                    7, sizeof(mem_229206.mem),
                                                    &mem_229206.mem));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_207524,
                                                    8, sizeof(mem_229240.mem),
                                                    &mem_229240.mem));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_207524,
                                                    9, sizeof(mem_229244.mem),
                                                    &mem_229244.mem));
            if (1 * ((size_t) binop_x_229202 *
                     (size_t) defunc_0_f_res_203631) != 0) {
                const size_t global_work_sizze_236798[1] =
                             {(size_t) binop_x_229202 *
                             (size_t) defunc_0_f_res_203631};
                const size_t local_work_sizze_236802[1] =
                             {(size_t) defunc_0_f_res_203631};
                int64_t time_start_236799 = 0, time_end_236800 = 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_207524",
                            global_work_sizze_236798[0],
                            local_work_sizze_236802[0], (int) (0 +
                                                               bytes_229230 +
                                                               bytes_229230));
                    time_start_236799 = get_wall_time();
                }
                OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                ctx->mainzisegmap_intragroup_207524,
                                                                1, NULL,
                                                                global_work_sizze_236798,
                                                                local_work_sizze_236802,
                                                                0, NULL,
                                                                ctx->profiling_paused ||
                                                                !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                          &ctx->mainzisegmap_intragroup_207524_runs,
                                                                                                          &ctx->mainzisegmap_intragroup_207524_total_runtime)));
                if (ctx->debugging) {
                    OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                    time_end_236800 = get_wall_time();
                    
                    long time_diff_236801 = time_end_236800 - time_start_236799;
                    
                    fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                            "main.segmap_intragroup_207524", time_diff_236801);
                }
            }
            if (ctx->debugging)
                fprintf(ctx->log, "%s\n", "");
            if (memblock_set_device(ctx, &ext_mem_229263, &mem_229240,
                                    "mem_229240") != 0)
                return 1;
            if (memblock_set_device(ctx, &ext_mem_229262, &mem_229244,
                                    "mem_229244") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_229244, "mem_229244") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_229240, "mem_229240") != 0)
                return 1;
        } else {
            struct memblock_device mem_229250;
            
            mem_229250.references = NULL;
            if (memblock_alloc_device(ctx, &mem_229250, bytes_229205,
                                      "mem_229250")) {
                err = 1;
                goto cleanup;
            }
            if (slt64((int64_t) 0, partition_sizze_203577 * n_p_203492 *
                      defunc_0_f_res_203631)) {
                if (ctx->debugging)
                    fprintf(ctx->log, "%s\n", "\n# SegScan");
                
                int64_t stage1_max_num_groups_232521;
                
                stage1_max_num_groups_232521 = ctx->opencl.max_group_size;
                
                int64_t stage1_num_groups_232522 =
                        smin64(stage1_max_num_groups_232521, num_groups_207553);
                int32_t num_threads_232523 =
                        sext_i64_i32(stage1_num_groups_232522 *
                        segscan_group_sizze_207552);
                
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage1_207559,
                                                        1,
                                                        (size_t) smax64((int64_t) 1,
                                                                        (int64_t) 8 *
                                                                        segscan_group_sizze_207552),
                                                        NULL));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage1_207559,
                                                        2, sizeof(n_p_203492),
                                                        &n_p_203492));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage1_207559,
                                                        3,
                                                        sizeof(partition_sizze_203577),
                                                        &partition_sizze_203577));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage1_207559,
                                                        4,
                                                        sizeof(defunc_0_f_res_203631),
                                                        &defunc_0_f_res_203631));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage1_207559,
                                                        5,
                                                        sizeof(num_threads_232523),
                                                        &num_threads_232523));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage1_207559,
                                                        6,
                                                        sizeof(mem_229206.mem),
                                                        &mem_229206.mem));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage1_207559,
                                                        7,
                                                        sizeof(mem_229250.mem),
                                                        &mem_229250.mem));
                if (1 * ((size_t) stage1_num_groups_232522 *
                         (size_t) segscan_group_sizze_207552) != 0) {
                    const size_t global_work_sizze_236803[1] =
                                 {(size_t) stage1_num_groups_232522 *
                                 (size_t) segscan_group_sizze_207552};
                    const size_t local_work_sizze_236807[1] =
                                 {(size_t) segscan_group_sizze_207552};
                    int64_t time_start_236804 = 0, time_end_236805 = 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_207559",
                                global_work_sizze_236803[0],
                                local_work_sizze_236807[0], (int) (0 +
                                                                   smax64((int64_t) 1,
                                                                          (int64_t) 8 *
                                                                          segscan_group_sizze_207552)));
                        time_start_236804 = get_wall_time();
                    }
                    OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                    ctx->mainziscan_stage1_207559,
                                                                    1, NULL,
                                                                    global_work_sizze_236803,
                                                                    local_work_sizze_236807,
                                                                    0, NULL,
                                                                    ctx->profiling_paused ||
                                                                    !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                              &ctx->mainziscan_stage1_207559_runs,
                                                                                                              &ctx->mainziscan_stage1_207559_total_runtime)));
                    if (ctx->debugging) {
                        OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                        time_end_236805 = get_wall_time();
                        
                        long time_diff_236806 = time_end_236805 -
                             time_start_236804;
                        
                        fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                                "main.scan_stage1_207559", time_diff_236806);
                    }
                }
                if (ctx->debugging)
                    fprintf(ctx->log, "%s: %llu%c", "elems_per_group",
                            (long long) (segscan_group_sizze_207552 *
                                         sdiv_up64(partition_sizze_203577 *
                                                   n_p_203492 *
                                                   defunc_0_f_res_203631,
                                                   sext_i32_i64(num_threads_232523))),
                            '\n');
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage2_207559,
                                                        1,
                                                        (size_t) smax64((int64_t) 1,
                                                                        (int64_t) 8 *
                                                                        stage1_num_groups_232522),
                                                        NULL));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage2_207559,
                                                        2, sizeof(n_p_203492),
                                                        &n_p_203492));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage2_207559,
                                                        3,
                                                        sizeof(partition_sizze_203577),
                                                        &partition_sizze_203577));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage2_207559,
                                                        4,
                                                        sizeof(defunc_0_f_res_203631),
                                                        &defunc_0_f_res_203631));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage2_207559,
                                                        5,
                                                        sizeof(stage1_num_groups_232522),
                                                        &stage1_num_groups_232522));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage2_207559,
                                                        6,
                                                        sizeof(num_threads_232523),
                                                        &num_threads_232523));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage2_207559,
                                                        7,
                                                        sizeof(mem_229250.mem),
                                                        &mem_229250.mem));
                if (1 * ((size_t) (int64_t) 1 *
                         (size_t) stage1_num_groups_232522) != 0) {
                    const size_t global_work_sizze_236808[1] =
                                 {(size_t) (int64_t) 1 *
                                 (size_t) stage1_num_groups_232522};
                    const size_t local_work_sizze_236812[1] =
                                 {(size_t) stage1_num_groups_232522};
                    int64_t time_start_236809 = 0, time_end_236810 = 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_207559",
                                global_work_sizze_236808[0],
                                local_work_sizze_236812[0], (int) (0 +
                                                                   smax64((int64_t) 1,
                                                                          (int64_t) 8 *
                                                                          stage1_num_groups_232522)));
                        time_start_236809 = get_wall_time();
                    }
                    OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                    ctx->mainziscan_stage2_207559,
                                                                    1, NULL,
                                                                    global_work_sizze_236808,
                                                                    local_work_sizze_236812,
                                                                    0, NULL,
                                                                    ctx->profiling_paused ||
                                                                    !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                              &ctx->mainziscan_stage2_207559_runs,
                                                                                                              &ctx->mainziscan_stage2_207559_total_runtime)));
                    if (ctx->debugging) {
                        OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                        time_end_236810 = get_wall_time();
                        
                        long time_diff_236811 = time_end_236810 -
                             time_start_236809;
                        
                        fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                                "main.scan_stage2_207559", time_diff_236811);
                    }
                }
                
                int32_t required_groups_232574 =
                        sext_i64_i32(sdiv_up64(partition_sizze_203577 *
                                               n_p_203492 *
                                               defunc_0_f_res_203631,
                                               segscan_group_sizze_207552));
                
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage3_207559,
                                                        1, sizeof(n_p_203492),
                                                        &n_p_203492));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage3_207559,
                                                        2,
                                                        sizeof(partition_sizze_203577),
                                                        &partition_sizze_203577));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage3_207559,
                                                        3,
                                                        sizeof(defunc_0_f_res_203631),
                                                        &defunc_0_f_res_203631));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage3_207559,
                                                        4,
                                                        sizeof(num_groups_207553),
                                                        &num_groups_207553));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage3_207559,
                                                        5,
                                                        sizeof(num_threads_232523),
                                                        &num_threads_232523));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage3_207559,
                                                        6,
                                                        sizeof(required_groups_232574),
                                                        &required_groups_232574));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage3_207559,
                                                        7,
                                                        sizeof(mem_229250.mem),
                                                        &mem_229250.mem));
                if (1 * ((size_t) num_groups_207553 *
                         (size_t) segscan_group_sizze_207552) != 0) {
                    const size_t global_work_sizze_236813[1] =
                                 {(size_t) num_groups_207553 *
                                 (size_t) segscan_group_sizze_207552};
                    const size_t local_work_sizze_236817[1] =
                                 {(size_t) segscan_group_sizze_207552};
                    int64_t time_start_236814 = 0, time_end_236815 = 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_207559",
                                global_work_sizze_236813[0],
                                local_work_sizze_236817[0], (int) 0);
                        time_start_236814 = get_wall_time();
                    }
                    OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                    ctx->mainziscan_stage3_207559,
                                                                    1, NULL,
                                                                    global_work_sizze_236813,
                                                                    local_work_sizze_236817,
                                                                    0, NULL,
                                                                    ctx->profiling_paused ||
                                                                    !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                              &ctx->mainziscan_stage3_207559_runs,
                                                                                                              &ctx->mainziscan_stage3_207559_total_runtime)));
                    if (ctx->debugging) {
                        OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                        time_end_236815 = get_wall_time();
                        
                        long time_diff_236816 = time_end_236815 -
                             time_start_236814;
                        
                        fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                                "main.scan_stage3_207559", time_diff_236816);
                    }
                }
            }
            
            struct memblock_device mem_229255;
            
            mem_229255.references = NULL;
            if (memblock_alloc_device(ctx, &mem_229255, bytes_229205,
                                      "mem_229255")) {
                err = 1;
                goto cleanup;
            }
            if (futrts_builtinzhreplicate_i64(ctx, mem_229255,
                                              partition_sizze_203577 *
                                              n_p_203492 *
                                              defunc_0_f_res_203631,
                                              (int64_t) -1) != 0) {
                if (memblock_unref_device(ctx, &mem_229255, "mem_229255") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_229250, "mem_229250") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_229262,
                                          "ext_mem_229262") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_229263,
                                          "ext_mem_229263") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_229264,
                                          "ext_mem_229264") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_229265,
                                          "ext_mem_229265") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_229206, "mem_229206") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_229200, "mem_229200") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_229196,
                                          "ext_mem_229196") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_229197,
                                          "ext_mem_229197") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_229164, "mem_229164") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_229161, "mem_229161") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_229157, "mem_229157") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_229155, "mem_229155") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_229152, "mem_229152") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_229148, "mem_229148") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_out_232249,
                                          "mem_out_232249") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_out_232248,
                                          "mem_out_232248") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_out_232247,
                                          "mem_out_232247") != 0)
                    return 1;
                err = 1;
                goto cleanup;
            }
            
            int64_t segmap_usable_groups_207600 = sdiv_up64(nest_sizze_207163,
                                                            segmap_group_sizze_207599);
            
            if (ctx->debugging)
                fprintf(ctx->log, "%s\n", "\n# SegMap");
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_207605, 1,
                                                    sizeof(n_p_203492),
                                                    &n_p_203492));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_207605, 2,
                                                    sizeof(partition_sizze_203577),
                                                    &partition_sizze_203577));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_207605, 3,
                                                    sizeof(defunc_0_f_res_203631),
                                                    &defunc_0_f_res_203631));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_207605, 4,
                                                    sizeof(mem_229206.mem),
                                                    &mem_229206.mem));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_207605, 5,
                                                    sizeof(mem_229250.mem),
                                                    &mem_229250.mem));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_207605, 6,
                                                    sizeof(mem_229255.mem),
                                                    &mem_229255.mem));
            if (1 * ((size_t) segmap_usable_groups_207600 *
                     (size_t) segmap_group_sizze_207599) != 0) {
                const size_t global_work_sizze_236818[1] =
                             {(size_t) segmap_usable_groups_207600 *
                             (size_t) segmap_group_sizze_207599};
                const size_t local_work_sizze_236822[1] =
                             {(size_t) segmap_group_sizze_207599};
                int64_t time_start_236819 = 0, time_end_236820 = 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_207605", global_work_sizze_236818[0],
                            local_work_sizze_236822[0], (int) 0);
                    time_start_236819 = get_wall_time();
                }
                OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                ctx->mainzisegmap_207605,
                                                                1, NULL,
                                                                global_work_sizze_236818,
                                                                local_work_sizze_236822,
                                                                0, NULL,
                                                                ctx->profiling_paused ||
                                                                !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                          &ctx->mainzisegmap_207605_runs,
                                                                                                          &ctx->mainzisegmap_207605_total_runtime)));
                if (ctx->debugging) {
                    OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                    time_end_236820 = get_wall_time();
                    
                    long time_diff_236821 = time_end_236820 - time_start_236819;
                    
                    fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                            "main.segmap_207605", time_diff_236821);
                }
            }
            if (ctx->debugging)
                fprintf(ctx->log, "%s\n", "");
            
            struct memblock_device mem_229260;
            
            mem_229260.references = NULL;
            if (memblock_alloc_device(ctx, &mem_229260, bytes_229225,
                                      "mem_229260")) {
                err = 1;
                goto cleanup;
            }
            
            int64_t group_sizze_232601;
            
            group_sizze_232601 = *ctx->tuning_params.mainzigroup_sizze_232601;
            
            int64_t num_groups_232602 = sdiv_up64(partition_sizze_203577 *
                                                  n_p_203492,
                                                  group_sizze_232601);
            
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzicopy_232598, 0,
                                                    sizeof(n_p_203492),
                                                    &n_p_203492));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzicopy_232598, 1,
                                                    sizeof(partition_sizze_203577),
                                                    &partition_sizze_203577));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzicopy_232598, 2,
                                                    sizeof(defunc_0_f_res_203631),
                                                    &defunc_0_f_res_203631));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzicopy_232598, 3,
                                                    sizeof(i_203718),
                                                    &i_203718));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzicopy_232598, 4,
                                                    sizeof(mem_229250.mem),
                                                    &mem_229250.mem));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzicopy_232598, 5,
                                                    sizeof(mem_229260.mem),
                                                    &mem_229260.mem));
            if (1 * ((size_t) num_groups_232602 *
                     (size_t) group_sizze_232601) != 0) {
                const size_t global_work_sizze_236823[1] =
                             {(size_t) num_groups_232602 *
                             (size_t) group_sizze_232601};
                const size_t local_work_sizze_236827[1] =
                             {(size_t) group_sizze_232601};
                int64_t time_start_236824 = 0, time_end_236825 = 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_232598", global_work_sizze_236823[0],
                            local_work_sizze_236827[0], (int) 0);
                    time_start_236824 = get_wall_time();
                }
                OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                ctx->mainzicopy_232598,
                                                                1, NULL,
                                                                global_work_sizze_236823,
                                                                local_work_sizze_236827,
                                                                0, NULL,
                                                                ctx->profiling_paused ||
                                                                !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                          &ctx->mainzicopy_232598_runs,
                                                                                                          &ctx->mainzicopy_232598_total_runtime)));
                if (ctx->debugging) {
                    OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                    time_end_236825 = get_wall_time();
                    
                    long time_diff_236826 = time_end_236825 - time_start_236824;
                    
                    fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                            "main.copy_232598", time_diff_236826);
                }
            }
            if (memblock_unref_device(ctx, &mem_229250, "mem_229250") != 0)
                return 1;
            if (memblock_set_device(ctx, &ext_mem_229263, &mem_229255,
                                    "mem_229255") != 0)
                return 1;
            if (memblock_set_device(ctx, &ext_mem_229262, &mem_229260,
                                    "mem_229260") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_229260, "mem_229260") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_229255, "mem_229255") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_229250, "mem_229250") != 0)
                return 1;
        }
        if (memblock_set_device(ctx, &ext_mem_229265, &ext_mem_229263,
                                "ext_mem_229263") != 0)
            return 1;
        if (memblock_set_device(ctx, &ext_mem_229264, &ext_mem_229262,
                                "ext_mem_229262") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229262, "ext_mem_229262") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229263, "ext_mem_229263") != 0)
            return 1;
    }
    if (memblock_unref_device(ctx, &mem_229206, "mem_229206") != 0)
        return 1;
    
    int64_t min_res_203749 = smin64(q_s_203493, defunc_0_f_res_203631);
    bool bounds_invalid_upwards_203750 = slt64(s_n_m_203636, (int64_t) 0);
    bool valid_203751 = !bounds_invalid_upwards_203750;
    bool range_valid_c_203752;
    
    if (!valid_203751) {
        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_203636, " 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_229264, "ext_mem_229264") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229265, "ext_mem_229265") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229206, "mem_229206") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229200, "mem_229200") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229196, "ext_mem_229196") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229197, "ext_mem_229197") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229164, "mem_229164") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229161, "mem_229161") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229157, "mem_229157") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229155, "mem_229155") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229152, "mem_229152") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229148, "mem_229148") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232249, "mem_out_232249") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232248, "mem_out_232248") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232247, "mem_out_232247") != 0)
            return 1;
        err = 1;
        goto cleanup;
    }
    
    bool loop_cond_203754 = slt64((int64_t) 1, min_res_203749);
    double i64_res_203755 = sitofp_i64_f64(q_s_203493);
    int64_t one_intra_par_min_207760 = n_p_203492 * s_n_m_203636;
    int64_t y_207763 = smin64(n_p_203492, one_intra_par_min_207760);
    int64_t intra_avail_par_207764 = smin64(y_207162, y_207763);
    int64_t y_207765 = smax64(n_p_203492, one_intra_par_min_207760);
    int64_t computed_group_sizze_207619 = smax64(y_207162, y_207765);
    bool fits_207772 = sle64(computed_group_sizze_207619,
                             max_group_sizze_206887);
    bool suff_intra_par_207770;
    
    suff_intra_par_207770 = *ctx->tuning_params.mainzisuff_intra_par_3 <=
        intra_avail_par_207764;
    if (ctx->logging)
        fprintf(ctx->log, "Compared %s <= %ld: %s.\n", "main.suff_intra_par_3",
                (long) intra_avail_par_207764,
                suff_intra_par_207770 ? "true" : "false");
    
    bool intra_suff_and_fits_207773 = suff_intra_par_207770 && fits_207772;
    int64_t intra_avail_par_208666 = smin64(defunc_0_f_res_203631,
                                            s_n_m_203636);
    int64_t computed_group_sizze_208667 = smax64(defunc_0_f_res_203631,
                                                 s_n_m_203636);
    bool fits_208671 = sle64(computed_group_sizze_208667,
                             max_group_sizze_206887);
    bool suff_intra_par_208673;
    
    suff_intra_par_208673 = *ctx->tuning_params.mainzisuff_intra_par_4 <=
        intra_avail_par_208666;
    if (ctx->logging)
        fprintf(ctx->log, "Compared %s <= %ld: %s.\n", "main.suff_intra_par_4",
                (long) intra_avail_par_208666,
                suff_intra_par_208673 ? "true" : "false");
    
    bool intra_suff_and_fits_208674 = fits_208671 && suff_intra_par_208673;
    int64_t segmap_group_sizze_208812;
    
    segmap_group_sizze_208812 =
        *ctx->tuning_params.mainzisegmap_group_sizze_208475;
    
    int64_t segmap_group_sizze_208824;
    
    segmap_group_sizze_208824 =
        *ctx->tuning_params.mainzisegmap_group_sizze_208444;
    
    int64_t nest_sizze_208848 = partition_sizze_203577 *
            one_intra_par_min_207760;
    int64_t segmap_group_sizze_208849;
    
    segmap_group_sizze_208849 =
        *ctx->tuning_params.mainzisegmap_group_sizze_208205;
    
    int64_t binop_x_229295 = s_n_m_203636 * binop_x_229202;
    int64_t binop_y_229296 = (int64_t) 8 * binop_x_229295;
    int64_t bytes_229297 = smax64((int64_t) 0, binop_y_229296);
    int64_t binop_y_229273 = (int64_t) 8 * n_p_203492;
    int64_t bytes_229274 = smax64((int64_t) 0, binop_y_229273);
    int64_t binop_y_229287 = (int64_t) 8 * one_intra_par_min_207760;
    int64_t bytes_229288 = smax64((int64_t) 0, binop_y_229287);
    int64_t binop_y_229310 = (int64_t) 8 * s_n_m_203636;
    int64_t bytes_229311 = smax64((int64_t) 0, binop_y_229310);
    struct memblock_device ext_mem_229363;
    
    ext_mem_229363.references = NULL;
    
    struct memblock_device ext_mem_229362;
    
    ext_mem_229362.references = NULL;
    
    int32_t local_memory_capacity_232713;
    
    local_memory_capacity_232713 = ctx->opencl.max_local_memory;
    if (sle64(bytes_229288 + srem64((int64_t) 8 - srem64(bytes_229288,
                                                         (int64_t) 8),
                                    (int64_t) 8) + (bytes_229288 +
                                                    srem64((int64_t) 8 -
                                                           srem64(bytes_229288,
                                                                  (int64_t) 8),
                                                           (int64_t) 8)) +
              (bytes_229274 + srem64((int64_t) 8 - srem64(bytes_229274,
                                                          (int64_t) 8),
                                     (int64_t) 8)) + (bytes_229274 +
                                                      srem64((int64_t) 8 -
                                                             srem64(bytes_229274,
                                                                    (int64_t) 8),
                                                             (int64_t) 8)) +
              (bytes_229274 + srem64((int64_t) 8 - srem64(bytes_229274,
                                                          (int64_t) 8),
                                     (int64_t) 8)) + (bytes_229274 +
                                                      srem64((int64_t) 8 -
                                                             srem64(bytes_229274,
                                                                    (int64_t) 8),
                                                             (int64_t) 8)) +
              (bytes_229211 + srem64((int64_t) 8 - srem64(bytes_229211,
                                                          (int64_t) 8),
                                     (int64_t) 8)),
              sext_i32_i64(local_memory_capacity_232713)) &&
        intra_suff_and_fits_207773) {
        struct memblock_device mem_229298;
        
        mem_229298.references = NULL;
        if (memblock_alloc_device(ctx, &mem_229298, bytes_229297,
                                  "mem_229298")) {
            err = 1;
            goto cleanup;
        }
        
        struct memblock_device mem_229303;
        
        mem_229303.references = NULL;
        if (memblock_alloc_device(ctx, &mem_229303, bytes_229297,
                                  "mem_229303")) {
            err = 1;
            goto cleanup;
        }
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "\n# SegMap");
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_207777,
                                                1,
                                                sizeof(ctx->failure_is_an_option),
                                                &ctx->failure_is_an_option));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_207777,
                                                3, (size_t) bytes_229211,
                                                NULL));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_207777,
                                                4, (size_t) bytes_229274,
                                                NULL));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_207777,
                                                5, (size_t) bytes_229274,
                                                NULL));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_207777,
                                                6, (size_t) bytes_229274,
                                                NULL));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_207777,
                                                7, (size_t) bytes_229274,
                                                NULL));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_207777,
                                                8, (size_t) bytes_229288,
                                                NULL));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_207777,
                                                9, (size_t) bytes_229288,
                                                NULL));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_207777,
                                                10, sizeof(n_p_203492),
                                                &n_p_203492));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_207777,
                                                11, sizeof(q_s_203493),
                                                &q_s_203493));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_207777,
                                                12, sizeof(jump_s_203499),
                                                &jump_s_203499));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_207777,
                                                13,
                                                sizeof(partition_sizze_203577),
                                                &partition_sizze_203577));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_207777,
                                                14,
                                                sizeof(defunc_0_f_res_203631),
                                                &defunc_0_f_res_203631));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_207777,
                                                15, sizeof(pad_css_len_203632),
                                                &pad_css_len_203632));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_207777,
                                                16, sizeof(s_n_m_203636),
                                                &s_n_m_203636));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_207777,
                                                17, sizeof(i_203718),
                                                &i_203718));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_207777,
                                                18, sizeof(x_203719),
                                                &x_203719));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_207777,
                                                19, sizeof(min_res_203749),
                                                &min_res_203749));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_207777,
                                                20, sizeof(loop_cond_203754),
                                                &loop_cond_203754));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_207777,
                                                21, sizeof(i64_res_203755),
                                                &i64_res_203755));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_207777,
                                                22,
                                                sizeof(computed_group_sizze_207619),
                                                &computed_group_sizze_207619));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_207777,
                                                23, sizeof(ext_mem_229264.mem),
                                                &ext_mem_229264.mem));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_207777,
                                                24, sizeof(ext_mem_229265.mem),
                                                &ext_mem_229265.mem));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_207777,
                                                25, sizeof(mem_229298.mem),
                                                &mem_229298.mem));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_207777,
                                                26, sizeof(mem_229303.mem),
                                                &mem_229303.mem));
        if (1 * ((size_t) partition_sizze_203577 *
                 (size_t) computed_group_sizze_207619) != 0) {
            const size_t global_work_sizze_236828[1] =
                         {(size_t) partition_sizze_203577 *
                         (size_t) computed_group_sizze_207619};
            const size_t local_work_sizze_236832[1] =
                         {(size_t) computed_group_sizze_207619};
            int64_t time_start_236829 = 0, time_end_236830 = 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_207777",
                        global_work_sizze_236828[0], local_work_sizze_236832[0],
                        (int) (0 + bytes_229211 + bytes_229274 + bytes_229274 +
                               bytes_229274 + bytes_229274 + bytes_229288 +
                               bytes_229288));
                time_start_236829 = get_wall_time();
            }
            OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                            ctx->mainzisegmap_intragroup_207777,
                                                            1, NULL,
                                                            global_work_sizze_236828,
                                                            local_work_sizze_236832,
                                                            0, NULL,
                                                            ctx->profiling_paused ||
                                                            !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                      &ctx->mainzisegmap_intragroup_207777_runs,
                                                                                                      &ctx->mainzisegmap_intragroup_207777_total_runtime)));
            if (ctx->debugging) {
                OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                time_end_236830 = get_wall_time();
                
                long time_diff_236831 = time_end_236830 - time_start_236829;
                
                fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                        "main.segmap_intragroup_207777", time_diff_236831);
            }
        }
        ctx->failure_is_an_option = 1;
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "");
        if (memblock_set_device(ctx, &ext_mem_229363, &mem_229298,
                                "mem_229298") != 0)
            return 1;
        if (memblock_set_device(ctx, &ext_mem_229362, &mem_229303,
                                "mem_229303") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229303, "mem_229303") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229298, "mem_229298") != 0)
            return 1;
    } else {
        struct memblock_device ext_mem_229361;
        
        ext_mem_229361.references = NULL;
        
        struct memblock_device ext_mem_229360;
        
        ext_mem_229360.references = NULL;
        
        int32_t local_memory_capacity_232712;
        
        local_memory_capacity_232712 = ctx->opencl.max_local_memory;
        if (sle64(bytes_229311 + srem64((int64_t) 8 - srem64(bytes_229311,
                                                             (int64_t) 8),
                                        (int64_t) 8) + (bytes_229311 +
                                                        srem64((int64_t) 8 -
                                                               srem64(bytes_229311,
                                                                      (int64_t) 8),
                                                               (int64_t) 8)) +
                  (bytes_229230 + srem64((int64_t) 8 - srem64(bytes_229230,
                                                              (int64_t) 8),
                                         (int64_t) 8)),
                  sext_i32_i64(local_memory_capacity_232712)) &&
            intra_suff_and_fits_208674) {
            struct memblock_device mem_229320;
            
            mem_229320.references = NULL;
            if (memblock_alloc_device(ctx, &mem_229320, bytes_229297,
                                      "mem_229320")) {
                err = 1;
                goto cleanup;
            }
            
            struct memblock_device mem_229325;
            
            mem_229325.references = NULL;
            if (memblock_alloc_device(ctx, &mem_229325, bytes_229297,
                                      "mem_229325")) {
                err = 1;
                goto cleanup;
            }
            if (ctx->debugging)
                fprintf(ctx->log, "%s\n", "\n# SegMap");
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_208681,
                                                    1,
                                                    sizeof(ctx->failure_is_an_option),
                                                    &ctx->failure_is_an_option));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_208681,
                                                    3, (size_t) bytes_229230,
                                                    NULL));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_208681,
                                                    4, (size_t) bytes_229311,
                                                    NULL));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_208681,
                                                    5, (size_t) bytes_229311,
                                                    NULL));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_208681,
                                                    6, sizeof(n_p_203492),
                                                    &n_p_203492));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_208681,
                                                    7, sizeof(q_s_203493),
                                                    &q_s_203493));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_208681,
                                                    8, sizeof(jump_s_203499),
                                                    &jump_s_203499));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_208681,
                                                    9,
                                                    sizeof(partition_sizze_203577),
                                                    &partition_sizze_203577));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_208681,
                                                    10,
                                                    sizeof(defunc_0_f_res_203631),
                                                    &defunc_0_f_res_203631));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_208681,
                                                    11,
                                                    sizeof(pad_css_len_203632),
                                                    &pad_css_len_203632));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_208681,
                                                    12, sizeof(s_n_m_203636),
                                                    &s_n_m_203636));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_208681,
                                                    13, sizeof(i_203718),
                                                    &i_203718));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_208681,
                                                    14, sizeof(x_203719),
                                                    &x_203719));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_208681,
                                                    15, sizeof(min_res_203749),
                                                    &min_res_203749));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_208681,
                                                    16,
                                                    sizeof(loop_cond_203754),
                                                    &loop_cond_203754));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_208681,
                                                    17, sizeof(i64_res_203755),
                                                    &i64_res_203755));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_208681,
                                                    18,
                                                    sizeof(computed_group_sizze_208667),
                                                    &computed_group_sizze_208667));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_208681,
                                                    19,
                                                    sizeof(ext_mem_229264.mem),
                                                    &ext_mem_229264.mem));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_208681,
                                                    20,
                                                    sizeof(ext_mem_229265.mem),
                                                    &ext_mem_229265.mem));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_208681,
                                                    21, sizeof(mem_229320.mem),
                                                    &mem_229320.mem));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_208681,
                                                    22, sizeof(mem_229325.mem),
                                                    &mem_229325.mem));
            if (1 * ((size_t) binop_x_229202 *
                     (size_t) computed_group_sizze_208667) != 0) {
                const size_t global_work_sizze_236833[1] =
                             {(size_t) binop_x_229202 *
                             (size_t) computed_group_sizze_208667};
                const size_t local_work_sizze_236837[1] =
                             {(size_t) computed_group_sizze_208667};
                int64_t time_start_236834 = 0, time_end_236835 = 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_208681",
                            global_work_sizze_236833[0],
                            local_work_sizze_236837[0], (int) (0 +
                                                               bytes_229230 +
                                                               bytes_229311 +
                                                               bytes_229311));
                    time_start_236834 = get_wall_time();
                }
                OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                ctx->mainzisegmap_intragroup_208681,
                                                                1, NULL,
                                                                global_work_sizze_236833,
                                                                local_work_sizze_236837,
                                                                0, NULL,
                                                                ctx->profiling_paused ||
                                                                !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                          &ctx->mainzisegmap_intragroup_208681_runs,
                                                                                                          &ctx->mainzisegmap_intragroup_208681_total_runtime)));
                if (ctx->debugging) {
                    OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                    time_end_236835 = get_wall_time();
                    
                    long time_diff_236836 = time_end_236835 - time_start_236834;
                    
                    fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                            "main.segmap_intragroup_208681", time_diff_236836);
                }
            }
            ctx->failure_is_an_option = 1;
            if (ctx->debugging)
                fprintf(ctx->log, "%s\n", "");
            if (memblock_set_device(ctx, &ext_mem_229361, &mem_229320,
                                    "mem_229320") != 0)
                return 1;
            if (memblock_set_device(ctx, &ext_mem_229360, &mem_229325,
                                    "mem_229325") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_229325, "mem_229325") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_229320, "mem_229320") != 0)
                return 1;
        } else {
            int64_t segmap_usable_groups_208813 = sdiv_up64(nest_sizze_207163,
                                                            segmap_group_sizze_208812);
            struct memblock_device mem_229331;
            
            mem_229331.references = NULL;
            if (memblock_alloc_device(ctx, &mem_229331, bytes_229205,
                                      "mem_229331")) {
                err = 1;
                goto cleanup;
            }
            if (ctx->debugging)
                fprintf(ctx->log, "%s\n", "\n# SegMap");
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_208818, 1,
                                                    sizeof(n_p_203492),
                                                    &n_p_203492));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_208818, 2,
                                                    sizeof(partition_sizze_203577),
                                                    &partition_sizze_203577));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_208818, 3,
                                                    sizeof(defunc_0_f_res_203631),
                                                    &defunc_0_f_res_203631));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_208818, 4,
                                                    sizeof(ext_mem_229265.mem),
                                                    &ext_mem_229265.mem));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_208818, 5,
                                                    sizeof(mem_229331.mem),
                                                    &mem_229331.mem));
            if (1 * ((size_t) segmap_usable_groups_208813 *
                     (size_t) segmap_group_sizze_208812) != 0) {
                const size_t global_work_sizze_236838[1] =
                             {(size_t) segmap_usable_groups_208813 *
                             (size_t) segmap_group_sizze_208812};
                const size_t local_work_sizze_236842[1] =
                             {(size_t) segmap_group_sizze_208812};
                int64_t time_start_236839 = 0, time_end_236840 = 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_208818", global_work_sizze_236838[0],
                            local_work_sizze_236842[0], (int) 0);
                    time_start_236839 = get_wall_time();
                }
                OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                ctx->mainzisegmap_208818,
                                                                1, NULL,
                                                                global_work_sizze_236838,
                                                                local_work_sizze_236842,
                                                                0, NULL,
                                                                ctx->profiling_paused ||
                                                                !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                          &ctx->mainzisegmap_208818_runs,
                                                                                                          &ctx->mainzisegmap_208818_total_runtime)));
                if (ctx->debugging) {
                    OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                    time_end_236840 = get_wall_time();
                    
                    long time_diff_236841 = time_end_236840 - time_start_236839;
                    
                    fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                            "main.segmap_208818", time_diff_236841);
                }
            }
            if (ctx->debugging)
                fprintf(ctx->log, "%s\n", "");
            
            int64_t segmap_usable_groups_208825 = sdiv_up64(binop_x_229202,
                                                            segmap_group_sizze_208824);
            struct memblock_device mem_229336;
            
            mem_229336.references = NULL;
            if (memblock_alloc_device(ctx, &mem_229336, bytes_229225,
                                      "mem_229336")) {
                err = 1;
                goto cleanup;
            }
            
            struct memblock_device mem_229340;
            
            mem_229340.references = NULL;
            if (memblock_alloc_device(ctx, &mem_229340, bytes_229225,
                                      "mem_229340")) {
                err = 1;
                goto cleanup;
            }
            
            struct memblock_device mem_229344;
            
            mem_229344.references = NULL;
            if (memblock_alloc_device(ctx, &mem_229344, bytes_229225,
                                      "mem_229344")) {
                err = 1;
                goto cleanup;
            }
            
            struct memblock_device mem_229348;
            
            mem_229348.references = NULL;
            if (memblock_alloc_device(ctx, &mem_229348, bytes_229225,
                                      "mem_229348")) {
                err = 1;
                goto cleanup;
            }
            if (ctx->debugging)
                fprintf(ctx->log, "%s\n", "\n# SegMap");
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_208832, 1,
                                                    sizeof(n_p_203492),
                                                    &n_p_203492));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_208832, 2,
                                                    sizeof(q_s_203493),
                                                    &q_s_203493));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_208832, 3,
                                                    sizeof(partition_sizze_203577),
                                                    &partition_sizze_203577));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_208832, 4,
                                                    sizeof(min_res_203749),
                                                    &min_res_203749));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_208832, 5,
                                                    sizeof(i64_res_203755),
                                                    &i64_res_203755));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_208832, 6,
                                                    sizeof(ext_mem_229264.mem),
                                                    &ext_mem_229264.mem));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_208832, 7,
                                                    sizeof(mem_229336.mem),
                                                    &mem_229336.mem));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_208832, 8,
                                                    sizeof(mem_229340.mem),
                                                    &mem_229340.mem));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_208832, 9,
                                                    sizeof(mem_229344.mem),
                                                    &mem_229344.mem));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_208832,
                                                    10, sizeof(mem_229348.mem),
                                                    &mem_229348.mem));
            if (1 * ((size_t) segmap_usable_groups_208825 *
                     (size_t) segmap_group_sizze_208824) != 0) {
                const size_t global_work_sizze_236843[1] =
                             {(size_t) segmap_usable_groups_208825 *
                             (size_t) segmap_group_sizze_208824};
                const size_t local_work_sizze_236847[1] =
                             {(size_t) segmap_group_sizze_208824};
                int64_t time_start_236844 = 0, time_end_236845 = 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_208832", global_work_sizze_236843[0],
                            local_work_sizze_236847[0], (int) 0);
                    time_start_236844 = get_wall_time();
                }
                OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                ctx->mainzisegmap_208832,
                                                                1, NULL,
                                                                global_work_sizze_236843,
                                                                local_work_sizze_236847,
                                                                0, NULL,
                                                                ctx->profiling_paused ||
                                                                !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                          &ctx->mainzisegmap_208832_runs,
                                                                                                          &ctx->mainzisegmap_208832_total_runtime)));
                if (ctx->debugging) {
                    OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                    time_end_236845 = get_wall_time();
                    
                    long time_diff_236846 = time_end_236845 - time_start_236844;
                    
                    fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                            "main.segmap_208832", time_diff_236846);
                }
            }
            if (ctx->debugging)
                fprintf(ctx->log, "%s\n", "");
            
            int64_t segmap_usable_groups_208850 = sdiv_up64(nest_sizze_208848,
                                                            segmap_group_sizze_208849);
            struct memblock_device mem_229354;
            
            mem_229354.references = NULL;
            if (memblock_alloc_device(ctx, &mem_229354, bytes_229297,
                                      "mem_229354")) {
                err = 1;
                goto cleanup;
            }
            
            struct memblock_device mem_229359;
            
            mem_229359.references = NULL;
            if (memblock_alloc_device(ctx, &mem_229359, bytes_229297,
                                      "mem_229359")) {
                err = 1;
                goto cleanup;
            }
            if (ctx->debugging)
                fprintf(ctx->log, "%s\n", "\n# SegMap");
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_208856, 1,
                                                    sizeof(ctx->failure_is_an_option),
                                                    &ctx->failure_is_an_option));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_208856, 3,
                                                    sizeof(n_p_203492),
                                                    &n_p_203492));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_208856, 4,
                                                    sizeof(jump_s_203499),
                                                    &jump_s_203499));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_208856, 5,
                                                    sizeof(partition_sizze_203577),
                                                    &partition_sizze_203577));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_208856, 6,
                                                    sizeof(defunc_0_f_res_203631),
                                                    &defunc_0_f_res_203631));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_208856, 7,
                                                    sizeof(pad_css_len_203632),
                                                    &pad_css_len_203632));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_208856, 8,
                                                    sizeof(s_n_m_203636),
                                                    &s_n_m_203636));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_208856, 9,
                                                    sizeof(i_203718),
                                                    &i_203718));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_208856,
                                                    10, sizeof(x_203719),
                                                    &x_203719));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_208856,
                                                    11, sizeof(min_res_203749),
                                                    &min_res_203749));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_208856,
                                                    12,
                                                    sizeof(loop_cond_203754),
                                                    &loop_cond_203754));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_208856,
                                                    13, sizeof(mem_229331.mem),
                                                    &mem_229331.mem));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_208856,
                                                    14, sizeof(mem_229336.mem),
                                                    &mem_229336.mem));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_208856,
                                                    15, sizeof(mem_229340.mem),
                                                    &mem_229340.mem));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_208856,
                                                    16, sizeof(mem_229344.mem),
                                                    &mem_229344.mem));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_208856,
                                                    17, sizeof(mem_229348.mem),
                                                    &mem_229348.mem));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_208856,
                                                    18, sizeof(mem_229354.mem),
                                                    &mem_229354.mem));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_208856,
                                                    19, sizeof(mem_229359.mem),
                                                    &mem_229359.mem));
            if (1 * ((size_t) segmap_usable_groups_208850 *
                     (size_t) segmap_group_sizze_208849) != 0) {
                const size_t global_work_sizze_236848[1] =
                             {(size_t) segmap_usable_groups_208850 *
                             (size_t) segmap_group_sizze_208849};
                const size_t local_work_sizze_236852[1] =
                             {(size_t) segmap_group_sizze_208849};
                int64_t time_start_236849 = 0, time_end_236850 = 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_208856", global_work_sizze_236848[0],
                            local_work_sizze_236852[0], (int) 0);
                    time_start_236849 = get_wall_time();
                }
                OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                ctx->mainzisegmap_208856,
                                                                1, NULL,
                                                                global_work_sizze_236848,
                                                                local_work_sizze_236852,
                                                                0, NULL,
                                                                ctx->profiling_paused ||
                                                                !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                          &ctx->mainzisegmap_208856_runs,
                                                                                                          &ctx->mainzisegmap_208856_total_runtime)));
                if (ctx->debugging) {
                    OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                    time_end_236850 = get_wall_time();
                    
                    long time_diff_236851 = time_end_236850 - time_start_236849;
                    
                    fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                            "main.segmap_208856", time_diff_236851);
                }
            }
            ctx->failure_is_an_option = 1;
            if (ctx->debugging)
                fprintf(ctx->log, "%s\n", "");
            if (memblock_unref_device(ctx, &mem_229331, "mem_229331") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_229336, "mem_229336") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_229340, "mem_229340") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_229344, "mem_229344") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_229348, "mem_229348") != 0)
                return 1;
            if (memblock_set_device(ctx, &ext_mem_229361, &mem_229359,
                                    "mem_229359") != 0)
                return 1;
            if (memblock_set_device(ctx, &ext_mem_229360, &mem_229354,
                                    "mem_229354") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_229359, "mem_229359") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_229354, "mem_229354") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_229348, "mem_229348") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_229344, "mem_229344") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_229340, "mem_229340") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_229336, "mem_229336") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_229331, "mem_229331") != 0)
                return 1;
        }
        if (memblock_set_device(ctx, &ext_mem_229363, &ext_mem_229361,
                                "ext_mem_229361") != 0)
            return 1;
        if (memblock_set_device(ctx, &ext_mem_229362, &ext_mem_229360,
                                "ext_mem_229360") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229360, "ext_mem_229360") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229361, "ext_mem_229361") != 0)
            return 1;
    }
    
    int64_t min_res_203881 = smin64(n_203490, q_l_203495);
    bool bounds_invalid_upwards_203882 = slt64(l_n_m_203643, (int64_t) 0);
    bool valid_203883 = !bounds_invalid_upwards_203882;
    bool range_valid_c_203884;
    
    if (!valid_203883) {
        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_203643, " 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_229362, "ext_mem_229362") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229363, "ext_mem_229363") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229264, "ext_mem_229264") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229265, "ext_mem_229265") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229206, "mem_229206") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229200, "mem_229200") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229196, "ext_mem_229196") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229197, "ext_mem_229197") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229164, "mem_229164") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229161, "mem_229161") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229157, "mem_229157") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229155, "mem_229155") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229152, "mem_229152") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229148, "mem_229148") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232249, "mem_out_232249") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232248, "mem_out_232248") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232247, "mem_out_232247") != 0)
            return 1;
        err = 1;
        goto cleanup;
    }
    
    bool loop_cond_203886 = slt64((int64_t) 1, min_res_203881);
    double i64_res_203887 = sitofp_i64_f64(q_l_203495);
    int64_t intra_avail_par_209071 = smin64(n_203490, l_n_m_203643);
    int64_t computed_group_sizze_208973 = smax64(n_203490, l_n_m_203643);
    bool fits_209077 = sle64(computed_group_sizze_208973,
                             max_group_sizze_206887);
    bool suff_intra_par_209075;
    
    suff_intra_par_209075 = *ctx->tuning_params.mainzisuff_intra_par_5 <=
        intra_avail_par_209071;
    if (ctx->logging)
        fprintf(ctx->log, "Compared %s <= %ld: %s.\n", "main.suff_intra_par_5",
                (long) intra_avail_par_209071,
                suff_intra_par_209075 ? "true" : "false");
    
    bool intra_suff_and_fits_209078 = suff_intra_par_209075 && fits_209077;
    int64_t segmap_group_sizze_209461;
    
    segmap_group_sizze_209461 =
        *ctx->tuning_params.mainzisegmap_group_sizze_209437;
    
    int64_t segmap_group_sizze_209471;
    
    segmap_group_sizze_209471 =
        *ctx->tuning_params.mainzisegmap_group_sizze_209411;
    
    int64_t nest_sizze_209492 = partition_sizze_203577 * l_n_m_203643;
    int64_t segmap_group_sizze_209493;
    
    segmap_group_sizze_209493 =
        *ctx->tuning_params.mainzisegmap_group_sizze_209207;
    
    int64_t binop_y_229377 = (int64_t) 8 * nest_sizze_209492;
    int64_t bytes_229378 = smax64((int64_t) 0, binop_y_229377);
    int64_t binop_y_229370 = (int64_t) 8 * l_n_m_203643;
    int64_t bytes_229371 = smax64((int64_t) 0, binop_y_229370);
    struct memblock_device ext_mem_229412;
    
    ext_mem_229412.references = NULL;
    
    struct memblock_device ext_mem_229411;
    
    ext_mem_229411.references = NULL;
    
    int32_t local_memory_capacity_232773;
    
    local_memory_capacity_232773 = ctx->opencl.max_local_memory;
    if (sle64(bytes_229371 + srem64((int64_t) 8 - srem64(bytes_229371,
                                                         (int64_t) 8),
                                    (int64_t) 8) + (bytes_229371 +
                                                    srem64((int64_t) 8 -
                                                           srem64(bytes_229371,
                                                                  (int64_t) 8),
                                                           (int64_t) 8)) +
              (bytes_229169 + srem64((int64_t) 8 - srem64(bytes_229169,
                                                          (int64_t) 8),
                                     (int64_t) 8)),
              sext_i32_i64(local_memory_capacity_232773)) &&
        intra_suff_and_fits_209078) {
        struct memblock_device mem_229379;
        
        mem_229379.references = NULL;
        if (memblock_alloc_device(ctx, &mem_229379, bytes_229378,
                                  "mem_229379")) {
            err = 1;
            goto cleanup;
        }
        
        struct memblock_device mem_229383;
        
        mem_229383.references = NULL;
        if (memblock_alloc_device(ctx, &mem_229383, bytes_229378,
                                  "mem_229383")) {
            err = 1;
            goto cleanup;
        }
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "\n# SegMap");
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_209082,
                                                1,
                                                sizeof(ctx->failure_is_an_option),
                                                &ctx->failure_is_an_option));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_209082,
                                                3, (size_t) bytes_229169,
                                                NULL));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_209082,
                                                4, (size_t) bytes_229371,
                                                NULL));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_209082,
                                                5, (size_t) bytes_229371,
                                                NULL));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_209082,
                                                6, sizeof(n_203490),
                                                &n_203490));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_209082,
                                                7, sizeof(q_l_203495),
                                                &q_l_203495));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_209082,
                                                8, sizeof(jump_l_203501),
                                                &jump_l_203501));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_209082,
                                                9,
                                                sizeof(partition_sizze_203577),
                                                &partition_sizze_203577));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_209082,
                                                10, sizeof(l_n_m_203643),
                                                &l_n_m_203643));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_209082,
                                                11, sizeof(i_203670),
                                                &i_203670));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_209082,
                                                12, sizeof(x_203671),
                                                &x_203671));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_209082,
                                                13, sizeof(min_res_203881),
                                                &min_res_203881));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_209082,
                                                14, sizeof(loop_cond_203886),
                                                &loop_cond_203886));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_209082,
                                                15, sizeof(i64_res_203887),
                                                &i64_res_203887));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_209082,
                                                16,
                                                sizeof(computed_group_sizze_208973),
                                                &computed_group_sizze_208973));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_209082,
                                                17, sizeof(ext_mem_229196.mem),
                                                &ext_mem_229196.mem));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_209082,
                                                18, sizeof(ext_mem_229197.mem),
                                                &ext_mem_229197.mem));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_209082,
                                                19, sizeof(mem_229379.mem),
                                                &mem_229379.mem));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_209082,
                                                20, sizeof(mem_229383.mem),
                                                &mem_229383.mem));
        if (1 * ((size_t) partition_sizze_203577 *
                 (size_t) computed_group_sizze_208973) != 0) {
            const size_t global_work_sizze_236853[1] =
                         {(size_t) partition_sizze_203577 *
                         (size_t) computed_group_sizze_208973};
            const size_t local_work_sizze_236857[1] =
                         {(size_t) computed_group_sizze_208973};
            int64_t time_start_236854 = 0, time_end_236855 = 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_209082",
                        global_work_sizze_236853[0], local_work_sizze_236857[0],
                        (int) (0 + bytes_229169 + bytes_229371 + bytes_229371));
                time_start_236854 = get_wall_time();
            }
            OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                            ctx->mainzisegmap_intragroup_209082,
                                                            1, NULL,
                                                            global_work_sizze_236853,
                                                            local_work_sizze_236857,
                                                            0, NULL,
                                                            ctx->profiling_paused ||
                                                            !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                      &ctx->mainzisegmap_intragroup_209082_runs,
                                                                                                      &ctx->mainzisegmap_intragroup_209082_total_runtime)));
            if (ctx->debugging) {
                OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                time_end_236855 = get_wall_time();
                
                long time_diff_236856 = time_end_236855 - time_start_236854;
                
                fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                        "main.segmap_intragroup_209082", time_diff_236856);
            }
        }
        ctx->failure_is_an_option = 1;
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "");
        if (memblock_set_device(ctx, &ext_mem_229412, &mem_229379,
                                "mem_229379") != 0)
            return 1;
        if (memblock_set_device(ctx, &ext_mem_229411, &mem_229383,
                                "mem_229383") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229383, "mem_229383") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229379, "mem_229379") != 0)
            return 1;
    } else {
        int64_t segmap_usable_groups_209462 = sdiv_up64(nest_sizze_207000,
                                                        segmap_group_sizze_209461);
        struct memblock_device mem_229388;
        
        mem_229388.references = NULL;
        if (memblock_alloc_device(ctx, &mem_229388, bytes_229177,
                                  "mem_229388")) {
            err = 1;
            goto cleanup;
        }
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "\n# SegMap");
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_209466, 1,
                                                sizeof(n_203490), &n_203490));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_209466, 2,
                                                sizeof(partition_sizze_203577),
                                                &partition_sizze_203577));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_209466, 3,
                                                sizeof(ext_mem_229197.mem),
                                                &ext_mem_229197.mem));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_209466, 4,
                                                sizeof(mem_229388.mem),
                                                &mem_229388.mem));
        if (1 * ((size_t) segmap_usable_groups_209462 *
                 (size_t) segmap_group_sizze_209461) != 0) {
            const size_t global_work_sizze_236858[1] =
                         {(size_t) segmap_usable_groups_209462 *
                         (size_t) segmap_group_sizze_209461};
            const size_t local_work_sizze_236862[1] =
                         {(size_t) segmap_group_sizze_209461};
            int64_t time_start_236859 = 0, time_end_236860 = 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_209466", global_work_sizze_236858[0],
                        local_work_sizze_236862[0], (int) 0);
                time_start_236859 = get_wall_time();
            }
            OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                            ctx->mainzisegmap_209466,
                                                            1, NULL,
                                                            global_work_sizze_236858,
                                                            local_work_sizze_236862,
                                                            0, NULL,
                                                            ctx->profiling_paused ||
                                                            !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                      &ctx->mainzisegmap_209466_runs,
                                                                                                      &ctx->mainzisegmap_209466_total_runtime)));
            if (ctx->debugging) {
                OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                time_end_236860 = get_wall_time();
                
                long time_diff_236861 = time_end_236860 - time_start_236859;
                
                fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                        "main.segmap_209466", time_diff_236861);
            }
        }
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "");
        
        int64_t segmap_usable_groups_209472 = sdiv_up64(partition_sizze_203577,
                                                        segmap_group_sizze_209471);
        struct memblock_device mem_229392;
        
        mem_229392.references = NULL;
        if (memblock_alloc_device(ctx, &mem_229392, bytes_229180,
                                  "mem_229392")) {
            err = 1;
            goto cleanup;
        }
        
        struct memblock_device mem_229395;
        
        mem_229395.references = NULL;
        if (memblock_alloc_device(ctx, &mem_229395, bytes_229180,
                                  "mem_229395")) {
            err = 1;
            goto cleanup;
        }
        
        struct memblock_device mem_229398;
        
        mem_229398.references = NULL;
        if (memblock_alloc_device(ctx, &mem_229398, bytes_229180,
                                  "mem_229398")) {
            err = 1;
            goto cleanup;
        }
        
        struct memblock_device mem_229401;
        
        mem_229401.references = NULL;
        if (memblock_alloc_device(ctx, &mem_229401, bytes_229180,
                                  "mem_229401")) {
            err = 1;
            goto cleanup;
        }
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "\n# SegMap");
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_209478, 1,
                                                sizeof(q_l_203495),
                                                &q_l_203495));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_209478, 2,
                                                sizeof(partition_sizze_203577),
                                                &partition_sizze_203577));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_209478, 3,
                                                sizeof(min_res_203881),
                                                &min_res_203881));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_209478, 4,
                                                sizeof(i64_res_203887),
                                                &i64_res_203887));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_209478, 5,
                                                sizeof(ext_mem_229196.mem),
                                                &ext_mem_229196.mem));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_209478, 6,
                                                sizeof(mem_229392.mem),
                                                &mem_229392.mem));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_209478, 7,
                                                sizeof(mem_229395.mem),
                                                &mem_229395.mem));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_209478, 8,
                                                sizeof(mem_229398.mem),
                                                &mem_229398.mem));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_209478, 9,
                                                sizeof(mem_229401.mem),
                                                &mem_229401.mem));
        if (1 * ((size_t) segmap_usable_groups_209472 *
                 (size_t) segmap_group_sizze_209471) != 0) {
            const size_t global_work_sizze_236863[1] =
                         {(size_t) segmap_usable_groups_209472 *
                         (size_t) segmap_group_sizze_209471};
            const size_t local_work_sizze_236867[1] =
                         {(size_t) segmap_group_sizze_209471};
            int64_t time_start_236864 = 0, time_end_236865 = 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_209478", global_work_sizze_236863[0],
                        local_work_sizze_236867[0], (int) 0);
                time_start_236864 = get_wall_time();
            }
            OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                            ctx->mainzisegmap_209478,
                                                            1, NULL,
                                                            global_work_sizze_236863,
                                                            local_work_sizze_236867,
                                                            0, NULL,
                                                            ctx->profiling_paused ||
                                                            !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                      &ctx->mainzisegmap_209478_runs,
                                                                                                      &ctx->mainzisegmap_209478_total_runtime)));
            if (ctx->debugging) {
                OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                time_end_236865 = get_wall_time();
                
                long time_diff_236866 = time_end_236865 - time_start_236864;
                
                fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                        "main.segmap_209478", time_diff_236866);
            }
        }
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "");
        
        int64_t segmap_usable_groups_209494 = sdiv_up64(nest_sizze_209492,
                                                        segmap_group_sizze_209493);
        struct memblock_device mem_229406;
        
        mem_229406.references = NULL;
        if (memblock_alloc_device(ctx, &mem_229406, bytes_229378,
                                  "mem_229406")) {
            err = 1;
            goto cleanup;
        }
        
        struct memblock_device mem_229410;
        
        mem_229410.references = NULL;
        if (memblock_alloc_device(ctx, &mem_229410, bytes_229378,
                                  "mem_229410")) {
            err = 1;
            goto cleanup;
        }
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "\n# SegMap");
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_209499, 1,
                                                sizeof(ctx->failure_is_an_option),
                                                &ctx->failure_is_an_option));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_209499, 3,
                                                sizeof(n_203490), &n_203490));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_209499, 4,
                                                sizeof(jump_l_203501),
                                                &jump_l_203501));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_209499, 5,
                                                sizeof(partition_sizze_203577),
                                                &partition_sizze_203577));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_209499, 6,
                                                sizeof(l_n_m_203643),
                                                &l_n_m_203643));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_209499, 7,
                                                sizeof(i_203670), &i_203670));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_209499, 8,
                                                sizeof(x_203671), &x_203671));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_209499, 9,
                                                sizeof(min_res_203881),
                                                &min_res_203881));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_209499, 10,
                                                sizeof(loop_cond_203886),
                                                &loop_cond_203886));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_209499, 11,
                                                sizeof(ext_mem_229197.mem),
                                                &ext_mem_229197.mem));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_209499, 12,
                                                sizeof(mem_229388.mem),
                                                &mem_229388.mem));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_209499, 13,
                                                sizeof(mem_229392.mem),
                                                &mem_229392.mem));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_209499, 14,
                                                sizeof(mem_229395.mem),
                                                &mem_229395.mem));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_209499, 15,
                                                sizeof(mem_229398.mem),
                                                &mem_229398.mem));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_209499, 16,
                                                sizeof(mem_229401.mem),
                                                &mem_229401.mem));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_209499, 17,
                                                sizeof(mem_229406.mem),
                                                &mem_229406.mem));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_209499, 18,
                                                sizeof(mem_229410.mem),
                                                &mem_229410.mem));
        if (1 * ((size_t) segmap_usable_groups_209494 *
                 (size_t) segmap_group_sizze_209493) != 0) {
            const size_t global_work_sizze_236868[1] =
                         {(size_t) segmap_usable_groups_209494 *
                         (size_t) segmap_group_sizze_209493};
            const size_t local_work_sizze_236872[1] =
                         {(size_t) segmap_group_sizze_209493};
            int64_t time_start_236869 = 0, time_end_236870 = 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_209499", global_work_sizze_236868[0],
                        local_work_sizze_236872[0], (int) 0);
                time_start_236869 = get_wall_time();
            }
            OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                            ctx->mainzisegmap_209499,
                                                            1, NULL,
                                                            global_work_sizze_236868,
                                                            local_work_sizze_236872,
                                                            0, NULL,
                                                            ctx->profiling_paused ||
                                                            !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                      &ctx->mainzisegmap_209499_runs,
                                                                                                      &ctx->mainzisegmap_209499_total_runtime)));
            if (ctx->debugging) {
                OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                time_end_236870 = get_wall_time();
                
                long time_diff_236871 = time_end_236870 - time_start_236869;
                
                fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                        "main.segmap_209499", time_diff_236871);
            }
        }
        ctx->failure_is_an_option = 1;
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "");
        if (memblock_unref_device(ctx, &mem_229388, "mem_229388") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229392, "mem_229392") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229395, "mem_229395") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229398, "mem_229398") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229401, "mem_229401") != 0)
            return 1;
        if (memblock_set_device(ctx, &ext_mem_229412, &mem_229410,
                                "mem_229410") != 0)
            return 1;
        if (memblock_set_device(ctx, &ext_mem_229411, &mem_229406,
                                "mem_229406") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229410, "mem_229410") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229406, "mem_229406") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229401, "mem_229401") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229398, "mem_229398") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229395, "mem_229395") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229392, "mem_229392") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229388, "mem_229388") != 0)
            return 1;
    }
    
    int64_t min_res_203993 = smin64(n_203490, q_t_203494);
    bool bounds_invalid_upwards_203994 = slt64(t_n_m_203650, (int64_t) 0);
    bool valid_203995 = !bounds_invalid_upwards_203994;
    bool range_valid_c_203996;
    
    if (!valid_203995) {
        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_203650, " 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_229411, "ext_mem_229411") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229412, "ext_mem_229412") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229362, "ext_mem_229362") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229363, "ext_mem_229363") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229264, "ext_mem_229264") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229265, "ext_mem_229265") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229206, "mem_229206") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229200, "mem_229200") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229196, "ext_mem_229196") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229197, "ext_mem_229197") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229164, "mem_229164") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229161, "mem_229161") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229157, "mem_229157") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229155, "mem_229155") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229152, "mem_229152") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229148, "mem_229148") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232249, "mem_out_232249") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232248, "mem_out_232248") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232247, "mem_out_232247") != 0)
            return 1;
        err = 1;
        goto cleanup;
    }
    
    bool loop_cond_203998 = slt64((int64_t) 1, min_res_203993);
    double i64_res_203999 = sitofp_i64_f64(q_t_203494);
    int64_t intra_avail_par_209697 = smin64(n_203490, t_n_m_203650);
    int64_t computed_group_sizze_209599 = smax64(n_203490, t_n_m_203650);
    bool fits_209703 = sle64(computed_group_sizze_209599,
                             max_group_sizze_206887);
    bool suff_intra_par_209701;
    
    suff_intra_par_209701 = *ctx->tuning_params.mainzisuff_intra_par_6 <=
        intra_avail_par_209697;
    if (ctx->logging)
        fprintf(ctx->log, "Compared %s <= %ld: %s.\n", "main.suff_intra_par_6",
                (long) intra_avail_par_209697,
                suff_intra_par_209701 ? "true" : "false");
    
    bool intra_suff_and_fits_209704 = suff_intra_par_209701 && fits_209703;
    int64_t segmap_group_sizze_210087;
    
    segmap_group_sizze_210087 =
        *ctx->tuning_params.mainzisegmap_group_sizze_210063;
    
    int64_t segmap_group_sizze_210097;
    
    segmap_group_sizze_210097 =
        *ctx->tuning_params.mainzisegmap_group_sizze_210037;
    
    int64_t nest_sizze_210118 = partition_sizze_203577 * t_n_m_203650;
    int64_t segmap_group_sizze_210119;
    
    segmap_group_sizze_210119 =
        *ctx->tuning_params.mainzisegmap_group_sizze_209833;
    
    int64_t binop_y_229426 = (int64_t) 8 * nest_sizze_210118;
    int64_t bytes_229427 = smax64((int64_t) 0, binop_y_229426);
    int64_t binop_y_229419 = (int64_t) 8 * t_n_m_203650;
    int64_t bytes_229420 = smax64((int64_t) 0, binop_y_229419);
    struct memblock_device ext_mem_229461;
    
    ext_mem_229461.references = NULL;
    
    struct memblock_device ext_mem_229460;
    
    ext_mem_229460.references = NULL;
    
    int32_t local_memory_capacity_232833;
    
    local_memory_capacity_232833 = ctx->opencl.max_local_memory;
    if (sle64(bytes_229420 + srem64((int64_t) 8 - srem64(bytes_229420,
                                                         (int64_t) 8),
                                    (int64_t) 8) + (bytes_229420 +
                                                    srem64((int64_t) 8 -
                                                           srem64(bytes_229420,
                                                                  (int64_t) 8),
                                                           (int64_t) 8)) +
              (bytes_229169 + srem64((int64_t) 8 - srem64(bytes_229169,
                                                          (int64_t) 8),
                                     (int64_t) 8)),
              sext_i32_i64(local_memory_capacity_232833)) &&
        intra_suff_and_fits_209704) {
        struct memblock_device mem_229428;
        
        mem_229428.references = NULL;
        if (memblock_alloc_device(ctx, &mem_229428, bytes_229427,
                                  "mem_229428")) {
            err = 1;
            goto cleanup;
        }
        
        struct memblock_device mem_229432;
        
        mem_229432.references = NULL;
        if (memblock_alloc_device(ctx, &mem_229432, bytes_229427,
                                  "mem_229432")) {
            err = 1;
            goto cleanup;
        }
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "\n# SegMap");
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_209708,
                                                1,
                                                sizeof(ctx->failure_is_an_option),
                                                &ctx->failure_is_an_option));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_209708,
                                                3, (size_t) bytes_229169,
                                                NULL));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_209708,
                                                4, (size_t) bytes_229420,
                                                NULL));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_209708,
                                                5, (size_t) bytes_229420,
                                                NULL));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_209708,
                                                6, sizeof(n_203490),
                                                &n_203490));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_209708,
                                                7, sizeof(q_t_203494),
                                                &q_t_203494));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_209708,
                                                8, sizeof(jump_t_203500),
                                                &jump_t_203500));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_209708,
                                                9,
                                                sizeof(partition_sizze_203577),
                                                &partition_sizze_203577));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_209708,
                                                10, sizeof(t_n_m_203650),
                                                &t_n_m_203650));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_209708,
                                                11, sizeof(i_203670),
                                                &i_203670));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_209708,
                                                12, sizeof(x_203671),
                                                &x_203671));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_209708,
                                                13, sizeof(min_res_203993),
                                                &min_res_203993));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_209708,
                                                14, sizeof(loop_cond_203998),
                                                &loop_cond_203998));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_209708,
                                                15, sizeof(i64_res_203999),
                                                &i64_res_203999));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_209708,
                                                16,
                                                sizeof(computed_group_sizze_209599),
                                                &computed_group_sizze_209599));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_209708,
                                                17, sizeof(ext_mem_229196.mem),
                                                &ext_mem_229196.mem));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_209708,
                                                18, sizeof(ext_mem_229197.mem),
                                                &ext_mem_229197.mem));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_209708,
                                                19, sizeof(mem_229428.mem),
                                                &mem_229428.mem));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_209708,
                                                20, sizeof(mem_229432.mem),
                                                &mem_229432.mem));
        if (1 * ((size_t) partition_sizze_203577 *
                 (size_t) computed_group_sizze_209599) != 0) {
            const size_t global_work_sizze_236873[1] =
                         {(size_t) partition_sizze_203577 *
                         (size_t) computed_group_sizze_209599};
            const size_t local_work_sizze_236877[1] =
                         {(size_t) computed_group_sizze_209599};
            int64_t time_start_236874 = 0, time_end_236875 = 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_209708",
                        global_work_sizze_236873[0], local_work_sizze_236877[0],
                        (int) (0 + bytes_229169 + bytes_229420 + bytes_229420));
                time_start_236874 = get_wall_time();
            }
            OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                            ctx->mainzisegmap_intragroup_209708,
                                                            1, NULL,
                                                            global_work_sizze_236873,
                                                            local_work_sizze_236877,
                                                            0, NULL,
                                                            ctx->profiling_paused ||
                                                            !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                      &ctx->mainzisegmap_intragroup_209708_runs,
                                                                                                      &ctx->mainzisegmap_intragroup_209708_total_runtime)));
            if (ctx->debugging) {
                OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                time_end_236875 = get_wall_time();
                
                long time_diff_236876 = time_end_236875 - time_start_236874;
                
                fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                        "main.segmap_intragroup_209708", time_diff_236876);
            }
        }
        ctx->failure_is_an_option = 1;
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "");
        if (memblock_set_device(ctx, &ext_mem_229461, &mem_229428,
                                "mem_229428") != 0)
            return 1;
        if (memblock_set_device(ctx, &ext_mem_229460, &mem_229432,
                                "mem_229432") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229432, "mem_229432") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229428, "mem_229428") != 0)
            return 1;
    } else {
        int64_t segmap_usable_groups_210088 = sdiv_up64(nest_sizze_207000,
                                                        segmap_group_sizze_210087);
        struct memblock_device mem_229437;
        
        mem_229437.references = NULL;
        if (memblock_alloc_device(ctx, &mem_229437, bytes_229177,
                                  "mem_229437")) {
            err = 1;
            goto cleanup;
        }
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "\n# SegMap");
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_210092, 1,
                                                sizeof(n_203490), &n_203490));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_210092, 2,
                                                sizeof(partition_sizze_203577),
                                                &partition_sizze_203577));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_210092, 3,
                                                sizeof(ext_mem_229197.mem),
                                                &ext_mem_229197.mem));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_210092, 4,
                                                sizeof(mem_229437.mem),
                                                &mem_229437.mem));
        if (1 * ((size_t) segmap_usable_groups_210088 *
                 (size_t) segmap_group_sizze_210087) != 0) {
            const size_t global_work_sizze_236878[1] =
                         {(size_t) segmap_usable_groups_210088 *
                         (size_t) segmap_group_sizze_210087};
            const size_t local_work_sizze_236882[1] =
                         {(size_t) segmap_group_sizze_210087};
            int64_t time_start_236879 = 0, time_end_236880 = 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_210092", global_work_sizze_236878[0],
                        local_work_sizze_236882[0], (int) 0);
                time_start_236879 = get_wall_time();
            }
            OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                            ctx->mainzisegmap_210092,
                                                            1, NULL,
                                                            global_work_sizze_236878,
                                                            local_work_sizze_236882,
                                                            0, NULL,
                                                            ctx->profiling_paused ||
                                                            !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                      &ctx->mainzisegmap_210092_runs,
                                                                                                      &ctx->mainzisegmap_210092_total_runtime)));
            if (ctx->debugging) {
                OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                time_end_236880 = get_wall_time();
                
                long time_diff_236881 = time_end_236880 - time_start_236879;
                
                fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                        "main.segmap_210092", time_diff_236881);
            }
        }
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "");
        
        int64_t segmap_usable_groups_210098 = sdiv_up64(partition_sizze_203577,
                                                        segmap_group_sizze_210097);
        struct memblock_device mem_229441;
        
        mem_229441.references = NULL;
        if (memblock_alloc_device(ctx, &mem_229441, bytes_229180,
                                  "mem_229441")) {
            err = 1;
            goto cleanup;
        }
        
        struct memblock_device mem_229444;
        
        mem_229444.references = NULL;
        if (memblock_alloc_device(ctx, &mem_229444, bytes_229180,
                                  "mem_229444")) {
            err = 1;
            goto cleanup;
        }
        
        struct memblock_device mem_229447;
        
        mem_229447.references = NULL;
        if (memblock_alloc_device(ctx, &mem_229447, bytes_229180,
                                  "mem_229447")) {
            err = 1;
            goto cleanup;
        }
        
        struct memblock_device mem_229450;
        
        mem_229450.references = NULL;
        if (memblock_alloc_device(ctx, &mem_229450, bytes_229180,
                                  "mem_229450")) {
            err = 1;
            goto cleanup;
        }
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "\n# SegMap");
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_210104, 1,
                                                sizeof(q_t_203494),
                                                &q_t_203494));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_210104, 2,
                                                sizeof(partition_sizze_203577),
                                                &partition_sizze_203577));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_210104, 3,
                                                sizeof(min_res_203993),
                                                &min_res_203993));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_210104, 4,
                                                sizeof(i64_res_203999),
                                                &i64_res_203999));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_210104, 5,
                                                sizeof(ext_mem_229196.mem),
                                                &ext_mem_229196.mem));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_210104, 6,
                                                sizeof(mem_229441.mem),
                                                &mem_229441.mem));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_210104, 7,
                                                sizeof(mem_229444.mem),
                                                &mem_229444.mem));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_210104, 8,
                                                sizeof(mem_229447.mem),
                                                &mem_229447.mem));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_210104, 9,
                                                sizeof(mem_229450.mem),
                                                &mem_229450.mem));
        if (1 * ((size_t) segmap_usable_groups_210098 *
                 (size_t) segmap_group_sizze_210097) != 0) {
            const size_t global_work_sizze_236883[1] =
                         {(size_t) segmap_usable_groups_210098 *
                         (size_t) segmap_group_sizze_210097};
            const size_t local_work_sizze_236887[1] =
                         {(size_t) segmap_group_sizze_210097};
            int64_t time_start_236884 = 0, time_end_236885 = 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_210104", global_work_sizze_236883[0],
                        local_work_sizze_236887[0], (int) 0);
                time_start_236884 = get_wall_time();
            }
            OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                            ctx->mainzisegmap_210104,
                                                            1, NULL,
                                                            global_work_sizze_236883,
                                                            local_work_sizze_236887,
                                                            0, NULL,
                                                            ctx->profiling_paused ||
                                                            !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                      &ctx->mainzisegmap_210104_runs,
                                                                                                      &ctx->mainzisegmap_210104_total_runtime)));
            if (ctx->debugging) {
                OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                time_end_236885 = get_wall_time();
                
                long time_diff_236886 = time_end_236885 - time_start_236884;
                
                fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                        "main.segmap_210104", time_diff_236886);
            }
        }
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "");
        
        int64_t segmap_usable_groups_210120 = sdiv_up64(nest_sizze_210118,
                                                        segmap_group_sizze_210119);
        struct memblock_device mem_229455;
        
        mem_229455.references = NULL;
        if (memblock_alloc_device(ctx, &mem_229455, bytes_229427,
                                  "mem_229455")) {
            err = 1;
            goto cleanup;
        }
        
        struct memblock_device mem_229459;
        
        mem_229459.references = NULL;
        if (memblock_alloc_device(ctx, &mem_229459, bytes_229427,
                                  "mem_229459")) {
            err = 1;
            goto cleanup;
        }
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "\n# SegMap");
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_210125, 1,
                                                sizeof(ctx->failure_is_an_option),
                                                &ctx->failure_is_an_option));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_210125, 3,
                                                sizeof(n_203490), &n_203490));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_210125, 4,
                                                sizeof(jump_t_203500),
                                                &jump_t_203500));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_210125, 5,
                                                sizeof(partition_sizze_203577),
                                                &partition_sizze_203577));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_210125, 6,
                                                sizeof(t_n_m_203650),
                                                &t_n_m_203650));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_210125, 7,
                                                sizeof(i_203670), &i_203670));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_210125, 8,
                                                sizeof(x_203671), &x_203671));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_210125, 9,
                                                sizeof(min_res_203993),
                                                &min_res_203993));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_210125, 10,
                                                sizeof(loop_cond_203998),
                                                &loop_cond_203998));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_210125, 11,
                                                sizeof(ext_mem_229197.mem),
                                                &ext_mem_229197.mem));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_210125, 12,
                                                sizeof(mem_229437.mem),
                                                &mem_229437.mem));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_210125, 13,
                                                sizeof(mem_229441.mem),
                                                &mem_229441.mem));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_210125, 14,
                                                sizeof(mem_229444.mem),
                                                &mem_229444.mem));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_210125, 15,
                                                sizeof(mem_229447.mem),
                                                &mem_229447.mem));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_210125, 16,
                                                sizeof(mem_229450.mem),
                                                &mem_229450.mem));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_210125, 17,
                                                sizeof(mem_229455.mem),
                                                &mem_229455.mem));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_210125, 18,
                                                sizeof(mem_229459.mem),
                                                &mem_229459.mem));
        if (1 * ((size_t) segmap_usable_groups_210120 *
                 (size_t) segmap_group_sizze_210119) != 0) {
            const size_t global_work_sizze_236888[1] =
                         {(size_t) segmap_usable_groups_210120 *
                         (size_t) segmap_group_sizze_210119};
            const size_t local_work_sizze_236892[1] =
                         {(size_t) segmap_group_sizze_210119};
            int64_t time_start_236889 = 0, time_end_236890 = 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_210125", global_work_sizze_236888[0],
                        local_work_sizze_236892[0], (int) 0);
                time_start_236889 = get_wall_time();
            }
            OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                            ctx->mainzisegmap_210125,
                                                            1, NULL,
                                                            global_work_sizze_236888,
                                                            local_work_sizze_236892,
                                                            0, NULL,
                                                            ctx->profiling_paused ||
                                                            !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                      &ctx->mainzisegmap_210125_runs,
                                                                                                      &ctx->mainzisegmap_210125_total_runtime)));
            if (ctx->debugging) {
                OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                time_end_236890 = get_wall_time();
                
                long time_diff_236891 = time_end_236890 - time_start_236889;
                
                fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                        "main.segmap_210125", time_diff_236891);
            }
        }
        ctx->failure_is_an_option = 1;
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "");
        if (memblock_unref_device(ctx, &mem_229437, "mem_229437") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229441, "mem_229441") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229444, "mem_229444") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229447, "mem_229447") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229450, "mem_229450") != 0)
            return 1;
        if (memblock_set_device(ctx, &ext_mem_229461, &mem_229459,
                                "mem_229459") != 0)
            return 1;
        if (memblock_set_device(ctx, &ext_mem_229460, &mem_229455,
                                "mem_229455") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229459, "mem_229459") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229455, "mem_229455") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229450, "mem_229450") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229447, "mem_229447") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229444, "mem_229444") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229441, "mem_229441") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229437, "mem_229437") != 0)
            return 1;
    }
    
    struct memblock_device mem_229465;
    
    mem_229465.references = NULL;
    if (memblock_alloc_device(ctx, &mem_229465, bytes_229177, "mem_229465")) {
        err = 1;
        goto cleanup;
    }
    if (futrts_builtinzhreplicate_f64(ctx, mem_229465, partition_sizze_203577 *
                                      n_203490, 0.0) != 0) {
        if (memblock_unref_device(ctx, &mem_229465, "mem_229465") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229460, "ext_mem_229460") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229461, "ext_mem_229461") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229411, "ext_mem_229411") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229412, "ext_mem_229412") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229362, "ext_mem_229362") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229363, "ext_mem_229363") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229264, "ext_mem_229264") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229265, "ext_mem_229265") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229206, "mem_229206") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229200, "mem_229200") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229196, "ext_mem_229196") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229197, "ext_mem_229197") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229164, "mem_229164") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229161, "mem_229161") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229157, "mem_229157") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229155, "mem_229155") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229152, "mem_229152") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229148, "mem_229148") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232249, "mem_out_232249") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232248, "mem_out_232248") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232247, "mem_out_232247") != 0)
            return 1;
        err = 1;
        goto cleanup;
    }
    
    struct memblock_device mem_229469;
    
    mem_229469.references = NULL;
    if (memblock_alloc_device(ctx, &mem_229469, bytes_229177, "mem_229469")) {
        err = 1;
        goto cleanup;
    }
    if (futrts_builtinzhreplicate_f64(ctx, mem_229469, partition_sizze_203577 *
                                      n_203490, 1.0) != 0) {
        if (memblock_unref_device(ctx, &mem_229469, "mem_229469") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229465, "mem_229465") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229460, "ext_mem_229460") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229461, "ext_mem_229461") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229411, "ext_mem_229411") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229412, "ext_mem_229412") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229362, "ext_mem_229362") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229363, "ext_mem_229363") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229264, "ext_mem_229264") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229265, "ext_mem_229265") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229206, "mem_229206") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229200, "mem_229200") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229196, "ext_mem_229196") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229197, "ext_mem_229197") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229164, "mem_229164") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229161, "mem_229161") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229157, "mem_229157") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229155, "mem_229155") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229152, "mem_229152") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229148, "mem_229148") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232249, "mem_out_232249") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232248, "mem_out_232248") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232247, "mem_out_232247") != 0)
            return 1;
        err = 1;
        goto cleanup;
    }
    
    bool cond_204107 = slt64((int64_t) 1, jump_l_203501);
    bool cond_204108 = slt64((int64_t) 1, jump_t_203500);
    int64_t y_204109 = sub64(n_outer_203503, (int64_t) 1);
    int64_t css_results_l_204110;
    
    if (cond_203635) {
        css_results_l_204110 = s_n_m_203636;
    } else {
        css_results_l_204110 = pad_css_len_203632;
    }
    
    bool zzero_204111 = n_p_203492 == (int64_t) 0;
    bool nonzzero_204112 = !zzero_204111;
    bool loop_not_taken_204113 = !assert_cond_203626;
    bool protect_assert_disj_204114 = nonzzero_204112 || loop_not_taken_204113;
    bool loop_not_taken_204115 = !assert_cond_203628;
    bool protect_assert_disj_204116 = protect_assert_disj_204114 ||
         loop_not_taken_204115;
    bool nonzzero_cert_204117;
    
    if (!protect_assert_disj_204116) {
        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_229469, "mem_229469") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229465, "mem_229465") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229460, "ext_mem_229460") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229461, "ext_mem_229461") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229411, "ext_mem_229411") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229412, "ext_mem_229412") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229362, "ext_mem_229362") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229363, "ext_mem_229363") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229264, "ext_mem_229264") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229265, "ext_mem_229265") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229206, "mem_229206") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229200, "mem_229200") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229196, "ext_mem_229196") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229197, "ext_mem_229197") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229164, "mem_229164") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229161, "mem_229161") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229157, "mem_229157") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229155, "mem_229155") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229152, "mem_229152") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229148, "mem_229148") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232249, "mem_out_232249") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232248, "mem_out_232248") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232247, "mem_out_232247") != 0)
            return 1;
        err = 1;
        goto cleanup;
    }
    
    int64_t j_204118 = add64(n_203490, n_p_203492);
    bool empty_slice_204119 = n_203490 == (int64_t) 0;
    int64_t i_p_m_t_s_204120 = add64(n_p_203492, i_203670);
    bool zzero_leq_i_p_m_t_s_204121 = sle64((int64_t) 0, i_p_m_t_s_204120);
    bool i_p_m_t_s_leq_w_204122 = slt64(i_p_m_t_s_204120, C_len_203634);
    bool zzero_lte_i_204123 = sle64((int64_t) 0, n_p_203492);
    bool i_lte_j_204124 = sle64(n_p_203492, j_204118);
    bool y_204125 = i_p_m_t_s_leq_w_204122 && zzero_lte_i_204123;
    bool y_204126 = zzero_leq_i_p_m_t_s_204121 && y_204125;
    bool y_204127 = i_lte_j_204124 && y_204126;
    bool forwards_ok_204128 = zzero_lte_i_204123 && y_204127;
    bool ok_or_empty_204129 = empty_slice_204119 || forwards_ok_204128;
    bool protect_assert_disj_204130 = loop_not_taken_204113 ||
         ok_or_empty_204129;
    bool protect_assert_disj_204131 = loop_not_taken_204115 ||
         protect_assert_disj_204130;
    bool index_certs_204132;
    
    if (!protect_assert_disj_204131) {
        ctx->error = msgprintf("Error: %s%lld%s%lld%s%lld%s\n\nBacktrace:\n%s",
                               "Index [", (long long) n_p_203492, ":",
                               (long long) j_204118,
                               "] out of bounds for array of shape [",
                               (long long) C_len_203634, "].",
                               "-> #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_229469, "mem_229469") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229465, "mem_229465") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229460, "ext_mem_229460") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229461, "ext_mem_229461") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229411, "ext_mem_229411") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229412, "ext_mem_229412") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229362, "ext_mem_229362") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229363, "ext_mem_229363") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229264, "ext_mem_229264") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229265, "ext_mem_229265") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229206, "mem_229206") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229200, "mem_229200") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229196, "ext_mem_229196") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229197, "ext_mem_229197") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229164, "mem_229164") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229161, "mem_229161") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229157, "mem_229157") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229155, "mem_229155") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229152, "mem_229152") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229148, "mem_229148") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232249, "mem_out_232249") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232248, "mem_out_232248") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232247, "mem_out_232247") != 0)
            return 1;
        err = 1;
        goto cleanup;
    }
    
    int64_t j_m_i_204133 = sub64(stl_res_203665, stl_res_203664);
    int64_t lifted_single_ma_l_arg_204134 = add64((int64_t) 1, j_204118);
    int64_t m_204135 = sub64(n_p_203492, (int64_t) 1);
    bool zzero_leq_i_p_m_t_s_204136 = sle64((int64_t) 0, m_204135);
    bool i_p_m_t_s_leq_w_204137 = slt64(m_204135, C_len_203634);
    bool y_204138 = zzero_leq_i_p_m_t_s_204136 && i_p_m_t_s_leq_w_204137;
    bool y_204139 = zzero_lte_i_204123 && y_204138;
    bool ok_or_empty_204140 = zzero_204111 || y_204139;
    bool protect_assert_disj_204141 = loop_not_taken_204113 ||
         ok_or_empty_204140;
    bool protect_assert_disj_204142 = loop_not_taken_204115 ||
         protect_assert_disj_204141;
    bool index_certs_204143;
    
    if (!protect_assert_disj_204142) {
        ctx->error = msgprintf("Error: %s%lld%s%lld%s\n\nBacktrace:\n%s",
                               "Index [:", (long long) n_p_203492,
                               "] out of bounds for array of shape [",
                               (long long) C_len_203634, "].",
                               "-> #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_229469, "mem_229469") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229465, "mem_229465") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229460, "ext_mem_229460") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229461, "ext_mem_229461") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229411, "ext_mem_229411") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229412, "ext_mem_229412") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229362, "ext_mem_229362") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229363, "ext_mem_229363") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229264, "ext_mem_229264") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229265, "ext_mem_229265") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229206, "mem_229206") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229200, "mem_229200") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229196, "ext_mem_229196") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229197, "ext_mem_229197") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229164, "mem_229164") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229161, "mem_229161") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229157, "mem_229157") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229155, "mem_229155") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229152, "mem_229152") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229148, "mem_229148") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232249, "mem_out_232249") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232248, "mem_out_232248") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232247, "mem_out_232247") != 0)
            return 1;
        err = 1;
        goto cleanup;
    }
    
    int64_t dyn_lifted_single_ma_l_arg_204144 = add64((int64_t) 2, n_203490);
    bool i_p_m_t_s_leq_w_204145 = slt64(m_204135,
                                        lifted_single_ma_l_arg_204134);
    bool y_204146 = zzero_leq_i_p_m_t_s_204136 && i_p_m_t_s_leq_w_204145;
    bool y_204147 = zzero_lte_i_204123 && y_204146;
    bool ok_or_empty_204148 = zzero_204111 || y_204147;
    bool protect_assert_disj_204149 = loop_not_taken_204113 ||
         ok_or_empty_204148;
    bool protect_assert_disj_204150 = loop_not_taken_204115 ||
         protect_assert_disj_204149;
    bool index_certs_204151;
    
    if (!protect_assert_disj_204150) {
        ctx->error = msgprintf("Error: %s%lld%s%lld%s\n\nBacktrace:\n%s",
                               "Index [:", (long long) n_p_203492,
                               "] out of bounds for array of shape [",
                               (long long) lifted_single_ma_l_arg_204134, "].",
                               "-> #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_229469, "mem_229469") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229465, "mem_229465") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229460, "ext_mem_229460") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229461, "ext_mem_229461") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229411, "ext_mem_229411") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229412, "ext_mem_229412") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229362, "ext_mem_229362") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229363, "ext_mem_229363") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229264, "ext_mem_229264") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229265, "ext_mem_229265") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229206, "mem_229206") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229200, "mem_229200") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229196, "ext_mem_229196") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229197, "ext_mem_229197") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229164, "mem_229164") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229161, "mem_229161") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229157, "mem_229157") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229155, "mem_229155") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229152, "mem_229152") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229148, "mem_229148") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232249, "mem_out_232249") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232248, "mem_out_232248") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232247, "mem_out_232247") != 0)
            return 1;
        err = 1;
        goto cleanup;
    }
    
    bool i_p_m_t_s_leq_w_204152 = slt64((int64_t) 2,
                                        dyn_lifted_single_ma_l_arg_204144);
    bool protect_assert_disj_204153 = loop_not_taken_204113 ||
         i_p_m_t_s_leq_w_204152;
    bool protect_assert_disj_204154 = loop_not_taken_204115 ||
         protect_assert_disj_204153;
    bool index_certs_204155;
    
    if (!protect_assert_disj_204154) {
        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_204144,
                               "].",
                               "-> #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_229469, "mem_229469") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229465, "mem_229465") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229460, "ext_mem_229460") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229461, "ext_mem_229461") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229411, "ext_mem_229411") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229412, "ext_mem_229412") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229362, "ext_mem_229362") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229363, "ext_mem_229363") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229264, "ext_mem_229264") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229265, "ext_mem_229265") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229206, "mem_229206") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229200, "mem_229200") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229196, "ext_mem_229196") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229197, "ext_mem_229197") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229164, "mem_229164") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229161, "mem_229161") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229157, "mem_229157") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229155, "mem_229155") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229152, "mem_229152") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229148, "mem_229148") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232249, "mem_out_232249") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232248, "mem_out_232248") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232247, "mem_out_232247") != 0)
            return 1;
        err = 1;
        goto cleanup;
    }
    
    bool cond_204156 = slt64(jump_l_203501, jump_threshold_203504);
    bool cond_f_res_204157 = slt64(q_threshold_203505, q_l_203495);
    bool x_204158 = !cond_204156;
    bool y_204159 = cond_f_res_204157 && x_204158;
    bool cond_204160 = cond_204156 || y_204159;
    bool cond_204161 = slt64(jump_t_203500, jump_threshold_203504);
    bool cond_f_res_204162 = slt64(q_threshold_203505, q_t_203494);
    bool x_204163 = !cond_204161;
    bool y_204164 = cond_f_res_204162 && x_204163;
    bool cond_204165 = cond_204161 || y_204164;
    bool cond_204166 = slt64(jump_s_203499, jump_threshold_203504);
    bool cond_f_res_204167 = slt64(q_threshold_203505, q_s_203493);
    bool x_204168 = !cond_204166;
    bool y_204169 = cond_f_res_204167 && x_204168;
    bool cond_204170 = cond_204166 || y_204169;
    bool bounds_invalid_upwards_204171 = slt64(C_len_203634, (int64_t) 0);
    bool valid_204172 = !bounds_invalid_upwards_204171;
    bool protect_assert_disj_204173 = loop_not_taken_204113 || valid_204172;
    bool protect_assert_disj_204174 = loop_not_taken_204115 ||
         protect_assert_disj_204173;
    bool range_valid_c_204175;
    
    if (!protect_assert_disj_204174) {
        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_203634, " 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_229469, "mem_229469") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229465, "mem_229465") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229460, "ext_mem_229460") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229461, "ext_mem_229461") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229411, "ext_mem_229411") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229412, "ext_mem_229412") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229362, "ext_mem_229362") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229363, "ext_mem_229363") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229264, "ext_mem_229264") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229265, "ext_mem_229265") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229206, "mem_229206") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229200, "mem_229200") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229196, "ext_mem_229196") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229197, "ext_mem_229197") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229164, "mem_229164") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229161, "mem_229161") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229157, "mem_229157") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229155, "mem_229155") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229152, "mem_229152") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229148, "mem_229148") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232249, "mem_out_232249") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232248, "mem_out_232248") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232247, "mem_out_232247") != 0)
            return 1;
        err = 1;
        goto cleanup;
    }
    
    bool bounds_invalid_upwards_204177 = slt64(lifted_single_ma_l_arg_204134,
                                               (int64_t) 0);
    bool valid_204178 = !bounds_invalid_upwards_204177;
    bool protect_assert_disj_204179 = loop_not_taken_204113 || valid_204178;
    bool protect_assert_disj_204180 = loop_not_taken_204115 ||
         protect_assert_disj_204179;
    bool range_valid_c_204181;
    
    if (!protect_assert_disj_204180) {
        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_204134,
                               " 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_229469, "mem_229469") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229465, "mem_229465") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229460, "ext_mem_229460") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229461, "ext_mem_229461") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229411, "ext_mem_229411") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229412, "ext_mem_229412") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229362, "ext_mem_229362") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229363, "ext_mem_229363") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229264, "ext_mem_229264") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229265, "ext_mem_229265") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229206, "mem_229206") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229200, "mem_229200") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229196, "ext_mem_229196") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229197, "ext_mem_229197") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229164, "mem_229164") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229161, "mem_229161") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229157, "mem_229157") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229155, "mem_229155") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229152, "mem_229152") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229148, "mem_229148") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232249, "mem_out_232249") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232248, "mem_out_232248") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232247, "mem_out_232247") != 0)
            return 1;
        err = 1;
        goto cleanup;
    }
    
    bool bounds_invalid_upwards_204183 =
         slt64(dyn_lifted_single_ma_l_arg_204144, (int64_t) 0);
    bool valid_204184 = !bounds_invalid_upwards_204183;
    bool protect_assert_disj_204185 = loop_not_taken_204113 || valid_204184;
    bool protect_assert_disj_204186 = loop_not_taken_204115 ||
         protect_assert_disj_204185;
    bool range_valid_c_204187;
    
    if (!protect_assert_disj_204186) {
        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_204144,
                               " 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_229469, "mem_229469") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229465, "mem_229465") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229460, "ext_mem_229460") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229461, "ext_mem_229461") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229411, "ext_mem_229411") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229412, "ext_mem_229412") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229362, "ext_mem_229362") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229363, "ext_mem_229363") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229264, "ext_mem_229264") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229265, "ext_mem_229265") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229206, "mem_229206") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229200, "mem_229200") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229196, "ext_mem_229196") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229197, "ext_mem_229197") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229164, "mem_229164") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229161, "mem_229161") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229157, "mem_229157") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229155, "mem_229155") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229152, "mem_229152") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229148, "mem_229148") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232249, "mem_out_232249") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232248, "mem_out_232248") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232247, "mem_out_232247") != 0)
            return 1;
        err = 1;
        goto cleanup;
    }
    
    int64_t segmap_group_sizze_210262;
    
    segmap_group_sizze_210262 =
        *ctx->tuning_params.mainzisegmap_group_sizze_210236;
    
    int64_t segmap_usable_groups_210263 = sdiv_up_safe64(nest_sizze_207000,
                                                         segmap_group_sizze_210262);
    int64_t segmap_group_sizze_210405;
    
    segmap_group_sizze_210405 =
        *ctx->tuning_params.mainzisegmap_group_sizze_210299;
    
    int64_t segmap_usable_groups_210406 = sdiv_up_safe64(nest_sizze_207163,
                                                         segmap_group_sizze_210405);
    int64_t nest_sizze_218556 = partition_sizze_203577 * C_len_203634;
    int64_t segmap_group_sizze_218557;
    
    segmap_group_sizze_218557 =
        *ctx->tuning_params.mainzisegmap_group_sizze_218511;
    
    int64_t segmap_usable_groups_218558 = sdiv_up_safe64(nest_sizze_218556,
                                                         segmap_group_sizze_218557);
    bool suff_outer_par_218578;
    
    suff_outer_par_218578 = *ctx->tuning_params.mainzisuff_outer_par_19 <=
        partition_sizze_203577;
    if (ctx->logging)
        fprintf(ctx->log, "Compared %s <= %ld: %s.\n", "main.suff_outer_par_19",
                (long) partition_sizze_203577,
                suff_outer_par_218578 ? "true" : "false");
    
    int64_t segmap_group_sizze_218594;
    
    segmap_group_sizze_218594 =
        *ctx->tuning_params.mainzisegmap_group_sizze_218582;
    
    int64_t segred_group_sizze_218625;
    
    segred_group_sizze_218625 =
        *ctx->tuning_params.mainzisegred_group_sizze_218608;
    
    int64_t num_groups_218626;
    int32_t max_num_groups_232846;
    
    max_num_groups_232846 = *ctx->tuning_params.mainzisegred_num_groups_218610;
    num_groups_218626 = sext_i64_i32(smax64((int64_t) 1,
                                            smin64(sdiv_up64(binop_x_229202,
                                                             segred_group_sizze_218625),
                                                   sext_i32_i64(max_num_groups_232846))));
    
    int64_t nest_sizze_218676 = partition_sizze_203577 *
            lifted_single_ma_l_arg_204134;
    int64_t segscan_group_sizze_218677;
    
    segscan_group_sizze_218677 =
        *ctx->tuning_params.mainzisegscan_group_sizze_218641;
    
    int64_t num_groups_218678;
    int32_t max_num_groups_232847;
    
    max_num_groups_232847 = *ctx->tuning_params.mainzisegscan_num_groups_218643;
    num_groups_218678 = sext_i64_i32(smax64((int64_t) 1,
                                            smin64(sdiv_up64(nest_sizze_218676,
                                                             segscan_group_sizze_218677),
                                                   sext_i32_i64(max_num_groups_232847))));
    
    bool suff_outer_par_218709;
    
    suff_outer_par_218709 = *ctx->tuning_params.mainzisuff_outer_par_20 <=
        partition_sizze_203577;
    if (ctx->logging)
        fprintf(ctx->log, "Compared %s <= %ld: %s.\n", "main.suff_outer_par_20",
                (long) partition_sizze_203577,
                suff_outer_par_218709 ? "true" : "false");
    
    int64_t segmap_group_sizze_218725;
    
    segmap_group_sizze_218725 =
        *ctx->tuning_params.mainzisegmap_group_sizze_218713;
    
    int64_t segred_group_sizze_218756;
    
    segred_group_sizze_218756 =
        *ctx->tuning_params.mainzisegred_group_sizze_218739;
    
    int64_t num_groups_218757;
    int32_t max_num_groups_232848;
    
    max_num_groups_232848 = *ctx->tuning_params.mainzisegred_num_groups_218741;
    num_groups_218757 = sext_i64_i32(smax64((int64_t) 1,
                                            smin64(sdiv_up64(binop_x_229202,
                                                             segred_group_sizze_218756),
                                                   sext_i32_i64(max_num_groups_232848))));
    
    int64_t nest_sizze_218807 = partition_sizze_203577 *
            dyn_lifted_single_ma_l_arg_204144;
    int64_t segscan_group_sizze_218808;
    
    segscan_group_sizze_218808 =
        *ctx->tuning_params.mainzisegscan_group_sizze_218772;
    
    int64_t num_groups_218809;
    int32_t max_num_groups_232849;
    
    max_num_groups_232849 = *ctx->tuning_params.mainzisegscan_num_groups_218774;
    num_groups_218809 = sext_i64_i32(smax64((int64_t) 1,
                                            smin64(sdiv_up64(nest_sizze_218807,
                                                             segscan_group_sizze_218808),
                                                   sext_i32_i64(max_num_groups_232849))));
    
    bool suff_outer_par_218840;
    
    suff_outer_par_218840 = *ctx->tuning_params.mainzisuff_outer_par_21 <=
        partition_sizze_203577;
    if (ctx->logging)
        fprintf(ctx->log, "Compared %s <= %ld: %s.\n", "main.suff_outer_par_21",
                (long) partition_sizze_203577,
                suff_outer_par_218840 ? "true" : "false");
    
    int64_t segmap_group_sizze_218856;
    
    segmap_group_sizze_218856 =
        *ctx->tuning_params.mainzisegmap_group_sizze_218844;
    
    int64_t nest_sizze_218886 = (int64_t) 3 * partition_sizze_203577;
    int64_t segred_group_sizze_218887;
    
    segred_group_sizze_218887 =
        *ctx->tuning_params.mainzisegred_group_sizze_218870;
    
    int64_t num_groups_218888;
    int32_t max_num_groups_232850;
    
    max_num_groups_232850 = *ctx->tuning_params.mainzisegred_num_groups_218872;
    num_groups_218888 = sext_i64_i32(smax64((int64_t) 1,
                                            smin64(sdiv_up64(nest_sizze_218886,
                                                             segred_group_sizze_218887),
                                                   sext_i32_i64(max_num_groups_232850))));
    
    int64_t segscan_group_sizze_218939;
    
    segscan_group_sizze_218939 =
        *ctx->tuning_params.mainzisegscan_group_sizze_218903;
    
    int64_t num_groups_218940;
    int32_t max_num_groups_232851;
    
    max_num_groups_232851 = *ctx->tuning_params.mainzisegscan_num_groups_218905;
    num_groups_218940 = sext_i64_i32(smax64((int64_t) 1,
                                            smin64(sdiv_up64(nest_sizze_207000,
                                                             segscan_group_sizze_218939),
                                                   sext_i32_i64(max_num_groups_232851))));
    
    int64_t segmap_group_sizze_222439;
    
    segmap_group_sizze_222439 =
        *ctx->tuning_params.mainzisegmap_group_sizze_222413;
    
    int64_t segmap_usable_groups_222440 = sdiv_up_safe64(nest_sizze_207000,
                                                         segmap_group_sizze_222439);
    int64_t segmap_usable_groups_218595 = sdiv_up_safe64(partition_sizze_203577,
                                                         segmap_group_sizze_218594);
    int64_t segmap_usable_groups_218726 = sdiv_up_safe64(partition_sizze_203577,
                                                         segmap_group_sizze_218725);
    int64_t segmap_usable_groups_218857 = sdiv_up_safe64(partition_sizze_203577,
                                                         segmap_group_sizze_218856);
    struct memblock_device mem_229520;
    
    mem_229520.references = NULL;
    if (memblock_alloc_device(ctx, &mem_229520, bytes_229177, "mem_229520")) {
        err = 1;
        goto cleanup;
    }
    
    struct memblock_device mem_229526;
    
    mem_229526.references = NULL;
    if (memblock_alloc_device(ctx, &mem_229526, bytes_229205, "mem_229526")) {
        err = 1;
        goto cleanup;
    }
    
    struct memblock_device mem_229531;
    
    mem_229531.references = NULL;
    if (memblock_alloc_device(ctx, &mem_229531, bytes_229205, "mem_229531")) {
        err = 1;
        goto cleanup;
    }
    
    int64_t binop_x_230490 = pad_css_len_203632 * binop_x_229202;
    int64_t binop_y_230491 = (int64_t) 8 * binop_x_230490;
    int64_t bytes_230492 = smax64((int64_t) 0, binop_y_230491);
    int64_t binop_y_230498 = (int64_t) 8 * nest_sizze_218556;
    int64_t bytes_230499 = smax64((int64_t) 0, binop_y_230498);
    struct memblock_device mem_230500;
    
    mem_230500.references = NULL;
    if (memblock_alloc_device(ctx, &mem_230500, bytes_230499, "mem_230500")) {
        err = 1;
        goto cleanup;
    }
    
    int64_t binop_y_230515 = (int64_t) 8 * nest_sizze_218676;
    int64_t bytes_230516 = smax64((int64_t) 0, binop_y_230515);
    struct memblock_device mem_230517;
    
    mem_230517.references = NULL;
    if (memblock_alloc_device(ctx, &mem_230517, bytes_230516, "mem_230517")) {
        err = 1;
        goto cleanup;
    }
    
    int64_t binop_y_230532 = (int64_t) 8 * nest_sizze_218807;
    int64_t bytes_230533 = smax64((int64_t) 0, binop_y_230532);
    struct memblock_device mem_230534;
    
    mem_230534.references = NULL;
    if (memblock_alloc_device(ctx, &mem_230534, bytes_230533, "mem_230534")) {
        err = 1;
        goto cleanup;
    }
    
    struct memblock_device mem_230551;
    
    mem_230551.references = NULL;
    if (memblock_alloc_device(ctx, &mem_230551, bytes_229177, "mem_230551")) {
        err = 1;
        goto cleanup;
    }
    
    int64_t ext_230915;
    
    if (cond_204107) {
        ext_230915 = n_203490;
    } else {
        ext_230915 = l_n_m_203643;
    }
    
    int64_t ext_231512;
    
    if (cond_204108) {
        ext_231512 = n_203490;
    } else {
        ext_231512 = t_n_m_203650;
    }
    
    int64_t ext_231875;
    int64_t ext_231873;
    int64_t ext_231869;
    int64_t ext_231868;
    int64_t ext_231867;
    int64_t ext_231866;
    int64_t ext_231865;
    int64_t ext_231864;
    int64_t ext_231863;
    struct memblock_device ext_mem_231862;
    
    ext_mem_231862.references = NULL;
    
    struct memblock_device ext_mem_231861;
    
    ext_mem_231861.references = NULL;
    
    struct memblock_device ext_mem_231860;
    
    ext_mem_231860.references = NULL;
    
    struct memblock_device mem_param_229477;
    
    mem_param_229477.references = NULL;
    
    int64_t ctx_param_ext_229479;
    int64_t ctx_param_ext_229481;
    struct memblock_device mem_param_229485;
    
    mem_param_229485.references = NULL;
    
    int64_t ctx_param_ext_229486;
    int64_t ctx_param_ext_229487;
    int64_t ctx_param_ext_229488;
    int64_t ctx_param_ext_229489;
    int64_t ctx_param_ext_229490;
    int64_t ctx_param_ext_229491;
    int64_t ctx_param_ext_229492;
    struct memblock_device mem_param_229493;
    
    mem_param_229493.references = NULL;
    ctx_param_ext_229479 = n_203490;
    ctx_param_ext_229481 = n_203490;
    ctx_param_ext_229486 = partition_sizze_203577;
    ctx_param_ext_229487 = n_203490;
    ctx_param_ext_229488 = (int64_t) 0;
    ctx_param_ext_229489 = n_203490;
    ctx_param_ext_229490 = partition_sizze_203577;
    ctx_param_ext_229491 = (int64_t) 1;
    ctx_param_ext_229492 = n_203490;
    if (memblock_set_device(ctx, &mem_param_229477, &mem_229465,
                            "mem_229465") != 0)
        return 1;
    if (memblock_set_device(ctx, &mem_param_229485, &mem_229465,
                            "mem_229465") != 0)
        return 1;
    if (memblock_set_device(ctx, &mem_param_229493, &mem_229469,
                            "mem_229469") != 0)
        return 1;
    for (int64_t i_outer_204192 = 0; i_outer_204192 < n_outer_203503;
         i_outer_204192++) {
        int64_t ext_231524;
        int64_t ext_231522;
        struct memblock_device ext_mem_231518;
        
        ext_mem_231518.references = NULL;
        
        struct memblock_device ext_mem_231517;
        
        ext_mem_231517.references = NULL;
        
        struct memblock_device mem_param_229507;
        
        mem_param_229507.references = NULL;
        
        int64_t ctx_param_ext_229509;
        int64_t ctx_param_ext_229511;
        struct memblock_device mem_param_229515;
        
        mem_param_229515.references = NULL;
        ctx_param_ext_229509 = ctx_param_ext_229479;
        ctx_param_ext_229511 = ctx_param_ext_229481;
        if (memblock_set_device(ctx, &mem_param_229507, &mem_param_229477,
                                "mem_param_229477") != 0)
            return 1;
        if (memblock_set_device(ctx, &mem_param_229515, &mem_param_229485,
                                "mem_param_229485") != 0)
            return 1;
        for (int64_t _i_inner_204198 = 0; _i_inner_204198 < n_inner_203502;
             _i_inner_204198++) {
            if (ctx->debugging)
                fprintf(ctx->log, "%s\n", "\n# SegMap");
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_210267, 1,
                                                    sizeof(n_203490),
                                                    &n_203490));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_210267, 2,
                                                    sizeof(partition_sizze_203577),
                                                    &partition_sizze_203577));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_210267, 3,
                                                    sizeof(ctx_param_ext_229511),
                                                    &ctx_param_ext_229511));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_210267, 4,
                                                    sizeof(mem_229161.mem),
                                                    &mem_229161.mem));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_210267, 5,
                                                    sizeof(mem_param_229515.mem),
                                                    &mem_param_229515.mem));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_210267, 6,
                                                    sizeof(mem_229520.mem),
                                                    &mem_229520.mem));
            if (1 * ((size_t) segmap_usable_groups_210263 *
                     (size_t) segmap_group_sizze_210262) != 0) {
                const size_t global_work_sizze_236893[1] =
                             {(size_t) segmap_usable_groups_210263 *
                             (size_t) segmap_group_sizze_210262};
                const size_t local_work_sizze_236897[1] =
                             {(size_t) segmap_group_sizze_210262};
                int64_t time_start_236894 = 0, time_end_236895 = 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_210267", global_work_sizze_236893[0],
                            local_work_sizze_236897[0], (int) 0);
                    time_start_236894 = get_wall_time();
                }
                OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                ctx->mainzisegmap_210267,
                                                                1, NULL,
                                                                global_work_sizze_236893,
                                                                local_work_sizze_236897,
                                                                0, NULL,
                                                                ctx->profiling_paused ||
                                                                !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                          &ctx->mainzisegmap_210267_runs,
                                                                                                          &ctx->mainzisegmap_210267_total_runtime)));
                if (ctx->debugging) {
                    OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                    time_end_236895 = get_wall_time();
                    
                    long time_diff_236896 = time_end_236895 - time_start_236894;
                    
                    fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                            "main.segmap_210267", time_diff_236896);
                }
            }
            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_210412, 1,
                                                    sizeof(ctx->failure_is_an_option),
                                                    &ctx->failure_is_an_option));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_210412, 3,
                                                    sizeof(n_203490),
                                                    &n_203490));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_210412, 4,
                                                    sizeof(n_p_203492),
                                                    &n_p_203492));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_210412, 5,
                                                    sizeof(partition_sizze_203577),
                                                    &partition_sizze_203577));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_210412, 6,
                                                    sizeof(defunc_0_f_res_203631),
                                                    &defunc_0_f_res_203631));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_210412, 7,
                                                    sizeof(i_203670),
                                                    &i_203670));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_210412, 8,
                                                    sizeof(ctx_param_ext_229488),
                                                    &ctx_param_ext_229488));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_210412, 9,
                                                    sizeof(ctx_param_ext_229489),
                                                    &ctx_param_ext_229489));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_210412,
                                                    10,
                                                    sizeof(ctx_param_ext_229491),
                                                    &ctx_param_ext_229491));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_210412,
                                                    11,
                                                    sizeof(ext_mem_229265.mem),
                                                    &ext_mem_229265.mem));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_210412,
                                                    12,
                                                    sizeof(mem_param_229493.mem),
                                                    &mem_param_229493.mem));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_210412,
                                                    13, sizeof(mem_229520.mem),
                                                    &mem_229520.mem));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_210412,
                                                    14, sizeof(mem_229526.mem),
                                                    &mem_229526.mem));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_210412,
                                                    15, sizeof(mem_229531.mem),
                                                    &mem_229531.mem));
            if (1 * ((size_t) segmap_usable_groups_210406 *
                     (size_t) segmap_group_sizze_210405) != 0) {
                const size_t global_work_sizze_236898[1] =
                             {(size_t) segmap_usable_groups_210406 *
                             (size_t) segmap_group_sizze_210405};
                const size_t local_work_sizze_236902[1] =
                             {(size_t) segmap_group_sizze_210405};
                int64_t time_start_236899 = 0, time_end_236900 = 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_210412", global_work_sizze_236898[0],
                            local_work_sizze_236902[0], (int) 0);
                    time_start_236899 = get_wall_time();
                }
                OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                ctx->mainzisegmap_210412,
                                                                1, NULL,
                                                                global_work_sizze_236898,
                                                                local_work_sizze_236902,
                                                                0, NULL,
                                                                ctx->profiling_paused ||
                                                                !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                          &ctx->mainzisegmap_210412_runs,
                                                                                                          &ctx->mainzisegmap_210412_total_runtime)));
                if (ctx->debugging) {
                    OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                    time_end_236900 = get_wall_time();
                    
                    long time_diff_236901 = time_end_236900 - time_start_236899;
                    
                    fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                            "main.segmap_210412", time_diff_236901);
                }
            }
            ctx->failure_is_an_option = 1;
            if (ctx->debugging)
                fprintf(ctx->log, "%s\n", "");
            
            struct memblock_device ext_mem_230487;
            
            ext_mem_230487.references = NULL;
            
            struct memblock_device ext_mem_230486;
            
            ext_mem_230486.references = NULL;
            if (cond_204170) {
                bool match_lit_204240 = (int64_t) 0 == d_s_203496;
                struct memblock_device ext_mem_230420;
                
                ext_mem_230420.references = NULL;
                
                struct memblock_device ext_mem_230419;
                
                ext_mem_230419.references = NULL;
                if (match_lit_204240) {
                    struct memblock_device mem_229536;
                    
                    mem_229536.references = NULL;
                    if (memblock_alloc_device(ctx, &mem_229536, bytes_229297,
                                              "mem_229536")) {
                        err = 1;
                        goto cleanup;
                    }
                    if (futrts_builtinzhreplicate_f64(ctx, mem_229536,
                                                      partition_sizze_203577 *
                                                      n_p_203492 * s_n_m_203636,
                                                      0.0) != 0) {
                        if (memblock_unref_device(ctx, &mem_229536,
                                                  "mem_229536") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_230419,
                                                  "ext_mem_230419") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_230420,
                                                  "ext_mem_230420") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_230486,
                                                  "ext_mem_230486") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_230487,
                                                  "ext_mem_230487") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_param_229515,
                                                  "mem_param_229515") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_param_229507,
                                                  "mem_param_229507") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_231517,
                                                  "ext_mem_231517") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_231518,
                                                  "ext_mem_231518") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_param_229493,
                                                  "mem_param_229493") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_param_229485,
                                                  "mem_param_229485") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_param_229477,
                                                  "mem_param_229477") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_231860,
                                                  "ext_mem_231860") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_231861,
                                                  "ext_mem_231861") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_231862,
                                                  "ext_mem_231862") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_230551,
                                                  "mem_230551") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_230534,
                                                  "mem_230534") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_230517,
                                                  "mem_230517") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_230500,
                                                  "mem_230500") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229531,
                                                  "mem_229531") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229526,
                                                  "mem_229526") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229520,
                                                  "mem_229520") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229469,
                                                  "mem_229469") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229465,
                                                  "mem_229465") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_229460,
                                                  "ext_mem_229460") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_229461,
                                                  "ext_mem_229461") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_229411,
                                                  "ext_mem_229411") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_229412,
                                                  "ext_mem_229412") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_229362,
                                                  "ext_mem_229362") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_229363,
                                                  "ext_mem_229363") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_229264,
                                                  "ext_mem_229264") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_229265,
                                                  "ext_mem_229265") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229206,
                                                  "mem_229206") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229200,
                                                  "mem_229200") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_229196,
                                                  "ext_mem_229196") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_229197,
                                                  "ext_mem_229197") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229164,
                                                  "mem_229164") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229161,
                                                  "mem_229161") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229157,
                                                  "mem_229157") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229155,
                                                  "mem_229155") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229152,
                                                  "mem_229152") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229148,
                                                  "mem_229148") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_out_232249,
                                                  "mem_out_232249") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_out_232248,
                                                  "mem_out_232248") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_out_232247,
                                                  "mem_out_232247") != 0)
                            return 1;
                        err = 1;
                        goto cleanup;
                    }
                    
                    bool suff_outer_par_210437;
                    
                    suff_outer_par_210437 =
                        *ctx->tuning_params.mainzisuff_outer_par_7 <=
                        partition_sizze_203577;
                    if (ctx->logging)
                        fprintf(ctx->log, "Compared %s <= %ld: %s.\n",
                                "main.suff_outer_par_7",
                                (long) partition_sizze_203577,
                                suff_outer_par_210437 ? "true" : "false");
                    
                    int64_t segmap_group_sizze_210537;
                    
                    segmap_group_sizze_210537 =
                        *ctx->tuning_params.mainzisegmap_group_sizze_210441;
                    
                    int64_t num_groups_210538;
                    int32_t max_num_groups_232895;
                    
                    max_num_groups_232895 =
                        *ctx->tuning_params.mainzisegmap_num_groups_210443;
                    num_groups_210538 = sext_i64_i32(smax64((int64_t) 1,
                                                            smin64(sdiv_up64(partition_sizze_203577,
                                                                             segmap_group_sizze_210537),
                                                                   sext_i32_i64(max_num_groups_232895))));
                    
                    int64_t segmap_group_sizze_211661;
                    
                    segmap_group_sizze_211661 =
                        *ctx->tuning_params.mainzisegmap_group_sizze_210636;
                    
                    int64_t num_groups_211662;
                    int32_t max_num_groups_232896;
                    
                    max_num_groups_232896 =
                        *ctx->tuning_params.mainzisegmap_num_groups_210638;
                    num_groups_211662 = sext_i64_i32(smax64((int64_t) 1,
                                                            smin64(sdiv_up64(binop_x_229202,
                                                                             segmap_group_sizze_211661),
                                                                   sext_i32_i64(max_num_groups_232896))));
                    
                    bool suff_outer_par_211666;
                    
                    suff_outer_par_211666 =
                        *ctx->tuning_params.mainzisuff_outer_par_8 <=
                        binop_x_229202;
                    if (ctx->logging)
                        fprintf(ctx->log, "Compared %s <= %ld: %s.\n",
                                "main.suff_outer_par_8", (long) binop_x_229202,
                                suff_outer_par_211666 ? "true" : "false");
                    
                    int64_t one_intra_par_min_211667 = q_s_203493 *
                            s_n_m_203636;
                    int64_t intra_avail_par_211669 = smin64(s_n_m_203636,
                                                            one_intra_par_min_211667);
                    int64_t computed_group_sizze_211670 = smax64(s_n_m_203636,
                                                                 one_intra_par_min_211667);
                    bool fits_211674 = sle64(computed_group_sizze_211670,
                                             max_group_sizze_206887);
                    bool suff_intra_par_211676;
                    
                    suff_intra_par_211676 =
                        *ctx->tuning_params.mainzisuff_intra_par_9 <=
                        intra_avail_par_211669;
                    if (ctx->logging)
                        fprintf(ctx->log, "Compared %s <= %ld: %s.\n",
                                "main.suff_intra_par_9",
                                (long) intra_avail_par_211669,
                                suff_intra_par_211676 ? "true" : "false");
                    
                    bool intra_suff_and_fits_211677 = fits_211674 &&
                         suff_intra_par_211676;
                    int64_t segmap_group_sizze_211879;
                    
                    segmap_group_sizze_211879 =
                        *ctx->tuning_params.mainzisegmap_group_sizze_210971;
                    
                    bool suff_outer_par_211884;
                    
                    suff_outer_par_211884 =
                        *ctx->tuning_params.mainzisuff_outer_par_10 <=
                        nest_sizze_208848;
                    if (ctx->logging)
                        fprintf(ctx->log, "Compared %s <= %ld: %s.\n",
                                "main.suff_outer_par_10",
                                (long) nest_sizze_208848,
                                suff_outer_par_211884 ? "true" : "false");
                    
                    int64_t segmap_group_sizze_211972;
                    
                    segmap_group_sizze_211972 =
                        *ctx->tuning_params.mainzisegmap_group_sizze_211232;
                    
                    int64_t nest_sizze_211994 = q_s_203493 * nest_sizze_208848;
                    int64_t segred_group_sizze_211995;
                    
                    segred_group_sizze_211995 =
                        *ctx->tuning_params.mainzisegred_group_sizze_211176;
                    
                    int64_t num_groups_211996;
                    int32_t max_num_groups_232897;
                    
                    max_num_groups_232897 =
                        *ctx->tuning_params.mainzisegred_num_groups_211178;
                    num_groups_211996 = sext_i64_i32(smax64((int64_t) 1,
                                                            smin64(sdiv_up64(nest_sizze_211994,
                                                                             segred_group_sizze_211995),
                                                                   sext_i32_i64(max_num_groups_232897))));
                    
                    int64_t segmap_group_sizze_212044;
                    
                    segmap_group_sizze_212044 =
                        *ctx->tuning_params.mainzisegmap_group_sizze_211146;
                    
                    int64_t segred_group_sizze_212069;
                    
                    segred_group_sizze_212069 =
                        *ctx->tuning_params.mainzisegred_group_sizze_211074;
                    
                    int64_t num_groups_212070;
                    int32_t max_num_groups_232898;
                    
                    max_num_groups_232898 =
                        *ctx->tuning_params.mainzisegred_num_groups_211076;
                    num_groups_212070 = sext_i64_i32(smax64((int64_t) 1,
                                                            smin64(sdiv_up64(nest_sizze_211994,
                                                                             segred_group_sizze_212069),
                                                                   sext_i32_i64(max_num_groups_232898))));
                    
                    int64_t bytes_229539 = (int64_t) 8 * nest_sizze_208848;
                    int64_t bytes_229546 = (int64_t) 8 * nest_sizze_207163;
                    int64_t binop_x_229609 = partition_sizze_203577 *
                            s_n_m_203636;
                    int64_t binop_x_229610 = n_p_203492 * binop_x_229609;
                    int64_t bytes_229611 = (int64_t) 8 * binop_x_229610;
                    int64_t binop_x_229617 = partition_sizze_203577 *
                            defunc_0_f_res_203631;
                    int64_t binop_x_229618 = n_p_203492 * binop_x_229617;
                    int64_t bytes_229619 = (int64_t) 8 * binop_x_229618;
                    int64_t bytes_229654 = smax64((int64_t) 0, s_n_m_203636);
                    int64_t bytes_229690 = smax64((int64_t) 0, binop_x_229295);
                    int64_t num_threads_232109 = segmap_group_sizze_210537 *
                            num_groups_210538;
                    int64_t total_sizze_232110 = bytes_229288 *
                            num_threads_232109;
                    int64_t num_threads_232111 = segmap_group_sizze_211661 *
                            num_groups_211662;
                    int64_t total_sizze_232112 = bytes_229311 *
                            num_threads_232111;
                    struct memblock_device ext_mem_229730;
                    
                    ext_mem_229730.references = NULL;
                    
                    int32_t local_memory_capacity_233184;
                    
                    local_memory_capacity_233184 = ctx->opencl.max_local_memory;
                    if (sle64((int64_t) 0,
                              sext_i32_i64(local_memory_capacity_233184)) &&
                        suff_outer_par_210437) {
                        struct memblock_device mem_229540;
                        
                        mem_229540.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_229540,
                                                  bytes_229539, "mem_229540")) {
                            err = 1;
                            goto cleanup;
                        }
                        if (futrts_builtinzhgpu_map_transpose_f64(ctx,
                                                                  mem_229540,
                                                                  (int64_t) 0,
                                                                  ext_mem_229362,
                                                                  (int64_t) 0,
                                                                  (int64_t) 1,
                                                                  n_p_203492 *
                                                                  s_n_m_203636,
                                                                  partition_sizze_203577) !=
                            0) {
                            if (memblock_unref_device(ctx, &mem_229540,
                                                      "mem_229540") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229730,
                                                      "ext_mem_229730") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229536,
                                                      "mem_229536") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230419,
                                                      "ext_mem_230419") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230420,
                                                      "ext_mem_230420") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230486,
                                                      "ext_mem_230486") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230487,
                                                      "ext_mem_230487") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229515,
                                                      "mem_param_229515") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229507,
                                                      "mem_param_229507") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231517,
                                                      "ext_mem_231517") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231518,
                                                      "ext_mem_231518") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229493,
                                                      "mem_param_229493") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229485,
                                                      "mem_param_229485") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229477,
                                                      "mem_param_229477") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231860,
                                                      "ext_mem_231860") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231861,
                                                      "ext_mem_231861") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231862,
                                                      "ext_mem_231862") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230551,
                                                      "mem_230551") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230534,
                                                      "mem_230534") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230517,
                                                      "mem_230517") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230500,
                                                      "mem_230500") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229531,
                                                      "mem_229531") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229526,
                                                      "mem_229526") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229520,
                                                      "mem_229520") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229469,
                                                      "mem_229469") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229465,
                                                      "mem_229465") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229460,
                                                      "ext_mem_229460") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229461,
                                                      "ext_mem_229461") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229411,
                                                      "ext_mem_229411") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229412,
                                                      "ext_mem_229412") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229362,
                                                      "ext_mem_229362") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229363,
                                                      "ext_mem_229363") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229264,
                                                      "ext_mem_229264") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229265,
                                                      "ext_mem_229265") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229206,
                                                      "mem_229206") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229200,
                                                      "mem_229200") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229196,
                                                      "ext_mem_229196") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229197,
                                                      "ext_mem_229197") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229164,
                                                      "mem_229164") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229161,
                                                      "mem_229161") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229157,
                                                      "mem_229157") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229155,
                                                      "mem_229155") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229152,
                                                      "mem_229152") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229148,
                                                      "mem_229148") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_out_232249,
                                                      "mem_out_232249") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_out_232248,
                                                      "mem_out_232248") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_out_232247,
                                                      "mem_out_232247") != 0)
                                return 1;
                            err = 1;
                            goto cleanup;
                        }
                        
                        struct memblock_device mem_229543;
                        
                        mem_229543.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_229543,
                                                  binop_y_229224,
                                                  "mem_229543")) {
                            err = 1;
                            goto cleanup;
                        }
                        if (futrts_builtinzhgpu_map_transpose_i64(ctx,
                                                                  mem_229543,
                                                                  (int64_t) 0,
                                                                  ext_mem_229264,
                                                                  (int64_t) 0,
                                                                  (int64_t) 1,
                                                                  n_p_203492,
                                                                  partition_sizze_203577) !=
                            0) {
                            if (memblock_unref_device(ctx, &mem_229543,
                                                      "mem_229543") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229540,
                                                      "mem_229540") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229730,
                                                      "ext_mem_229730") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229536,
                                                      "mem_229536") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230419,
                                                      "ext_mem_230419") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230420,
                                                      "ext_mem_230420") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230486,
                                                      "ext_mem_230486") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230487,
                                                      "ext_mem_230487") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229515,
                                                      "mem_param_229515") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229507,
                                                      "mem_param_229507") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231517,
                                                      "ext_mem_231517") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231518,
                                                      "ext_mem_231518") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229493,
                                                      "mem_param_229493") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229485,
                                                      "mem_param_229485") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229477,
                                                      "mem_param_229477") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231860,
                                                      "ext_mem_231860") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231861,
                                                      "ext_mem_231861") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231862,
                                                      "ext_mem_231862") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230551,
                                                      "mem_230551") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230534,
                                                      "mem_230534") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230517,
                                                      "mem_230517") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230500,
                                                      "mem_230500") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229531,
                                                      "mem_229531") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229526,
                                                      "mem_229526") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229520,
                                                      "mem_229520") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229469,
                                                      "mem_229469") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229465,
                                                      "mem_229465") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229460,
                                                      "ext_mem_229460") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229461,
                                                      "ext_mem_229461") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229411,
                                                      "ext_mem_229411") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229412,
                                                      "ext_mem_229412") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229362,
                                                      "ext_mem_229362") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229363,
                                                      "ext_mem_229363") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229264,
                                                      "ext_mem_229264") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229265,
                                                      "ext_mem_229265") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229206,
                                                      "mem_229206") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229200,
                                                      "mem_229200") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229196,
                                                      "ext_mem_229196") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229197,
                                                      "ext_mem_229197") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229164,
                                                      "mem_229164") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229161,
                                                      "mem_229161") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229157,
                                                      "mem_229157") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229155,
                                                      "mem_229155") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229152,
                                                      "mem_229152") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229148,
                                                      "mem_229148") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_out_232249,
                                                      "mem_out_232249") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_out_232248,
                                                      "mem_out_232248") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_out_232247,
                                                      "mem_out_232247") != 0)
                                return 1;
                            err = 1;
                            goto cleanup;
                        }
                        
                        struct memblock_device mem_229547;
                        
                        mem_229547.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_229547,
                                                  bytes_229546, "mem_229547")) {
                            err = 1;
                            goto cleanup;
                        }
                        if (futrts_builtinzhgpu_map_transpose_f64(ctx,
                                                                  mem_229547,
                                                                  (int64_t) 0,
                                                                  mem_229531,
                                                                  (int64_t) 0,
                                                                  (int64_t) 1,
                                                                  n_p_203492 *
                                                                  defunc_0_f_res_203631,
                                                                  partition_sizze_203577) !=
                            0) {
                            if (memblock_unref_device(ctx, &mem_229547,
                                                      "mem_229547") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229543,
                                                      "mem_229543") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229540,
                                                      "mem_229540") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229730,
                                                      "ext_mem_229730") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229536,
                                                      "mem_229536") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230419,
                                                      "ext_mem_230419") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230420,
                                                      "ext_mem_230420") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230486,
                                                      "ext_mem_230486") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230487,
                                                      "ext_mem_230487") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229515,
                                                      "mem_param_229515") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229507,
                                                      "mem_param_229507") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231517,
                                                      "ext_mem_231517") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231518,
                                                      "ext_mem_231518") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229493,
                                                      "mem_param_229493") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229485,
                                                      "mem_param_229485") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229477,
                                                      "mem_param_229477") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231860,
                                                      "ext_mem_231860") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231861,
                                                      "ext_mem_231861") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231862,
                                                      "ext_mem_231862") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230551,
                                                      "mem_230551") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230534,
                                                      "mem_230534") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230517,
                                                      "mem_230517") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230500,
                                                      "mem_230500") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229531,
                                                      "mem_229531") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229526,
                                                      "mem_229526") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229520,
                                                      "mem_229520") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229469,
                                                      "mem_229469") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229465,
                                                      "mem_229465") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229460,
                                                      "ext_mem_229460") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229461,
                                                      "ext_mem_229461") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229411,
                                                      "ext_mem_229411") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229412,
                                                      "ext_mem_229412") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229362,
                                                      "ext_mem_229362") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229363,
                                                      "ext_mem_229363") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229264,
                                                      "ext_mem_229264") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229265,
                                                      "ext_mem_229265") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229206,
                                                      "mem_229206") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229200,
                                                      "mem_229200") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229196,
                                                      "ext_mem_229196") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229197,
                                                      "ext_mem_229197") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229164,
                                                      "mem_229164") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229161,
                                                      "mem_229161") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229157,
                                                      "mem_229157") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229155,
                                                      "mem_229155") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229152,
                                                      "mem_229152") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229148,
                                                      "mem_229148") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_out_232249,
                                                      "mem_out_232249") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_out_232248,
                                                      "mem_out_232248") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_out_232247,
                                                      "mem_out_232247") != 0)
                                return 1;
                            err = 1;
                            goto cleanup;
                        }
                        
                        struct memblock_device mem_229551;
                        
                        mem_229551.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_229551,
                                                  bytes_229539, "mem_229551")) {
                            err = 1;
                            goto cleanup;
                        }
                        if (futrts_builtinzhgpu_map_transpose_i64(ctx,
                                                                  mem_229551,
                                                                  (int64_t) 0,
                                                                  ext_mem_229363,
                                                                  (int64_t) 0,
                                                                  (int64_t) 1,
                                                                  n_p_203492 *
                                                                  s_n_m_203636,
                                                                  partition_sizze_203577) !=
                            0) {
                            if (memblock_unref_device(ctx, &mem_229551,
                                                      "mem_229551") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229547,
                                                      "mem_229547") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229543,
                                                      "mem_229543") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229540,
                                                      "mem_229540") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229730,
                                                      "ext_mem_229730") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229536,
                                                      "mem_229536") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230419,
                                                      "ext_mem_230419") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230420,
                                                      "ext_mem_230420") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230486,
                                                      "ext_mem_230486") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230487,
                                                      "ext_mem_230487") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229515,
                                                      "mem_param_229515") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229507,
                                                      "mem_param_229507") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231517,
                                                      "ext_mem_231517") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231518,
                                                      "ext_mem_231518") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229493,
                                                      "mem_param_229493") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229485,
                                                      "mem_param_229485") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229477,
                                                      "mem_param_229477") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231860,
                                                      "ext_mem_231860") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231861,
                                                      "ext_mem_231861") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231862,
                                                      "ext_mem_231862") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230551,
                                                      "mem_230551") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230534,
                                                      "mem_230534") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230517,
                                                      "mem_230517") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230500,
                                                      "mem_230500") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229531,
                                                      "mem_229531") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229526,
                                                      "mem_229526") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229520,
                                                      "mem_229520") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229469,
                                                      "mem_229469") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229465,
                                                      "mem_229465") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229460,
                                                      "ext_mem_229460") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229461,
                                                      "ext_mem_229461") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229411,
                                                      "ext_mem_229411") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229412,
                                                      "ext_mem_229412") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229362,
                                                      "ext_mem_229362") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229363,
                                                      "ext_mem_229363") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229264,
                                                      "ext_mem_229264") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229265,
                                                      "ext_mem_229265") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229206,
                                                      "mem_229206") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229200,
                                                      "mem_229200") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229196,
                                                      "ext_mem_229196") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229197,
                                                      "ext_mem_229197") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229164,
                                                      "mem_229164") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229161,
                                                      "mem_229161") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229157,
                                                      "mem_229157") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229155,
                                                      "mem_229155") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229152,
                                                      "mem_229152") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229148,
                                                      "mem_229148") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_out_232249,
                                                      "mem_out_232249") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_out_232248,
                                                      "mem_out_232248") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_out_232247,
                                                      "mem_out_232247") != 0)
                                return 1;
                            err = 1;
                            goto cleanup;
                        }
                        
                        struct memblock_device mem_229555;
                        
                        mem_229555.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_229555,
                                                  bytes_229546, "mem_229555")) {
                            err = 1;
                            goto cleanup;
                        }
                        if (futrts_builtinzhgpu_map_transpose_f64(ctx,
                                                                  mem_229555,
                                                                  (int64_t) 0,
                                                                  mem_229526,
                                                                  (int64_t) 0,
                                                                  (int64_t) 1,
                                                                  n_p_203492 *
                                                                  defunc_0_f_res_203631,
                                                                  partition_sizze_203577) !=
                            0) {
                            if (memblock_unref_device(ctx, &mem_229555,
                                                      "mem_229555") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229551,
                                                      "mem_229551") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229547,
                                                      "mem_229547") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229543,
                                                      "mem_229543") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229540,
                                                      "mem_229540") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229730,
                                                      "ext_mem_229730") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229536,
                                                      "mem_229536") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230419,
                                                      "ext_mem_230419") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230420,
                                                      "ext_mem_230420") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230486,
                                                      "ext_mem_230486") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230487,
                                                      "ext_mem_230487") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229515,
                                                      "mem_param_229515") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229507,
                                                      "mem_param_229507") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231517,
                                                      "ext_mem_231517") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231518,
                                                      "ext_mem_231518") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229493,
                                                      "mem_param_229493") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229485,
                                                      "mem_param_229485") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229477,
                                                      "mem_param_229477") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231860,
                                                      "ext_mem_231860") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231861,
                                                      "ext_mem_231861") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231862,
                                                      "ext_mem_231862") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230551,
                                                      "mem_230551") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230534,
                                                      "mem_230534") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230517,
                                                      "mem_230517") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230500,
                                                      "mem_230500") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229531,
                                                      "mem_229531") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229526,
                                                      "mem_229526") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229520,
                                                      "mem_229520") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229469,
                                                      "mem_229469") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229465,
                                                      "mem_229465") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229460,
                                                      "ext_mem_229460") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229461,
                                                      "ext_mem_229461") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229411,
                                                      "ext_mem_229411") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229412,
                                                      "ext_mem_229412") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229362,
                                                      "ext_mem_229362") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229363,
                                                      "ext_mem_229363") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229264,
                                                      "ext_mem_229264") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229265,
                                                      "ext_mem_229265") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229206,
                                                      "mem_229206") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229200,
                                                      "mem_229200") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229196,
                                                      "ext_mem_229196") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229197,
                                                      "ext_mem_229197") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229164,
                                                      "mem_229164") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229161,
                                                      "mem_229161") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229157,
                                                      "mem_229157") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229155,
                                                      "mem_229155") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229152,
                                                      "mem_229152") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229148,
                                                      "mem_229148") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_out_232249,
                                                      "mem_out_232249") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_out_232248,
                                                      "mem_out_232248") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_out_232247,
                                                      "mem_out_232247") != 0)
                                return 1;
                            err = 1;
                            goto cleanup;
                        }
                        
                        struct memblock_device mem_229559;
                        
                        mem_229559.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_229559,
                                                  bytes_229546, "mem_229559")) {
                            err = 1;
                            goto cleanup;
                        }
                        if (futrts_builtinzhgpu_map_transpose_i64(ctx,
                                                                  mem_229559,
                                                                  (int64_t) 0,
                                                                  ext_mem_229265,
                                                                  (int64_t) 0,
                                                                  (int64_t) 1,
                                                                  n_p_203492 *
                                                                  defunc_0_f_res_203631,
                                                                  partition_sizze_203577) !=
                            0) {
                            if (memblock_unref_device(ctx, &mem_229559,
                                                      "mem_229559") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229555,
                                                      "mem_229555") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229551,
                                                      "mem_229551") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229547,
                                                      "mem_229547") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229543,
                                                      "mem_229543") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229540,
                                                      "mem_229540") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229730,
                                                      "ext_mem_229730") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229536,
                                                      "mem_229536") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230419,
                                                      "ext_mem_230419") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230420,
                                                      "ext_mem_230420") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230486,
                                                      "ext_mem_230486") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230487,
                                                      "ext_mem_230487") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229515,
                                                      "mem_param_229515") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229507,
                                                      "mem_param_229507") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231517,
                                                      "ext_mem_231517") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231518,
                                                      "ext_mem_231518") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229493,
                                                      "mem_param_229493") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229485,
                                                      "mem_param_229485") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229477,
                                                      "mem_param_229477") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231860,
                                                      "ext_mem_231860") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231861,
                                                      "ext_mem_231861") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231862,
                                                      "ext_mem_231862") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230551,
                                                      "mem_230551") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230534,
                                                      "mem_230534") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230517,
                                                      "mem_230517") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230500,
                                                      "mem_230500") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229531,
                                                      "mem_229531") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229526,
                                                      "mem_229526") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229520,
                                                      "mem_229520") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229469,
                                                      "mem_229469") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229465,
                                                      "mem_229465") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229460,
                                                      "ext_mem_229460") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229461,
                                                      "ext_mem_229461") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229411,
                                                      "ext_mem_229411") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229412,
                                                      "ext_mem_229412") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229362,
                                                      "ext_mem_229362") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229363,
                                                      "ext_mem_229363") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229264,
                                                      "ext_mem_229264") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229265,
                                                      "ext_mem_229265") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229206,
                                                      "mem_229206") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229200,
                                                      "mem_229200") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229196,
                                                      "ext_mem_229196") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229197,
                                                      "ext_mem_229197") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229164,
                                                      "mem_229164") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229161,
                                                      "mem_229161") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229157,
                                                      "mem_229157") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229155,
                                                      "mem_229155") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229152,
                                                      "mem_229152") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229148,
                                                      "mem_229148") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_out_232249,
                                                      "mem_out_232249") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_out_232248,
                                                      "mem_out_232248") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_out_232247,
                                                      "mem_out_232247") != 0)
                                return 1;
                            err = 1;
                            goto cleanup;
                        }
                        
                        struct memblock_device mem_229608;
                        
                        mem_229608.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_229608,
                                                  bytes_229539, "mem_229608")) {
                            err = 1;
                            goto cleanup;
                        }
                        
                        struct memblock_device color_231986;
                        
                        color_231986.references = NULL;
                        if (memblock_alloc_device(ctx, &color_231986,
                                                  total_sizze_232110,
                                                  "color_231986")) {
                            err = 1;
                            goto cleanup;
                        }
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s\n", "\n# SegMap");
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_210542,
                                                                1,
                                                                sizeof(n_p_203492),
                                                                &n_p_203492));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_210542,
                                                                2,
                                                                sizeof(q_s_203493),
                                                                &q_s_203493));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_210542,
                                                                3,
                                                                sizeof(jump_s_203499),
                                                                &jump_s_203499));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_210542,
                                                                4,
                                                                sizeof(partition_sizze_203577),
                                                                &partition_sizze_203577));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_210542,
                                                                5,
                                                                sizeof(defunc_0_f_res_203631),
                                                                &defunc_0_f_res_203631));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_210542,
                                                                6,
                                                                sizeof(pad_css_len_203632),
                                                                &pad_css_len_203632));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_210542,
                                                                7,
                                                                sizeof(s_n_m_203636),
                                                                &s_n_m_203636));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_210542,
                                                                8,
                                                                sizeof(num_groups_210538),
                                                                &num_groups_210538));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_210542,
                                                                9,
                                                                sizeof(num_threads_232109),
                                                                &num_threads_232109));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_210542,
                                                                10,
                                                                sizeof(mem_229540.mem),
                                                                &mem_229540.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_210542,
                                                                11,
                                                                sizeof(mem_229543.mem),
                                                                &mem_229543.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_210542,
                                                                12,
                                                                sizeof(mem_229547.mem),
                                                                &mem_229547.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_210542,
                                                                13,
                                                                sizeof(mem_229551.mem),
                                                                &mem_229551.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_210542,
                                                                14,
                                                                sizeof(mem_229555.mem),
                                                                &mem_229555.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_210542,
                                                                15,
                                                                sizeof(mem_229559.mem),
                                                                &mem_229559.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_210542,
                                                                16,
                                                                sizeof(mem_229608.mem),
                                                                &mem_229608.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_210542,
                                                                17,
                                                                sizeof(color_231986.mem),
                                                                &color_231986.mem));
                        if (1 * ((size_t) num_groups_210538 *
                                 (size_t) segmap_group_sizze_210537) != 0) {
                            const size_t global_work_sizze_236903[1] =
                                         {(size_t) num_groups_210538 *
                                         (size_t) segmap_group_sizze_210537};
                            const size_t local_work_sizze_236907[1] =
                                         {(size_t) segmap_group_sizze_210537};
                            int64_t time_start_236904 = 0, time_end_236905 = 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_210542",
                                        global_work_sizze_236903[0],
                                        local_work_sizze_236907[0], (int) 0);
                                time_start_236904 = get_wall_time();
                            }
                            OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                            ctx->mainzisegmap_210542,
                                                                            1,
                                                                            NULL,
                                                                            global_work_sizze_236903,
                                                                            local_work_sizze_236907,
                                                                            0,
                                                                            NULL,
                                                                            ctx->profiling_paused ||
                                                                            !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                      &ctx->mainzisegmap_210542_runs,
                                                                                                                      &ctx->mainzisegmap_210542_total_runtime)));
                            if (ctx->debugging) {
                                OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                time_end_236905 = get_wall_time();
                                
                                long time_diff_236906 = time_end_236905 -
                                     time_start_236904;
                                
                                fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                                        "main.segmap_210542", time_diff_236906);
                            }
                        }
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s\n", "");
                        if (memblock_unref_device(ctx, &mem_229540,
                                                  "mem_229540") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229543,
                                                  "mem_229543") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229547,
                                                  "mem_229547") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229551,
                                                  "mem_229551") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229555,
                                                  "mem_229555") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229559,
                                                  "mem_229559") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &color_231986,
                                                  "color_231986") != 0)
                            return 1;
                        
                        struct memblock_device mem_229728;
                        
                        mem_229728.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_229728,
                                                  bytes_229297, "mem_229728")) {
                            err = 1;
                            goto cleanup;
                        }
                        if (futrts_builtinzhgpu_map_transpose_f64(ctx,
                                                                  mem_229728,
                                                                  (int64_t) 0,
                                                                  mem_229608,
                                                                  (int64_t) 0,
                                                                  (int64_t) 1,
                                                                  partition_sizze_203577,
                                                                  n_p_203492 *
                                                                  s_n_m_203636) !=
                            0) {
                            if (memblock_unref_device(ctx, &mem_229728,
                                                      "mem_229728") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &color_231986,
                                                      "color_231986") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229608,
                                                      "mem_229608") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229559,
                                                      "mem_229559") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229555,
                                                      "mem_229555") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229551,
                                                      "mem_229551") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229547,
                                                      "mem_229547") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229543,
                                                      "mem_229543") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229540,
                                                      "mem_229540") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229730,
                                                      "ext_mem_229730") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229536,
                                                      "mem_229536") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230419,
                                                      "ext_mem_230419") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230420,
                                                      "ext_mem_230420") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230486,
                                                      "ext_mem_230486") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230487,
                                                      "ext_mem_230487") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229515,
                                                      "mem_param_229515") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229507,
                                                      "mem_param_229507") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231517,
                                                      "ext_mem_231517") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231518,
                                                      "ext_mem_231518") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229493,
                                                      "mem_param_229493") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229485,
                                                      "mem_param_229485") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229477,
                                                      "mem_param_229477") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231860,
                                                      "ext_mem_231860") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231861,
                                                      "ext_mem_231861") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231862,
                                                      "ext_mem_231862") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230551,
                                                      "mem_230551") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230534,
                                                      "mem_230534") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230517,
                                                      "mem_230517") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230500,
                                                      "mem_230500") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229531,
                                                      "mem_229531") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229526,
                                                      "mem_229526") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229520,
                                                      "mem_229520") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229469,
                                                      "mem_229469") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229465,
                                                      "mem_229465") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229460,
                                                      "ext_mem_229460") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229461,
                                                      "ext_mem_229461") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229411,
                                                      "ext_mem_229411") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229412,
                                                      "ext_mem_229412") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229362,
                                                      "ext_mem_229362") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229363,
                                                      "ext_mem_229363") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229264,
                                                      "ext_mem_229264") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229265,
                                                      "ext_mem_229265") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229206,
                                                      "mem_229206") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229200,
                                                      "mem_229200") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229196,
                                                      "ext_mem_229196") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229197,
                                                      "ext_mem_229197") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229164,
                                                      "mem_229164") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229161,
                                                      "mem_229161") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229157,
                                                      "mem_229157") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229155,
                                                      "mem_229155") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229152,
                                                      "mem_229152") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229148,
                                                      "mem_229148") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_out_232249,
                                                      "mem_out_232249") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_out_232248,
                                                      "mem_out_232248") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_out_232247,
                                                      "mem_out_232247") != 0)
                                return 1;
                            err = 1;
                            goto cleanup;
                        }
                        if (memblock_unref_device(ctx, &mem_229608,
                                                  "mem_229608") != 0)
                            return 1;
                        if (memblock_set_device(ctx, &ext_mem_229730,
                                                &mem_229728, "mem_229728") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229728,
                                                  "mem_229728") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &color_231986,
                                                  "color_231986") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229608,
                                                  "mem_229608") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229559,
                                                  "mem_229559") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229555,
                                                  "mem_229555") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229551,
                                                  "mem_229551") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229547,
                                                  "mem_229547") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229543,
                                                  "mem_229543") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229540,
                                                  "mem_229540") != 0)
                            return 1;
                    } else {
                        struct memblock_device ext_mem_229723;
                        
                        ext_mem_229723.references = NULL;
                        
                        int32_t local_memory_capacity_233183;
                        
                        local_memory_capacity_233183 =
                            ctx->opencl.max_local_memory;
                        if (sle64((int64_t) 0,
                                  sext_i32_i64(local_memory_capacity_233183)) &&
                            suff_outer_par_211666) {
                            struct memblock_device mem_229612;
                            
                            mem_229612.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_229612,
                                                      bytes_229611,
                                                      "mem_229612")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (futrts_builtinzhgpu_map_transpose_i64(ctx,
                                                                      mem_229612,
                                                                      (int64_t) 0,
                                                                      ext_mem_229363,
                                                                      (int64_t) 0,
                                                                      (int64_t) 1,
                                                                      s_n_m_203636,
                                                                      partition_sizze_203577 *
                                                                      n_p_203492) !=
                                0) {
                                if (memblock_unref_device(ctx, &mem_229612,
                                                          "mem_229612") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229723,
                                                          "ext_mem_229723") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229730,
                                                          "ext_mem_229730") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229536,
                                                          "mem_229536") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230419,
                                                          "ext_mem_230419") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230420,
                                                          "ext_mem_230420") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230486,
                                                          "ext_mem_230486") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230487,
                                                          "ext_mem_230487") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229515,
                                                          "mem_param_229515") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229507,
                                                          "mem_param_229507") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231517,
                                                          "ext_mem_231517") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231518,
                                                          "ext_mem_231518") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229493,
                                                          "mem_param_229493") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229485,
                                                          "mem_param_229485") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229477,
                                                          "mem_param_229477") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231860,
                                                          "ext_mem_231860") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231861,
                                                          "ext_mem_231861") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231862,
                                                          "ext_mem_231862") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230551,
                                                          "mem_230551") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230534,
                                                          "mem_230534") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230517,
                                                          "mem_230517") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230500,
                                                          "mem_230500") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229531,
                                                          "mem_229531") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229526,
                                                          "mem_229526") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229520,
                                                          "mem_229520") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229469,
                                                          "mem_229469") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229465,
                                                          "mem_229465") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229460,
                                                          "ext_mem_229460") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229461,
                                                          "ext_mem_229461") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229411,
                                                          "ext_mem_229411") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229412,
                                                          "ext_mem_229412") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229362,
                                                          "ext_mem_229362") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229363,
                                                          "ext_mem_229363") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229264,
                                                          "ext_mem_229264") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229265,
                                                          "ext_mem_229265") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229206,
                                                          "mem_229206") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229200,
                                                          "mem_229200") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229196,
                                                          "ext_mem_229196") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229197,
                                                          "ext_mem_229197") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229164,
                                                          "mem_229164") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229161,
                                                          "mem_229161") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229157,
                                                          "mem_229157") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229155,
                                                          "mem_229155") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229152,
                                                          "mem_229152") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229148,
                                                          "mem_229148") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232249,
                                                          "mem_out_232249") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232248,
                                                          "mem_out_232248") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232247,
                                                          "mem_out_232247") !=
                                    0)
                                    return 1;
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device mem_229616;
                            
                            mem_229616.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_229616,
                                                      bytes_229611,
                                                      "mem_229616")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (futrts_builtinzhgpu_map_transpose_f64(ctx,
                                                                      mem_229616,
                                                                      (int64_t) 0,
                                                                      ext_mem_229362,
                                                                      (int64_t) 0,
                                                                      (int64_t) 1,
                                                                      s_n_m_203636,
                                                                      partition_sizze_203577 *
                                                                      n_p_203492) !=
                                0) {
                                if (memblock_unref_device(ctx, &mem_229616,
                                                          "mem_229616") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229612,
                                                          "mem_229612") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229723,
                                                          "ext_mem_229723") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229730,
                                                          "ext_mem_229730") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229536,
                                                          "mem_229536") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230419,
                                                          "ext_mem_230419") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230420,
                                                          "ext_mem_230420") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230486,
                                                          "ext_mem_230486") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230487,
                                                          "ext_mem_230487") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229515,
                                                          "mem_param_229515") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229507,
                                                          "mem_param_229507") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231517,
                                                          "ext_mem_231517") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231518,
                                                          "ext_mem_231518") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229493,
                                                          "mem_param_229493") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229485,
                                                          "mem_param_229485") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229477,
                                                          "mem_param_229477") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231860,
                                                          "ext_mem_231860") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231861,
                                                          "ext_mem_231861") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231862,
                                                          "ext_mem_231862") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230551,
                                                          "mem_230551") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230534,
                                                          "mem_230534") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230517,
                                                          "mem_230517") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230500,
                                                          "mem_230500") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229531,
                                                          "mem_229531") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229526,
                                                          "mem_229526") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229520,
                                                          "mem_229520") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229469,
                                                          "mem_229469") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229465,
                                                          "mem_229465") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229460,
                                                          "ext_mem_229460") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229461,
                                                          "ext_mem_229461") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229411,
                                                          "ext_mem_229411") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229412,
                                                          "ext_mem_229412") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229362,
                                                          "ext_mem_229362") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229363,
                                                          "ext_mem_229363") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229264,
                                                          "ext_mem_229264") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229265,
                                                          "ext_mem_229265") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229206,
                                                          "mem_229206") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229200,
                                                          "mem_229200") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229196,
                                                          "ext_mem_229196") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229197,
                                                          "ext_mem_229197") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229164,
                                                          "mem_229164") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229161,
                                                          "mem_229161") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229157,
                                                          "mem_229157") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229155,
                                                          "mem_229155") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229152,
                                                          "mem_229152") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229148,
                                                          "mem_229148") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232249,
                                                          "mem_out_232249") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232248,
                                                          "mem_out_232248") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232247,
                                                          "mem_out_232247") !=
                                    0)
                                    return 1;
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device mem_229620;
                            
                            mem_229620.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_229620,
                                                      bytes_229619,
                                                      "mem_229620")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (futrts_builtinzhgpu_map_transpose_i64(ctx,
                                                                      mem_229620,
                                                                      (int64_t) 0,
                                                                      ext_mem_229265,
                                                                      (int64_t) 0,
                                                                      (int64_t) 1,
                                                                      defunc_0_f_res_203631,
                                                                      partition_sizze_203577 *
                                                                      n_p_203492) !=
                                0) {
                                if (memblock_unref_device(ctx, &mem_229620,
                                                          "mem_229620") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229616,
                                                          "mem_229616") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229612,
                                                          "mem_229612") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229723,
                                                          "ext_mem_229723") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229730,
                                                          "ext_mem_229730") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229536,
                                                          "mem_229536") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230419,
                                                          "ext_mem_230419") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230420,
                                                          "ext_mem_230420") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230486,
                                                          "ext_mem_230486") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230487,
                                                          "ext_mem_230487") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229515,
                                                          "mem_param_229515") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229507,
                                                          "mem_param_229507") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231517,
                                                          "ext_mem_231517") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231518,
                                                          "ext_mem_231518") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229493,
                                                          "mem_param_229493") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229485,
                                                          "mem_param_229485") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229477,
                                                          "mem_param_229477") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231860,
                                                          "ext_mem_231860") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231861,
                                                          "ext_mem_231861") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231862,
                                                          "ext_mem_231862") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230551,
                                                          "mem_230551") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230534,
                                                          "mem_230534") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230517,
                                                          "mem_230517") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230500,
                                                          "mem_230500") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229531,
                                                          "mem_229531") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229526,
                                                          "mem_229526") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229520,
                                                          "mem_229520") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229469,
                                                          "mem_229469") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229465,
                                                          "mem_229465") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229460,
                                                          "ext_mem_229460") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229461,
                                                          "ext_mem_229461") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229411,
                                                          "ext_mem_229411") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229412,
                                                          "ext_mem_229412") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229362,
                                                          "ext_mem_229362") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229363,
                                                          "ext_mem_229363") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229264,
                                                          "ext_mem_229264") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229265,
                                                          "ext_mem_229265") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229206,
                                                          "mem_229206") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229200,
                                                          "mem_229200") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229196,
                                                          "ext_mem_229196") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229197,
                                                          "ext_mem_229197") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229164,
                                                          "mem_229164") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229161,
                                                          "mem_229161") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229157,
                                                          "mem_229157") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229155,
                                                          "mem_229155") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229152,
                                                          "mem_229152") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229148,
                                                          "mem_229148") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232249,
                                                          "mem_out_232249") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232248,
                                                          "mem_out_232248") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232247,
                                                          "mem_out_232247") !=
                                    0)
                                    return 1;
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device mem_229624;
                            
                            mem_229624.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_229624,
                                                      bytes_229619,
                                                      "mem_229624")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (futrts_builtinzhgpu_map_transpose_f64(ctx,
                                                                      mem_229624,
                                                                      (int64_t) 0,
                                                                      mem_229531,
                                                                      (int64_t) 0,
                                                                      (int64_t) 1,
                                                                      defunc_0_f_res_203631,
                                                                      partition_sizze_203577 *
                                                                      n_p_203492) !=
                                0) {
                                if (memblock_unref_device(ctx, &mem_229624,
                                                          "mem_229624") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229620,
                                                          "mem_229620") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229616,
                                                          "mem_229616") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229612,
                                                          "mem_229612") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229723,
                                                          "ext_mem_229723") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229730,
                                                          "ext_mem_229730") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229536,
                                                          "mem_229536") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230419,
                                                          "ext_mem_230419") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230420,
                                                          "ext_mem_230420") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230486,
                                                          "ext_mem_230486") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230487,
                                                          "ext_mem_230487") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229515,
                                                          "mem_param_229515") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229507,
                                                          "mem_param_229507") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231517,
                                                          "ext_mem_231517") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231518,
                                                          "ext_mem_231518") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229493,
                                                          "mem_param_229493") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229485,
                                                          "mem_param_229485") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229477,
                                                          "mem_param_229477") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231860,
                                                          "ext_mem_231860") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231861,
                                                          "ext_mem_231861") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231862,
                                                          "ext_mem_231862") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230551,
                                                          "mem_230551") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230534,
                                                          "mem_230534") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230517,
                                                          "mem_230517") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230500,
                                                          "mem_230500") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229531,
                                                          "mem_229531") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229526,
                                                          "mem_229526") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229520,
                                                          "mem_229520") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229469,
                                                          "mem_229469") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229465,
                                                          "mem_229465") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229460,
                                                          "ext_mem_229460") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229461,
                                                          "ext_mem_229461") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229411,
                                                          "ext_mem_229411") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229412,
                                                          "ext_mem_229412") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229362,
                                                          "ext_mem_229362") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229363,
                                                          "ext_mem_229363") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229264,
                                                          "ext_mem_229264") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229265,
                                                          "ext_mem_229265") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229206,
                                                          "mem_229206") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229200,
                                                          "mem_229200") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229196,
                                                          "ext_mem_229196") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229197,
                                                          "ext_mem_229197") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229164,
                                                          "mem_229164") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229161,
                                                          "mem_229161") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229157,
                                                          "mem_229157") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229155,
                                                          "mem_229155") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229152,
                                                          "mem_229152") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229148,
                                                          "mem_229148") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232249,
                                                          "mem_out_232249") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232248,
                                                          "mem_out_232248") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232247,
                                                          "mem_out_232247") !=
                                    0)
                                    return 1;
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device mem_229628;
                            
                            mem_229628.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_229628,
                                                      bytes_229619,
                                                      "mem_229628")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (futrts_builtinzhgpu_map_transpose_f64(ctx,
                                                                      mem_229628,
                                                                      (int64_t) 0,
                                                                      mem_229526,
                                                                      (int64_t) 0,
                                                                      (int64_t) 1,
                                                                      defunc_0_f_res_203631,
                                                                      partition_sizze_203577 *
                                                                      n_p_203492) !=
                                0) {
                                if (memblock_unref_device(ctx, &mem_229628,
                                                          "mem_229628") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229624,
                                                          "mem_229624") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229620,
                                                          "mem_229620") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229616,
                                                          "mem_229616") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229612,
                                                          "mem_229612") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229723,
                                                          "ext_mem_229723") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229730,
                                                          "ext_mem_229730") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229536,
                                                          "mem_229536") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230419,
                                                          "ext_mem_230419") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230420,
                                                          "ext_mem_230420") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230486,
                                                          "ext_mem_230486") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230487,
                                                          "ext_mem_230487") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229515,
                                                          "mem_param_229515") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229507,
                                                          "mem_param_229507") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231517,
                                                          "ext_mem_231517") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231518,
                                                          "ext_mem_231518") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229493,
                                                          "mem_param_229493") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229485,
                                                          "mem_param_229485") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229477,
                                                          "mem_param_229477") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231860,
                                                          "ext_mem_231860") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231861,
                                                          "ext_mem_231861") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231862,
                                                          "ext_mem_231862") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230551,
                                                          "mem_230551") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230534,
                                                          "mem_230534") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230517,
                                                          "mem_230517") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230500,
                                                          "mem_230500") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229531,
                                                          "mem_229531") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229526,
                                                          "mem_229526") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229520,
                                                          "mem_229520") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229469,
                                                          "mem_229469") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229465,
                                                          "mem_229465") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229460,
                                                          "ext_mem_229460") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229461,
                                                          "ext_mem_229461") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229411,
                                                          "ext_mem_229411") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229412,
                                                          "ext_mem_229412") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229362,
                                                          "ext_mem_229362") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229363,
                                                          "ext_mem_229363") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229264,
                                                          "ext_mem_229264") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229265,
                                                          "ext_mem_229265") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229206,
                                                          "mem_229206") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229200,
                                                          "mem_229200") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229196,
                                                          "ext_mem_229196") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229197,
                                                          "ext_mem_229197") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229164,
                                                          "mem_229164") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229161,
                                                          "mem_229161") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229157,
                                                          "mem_229157") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229155,
                                                          "mem_229155") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229152,
                                                          "mem_229152") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229148,
                                                          "mem_229148") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232249,
                                                          "mem_out_232249") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232248,
                                                          "mem_out_232248") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232247,
                                                          "mem_out_232247") !=
                                    0)
                                    return 1;
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device mem_229648;
                            
                            mem_229648.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_229648,
                                                      bytes_229611,
                                                      "mem_229648")) {
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device color_231987;
                            
                            color_231987.references = NULL;
                            if (memblock_alloc_device(ctx, &color_231987,
                                                      total_sizze_232112,
                                                      "color_231987")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s\n", "\n# SegMap");
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_211682,
                                                                    1,
                                                                    sizeof(n_p_203492),
                                                                    &n_p_203492));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_211682,
                                                                    2,
                                                                    sizeof(q_s_203493),
                                                                    &q_s_203493));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_211682,
                                                                    3,
                                                                    sizeof(jump_s_203499),
                                                                    &jump_s_203499));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_211682,
                                                                    4,
                                                                    sizeof(partition_sizze_203577),
                                                                    &partition_sizze_203577));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_211682,
                                                                    5,
                                                                    sizeof(defunc_0_f_res_203631),
                                                                    &defunc_0_f_res_203631));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_211682,
                                                                    6,
                                                                    sizeof(pad_css_len_203632),
                                                                    &pad_css_len_203632));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_211682,
                                                                    7,
                                                                    sizeof(s_n_m_203636),
                                                                    &s_n_m_203636));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_211682,
                                                                    8,
                                                                    sizeof(num_groups_211662),
                                                                    &num_groups_211662));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_211682,
                                                                    9,
                                                                    sizeof(num_threads_232111),
                                                                    &num_threads_232111));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_211682,
                                                                    10,
                                                                    sizeof(ext_mem_229264.mem),
                                                                    &ext_mem_229264.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_211682,
                                                                    11,
                                                                    sizeof(mem_229612.mem),
                                                                    &mem_229612.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_211682,
                                                                    12,
                                                                    sizeof(mem_229616.mem),
                                                                    &mem_229616.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_211682,
                                                                    13,
                                                                    sizeof(mem_229620.mem),
                                                                    &mem_229620.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_211682,
                                                                    14,
                                                                    sizeof(mem_229624.mem),
                                                                    &mem_229624.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_211682,
                                                                    15,
                                                                    sizeof(mem_229628.mem),
                                                                    &mem_229628.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_211682,
                                                                    16,
                                                                    sizeof(mem_229648.mem),
                                                                    &mem_229648.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_211682,
                                                                    17,
                                                                    sizeof(color_231987.mem),
                                                                    &color_231987.mem));
                            if (1 * ((size_t) num_groups_211662 *
                                     (size_t) segmap_group_sizze_211661) != 0) {
                                const size_t global_work_sizze_236908[1] =
                                             {(size_t) num_groups_211662 *
                                             (size_t) segmap_group_sizze_211661};
                                const size_t local_work_sizze_236912[1] =
                                             {(size_t) segmap_group_sizze_211661};
                                int64_t time_start_236909 = 0, time_end_236910 =
                                        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_211682",
                                            global_work_sizze_236908[0],
                                            local_work_sizze_236912[0],
                                            (int) 0);
                                    time_start_236909 = get_wall_time();
                                }
                                OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                                ctx->mainzisegmap_211682,
                                                                                1,
                                                                                NULL,
                                                                                global_work_sizze_236908,
                                                                                local_work_sizze_236912,
                                                                                0,
                                                                                NULL,
                                                                                ctx->profiling_paused ||
                                                                                !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                          &ctx->mainzisegmap_211682_runs,
                                                                                                                          &ctx->mainzisegmap_211682_total_runtime)));
                                if (ctx->debugging) {
                                    OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                    time_end_236910 = get_wall_time();
                                    
                                    long time_diff_236911 = time_end_236910 -
                                         time_start_236909;
                                    
                                    fprintf(ctx->log,
                                            "kernel %s runtime: %ldus\n",
                                            "main.segmap_211682",
                                            time_diff_236911);
                                }
                            }
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s\n", "");
                            if (memblock_unref_device(ctx, &mem_229612,
                                                      "mem_229612") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229616,
                                                      "mem_229616") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229620,
                                                      "mem_229620") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229624,
                                                      "mem_229624") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229628,
                                                      "mem_229628") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &color_231987,
                                                      "color_231987") != 0)
                                return 1;
                            
                            struct memblock_device mem_229721;
                            
                            mem_229721.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_229721,
                                                      bytes_229297,
                                                      "mem_229721")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (futrts_builtinzhgpu_map_transpose_f64(ctx,
                                                                      mem_229721,
                                                                      (int64_t) 0,
                                                                      mem_229648,
                                                                      (int64_t) 0,
                                                                      (int64_t) 1,
                                                                      partition_sizze_203577 *
                                                                      n_p_203492,
                                                                      s_n_m_203636) !=
                                0) {
                                if (memblock_unref_device(ctx, &mem_229721,
                                                          "mem_229721") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &color_231987,
                                                          "color_231987") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229648,
                                                          "mem_229648") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229628,
                                                          "mem_229628") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229624,
                                                          "mem_229624") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229620,
                                                          "mem_229620") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229616,
                                                          "mem_229616") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229612,
                                                          "mem_229612") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229723,
                                                          "ext_mem_229723") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229730,
                                                          "ext_mem_229730") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229536,
                                                          "mem_229536") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230419,
                                                          "ext_mem_230419") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230420,
                                                          "ext_mem_230420") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230486,
                                                          "ext_mem_230486") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230487,
                                                          "ext_mem_230487") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229515,
                                                          "mem_param_229515") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229507,
                                                          "mem_param_229507") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231517,
                                                          "ext_mem_231517") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231518,
                                                          "ext_mem_231518") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229493,
                                                          "mem_param_229493") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229485,
                                                          "mem_param_229485") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229477,
                                                          "mem_param_229477") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231860,
                                                          "ext_mem_231860") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231861,
                                                          "ext_mem_231861") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231862,
                                                          "ext_mem_231862") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230551,
                                                          "mem_230551") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230534,
                                                          "mem_230534") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230517,
                                                          "mem_230517") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230500,
                                                          "mem_230500") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229531,
                                                          "mem_229531") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229526,
                                                          "mem_229526") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229520,
                                                          "mem_229520") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229469,
                                                          "mem_229469") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229465,
                                                          "mem_229465") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229460,
                                                          "ext_mem_229460") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229461,
                                                          "ext_mem_229461") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229411,
                                                          "ext_mem_229411") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229412,
                                                          "ext_mem_229412") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229362,
                                                          "ext_mem_229362") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229363,
                                                          "ext_mem_229363") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229264,
                                                          "ext_mem_229264") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229265,
                                                          "ext_mem_229265") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229206,
                                                          "mem_229206") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229200,
                                                          "mem_229200") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229196,
                                                          "ext_mem_229196") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229197,
                                                          "ext_mem_229197") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229164,
                                                          "mem_229164") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229161,
                                                          "mem_229161") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229157,
                                                          "mem_229157") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229155,
                                                          "mem_229155") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229152,
                                                          "mem_229152") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229148,
                                                          "mem_229148") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232249,
                                                          "mem_out_232249") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232248,
                                                          "mem_out_232248") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232247,
                                                          "mem_out_232247") !=
                                    0)
                                    return 1;
                                err = 1;
                                goto cleanup;
                            }
                            if (memblock_unref_device(ctx, &mem_229648,
                                                      "mem_229648") != 0)
                                return 1;
                            if (memblock_set_device(ctx, &ext_mem_229723,
                                                    &mem_229721,
                                                    "mem_229721") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229721,
                                                      "mem_229721") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &color_231987,
                                                      "color_231987") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229648,
                                                      "mem_229648") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229628,
                                                      "mem_229628") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229624,
                                                      "mem_229624") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229620,
                                                      "mem_229620") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229616,
                                                      "mem_229616") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229612,
                                                      "mem_229612") != 0)
                                return 1;
                        } else {
                            struct memblock_device ext_mem_229716;
                            
                            ext_mem_229716.references = NULL;
                            
                            int32_t local_memory_capacity_233182;
                            
                            local_memory_capacity_233182 =
                                ctx->opencl.max_local_memory;
                            if (sle64(bytes_229311 + srem64((int64_t) 8 -
                                                            srem64(bytes_229311,
                                                                   (int64_t) 8),
                                                            (int64_t) 8) +
                                      (bytes_229311 + srem64((int64_t) 8 -
                                                             srem64(bytes_229311,
                                                                    (int64_t) 8),
                                                             (int64_t) 8)) +
                                      (bytes_229311 + srem64((int64_t) 8 -
                                                             srem64(bytes_229311,
                                                                    (int64_t) 8),
                                                             (int64_t) 8)) +
                                      (bytes_229654 + srem64((int64_t) 8 -
                                                             srem64(bytes_229654,
                                                                    (int64_t) 8),
                                                             (int64_t) 8)) +
                                      ((int64_t) 8 * (s_n_m_203636 *
                                                      q_s_203493) +
                                       srem64((int64_t) 8 - srem64((int64_t) 8 *
                                                                   (s_n_m_203636 *
                                                                    q_s_203493),
                                                                   (int64_t) 8),
                                              (int64_t) 8)) + ((int64_t) 8 *
                                                               (s_n_m_203636 *
                                                                q_s_203493) +
                                                               srem64((int64_t) 8 -
                                                                      srem64((int64_t) 8 *
                                                                             (s_n_m_203636 *
                                                                              q_s_203493),
                                                                             (int64_t) 8),
                                                                      (int64_t) 8)),
                                      sext_i32_i64(local_memory_capacity_233182)) &&
                                intra_suff_and_fits_211677) {
                                struct memblock_device mem_229675;
                                
                                mem_229675.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_229675,
                                                          bytes_229297,
                                                          "mem_229675")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s\n", "\n# SegMap");
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_211768,
                                                                        1,
                                                                        (size_t) ((int64_t) 8 *
                                                                                  (s_n_m_203636 *
                                                                                   q_s_203493)),
                                                                        NULL));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_211768,
                                                                        2,
                                                                        (size_t) ((int64_t) 8 *
                                                                                  (s_n_m_203636 *
                                                                                   q_s_203493)),
                                                                        NULL));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_211768,
                                                                        3,
                                                                        (size_t) bytes_229654,
                                                                        NULL));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_211768,
                                                                        4,
                                                                        (size_t) bytes_229311,
                                                                        NULL));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_211768,
                                                                        5,
                                                                        (size_t) bytes_229311,
                                                                        NULL));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_211768,
                                                                        6,
                                                                        (size_t) bytes_229311,
                                                                        NULL));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_211768,
                                                                        7,
                                                                        sizeof(n_p_203492),
                                                                        &n_p_203492));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_211768,
                                                                        8,
                                                                        sizeof(q_s_203493),
                                                                        &q_s_203493));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_211768,
                                                                        9,
                                                                        sizeof(jump_s_203499),
                                                                        &jump_s_203499));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_211768,
                                                                        10,
                                                                        sizeof(partition_sizze_203577),
                                                                        &partition_sizze_203577));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_211768,
                                                                        11,
                                                                        sizeof(defunc_0_f_res_203631),
                                                                        &defunc_0_f_res_203631));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_211768,
                                                                        12,
                                                                        sizeof(pad_css_len_203632),
                                                                        &pad_css_len_203632));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_211768,
                                                                        13,
                                                                        sizeof(s_n_m_203636),
                                                                        &s_n_m_203636));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_211768,
                                                                        14,
                                                                        sizeof(computed_group_sizze_211670),
                                                                        &computed_group_sizze_211670));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_211768,
                                                                        15,
                                                                        sizeof(ext_mem_229264.mem),
                                                                        &ext_mem_229264.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_211768,
                                                                        16,
                                                                        sizeof(ext_mem_229265.mem),
                                                                        &ext_mem_229265.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_211768,
                                                                        17,
                                                                        sizeof(ext_mem_229362.mem),
                                                                        &ext_mem_229362.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_211768,
                                                                        18,
                                                                        sizeof(ext_mem_229363.mem),
                                                                        &ext_mem_229363.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_211768,
                                                                        19,
                                                                        sizeof(mem_229526.mem),
                                                                        &mem_229526.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_211768,
                                                                        20,
                                                                        sizeof(mem_229531.mem),
                                                                        &mem_229531.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_211768,
                                                                        21,
                                                                        sizeof(mem_229675.mem),
                                                                        &mem_229675.mem));
                                if (1 * ((size_t) binop_x_229202 *
                                         (size_t) computed_group_sizze_211670) !=
                                    0) {
                                    const size_t global_work_sizze_236913[1] =
                                                 {(size_t) binop_x_229202 *
                                                 (size_t) computed_group_sizze_211670};
                                    const size_t local_work_sizze_236917[1] =
                                                 {(size_t) computed_group_sizze_211670};
                                    int64_t time_start_236914 = 0,
                                            time_end_236915 = 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_211768",
                                                global_work_sizze_236913[0],
                                                local_work_sizze_236917[0],
                                                (int) (0 + (int64_t) 8 *
                                                       (s_n_m_203636 *
                                                        q_s_203493) +
                                                       (int64_t) 8 *
                                                       (s_n_m_203636 *
                                                        q_s_203493) +
                                                       bytes_229654 +
                                                       bytes_229311 +
                                                       bytes_229311 +
                                                       bytes_229311));
                                        time_start_236914 = get_wall_time();
                                    }
                                    OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                                    ctx->mainzisegmap_intragroup_211768,
                                                                                    1,
                                                                                    NULL,
                                                                                    global_work_sizze_236913,
                                                                                    local_work_sizze_236917,
                                                                                    0,
                                                                                    NULL,
                                                                                    ctx->profiling_paused ||
                                                                                    !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                              &ctx->mainzisegmap_intragroup_211768_runs,
                                                                                                                              &ctx->mainzisegmap_intragroup_211768_total_runtime)));
                                    if (ctx->debugging) {
                                        OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                        time_end_236915 = get_wall_time();
                                        
                                        long time_diff_236916 =
                                             time_end_236915 -
                                             time_start_236914;
                                        
                                        fprintf(ctx->log,
                                                "kernel %s runtime: %ldus\n",
                                                "main.segmap_intragroup_211768",
                                                time_diff_236916);
                                    }
                                }
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s\n", "");
                                if (memblock_set_device(ctx, &ext_mem_229716,
                                                        &mem_229675,
                                                        "mem_229675") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229675,
                                                          "mem_229675") != 0)
                                    return 1;
                            } else {
                                int64_t segmap_usable_groups_211880 =
                                        sdiv_up64(nest_sizze_208848,
                                                  segmap_group_sizze_211879);
                                struct memblock_device ext_mem_229715;
                                
                                ext_mem_229715.references = NULL;
                                
                                int32_t local_memory_capacity_233181;
                                
                                local_memory_capacity_233181 =
                                    ctx->opencl.max_local_memory;
                                if (sle64((int64_t) 0,
                                          sext_i32_i64(local_memory_capacity_233181)) &&
                                    suff_outer_par_211884) {
                                    struct memblock_device mem_229681;
                                    
                                    mem_229681.references = NULL;
                                    if (memblock_alloc_device(ctx, &mem_229681,
                                                              bytes_229297,
                                                              "mem_229681")) {
                                        err = 1;
                                        goto cleanup;
                                    }
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s\n", "\n# SegMap");
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_211890,
                                                                            1,
                                                                            sizeof(n_p_203492),
                                                                            &n_p_203492));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_211890,
                                                                            2,
                                                                            sizeof(q_s_203493),
                                                                            &q_s_203493));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_211890,
                                                                            3,
                                                                            sizeof(jump_s_203499),
                                                                            &jump_s_203499));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_211890,
                                                                            4,
                                                                            sizeof(partition_sizze_203577),
                                                                            &partition_sizze_203577));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_211890,
                                                                            5,
                                                                            sizeof(defunc_0_f_res_203631),
                                                                            &defunc_0_f_res_203631));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_211890,
                                                                            6,
                                                                            sizeof(pad_css_len_203632),
                                                                            &pad_css_len_203632));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_211890,
                                                                            7,
                                                                            sizeof(s_n_m_203636),
                                                                            &s_n_m_203636));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_211890,
                                                                            8,
                                                                            sizeof(ext_mem_229264.mem),
                                                                            &ext_mem_229264.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_211890,
                                                                            9,
                                                                            sizeof(ext_mem_229265.mem),
                                                                            &ext_mem_229265.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_211890,
                                                                            10,
                                                                            sizeof(ext_mem_229362.mem),
                                                                            &ext_mem_229362.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_211890,
                                                                            11,
                                                                            sizeof(ext_mem_229363.mem),
                                                                            &ext_mem_229363.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_211890,
                                                                            12,
                                                                            sizeof(mem_229526.mem),
                                                                            &mem_229526.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_211890,
                                                                            13,
                                                                            sizeof(mem_229531.mem),
                                                                            &mem_229531.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_211890,
                                                                            14,
                                                                            sizeof(mem_229681.mem),
                                                                            &mem_229681.mem));
                                    if (1 *
                                        ((size_t) segmap_usable_groups_211880 *
                                         (size_t) segmap_group_sizze_211879) !=
                                        0) {
                                        const size_t global_work_sizze_236918[1]
                                                     =
                                                     {(size_t) segmap_usable_groups_211880 *
                                                     (size_t) segmap_group_sizze_211879};
                                        const size_t local_work_sizze_236922[1]
                                                     =
                                                     {(size_t) segmap_group_sizze_211879};
                                        int64_t time_start_236919 = 0,
                                                time_end_236920 = 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_211890",
                                                    global_work_sizze_236918[0],
                                                    local_work_sizze_236922[0],
                                                    (int) 0);
                                            time_start_236919 = get_wall_time();
                                        }
                                        OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                                        ctx->mainzisegmap_211890,
                                                                                        1,
                                                                                        NULL,
                                                                                        global_work_sizze_236918,
                                                                                        local_work_sizze_236922,
                                                                                        0,
                                                                                        NULL,
                                                                                        ctx->profiling_paused ||
                                                                                        !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                                  &ctx->mainzisegmap_211890_runs,
                                                                                                                                  &ctx->mainzisegmap_211890_total_runtime)));
                                        if (ctx->debugging) {
                                            OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                            time_end_236920 = get_wall_time();
                                            
                                            long time_diff_236921 =
                                                 time_end_236920 -
                                                 time_start_236919;
                                            
                                            fprintf(ctx->log,
                                                    "kernel %s runtime: %ldus\n",
                                                    "main.segmap_211890",
                                                    time_diff_236921);
                                        }
                                    }
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s\n", "");
                                    if (memblock_set_device(ctx,
                                                            &ext_mem_229715,
                                                            &mem_229681,
                                                            "mem_229681") != 0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229681,
                                                              "mem_229681") !=
                                        0)
                                        return 1;
                                } else {
                                    int64_t segmap_usable_groups_211973 =
                                            sdiv_up64(nest_sizze_208848,
                                                      segmap_group_sizze_211972);
                                    struct memblock_device mem_229687;
                                    
                                    mem_229687.references = NULL;
                                    if (memblock_alloc_device(ctx, &mem_229687,
                                                              bytes_229297,
                                                              "mem_229687")) {
                                        err = 1;
                                        goto cleanup;
                                    }
                                    
                                    struct memblock_device mem_229691;
                                    
                                    mem_229691.references = NULL;
                                    if (memblock_alloc_device(ctx, &mem_229691,
                                                              bytes_229690,
                                                              "mem_229691")) {
                                        err = 1;
                                        goto cleanup;
                                    }
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s\n", "\n# SegMap");
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_211979,
                                                                            1,
                                                                            sizeof(n_p_203492),
                                                                            &n_p_203492));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_211979,
                                                                            2,
                                                                            sizeof(jump_s_203499),
                                                                            &jump_s_203499));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_211979,
                                                                            3,
                                                                            sizeof(partition_sizze_203577),
                                                                            &partition_sizze_203577));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_211979,
                                                                            4,
                                                                            sizeof(defunc_0_f_res_203631),
                                                                            &defunc_0_f_res_203631));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_211979,
                                                                            5,
                                                                            sizeof(pad_css_len_203632),
                                                                            &pad_css_len_203632));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_211979,
                                                                            6,
                                                                            sizeof(s_n_m_203636),
                                                                            &s_n_m_203636));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_211979,
                                                                            7,
                                                                            sizeof(mem_229687.mem),
                                                                            &mem_229687.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_211979,
                                                                            8,
                                                                            sizeof(mem_229691.mem),
                                                                            &mem_229691.mem));
                                    if (1 *
                                        ((size_t) segmap_usable_groups_211973 *
                                         (size_t) segmap_group_sizze_211972) !=
                                        0) {
                                        const size_t global_work_sizze_236923[1]
                                                     =
                                                     {(size_t) segmap_usable_groups_211973 *
                                                     (size_t) segmap_group_sizze_211972};
                                        const size_t local_work_sizze_236927[1]
                                                     =
                                                     {(size_t) segmap_group_sizze_211972};
                                        int64_t time_start_236924 = 0,
                                                time_end_236925 = 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_211979",
                                                    global_work_sizze_236923[0],
                                                    local_work_sizze_236927[0],
                                                    (int) 0);
                                            time_start_236924 = get_wall_time();
                                        }
                                        OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                                        ctx->mainzisegmap_211979,
                                                                                        1,
                                                                                        NULL,
                                                                                        global_work_sizze_236923,
                                                                                        local_work_sizze_236927,
                                                                                        0,
                                                                                        NULL,
                                                                                        ctx->profiling_paused ||
                                                                                        !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                                  &ctx->mainzisegmap_211979_runs,
                                                                                                                                  &ctx->mainzisegmap_211979_total_runtime)));
                                        if (ctx->debugging) {
                                            OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                            time_end_236925 = get_wall_time();
                                            
                                            long time_diff_236926 =
                                                 time_end_236925 -
                                                 time_start_236924;
                                            
                                            fprintf(ctx->log,
                                                    "kernel %s runtime: %ldus\n",
                                                    "main.segmap_211979",
                                                    time_diff_236926);
                                        }
                                    }
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s\n", "");
                                    if (memblock_unref_device(ctx, &mem_229691,
                                                              "mem_229691") !=
                                        0)
                                        return 1;
                                    
                                    struct memblock_device mem_229697;
                                    
                                    mem_229697.references = NULL;
                                    if (memblock_alloc_device(ctx, &mem_229697,
                                                              bytes_229297,
                                                              "mem_229697")) {
                                        err = 1;
                                        goto cleanup;
                                    }
                                    if (slt64(q_s_203493 * (int64_t) 2,
                                              segred_group_sizze_211995)) {
                                        int64_t segment_sizze_nonzzero_233017 =
                                                smax64((int64_t) 1, q_s_203493);
                                        int64_t num_threads_233018 =
                                                num_groups_211996 *
                                                segred_group_sizze_211995;
                                        
                                        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_203577 *
                                                                 n_p_203492 *
                                                                 s_n_m_203636),
                                                    '\n');
                                        if (ctx->debugging)
                                            fprintf(ctx->log, "%s: %llu%c",
                                                    "segment_size",
                                                    (long long) q_s_203493,
                                                    '\n');
                                        if (ctx->debugging)
                                            fprintf(ctx->log, "%s: %llu%c",
                                                    "segments_per_group",
                                                    (long long) squot64(segred_group_sizze_211995,
                                                                        segment_sizze_nonzzero_233017),
                                                    '\n');
                                        if (ctx->debugging)
                                            fprintf(ctx->log, "%s: %llu%c",
                                                    "required_groups",
                                                    (long long) sext_i64_i32(sdiv_up64(partition_sizze_203577 *
                                                                                       n_p_203492 *
                                                                                       s_n_m_203636,
                                                                                       squot64(segred_group_sizze_211995,
                                                                                               segment_sizze_nonzzero_233017))),
                                                    '\n');
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_212003,
                                                                                1,
                                                                                (size_t) ((int64_t) 8 *
                                                                                          segred_group_sizze_211995),
                                                                                NULL));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_212003,
                                                                                2,
                                                                                sizeof(n_p_203492),
                                                                                &n_p_203492));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_212003,
                                                                                3,
                                                                                sizeof(q_s_203493),
                                                                                &q_s_203493));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_212003,
                                                                                4,
                                                                                sizeof(partition_sizze_203577),
                                                                                &partition_sizze_203577));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_212003,
                                                                                5,
                                                                                sizeof(defunc_0_f_res_203631),
                                                                                &defunc_0_f_res_203631));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_212003,
                                                                                6,
                                                                                sizeof(s_n_m_203636),
                                                                                &s_n_m_203636));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_212003,
                                                                                7,
                                                                                sizeof(num_groups_211996),
                                                                                &num_groups_211996));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_212003,
                                                                                8,
                                                                                sizeof(segment_sizze_nonzzero_233017),
                                                                                &segment_sizze_nonzzero_233017));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_212003,
                                                                                9,
                                                                                sizeof(ext_mem_229264.mem),
                                                                                &ext_mem_229264.mem));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_212003,
                                                                                10,
                                                                                sizeof(ext_mem_229265.mem),
                                                                                &ext_mem_229265.mem));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_212003,
                                                                                11,
                                                                                sizeof(ext_mem_229362.mem),
                                                                                &ext_mem_229362.mem));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_212003,
                                                                                12,
                                                                                sizeof(ext_mem_229363.mem),
                                                                                &ext_mem_229363.mem));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_212003,
                                                                                13,
                                                                                sizeof(mem_229531.mem),
                                                                                &mem_229531.mem));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_212003,
                                                                                14,
                                                                                sizeof(mem_229687.mem),
                                                                                &mem_229687.mem));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_212003,
                                                                                15,
                                                                                sizeof(mem_229697.mem),
                                                                                &mem_229697.mem));
                                        if (1 * ((size_t) num_groups_211996 *
                                                 (size_t) segred_group_sizze_211995) !=
                                            0) {
                                            const size_t
                                            global_work_sizze_236928[1] =
                                            {(size_t) num_groups_211996 *
                                            (size_t) segred_group_sizze_211995};
                                            const size_t
                                            local_work_sizze_236932[1] =
                                            {(size_t) segred_group_sizze_211995};
                                            int64_t time_start_236929 = 0,
                                                    time_end_236930 = 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_212003",
                                                        global_work_sizze_236928[0],
                                                        local_work_sizze_236932[0],
                                                        (int) (0 + (int64_t) 8 *
                                                               segred_group_sizze_211995));
                                                time_start_236929 =
                                                    get_wall_time();
                                            }
                                            OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                                            ctx->mainzisegred_small_212003,
                                                                                            1,
                                                                                            NULL,
                                                                                            global_work_sizze_236928,
                                                                                            local_work_sizze_236932,
                                                                                            0,
                                                                                            NULL,
                                                                                            ctx->profiling_paused ||
                                                                                            !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                                      &ctx->mainzisegred_small_212003_runs,
                                                                                                                                      &ctx->mainzisegred_small_212003_total_runtime)));
                                            if (ctx->debugging) {
                                                OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                                time_end_236930 =
                                                    get_wall_time();
                                                
                                                long time_diff_236931 =
                                                     time_end_236930 -
                                                     time_start_236929;
                                                
                                                fprintf(ctx->log,
                                                        "kernel %s runtime: %ldus\n",
                                                        "main.segred_small_212003",
                                                        time_diff_236931);
                                            }
                                        }
                                        if (ctx->debugging)
                                            fprintf(ctx->log, "%s\n", "");
                                    } else {
                                        int64_t groups_per_segment_233048 =
                                                sdiv_up64(num_groups_211996,
                                                          smax64((int64_t) 1,
                                                                 partition_sizze_203577 *
                                                                 n_p_203492 *
                                                                 s_n_m_203636));
                                        int64_t elements_per_thread_233049 =
                                                sdiv_up64(q_s_203493,
                                                          segred_group_sizze_211995 *
                                                          groups_per_segment_233048);
                                        int64_t virt_num_groups_233050 =
                                                groups_per_segment_233048 *
                                                (partition_sizze_203577 *
                                                 n_p_203492 * s_n_m_203636);
                                        int64_t num_threads_233051 =
                                                num_groups_211996 *
                                                segred_group_sizze_211995;
                                        int64_t threads_per_segment_233052 =
                                                groups_per_segment_233048 *
                                                segred_group_sizze_211995;
                                        
                                        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_203577 *
                                                                 n_p_203492 *
                                                                 s_n_m_203636),
                                                    '\n');
                                        if (ctx->debugging)
                                            fprintf(ctx->log, "%s: %llu%c",
                                                    "segment_size",
                                                    (long long) q_s_203493,
                                                    '\n');
                                        if (ctx->debugging)
                                            fprintf(ctx->log, "%s: %llu%c",
                                                    "virt_num_groups",
                                                    (long long) virt_num_groups_233050,
                                                    '\n');
                                        if (ctx->debugging)
                                            fprintf(ctx->log, "%s: %llu%c",
                                                    "num_groups",
                                                    (long long) num_groups_211996,
                                                    '\n');
                                        if (ctx->debugging)
                                            fprintf(ctx->log, "%s: %llu%c",
                                                    "group_size",
                                                    (long long) segred_group_sizze_211995,
                                                    '\n');
                                        if (ctx->debugging)
                                            fprintf(ctx->log, "%s: %llu%c",
                                                    "elems_per_thread",
                                                    (long long) elements_per_thread_233049,
                                                    '\n');
                                        if (ctx->debugging)
                                            fprintf(ctx->log, "%s: %llu%c",
                                                    "groups_per_segment",
                                                    (long long) groups_per_segment_233048,
                                                    '\n');
                                        
                                        struct memblock_device
                                        segred_tmp_mem_233053;
                                        
                                        segred_tmp_mem_233053.references = NULL;
                                        if (memblock_alloc_device(ctx,
                                                                  &segred_tmp_mem_233053,
                                                                  (int64_t) 8 *
                                                                  virt_num_groups_233050,
                                                                  "segred_tmp_mem_233053")) {
                                            err = 1;
                                            goto cleanup;
                                        }
                                        
                                        struct memblock_device
                                        mainzicounter_mem_233055 =
                                        ctx->mainzicounter_mem_233055;
                                        
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_212003,
                                                                                1,
                                                                                (size_t) 1,
                                                                                NULL));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_212003,
                                                                                2,
                                                                                (size_t) ((int64_t) 8 *
                                                                                          segred_group_sizze_211995),
                                                                                NULL));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_212003,
                                                                                3,
                                                                                sizeof(n_p_203492),
                                                                                &n_p_203492));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_212003,
                                                                                4,
                                                                                sizeof(q_s_203493),
                                                                                &q_s_203493));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_212003,
                                                                                5,
                                                                                sizeof(partition_sizze_203577),
                                                                                &partition_sizze_203577));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_212003,
                                                                                6,
                                                                                sizeof(defunc_0_f_res_203631),
                                                                                &defunc_0_f_res_203631));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_212003,
                                                                                7,
                                                                                sizeof(s_n_m_203636),
                                                                                &s_n_m_203636));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_212003,
                                                                                8,
                                                                                sizeof(num_groups_211996),
                                                                                &num_groups_211996));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_212003,
                                                                                9,
                                                                                sizeof(groups_per_segment_233048),
                                                                                &groups_per_segment_233048));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_212003,
                                                                                10,
                                                                                sizeof(elements_per_thread_233049),
                                                                                &elements_per_thread_233049));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_212003,
                                                                                11,
                                                                                sizeof(virt_num_groups_233050),
                                                                                &virt_num_groups_233050));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_212003,
                                                                                12,
                                                                                sizeof(threads_per_segment_233052),
                                                                                &threads_per_segment_233052));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_212003,
                                                                                13,
                                                                                sizeof(ext_mem_229264.mem),
                                                                                &ext_mem_229264.mem));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_212003,
                                                                                14,
                                                                                sizeof(ext_mem_229265.mem),
                                                                                &ext_mem_229265.mem));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_212003,
                                                                                15,
                                                                                sizeof(ext_mem_229362.mem),
                                                                                &ext_mem_229362.mem));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_212003,
                                                                                16,
                                                                                sizeof(ext_mem_229363.mem),
                                                                                &ext_mem_229363.mem));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_212003,
                                                                                17,
                                                                                sizeof(mem_229531.mem),
                                                                                &mem_229531.mem));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_212003,
                                                                                18,
                                                                                sizeof(mem_229687.mem),
                                                                                &mem_229687.mem));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_212003,
                                                                                19,
                                                                                sizeof(mem_229697.mem),
                                                                                &mem_229697.mem));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_212003,
                                                                                20,
                                                                                sizeof(segred_tmp_mem_233053.mem),
                                                                                &segred_tmp_mem_233053.mem));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_212003,
                                                                                21,
                                                                                sizeof(mainzicounter_mem_233055.mem),
                                                                                &mainzicounter_mem_233055.mem));
                                        if (1 * ((size_t) num_groups_211996 *
                                                 (size_t) segred_group_sizze_211995) !=
                                            0) {
                                            const size_t
                                            global_work_sizze_236934[1] =
                                            {(size_t) num_groups_211996 *
                                            (size_t) segred_group_sizze_211995};
                                            const size_t
                                            local_work_sizze_236938[1] =
                                            {(size_t) segred_group_sizze_211995};
                                            int64_t time_start_236935 = 0,
                                                    time_end_236936 = 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_212003",
                                                        global_work_sizze_236934[0],
                                                        local_work_sizze_236938[0],
                                                        (int) (0 + 1 +
                                                               (int64_t) 8 *
                                                               segred_group_sizze_211995));
                                                time_start_236935 =
                                                    get_wall_time();
                                            }
                                            OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                                            ctx->mainzisegred_large_212003,
                                                                                            1,
                                                                                            NULL,
                                                                                            global_work_sizze_236934,
                                                                                            local_work_sizze_236938,
                                                                                            0,
                                                                                            NULL,
                                                                                            ctx->profiling_paused ||
                                                                                            !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                                      &ctx->mainzisegred_large_212003_runs,
                                                                                                                                      &ctx->mainzisegred_large_212003_total_runtime)));
                                            if (ctx->debugging) {
                                                OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                                time_end_236936 =
                                                    get_wall_time();
                                                
                                                long time_diff_236937 =
                                                     time_end_236936 -
                                                     time_start_236935;
                                                
                                                fprintf(ctx->log,
                                                        "kernel %s runtime: %ldus\n",
                                                        "main.segred_large_212003",
                                                        time_diff_236937);
                                            }
                                        }
                                        if (ctx->debugging)
                                            fprintf(ctx->log, "%s\n", "");
                                        if (memblock_unref_device(ctx,
                                                                  &segred_tmp_mem_233053,
                                                                  "segred_tmp_mem_233053") !=
                                            0)
                                            return 1;
                                    }
                                    if (memblock_unref_device(ctx, &mem_229687,
                                                              "mem_229687") !=
                                        0)
                                        return 1;
                                    
                                    int64_t segmap_usable_groups_212045 =
                                            sdiv_up64(nest_sizze_208848,
                                                      segmap_group_sizze_212044);
                                    struct memblock_device mem_229703;
                                    
                                    mem_229703.references = NULL;
                                    if (memblock_alloc_device(ctx, &mem_229703,
                                                              bytes_229297,
                                                              "mem_229703")) {
                                        err = 1;
                                        goto cleanup;
                                    }
                                    
                                    struct memblock_device mem_229708;
                                    
                                    mem_229708.references = NULL;
                                    if (memblock_alloc_device(ctx, &mem_229708,
                                                              bytes_229297,
                                                              "mem_229708")) {
                                        err = 1;
                                        goto cleanup;
                                    }
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s\n", "\n# SegMap");
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_212051,
                                                                            1,
                                                                            sizeof(n_p_203492),
                                                                            &n_p_203492));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_212051,
                                                                            2,
                                                                            sizeof(jump_s_203499),
                                                                            &jump_s_203499));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_212051,
                                                                            3,
                                                                            sizeof(partition_sizze_203577),
                                                                            &partition_sizze_203577));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_212051,
                                                                            4,
                                                                            sizeof(defunc_0_f_res_203631),
                                                                            &defunc_0_f_res_203631));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_212051,
                                                                            5,
                                                                            sizeof(pad_css_len_203632),
                                                                            &pad_css_len_203632));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_212051,
                                                                            6,
                                                                            sizeof(s_n_m_203636),
                                                                            &s_n_m_203636));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_212051,
                                                                            7,
                                                                            sizeof(mem_229697.mem),
                                                                            &mem_229697.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_212051,
                                                                            8,
                                                                            sizeof(mem_229703.mem),
                                                                            &mem_229703.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_212051,
                                                                            9,
                                                                            sizeof(mem_229708.mem),
                                                                            &mem_229708.mem));
                                    if (1 *
                                        ((size_t) segmap_usable_groups_212045 *
                                         (size_t) segmap_group_sizze_212044) !=
                                        0) {
                                        const size_t global_work_sizze_236939[1]
                                                     =
                                                     {(size_t) segmap_usable_groups_212045 *
                                                     (size_t) segmap_group_sizze_212044};
                                        const size_t local_work_sizze_236943[1]
                                                     =
                                                     {(size_t) segmap_group_sizze_212044};
                                        int64_t time_start_236940 = 0,
                                                time_end_236941 = 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_212051",
                                                    global_work_sizze_236939[0],
                                                    local_work_sizze_236943[0],
                                                    (int) 0);
                                            time_start_236940 = get_wall_time();
                                        }
                                        OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                                        ctx->mainzisegmap_212051,
                                                                                        1,
                                                                                        NULL,
                                                                                        global_work_sizze_236939,
                                                                                        local_work_sizze_236943,
                                                                                        0,
                                                                                        NULL,
                                                                                        ctx->profiling_paused ||
                                                                                        !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                                  &ctx->mainzisegmap_212051_runs,
                                                                                                                                  &ctx->mainzisegmap_212051_total_runtime)));
                                        if (ctx->debugging) {
                                            OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                            time_end_236941 = get_wall_time();
                                            
                                            long time_diff_236942 =
                                                 time_end_236941 -
                                                 time_start_236940;
                                            
                                            fprintf(ctx->log,
                                                    "kernel %s runtime: %ldus\n",
                                                    "main.segmap_212051",
                                                    time_diff_236942);
                                        }
                                    }
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s\n", "");
                                    if (memblock_unref_device(ctx, &mem_229697,
                                                              "mem_229697") !=
                                        0)
                                        return 1;
                                    
                                    struct memblock_device mem_229714;
                                    
                                    mem_229714.references = NULL;
                                    if (memblock_alloc_device(ctx, &mem_229714,
                                                              bytes_229297,
                                                              "mem_229714")) {
                                        err = 1;
                                        goto cleanup;
                                    }
                                    if (slt64(q_s_203493 * (int64_t) 2,
                                              segred_group_sizze_212069)) {
                                        int64_t segment_sizze_nonzzero_233105 =
                                                smax64((int64_t) 1, q_s_203493);
                                        int64_t num_threads_233106 =
                                                num_groups_212070 *
                                                segred_group_sizze_212069;
                                        
                                        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_203577 *
                                                                 n_p_203492 *
                                                                 s_n_m_203636),
                                                    '\n');
                                        if (ctx->debugging)
                                            fprintf(ctx->log, "%s: %llu%c",
                                                    "segment_size",
                                                    (long long) q_s_203493,
                                                    '\n');
                                        if (ctx->debugging)
                                            fprintf(ctx->log, "%s: %llu%c",
                                                    "segments_per_group",
                                                    (long long) squot64(segred_group_sizze_212069,
                                                                        segment_sizze_nonzzero_233105),
                                                    '\n');
                                        if (ctx->debugging)
                                            fprintf(ctx->log, "%s: %llu%c",
                                                    "required_groups",
                                                    (long long) sext_i64_i32(sdiv_up64(partition_sizze_203577 *
                                                                                       n_p_203492 *
                                                                                       s_n_m_203636,
                                                                                       squot64(segred_group_sizze_212069,
                                                                                               segment_sizze_nonzzero_233105))),
                                                    '\n');
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_212077,
                                                                                1,
                                                                                (size_t) ((int64_t) 8 *
                                                                                          segred_group_sizze_212069),
                                                                                NULL));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_212077,
                                                                                2,
                                                                                sizeof(n_p_203492),
                                                                                &n_p_203492));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_212077,
                                                                                3,
                                                                                sizeof(q_s_203493),
                                                                                &q_s_203493));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_212077,
                                                                                4,
                                                                                sizeof(partition_sizze_203577),
                                                                                &partition_sizze_203577));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_212077,
                                                                                5,
                                                                                sizeof(defunc_0_f_res_203631),
                                                                                &defunc_0_f_res_203631));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_212077,
                                                                                6,
                                                                                sizeof(s_n_m_203636),
                                                                                &s_n_m_203636));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_212077,
                                                                                7,
                                                                                sizeof(num_groups_212070),
                                                                                &num_groups_212070));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_212077,
                                                                                8,
                                                                                sizeof(segment_sizze_nonzzero_233105),
                                                                                &segment_sizze_nonzzero_233105));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_212077,
                                                                                9,
                                                                                sizeof(ext_mem_229264.mem),
                                                                                &ext_mem_229264.mem));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_212077,
                                                                                10,
                                                                                sizeof(ext_mem_229265.mem),
                                                                                &ext_mem_229265.mem));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_212077,
                                                                                11,
                                                                                sizeof(ext_mem_229362.mem),
                                                                                &ext_mem_229362.mem));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_212077,
                                                                                12,
                                                                                sizeof(ext_mem_229363.mem),
                                                                                &ext_mem_229363.mem));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_212077,
                                                                                13,
                                                                                sizeof(mem_229526.mem),
                                                                                &mem_229526.mem));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_212077,
                                                                                14,
                                                                                sizeof(mem_229531.mem),
                                                                                &mem_229531.mem));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_212077,
                                                                                15,
                                                                                sizeof(mem_229703.mem),
                                                                                &mem_229703.mem));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_212077,
                                                                                16,
                                                                                sizeof(mem_229708.mem),
                                                                                &mem_229708.mem));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_212077,
                                                                                17,
                                                                                sizeof(mem_229714.mem),
                                                                                &mem_229714.mem));
                                        if (1 * ((size_t) num_groups_212070 *
                                                 (size_t) segred_group_sizze_212069) !=
                                            0) {
                                            const size_t
                                            global_work_sizze_236944[1] =
                                            {(size_t) num_groups_212070 *
                                            (size_t) segred_group_sizze_212069};
                                            const size_t
                                            local_work_sizze_236948[1] =
                                            {(size_t) segred_group_sizze_212069};
                                            int64_t time_start_236945 = 0,
                                                    time_end_236946 = 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_212077",
                                                        global_work_sizze_236944[0],
                                                        local_work_sizze_236948[0],
                                                        (int) (0 + (int64_t) 8 *
                                                               segred_group_sizze_212069));
                                                time_start_236945 =
                                                    get_wall_time();
                                            }
                                            OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                                            ctx->mainzisegred_small_212077,
                                                                                            1,
                                                                                            NULL,
                                                                                            global_work_sizze_236944,
                                                                                            local_work_sizze_236948,
                                                                                            0,
                                                                                            NULL,
                                                                                            ctx->profiling_paused ||
                                                                                            !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                                      &ctx->mainzisegred_small_212077_runs,
                                                                                                                                      &ctx->mainzisegred_small_212077_total_runtime)));
                                            if (ctx->debugging) {
                                                OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                                time_end_236946 =
                                                    get_wall_time();
                                                
                                                long time_diff_236947 =
                                                     time_end_236946 -
                                                     time_start_236945;
                                                
                                                fprintf(ctx->log,
                                                        "kernel %s runtime: %ldus\n",
                                                        "main.segred_small_212077",
                                                        time_diff_236947);
                                            }
                                        }
                                        if (ctx->debugging)
                                            fprintf(ctx->log, "%s\n", "");
                                    } else {
                                        int64_t groups_per_segment_233136 =
                                                sdiv_up64(num_groups_212070,
                                                          smax64((int64_t) 1,
                                                                 partition_sizze_203577 *
                                                                 n_p_203492 *
                                                                 s_n_m_203636));
                                        int64_t elements_per_thread_233137 =
                                                sdiv_up64(q_s_203493,
                                                          segred_group_sizze_212069 *
                                                          groups_per_segment_233136);
                                        int64_t virt_num_groups_233138 =
                                                groups_per_segment_233136 *
                                                (partition_sizze_203577 *
                                                 n_p_203492 * s_n_m_203636);
                                        int64_t num_threads_233139 =
                                                num_groups_212070 *
                                                segred_group_sizze_212069;
                                        int64_t threads_per_segment_233140 =
                                                groups_per_segment_233136 *
                                                segred_group_sizze_212069;
                                        
                                        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_203577 *
                                                                 n_p_203492 *
                                                                 s_n_m_203636),
                                                    '\n');
                                        if (ctx->debugging)
                                            fprintf(ctx->log, "%s: %llu%c",
                                                    "segment_size",
                                                    (long long) q_s_203493,
                                                    '\n');
                                        if (ctx->debugging)
                                            fprintf(ctx->log, "%s: %llu%c",
                                                    "virt_num_groups",
                                                    (long long) virt_num_groups_233138,
                                                    '\n');
                                        if (ctx->debugging)
                                            fprintf(ctx->log, "%s: %llu%c",
                                                    "num_groups",
                                                    (long long) num_groups_212070,
                                                    '\n');
                                        if (ctx->debugging)
                                            fprintf(ctx->log, "%s: %llu%c",
                                                    "group_size",
                                                    (long long) segred_group_sizze_212069,
                                                    '\n');
                                        if (ctx->debugging)
                                            fprintf(ctx->log, "%s: %llu%c",
                                                    "elems_per_thread",
                                                    (long long) elements_per_thread_233137,
                                                    '\n');
                                        if (ctx->debugging)
                                            fprintf(ctx->log, "%s: %llu%c",
                                                    "groups_per_segment",
                                                    (long long) groups_per_segment_233136,
                                                    '\n');
                                        
                                        struct memblock_device
                                        segred_tmp_mem_233141;
                                        
                                        segred_tmp_mem_233141.references = NULL;
                                        if (memblock_alloc_device(ctx,
                                                                  &segred_tmp_mem_233141,
                                                                  (int64_t) 8 *
                                                                  virt_num_groups_233138,
                                                                  "segred_tmp_mem_233141")) {
                                            err = 1;
                                            goto cleanup;
                                        }
                                        
                                        struct memblock_device
                                        mainzicounter_mem_233143 =
                                        ctx->mainzicounter_mem_233143;
                                        
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_212077,
                                                                                1,
                                                                                (size_t) 1,
                                                                                NULL));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_212077,
                                                                                2,
                                                                                (size_t) ((int64_t) 8 *
                                                                                          segred_group_sizze_212069),
                                                                                NULL));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_212077,
                                                                                3,
                                                                                sizeof(n_p_203492),
                                                                                &n_p_203492));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_212077,
                                                                                4,
                                                                                sizeof(q_s_203493),
                                                                                &q_s_203493));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_212077,
                                                                                5,
                                                                                sizeof(partition_sizze_203577),
                                                                                &partition_sizze_203577));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_212077,
                                                                                6,
                                                                                sizeof(defunc_0_f_res_203631),
                                                                                &defunc_0_f_res_203631));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_212077,
                                                                                7,
                                                                                sizeof(s_n_m_203636),
                                                                                &s_n_m_203636));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_212077,
                                                                                8,
                                                                                sizeof(num_groups_212070),
                                                                                &num_groups_212070));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_212077,
                                                                                9,
                                                                                sizeof(groups_per_segment_233136),
                                                                                &groups_per_segment_233136));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_212077,
                                                                                10,
                                                                                sizeof(elements_per_thread_233137),
                                                                                &elements_per_thread_233137));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_212077,
                                                                                11,
                                                                                sizeof(virt_num_groups_233138),
                                                                                &virt_num_groups_233138));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_212077,
                                                                                12,
                                                                                sizeof(threads_per_segment_233140),
                                                                                &threads_per_segment_233140));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_212077,
                                                                                13,
                                                                                sizeof(ext_mem_229264.mem),
                                                                                &ext_mem_229264.mem));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_212077,
                                                                                14,
                                                                                sizeof(ext_mem_229265.mem),
                                                                                &ext_mem_229265.mem));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_212077,
                                                                                15,
                                                                                sizeof(ext_mem_229362.mem),
                                                                                &ext_mem_229362.mem));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_212077,
                                                                                16,
                                                                                sizeof(ext_mem_229363.mem),
                                                                                &ext_mem_229363.mem));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_212077,
                                                                                17,
                                                                                sizeof(mem_229526.mem),
                                                                                &mem_229526.mem));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_212077,
                                                                                18,
                                                                                sizeof(mem_229531.mem),
                                                                                &mem_229531.mem));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_212077,
                                                                                19,
                                                                                sizeof(mem_229703.mem),
                                                                                &mem_229703.mem));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_212077,
                                                                                20,
                                                                                sizeof(mem_229708.mem),
                                                                                &mem_229708.mem));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_212077,
                                                                                21,
                                                                                sizeof(mem_229714.mem),
                                                                                &mem_229714.mem));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_212077,
                                                                                22,
                                                                                sizeof(segred_tmp_mem_233141.mem),
                                                                                &segred_tmp_mem_233141.mem));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_212077,
                                                                                23,
                                                                                sizeof(mainzicounter_mem_233143.mem),
                                                                                &mainzicounter_mem_233143.mem));
                                        if (1 * ((size_t) num_groups_212070 *
                                                 (size_t) segred_group_sizze_212069) !=
                                            0) {
                                            const size_t
                                            global_work_sizze_236950[1] =
                                            {(size_t) num_groups_212070 *
                                            (size_t) segred_group_sizze_212069};
                                            const size_t
                                            local_work_sizze_236954[1] =
                                            {(size_t) segred_group_sizze_212069};
                                            int64_t time_start_236951 = 0,
                                                    time_end_236952 = 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_212077",
                                                        global_work_sizze_236950[0],
                                                        local_work_sizze_236954[0],
                                                        (int) (0 + 1 +
                                                               (int64_t) 8 *
                                                               segred_group_sizze_212069));
                                                time_start_236951 =
                                                    get_wall_time();
                                            }
                                            OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                                            ctx->mainzisegred_large_212077,
                                                                                            1,
                                                                                            NULL,
                                                                                            global_work_sizze_236950,
                                                                                            local_work_sizze_236954,
                                                                                            0,
                                                                                            NULL,
                                                                                            ctx->profiling_paused ||
                                                                                            !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                                      &ctx->mainzisegred_large_212077_runs,
                                                                                                                                      &ctx->mainzisegred_large_212077_total_runtime)));
                                            if (ctx->debugging) {
                                                OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                                time_end_236952 =
                                                    get_wall_time();
                                                
                                                long time_diff_236953 =
                                                     time_end_236952 -
                                                     time_start_236951;
                                                
                                                fprintf(ctx->log,
                                                        "kernel %s runtime: %ldus\n",
                                                        "main.segred_large_212077",
                                                        time_diff_236953);
                                            }
                                        }
                                        if (ctx->debugging)
                                            fprintf(ctx->log, "%s\n", "");
                                        if (memblock_unref_device(ctx,
                                                                  &segred_tmp_mem_233141,
                                                                  "segred_tmp_mem_233141") !=
                                            0)
                                            return 1;
                                    }
                                    if (memblock_unref_device(ctx, &mem_229703,
                                                              "mem_229703") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229708,
                                                              "mem_229708") !=
                                        0)
                                        return 1;
                                    if (memblock_set_device(ctx,
                                                            &ext_mem_229715,
                                                            &mem_229714,
                                                            "mem_229714") != 0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229714,
                                                              "mem_229714") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229708,
                                                              "mem_229708") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229703,
                                                              "mem_229703") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229697,
                                                              "mem_229697") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229691,
                                                              "mem_229691") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229687,
                                                              "mem_229687") !=
                                        0)
                                        return 1;
                                }
                                if (memblock_set_device(ctx, &ext_mem_229716,
                                                        &ext_mem_229715,
                                                        "ext_mem_229715") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229715,
                                                          "ext_mem_229715") !=
                                    0)
                                    return 1;
                            }
                            if (memblock_set_device(ctx, &ext_mem_229723,
                                                    &ext_mem_229716,
                                                    "ext_mem_229716") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229716,
                                                      "ext_mem_229716") != 0)
                                return 1;
                        }
                        if (memblock_set_device(ctx, &ext_mem_229730,
                                                &ext_mem_229723,
                                                "ext_mem_229723") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_229723,
                                                  "ext_mem_229723") != 0)
                            return 1;
                    }
                    if (memblock_set_device(ctx, &ext_mem_230420,
                                            &ext_mem_229730,
                                            "ext_mem_229730") != 0)
                        return 1;
                    if (memblock_set_device(ctx, &ext_mem_230419, &mem_229536,
                                            "mem_229536") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229730,
                                              "ext_mem_229730") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229536, "mem_229536") !=
                        0)
                        return 1;
                } else {
                    bool match_lit_204336 = (int64_t) 1 == d_s_203496;
                    struct memblock_device ext_mem_230418;
                    
                    ext_mem_230418.references = NULL;
                    
                    struct memblock_device ext_mem_230417;
                    
                    ext_mem_230417.references = NULL;
                    if (match_lit_204336) {
                        bool suff_outer_par_212129;
                        
                        suff_outer_par_212129 =
                            *ctx->tuning_params.mainzisuff_outer_par_11 <=
                            partition_sizze_203577;
                        if (ctx->logging)
                            fprintf(ctx->log, "Compared %s <= %ld: %s.\n",
                                    "main.suff_outer_par_11",
                                    (long) partition_sizze_203577,
                                    suff_outer_par_212129 ? "true" : "false");
                        
                        int64_t segmap_group_sizze_212259;
                        
                        segmap_group_sizze_212259 =
                            *ctx->tuning_params.mainzisegmap_group_sizze_212133;
                        
                        int64_t num_groups_212260;
                        int32_t max_num_groups_233185;
                        
                        max_num_groups_233185 =
                            *ctx->tuning_params.mainzisegmap_num_groups_212135;
                        num_groups_212260 = sext_i64_i32(smax64((int64_t) 1,
                                                                smin64(sdiv_up64(partition_sizze_203577,
                                                                                 segmap_group_sizze_212259),
                                                                       sext_i32_i64(max_num_groups_233185))));
                        
                        int64_t segmap_group_sizze_213696;
                        
                        segmap_group_sizze_213696 =
                            *ctx->tuning_params.mainzisegmap_group_sizze_212389;
                        
                        int64_t num_groups_213697;
                        int32_t max_num_groups_233186;
                        
                        max_num_groups_233186 =
                            *ctx->tuning_params.mainzisegmap_num_groups_212391;
                        num_groups_213697 = sext_i64_i32(smax64((int64_t) 1,
                                                                smin64(sdiv_up64(binop_x_229202,
                                                                                 segmap_group_sizze_213696),
                                                                       sext_i32_i64(max_num_groups_233186))));
                        
                        bool suff_outer_par_213701;
                        
                        suff_outer_par_213701 =
                            *ctx->tuning_params.mainzisuff_outer_par_12 <=
                            binop_x_229202;
                        if (ctx->logging)
                            fprintf(ctx->log, "Compared %s <= %ld: %s.\n",
                                    "main.suff_outer_par_12",
                                    (long) binop_x_229202,
                                    suff_outer_par_213701 ? "true" : "false");
                        
                        int64_t one_intra_par_min_213702 = q_s_203493 *
                                s_n_m_203636;
                        int64_t intra_avail_par_213704 = smin64(s_n_m_203636,
                                                                one_intra_par_min_213702);
                        int64_t computed_group_sizze_213705 =
                                smax64(s_n_m_203636, one_intra_par_min_213702);
                        bool fits_213709 = sle64(computed_group_sizze_213705,
                                                 max_group_sizze_206887);
                        bool suff_intra_par_213711;
                        
                        suff_intra_par_213711 =
                            *ctx->tuning_params.mainzisuff_intra_par_13 <=
                            intra_avail_par_213704;
                        if (ctx->logging)
                            fprintf(ctx->log, "Compared %s <= %ld: %s.\n",
                                    "main.suff_intra_par_13",
                                    (long) intra_avail_par_213704,
                                    suff_intra_par_213711 ? "true" : "false");
                        
                        bool intra_suff_and_fits_213712 = fits_213709 &&
                             suff_intra_par_213711;
                        int64_t segmap_group_sizze_213981;
                        
                        segmap_group_sizze_213981 =
                            *ctx->tuning_params.mainzisegmap_group_sizze_212822;
                        
                        bool suff_outer_par_213986;
                        
                        suff_outer_par_213986 =
                            *ctx->tuning_params.mainzisuff_outer_par_14 <=
                            nest_sizze_208848;
                        if (ctx->logging)
                            fprintf(ctx->log, "Compared %s <= %ld: %s.\n",
                                    "main.suff_outer_par_14",
                                    (long) nest_sizze_208848,
                                    suff_outer_par_213986 ? "true" : "false");
                        
                        int64_t segmap_group_sizze_214104;
                        
                        segmap_group_sizze_214104 =
                            *ctx->tuning_params.mainzisegmap_group_sizze_213157;
                        
                        int64_t nest_sizze_214126 = q_s_203493 *
                                nest_sizze_208848;
                        int64_t segred_group_sizze_214127;
                        
                        segred_group_sizze_214127 =
                            *ctx->tuning_params.mainzisegred_group_sizze_213093;
                        
                        int64_t num_groups_214128;
                        int32_t max_num_groups_233187;
                        
                        max_num_groups_233187 =
                            *ctx->tuning_params.mainzisegred_num_groups_213095;
                        num_groups_214128 = sext_i64_i32(smax64((int64_t) 1,
                                                                smin64(sdiv_up64(nest_sizze_214126,
                                                                                 segred_group_sizze_214127),
                                                                       sext_i32_i64(max_num_groups_233187))));
                        
                        int64_t segmap_group_sizze_214186;
                        
                        segmap_group_sizze_214186 =
                            *ctx->tuning_params.mainzisegmap_group_sizze_213054;
                        
                        int64_t segred_group_sizze_214222;
                        
                        segred_group_sizze_214222 =
                            *ctx->tuning_params.mainzisegred_group_sizze_212960;
                        
                        int64_t num_groups_214223;
                        int32_t max_num_groups_233188;
                        
                        max_num_groups_233188 =
                            *ctx->tuning_params.mainzisegred_num_groups_212962;
                        num_groups_214223 = sext_i64_i32(smax64((int64_t) 1,
                                                                smin64(sdiv_up64(nest_sizze_214126,
                                                                                 segred_group_sizze_214222),
                                                                       sext_i32_i64(max_num_groups_233188))));
                        
                        int64_t bytes_229733 = (int64_t) 8 * nest_sizze_208848;
                        int64_t bytes_229740 = (int64_t) 8 * nest_sizze_207163;
                        int64_t binop_x_229851 = partition_sizze_203577 *
                                s_n_m_203636;
                        int64_t binop_x_229852 = n_p_203492 * binop_x_229851;
                        int64_t bytes_229853 = (int64_t) 8 * binop_x_229852;
                        int64_t binop_x_229859 = partition_sizze_203577 *
                                defunc_0_f_res_203631;
                        int64_t binop_x_229860 = n_p_203492 * binop_x_229859;
                        int64_t bytes_229861 = (int64_t) 8 * binop_x_229860;
                        int64_t bytes_229915 = smax64((int64_t) 0,
                                                      s_n_m_203636);
                        int64_t bytes_229976 = smax64((int64_t) 0,
                                                      binop_x_229295);
                        int64_t num_threads_232119 = segmap_group_sizze_212259 *
                                num_groups_212260;
                        int64_t total_sizze_232120 = bytes_229288 *
                                num_threads_232119;
                        int64_t total_sizze_232121 = bytes_229288 *
                                num_threads_232119;
                        int64_t num_threads_232122 = segmap_group_sizze_213696 *
                                num_groups_213697;
                        int64_t total_sizze_232123 = bytes_229311 *
                                num_threads_232122;
                        int64_t total_sizze_232124 = bytes_229311 *
                                num_threads_232122;
                        struct memblock_device ext_mem_230057;
                        
                        ext_mem_230057.references = NULL;
                        
                        struct memblock_device ext_mem_230056;
                        
                        ext_mem_230056.references = NULL;
                        
                        int32_t local_memory_capacity_233559;
                        
                        local_memory_capacity_233559 =
                            ctx->opencl.max_local_memory;
                        if (sle64((int64_t) 0,
                                  sext_i32_i64(local_memory_capacity_233559)) &&
                            suff_outer_par_212129) {
                            struct memblock_device mem_229734;
                            
                            mem_229734.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_229734,
                                                      bytes_229733,
                                                      "mem_229734")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (futrts_builtinzhgpu_map_transpose_f64(ctx,
                                                                      mem_229734,
                                                                      (int64_t) 0,
                                                                      ext_mem_229362,
                                                                      (int64_t) 0,
                                                                      (int64_t) 1,
                                                                      n_p_203492 *
                                                                      s_n_m_203636,
                                                                      partition_sizze_203577) !=
                                0) {
                                if (memblock_unref_device(ctx, &mem_229734,
                                                          "mem_229734") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230056,
                                                          "ext_mem_230056") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230057,
                                                          "ext_mem_230057") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230417,
                                                          "ext_mem_230417") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230418,
                                                          "ext_mem_230418") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230419,
                                                          "ext_mem_230419") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230420,
                                                          "ext_mem_230420") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230486,
                                                          "ext_mem_230486") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230487,
                                                          "ext_mem_230487") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229515,
                                                          "mem_param_229515") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229507,
                                                          "mem_param_229507") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231517,
                                                          "ext_mem_231517") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231518,
                                                          "ext_mem_231518") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229493,
                                                          "mem_param_229493") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229485,
                                                          "mem_param_229485") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229477,
                                                          "mem_param_229477") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231860,
                                                          "ext_mem_231860") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231861,
                                                          "ext_mem_231861") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231862,
                                                          "ext_mem_231862") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230551,
                                                          "mem_230551") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230534,
                                                          "mem_230534") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230517,
                                                          "mem_230517") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230500,
                                                          "mem_230500") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229531,
                                                          "mem_229531") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229526,
                                                          "mem_229526") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229520,
                                                          "mem_229520") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229469,
                                                          "mem_229469") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229465,
                                                          "mem_229465") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229460,
                                                          "ext_mem_229460") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229461,
                                                          "ext_mem_229461") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229411,
                                                          "ext_mem_229411") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229412,
                                                          "ext_mem_229412") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229362,
                                                          "ext_mem_229362") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229363,
                                                          "ext_mem_229363") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229264,
                                                          "ext_mem_229264") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229265,
                                                          "ext_mem_229265") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229206,
                                                          "mem_229206") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229200,
                                                          "mem_229200") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229196,
                                                          "ext_mem_229196") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229197,
                                                          "ext_mem_229197") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229164,
                                                          "mem_229164") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229161,
                                                          "mem_229161") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229157,
                                                          "mem_229157") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229155,
                                                          "mem_229155") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229152,
                                                          "mem_229152") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229148,
                                                          "mem_229148") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232249,
                                                          "mem_out_232249") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232248,
                                                          "mem_out_232248") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232247,
                                                          "mem_out_232247") !=
                                    0)
                                    return 1;
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device mem_229737;
                            
                            mem_229737.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_229737,
                                                      binop_y_229224,
                                                      "mem_229737")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (futrts_builtinzhgpu_map_transpose_i64(ctx,
                                                                      mem_229737,
                                                                      (int64_t) 0,
                                                                      ext_mem_229264,
                                                                      (int64_t) 0,
                                                                      (int64_t) 1,
                                                                      n_p_203492,
                                                                      partition_sizze_203577) !=
                                0) {
                                if (memblock_unref_device(ctx, &mem_229737,
                                                          "mem_229737") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229734,
                                                          "mem_229734") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230056,
                                                          "ext_mem_230056") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230057,
                                                          "ext_mem_230057") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230417,
                                                          "ext_mem_230417") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230418,
                                                          "ext_mem_230418") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230419,
                                                          "ext_mem_230419") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230420,
                                                          "ext_mem_230420") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230486,
                                                          "ext_mem_230486") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230487,
                                                          "ext_mem_230487") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229515,
                                                          "mem_param_229515") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229507,
                                                          "mem_param_229507") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231517,
                                                          "ext_mem_231517") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231518,
                                                          "ext_mem_231518") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229493,
                                                          "mem_param_229493") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229485,
                                                          "mem_param_229485") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229477,
                                                          "mem_param_229477") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231860,
                                                          "ext_mem_231860") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231861,
                                                          "ext_mem_231861") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231862,
                                                          "ext_mem_231862") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230551,
                                                          "mem_230551") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230534,
                                                          "mem_230534") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230517,
                                                          "mem_230517") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230500,
                                                          "mem_230500") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229531,
                                                          "mem_229531") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229526,
                                                          "mem_229526") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229520,
                                                          "mem_229520") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229469,
                                                          "mem_229469") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229465,
                                                          "mem_229465") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229460,
                                                          "ext_mem_229460") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229461,
                                                          "ext_mem_229461") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229411,
                                                          "ext_mem_229411") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229412,
                                                          "ext_mem_229412") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229362,
                                                          "ext_mem_229362") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229363,
                                                          "ext_mem_229363") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229264,
                                                          "ext_mem_229264") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229265,
                                                          "ext_mem_229265") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229206,
                                                          "mem_229206") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229200,
                                                          "mem_229200") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229196,
                                                          "ext_mem_229196") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229197,
                                                          "ext_mem_229197") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229164,
                                                          "mem_229164") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229161,
                                                          "mem_229161") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229157,
                                                          "mem_229157") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229155,
                                                          "mem_229155") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229152,
                                                          "mem_229152") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229148,
                                                          "mem_229148") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232249,
                                                          "mem_out_232249") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232248,
                                                          "mem_out_232248") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232247,
                                                          "mem_out_232247") !=
                                    0)
                                    return 1;
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device mem_229741;
                            
                            mem_229741.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_229741,
                                                      bytes_229740,
                                                      "mem_229741")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (futrts_builtinzhgpu_map_transpose_f64(ctx,
                                                                      mem_229741,
                                                                      (int64_t) 0,
                                                                      mem_229531,
                                                                      (int64_t) 0,
                                                                      (int64_t) 1,
                                                                      n_p_203492 *
                                                                      defunc_0_f_res_203631,
                                                                      partition_sizze_203577) !=
                                0) {
                                if (memblock_unref_device(ctx, &mem_229741,
                                                          "mem_229741") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229737,
                                                          "mem_229737") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229734,
                                                          "mem_229734") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230056,
                                                          "ext_mem_230056") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230057,
                                                          "ext_mem_230057") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230417,
                                                          "ext_mem_230417") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230418,
                                                          "ext_mem_230418") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230419,
                                                          "ext_mem_230419") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230420,
                                                          "ext_mem_230420") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230486,
                                                          "ext_mem_230486") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230487,
                                                          "ext_mem_230487") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229515,
                                                          "mem_param_229515") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229507,
                                                          "mem_param_229507") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231517,
                                                          "ext_mem_231517") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231518,
                                                          "ext_mem_231518") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229493,
                                                          "mem_param_229493") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229485,
                                                          "mem_param_229485") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229477,
                                                          "mem_param_229477") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231860,
                                                          "ext_mem_231860") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231861,
                                                          "ext_mem_231861") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231862,
                                                          "ext_mem_231862") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230551,
                                                          "mem_230551") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230534,
                                                          "mem_230534") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230517,
                                                          "mem_230517") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230500,
                                                          "mem_230500") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229531,
                                                          "mem_229531") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229526,
                                                          "mem_229526") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229520,
                                                          "mem_229520") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229469,
                                                          "mem_229469") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229465,
                                                          "mem_229465") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229460,
                                                          "ext_mem_229460") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229461,
                                                          "ext_mem_229461") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229411,
                                                          "ext_mem_229411") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229412,
                                                          "ext_mem_229412") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229362,
                                                          "ext_mem_229362") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229363,
                                                          "ext_mem_229363") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229264,
                                                          "ext_mem_229264") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229265,
                                                          "ext_mem_229265") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229206,
                                                          "mem_229206") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229200,
                                                          "mem_229200") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229196,
                                                          "ext_mem_229196") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229197,
                                                          "ext_mem_229197") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229164,
                                                          "mem_229164") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229161,
                                                          "mem_229161") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229157,
                                                          "mem_229157") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229155,
                                                          "mem_229155") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229152,
                                                          "mem_229152") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229148,
                                                          "mem_229148") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232249,
                                                          "mem_out_232249") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232248,
                                                          "mem_out_232248") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232247,
                                                          "mem_out_232247") !=
                                    0)
                                    return 1;
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device mem_229745;
                            
                            mem_229745.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_229745,
                                                      bytes_229733,
                                                      "mem_229745")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (futrts_builtinzhgpu_map_transpose_i64(ctx,
                                                                      mem_229745,
                                                                      (int64_t) 0,
                                                                      ext_mem_229363,
                                                                      (int64_t) 0,
                                                                      (int64_t) 1,
                                                                      n_p_203492 *
                                                                      s_n_m_203636,
                                                                      partition_sizze_203577) !=
                                0) {
                                if (memblock_unref_device(ctx, &mem_229745,
                                                          "mem_229745") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229741,
                                                          "mem_229741") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229737,
                                                          "mem_229737") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229734,
                                                          "mem_229734") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230056,
                                                          "ext_mem_230056") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230057,
                                                          "ext_mem_230057") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230417,
                                                          "ext_mem_230417") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230418,
                                                          "ext_mem_230418") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230419,
                                                          "ext_mem_230419") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230420,
                                                          "ext_mem_230420") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230486,
                                                          "ext_mem_230486") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230487,
                                                          "ext_mem_230487") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229515,
                                                          "mem_param_229515") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229507,
                                                          "mem_param_229507") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231517,
                                                          "ext_mem_231517") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231518,
                                                          "ext_mem_231518") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229493,
                                                          "mem_param_229493") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229485,
                                                          "mem_param_229485") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229477,
                                                          "mem_param_229477") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231860,
                                                          "ext_mem_231860") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231861,
                                                          "ext_mem_231861") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231862,
                                                          "ext_mem_231862") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230551,
                                                          "mem_230551") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230534,
                                                          "mem_230534") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230517,
                                                          "mem_230517") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230500,
                                                          "mem_230500") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229531,
                                                          "mem_229531") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229526,
                                                          "mem_229526") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229520,
                                                          "mem_229520") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229469,
                                                          "mem_229469") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229465,
                                                          "mem_229465") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229460,
                                                          "ext_mem_229460") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229461,
                                                          "ext_mem_229461") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229411,
                                                          "ext_mem_229411") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229412,
                                                          "ext_mem_229412") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229362,
                                                          "ext_mem_229362") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229363,
                                                          "ext_mem_229363") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229264,
                                                          "ext_mem_229264") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229265,
                                                          "ext_mem_229265") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229206,
                                                          "mem_229206") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229200,
                                                          "mem_229200") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229196,
                                                          "ext_mem_229196") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229197,
                                                          "ext_mem_229197") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229164,
                                                          "mem_229164") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229161,
                                                          "mem_229161") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229157,
                                                          "mem_229157") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229155,
                                                          "mem_229155") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229152,
                                                          "mem_229152") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229148,
                                                          "mem_229148") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232249,
                                                          "mem_out_232249") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232248,
                                                          "mem_out_232248") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232247,
                                                          "mem_out_232247") !=
                                    0)
                                    return 1;
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device mem_229749;
                            
                            mem_229749.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_229749,
                                                      bytes_229740,
                                                      "mem_229749")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (futrts_builtinzhgpu_map_transpose_f64(ctx,
                                                                      mem_229749,
                                                                      (int64_t) 0,
                                                                      mem_229526,
                                                                      (int64_t) 0,
                                                                      (int64_t) 1,
                                                                      n_p_203492 *
                                                                      defunc_0_f_res_203631,
                                                                      partition_sizze_203577) !=
                                0) {
                                if (memblock_unref_device(ctx, &mem_229749,
                                                          "mem_229749") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229745,
                                                          "mem_229745") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229741,
                                                          "mem_229741") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229737,
                                                          "mem_229737") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229734,
                                                          "mem_229734") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230056,
                                                          "ext_mem_230056") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230057,
                                                          "ext_mem_230057") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230417,
                                                          "ext_mem_230417") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230418,
                                                          "ext_mem_230418") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230419,
                                                          "ext_mem_230419") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230420,
                                                          "ext_mem_230420") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230486,
                                                          "ext_mem_230486") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230487,
                                                          "ext_mem_230487") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229515,
                                                          "mem_param_229515") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229507,
                                                          "mem_param_229507") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231517,
                                                          "ext_mem_231517") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231518,
                                                          "ext_mem_231518") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229493,
                                                          "mem_param_229493") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229485,
                                                          "mem_param_229485") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229477,
                                                          "mem_param_229477") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231860,
                                                          "ext_mem_231860") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231861,
                                                          "ext_mem_231861") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231862,
                                                          "ext_mem_231862") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230551,
                                                          "mem_230551") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230534,
                                                          "mem_230534") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230517,
                                                          "mem_230517") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230500,
                                                          "mem_230500") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229531,
                                                          "mem_229531") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229526,
                                                          "mem_229526") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229520,
                                                          "mem_229520") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229469,
                                                          "mem_229469") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229465,
                                                          "mem_229465") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229460,
                                                          "ext_mem_229460") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229461,
                                                          "ext_mem_229461") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229411,
                                                          "ext_mem_229411") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229412,
                                                          "ext_mem_229412") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229362,
                                                          "ext_mem_229362") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229363,
                                                          "ext_mem_229363") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229264,
                                                          "ext_mem_229264") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229265,
                                                          "ext_mem_229265") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229206,
                                                          "mem_229206") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229200,
                                                          "mem_229200") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229196,
                                                          "ext_mem_229196") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229197,
                                                          "ext_mem_229197") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229164,
                                                          "mem_229164") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229161,
                                                          "mem_229161") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229157,
                                                          "mem_229157") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229155,
                                                          "mem_229155") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229152,
                                                          "mem_229152") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229148,
                                                          "mem_229148") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232249,
                                                          "mem_out_232249") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232248,
                                                          "mem_out_232248") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232247,
                                                          "mem_out_232247") !=
                                    0)
                                    return 1;
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device mem_229753;
                            
                            mem_229753.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_229753,
                                                      bytes_229740,
                                                      "mem_229753")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (futrts_builtinzhgpu_map_transpose_i64(ctx,
                                                                      mem_229753,
                                                                      (int64_t) 0,
                                                                      ext_mem_229265,
                                                                      (int64_t) 0,
                                                                      (int64_t) 1,
                                                                      n_p_203492 *
                                                                      defunc_0_f_res_203631,
                                                                      partition_sizze_203577) !=
                                0) {
                                if (memblock_unref_device(ctx, &mem_229753,
                                                          "mem_229753") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229749,
                                                          "mem_229749") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229745,
                                                          "mem_229745") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229741,
                                                          "mem_229741") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229737,
                                                          "mem_229737") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229734,
                                                          "mem_229734") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230056,
                                                          "ext_mem_230056") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230057,
                                                          "ext_mem_230057") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230417,
                                                          "ext_mem_230417") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230418,
                                                          "ext_mem_230418") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230419,
                                                          "ext_mem_230419") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230420,
                                                          "ext_mem_230420") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230486,
                                                          "ext_mem_230486") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230487,
                                                          "ext_mem_230487") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229515,
                                                          "mem_param_229515") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229507,
                                                          "mem_param_229507") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231517,
                                                          "ext_mem_231517") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231518,
                                                          "ext_mem_231518") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229493,
                                                          "mem_param_229493") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229485,
                                                          "mem_param_229485") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229477,
                                                          "mem_param_229477") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231860,
                                                          "ext_mem_231860") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231861,
                                                          "ext_mem_231861") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231862,
                                                          "ext_mem_231862") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230551,
                                                          "mem_230551") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230534,
                                                          "mem_230534") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230517,
                                                          "mem_230517") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230500,
                                                          "mem_230500") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229531,
                                                          "mem_229531") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229526,
                                                          "mem_229526") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229520,
                                                          "mem_229520") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229469,
                                                          "mem_229469") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229465,
                                                          "mem_229465") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229460,
                                                          "ext_mem_229460") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229461,
                                                          "ext_mem_229461") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229411,
                                                          "ext_mem_229411") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229412,
                                                          "ext_mem_229412") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229362,
                                                          "ext_mem_229362") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229363,
                                                          "ext_mem_229363") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229264,
                                                          "ext_mem_229264") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229265,
                                                          "ext_mem_229265") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229206,
                                                          "mem_229206") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229200,
                                                          "mem_229200") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229196,
                                                          "ext_mem_229196") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229197,
                                                          "ext_mem_229197") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229164,
                                                          "mem_229164") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229161,
                                                          "mem_229161") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229157,
                                                          "mem_229157") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229155,
                                                          "mem_229155") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229152,
                                                          "mem_229152") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229148,
                                                          "mem_229148") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232249,
                                                          "mem_out_232249") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232248,
                                                          "mem_out_232248") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232247,
                                                          "mem_out_232247") !=
                                    0)
                                    return 1;
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device mem_229846;
                            
                            mem_229846.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_229846,
                                                      bytes_229733,
                                                      "mem_229846")) {
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device mem_229850;
                            
                            mem_229850.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_229850,
                                                      bytes_229733,
                                                      "mem_229850")) {
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device color_231992;
                            
                            color_231992.references = NULL;
                            if (memblock_alloc_device(ctx, &color_231992,
                                                      total_sizze_232120,
                                                      "color_231992")) {
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device color_231993;
                            
                            color_231993.references = NULL;
                            if (memblock_alloc_device(ctx, &color_231993,
                                                      total_sizze_232121,
                                                      "color_231993")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s\n", "\n# SegMap");
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_212265,
                                                                    1,
                                                                    sizeof(n_p_203492),
                                                                    &n_p_203492));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_212265,
                                                                    2,
                                                                    sizeof(q_s_203493),
                                                                    &q_s_203493));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_212265,
                                                                    3,
                                                                    sizeof(jump_s_203499),
                                                                    &jump_s_203499));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_212265,
                                                                    4,
                                                                    sizeof(partition_sizze_203577),
                                                                    &partition_sizze_203577));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_212265,
                                                                    5,
                                                                    sizeof(defunc_0_f_res_203631),
                                                                    &defunc_0_f_res_203631));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_212265,
                                                                    6,
                                                                    sizeof(pad_css_len_203632),
                                                                    &pad_css_len_203632));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_212265,
                                                                    7,
                                                                    sizeof(s_n_m_203636),
                                                                    &s_n_m_203636));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_212265,
                                                                    8,
                                                                    sizeof(num_groups_212260),
                                                                    &num_groups_212260));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_212265,
                                                                    9,
                                                                    sizeof(num_threads_232119),
                                                                    &num_threads_232119));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_212265,
                                                                    10,
                                                                    sizeof(mem_229734.mem),
                                                                    &mem_229734.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_212265,
                                                                    11,
                                                                    sizeof(mem_229737.mem),
                                                                    &mem_229737.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_212265,
                                                                    12,
                                                                    sizeof(mem_229741.mem),
                                                                    &mem_229741.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_212265,
                                                                    13,
                                                                    sizeof(mem_229745.mem),
                                                                    &mem_229745.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_212265,
                                                                    14,
                                                                    sizeof(mem_229749.mem),
                                                                    &mem_229749.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_212265,
                                                                    15,
                                                                    sizeof(mem_229753.mem),
                                                                    &mem_229753.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_212265,
                                                                    16,
                                                                    sizeof(mem_229846.mem),
                                                                    &mem_229846.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_212265,
                                                                    17,
                                                                    sizeof(mem_229850.mem),
                                                                    &mem_229850.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_212265,
                                                                    18,
                                                                    sizeof(color_231992.mem),
                                                                    &color_231992.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_212265,
                                                                    19,
                                                                    sizeof(color_231993.mem),
                                                                    &color_231993.mem));
                            if (1 * ((size_t) num_groups_212260 *
                                     (size_t) segmap_group_sizze_212259) != 0) {
                                const size_t global_work_sizze_236955[1] =
                                             {(size_t) num_groups_212260 *
                                             (size_t) segmap_group_sizze_212259};
                                const size_t local_work_sizze_236959[1] =
                                             {(size_t) segmap_group_sizze_212259};
                                int64_t time_start_236956 = 0, time_end_236957 =
                                        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_212265",
                                            global_work_sizze_236955[0],
                                            local_work_sizze_236959[0],
                                            (int) 0);
                                    time_start_236956 = get_wall_time();
                                }
                                OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                                ctx->mainzisegmap_212265,
                                                                                1,
                                                                                NULL,
                                                                                global_work_sizze_236955,
                                                                                local_work_sizze_236959,
                                                                                0,
                                                                                NULL,
                                                                                ctx->profiling_paused ||
                                                                                !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                          &ctx->mainzisegmap_212265_runs,
                                                                                                                          &ctx->mainzisegmap_212265_total_runtime)));
                                if (ctx->debugging) {
                                    OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                    time_end_236957 = get_wall_time();
                                    
                                    long time_diff_236958 = time_end_236957 -
                                         time_start_236956;
                                    
                                    fprintf(ctx->log,
                                            "kernel %s runtime: %ldus\n",
                                            "main.segmap_212265",
                                            time_diff_236958);
                                }
                            }
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s\n", "");
                            if (memblock_unref_device(ctx, &mem_229734,
                                                      "mem_229734") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229737,
                                                      "mem_229737") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229741,
                                                      "mem_229741") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229745,
                                                      "mem_229745") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229749,
                                                      "mem_229749") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229753,
                                                      "mem_229753") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &color_231992,
                                                      "color_231992") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &color_231993,
                                                      "color_231993") != 0)
                                return 1;
                            
                            struct memblock_device mem_230048;
                            
                            mem_230048.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_230048,
                                                      bytes_229297,
                                                      "mem_230048")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (futrts_builtinzhgpu_map_transpose_f64(ctx,
                                                                      mem_230048,
                                                                      (int64_t) 0,
                                                                      mem_229846,
                                                                      (int64_t) 0,
                                                                      (int64_t) 1,
                                                                      partition_sizze_203577,
                                                                      n_p_203492 *
                                                                      s_n_m_203636) !=
                                0) {
                                if (memblock_unref_device(ctx, &mem_230048,
                                                          "mem_230048") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &color_231993,
                                                          "color_231993") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &color_231992,
                                                          "color_231992") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229850,
                                                          "mem_229850") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229846,
                                                          "mem_229846") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229753,
                                                          "mem_229753") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229749,
                                                          "mem_229749") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229745,
                                                          "mem_229745") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229741,
                                                          "mem_229741") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229737,
                                                          "mem_229737") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229734,
                                                          "mem_229734") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230056,
                                                          "ext_mem_230056") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230057,
                                                          "ext_mem_230057") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230417,
                                                          "ext_mem_230417") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230418,
                                                          "ext_mem_230418") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230419,
                                                          "ext_mem_230419") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230420,
                                                          "ext_mem_230420") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230486,
                                                          "ext_mem_230486") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230487,
                                                          "ext_mem_230487") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229515,
                                                          "mem_param_229515") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229507,
                                                          "mem_param_229507") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231517,
                                                          "ext_mem_231517") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231518,
                                                          "ext_mem_231518") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229493,
                                                          "mem_param_229493") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229485,
                                                          "mem_param_229485") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229477,
                                                          "mem_param_229477") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231860,
                                                          "ext_mem_231860") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231861,
                                                          "ext_mem_231861") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231862,
                                                          "ext_mem_231862") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230551,
                                                          "mem_230551") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230534,
                                                          "mem_230534") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230517,
                                                          "mem_230517") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230500,
                                                          "mem_230500") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229531,
                                                          "mem_229531") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229526,
                                                          "mem_229526") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229520,
                                                          "mem_229520") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229469,
                                                          "mem_229469") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229465,
                                                          "mem_229465") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229460,
                                                          "ext_mem_229460") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229461,
                                                          "ext_mem_229461") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229411,
                                                          "ext_mem_229411") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229412,
                                                          "ext_mem_229412") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229362,
                                                          "ext_mem_229362") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229363,
                                                          "ext_mem_229363") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229264,
                                                          "ext_mem_229264") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229265,
                                                          "ext_mem_229265") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229206,
                                                          "mem_229206") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229200,
                                                          "mem_229200") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229196,
                                                          "ext_mem_229196") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229197,
                                                          "ext_mem_229197") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229164,
                                                          "mem_229164") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229161,
                                                          "mem_229161") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229157,
                                                          "mem_229157") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229155,
                                                          "mem_229155") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229152,
                                                          "mem_229152") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229148,
                                                          "mem_229148") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232249,
                                                          "mem_out_232249") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232248,
                                                          "mem_out_232248") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232247,
                                                          "mem_out_232247") !=
                                    0)
                                    return 1;
                                err = 1;
                                goto cleanup;
                            }
                            if (memblock_unref_device(ctx, &mem_229846,
                                                      "mem_229846") != 0)
                                return 1;
                            
                            struct memblock_device mem_230054;
                            
                            mem_230054.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_230054,
                                                      bytes_229297,
                                                      "mem_230054")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (futrts_builtinzhgpu_map_transpose_f64(ctx,
                                                                      mem_230054,
                                                                      (int64_t) 0,
                                                                      mem_229850,
                                                                      (int64_t) 0,
                                                                      (int64_t) 1,
                                                                      partition_sizze_203577,
                                                                      n_p_203492 *
                                                                      s_n_m_203636) !=
                                0) {
                                if (memblock_unref_device(ctx, &mem_230054,
                                                          "mem_230054") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230048,
                                                          "mem_230048") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &color_231993,
                                                          "color_231993") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &color_231992,
                                                          "color_231992") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229850,
                                                          "mem_229850") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229846,
                                                          "mem_229846") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229753,
                                                          "mem_229753") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229749,
                                                          "mem_229749") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229745,
                                                          "mem_229745") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229741,
                                                          "mem_229741") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229737,
                                                          "mem_229737") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229734,
                                                          "mem_229734") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230056,
                                                          "ext_mem_230056") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230057,
                                                          "ext_mem_230057") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230417,
                                                          "ext_mem_230417") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230418,
                                                          "ext_mem_230418") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230419,
                                                          "ext_mem_230419") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230420,
                                                          "ext_mem_230420") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230486,
                                                          "ext_mem_230486") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230487,
                                                          "ext_mem_230487") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229515,
                                                          "mem_param_229515") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229507,
                                                          "mem_param_229507") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231517,
                                                          "ext_mem_231517") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231518,
                                                          "ext_mem_231518") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229493,
                                                          "mem_param_229493") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229485,
                                                          "mem_param_229485") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229477,
                                                          "mem_param_229477") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231860,
                                                          "ext_mem_231860") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231861,
                                                          "ext_mem_231861") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231862,
                                                          "ext_mem_231862") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230551,
                                                          "mem_230551") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230534,
                                                          "mem_230534") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230517,
                                                          "mem_230517") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230500,
                                                          "mem_230500") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229531,
                                                          "mem_229531") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229526,
                                                          "mem_229526") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229520,
                                                          "mem_229520") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229469,
                                                          "mem_229469") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229465,
                                                          "mem_229465") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229460,
                                                          "ext_mem_229460") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229461,
                                                          "ext_mem_229461") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229411,
                                                          "ext_mem_229411") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229412,
                                                          "ext_mem_229412") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229362,
                                                          "ext_mem_229362") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229363,
                                                          "ext_mem_229363") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229264,
                                                          "ext_mem_229264") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229265,
                                                          "ext_mem_229265") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229206,
                                                          "mem_229206") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229200,
                                                          "mem_229200") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229196,
                                                          "ext_mem_229196") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229197,
                                                          "ext_mem_229197") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229164,
                                                          "mem_229164") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229161,
                                                          "mem_229161") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229157,
                                                          "mem_229157") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229155,
                                                          "mem_229155") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229152,
                                                          "mem_229152") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229148,
                                                          "mem_229148") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232249,
                                                          "mem_out_232249") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232248,
                                                          "mem_out_232248") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232247,
                                                          "mem_out_232247") !=
                                    0)
                                    return 1;
                                err = 1;
                                goto cleanup;
                            }
                            if (memblock_unref_device(ctx, &mem_229850,
                                                      "mem_229850") != 0)
                                return 1;
                            if (memblock_set_device(ctx, &ext_mem_230057,
                                                    &mem_230048,
                                                    "mem_230048") != 0)
                                return 1;
                            if (memblock_set_device(ctx, &ext_mem_230056,
                                                    &mem_230054,
                                                    "mem_230054") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230054,
                                                      "mem_230054") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230048,
                                                      "mem_230048") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &color_231993,
                                                      "color_231993") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &color_231992,
                                                      "color_231992") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229850,
                                                      "mem_229850") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229846,
                                                      "mem_229846") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229753,
                                                      "mem_229753") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229749,
                                                      "mem_229749") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229745,
                                                      "mem_229745") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229741,
                                                      "mem_229741") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229737,
                                                      "mem_229737") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229734,
                                                      "mem_229734") != 0)
                                return 1;
                        } else {
                            struct memblock_device ext_mem_230043;
                            
                            ext_mem_230043.references = NULL;
                            
                            struct memblock_device ext_mem_230042;
                            
                            ext_mem_230042.references = NULL;
                            
                            int32_t local_memory_capacity_233558;
                            
                            local_memory_capacity_233558 =
                                ctx->opencl.max_local_memory;
                            if (sle64((int64_t) 0,
                                      sext_i32_i64(local_memory_capacity_233558)) &&
                                suff_outer_par_213701) {
                                struct memblock_device mem_229854;
                                
                                mem_229854.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_229854,
                                                          bytes_229853,
                                                          "mem_229854")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                if (futrts_builtinzhgpu_map_transpose_i64(ctx,
                                                                          mem_229854,
                                                                          (int64_t) 0,
                                                                          ext_mem_229363,
                                                                          (int64_t) 0,
                                                                          (int64_t) 1,
                                                                          s_n_m_203636,
                                                                          partition_sizze_203577 *
                                                                          n_p_203492) !=
                                    0) {
                                    if (memblock_unref_device(ctx, &mem_229854,
                                                              "mem_229854") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230042,
                                                              "ext_mem_230042") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230043,
                                                              "ext_mem_230043") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230056,
                                                              "ext_mem_230056") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230057,
                                                              "ext_mem_230057") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230417,
                                                              "ext_mem_230417") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230418,
                                                              "ext_mem_230418") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230419,
                                                              "ext_mem_230419") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230420,
                                                              "ext_mem_230420") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230486,
                                                              "ext_mem_230486") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230487,
                                                              "ext_mem_230487") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229515,
                                                              "mem_param_229515") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229507,
                                                              "mem_param_229507") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231517,
                                                              "ext_mem_231517") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231518,
                                                              "ext_mem_231518") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229493,
                                                              "mem_param_229493") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229485,
                                                              "mem_param_229485") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229477,
                                                              "mem_param_229477") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231860,
                                                              "ext_mem_231860") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231861,
                                                              "ext_mem_231861") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231862,
                                                              "ext_mem_231862") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230551,
                                                              "mem_230551") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230534,
                                                              "mem_230534") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230517,
                                                              "mem_230517") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230500,
                                                              "mem_230500") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229531,
                                                              "mem_229531") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229526,
                                                              "mem_229526") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229520,
                                                              "mem_229520") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229469,
                                                              "mem_229469") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229465,
                                                              "mem_229465") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229460,
                                                              "ext_mem_229460") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229461,
                                                              "ext_mem_229461") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229411,
                                                              "ext_mem_229411") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229412,
                                                              "ext_mem_229412") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229362,
                                                              "ext_mem_229362") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229363,
                                                              "ext_mem_229363") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229264,
                                                              "ext_mem_229264") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229265,
                                                              "ext_mem_229265") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229206,
                                                              "mem_229206") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229200,
                                                              "mem_229200") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229196,
                                                              "ext_mem_229196") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229197,
                                                              "ext_mem_229197") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229164,
                                                              "mem_229164") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229161,
                                                              "mem_229161") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229157,
                                                              "mem_229157") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229155,
                                                              "mem_229155") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229152,
                                                              "mem_229152") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229148,
                                                              "mem_229148") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_out_232249,
                                                              "mem_out_232249") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_out_232248,
                                                              "mem_out_232248") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_out_232247,
                                                              "mem_out_232247") !=
                                        0)
                                        return 1;
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device mem_229858;
                                
                                mem_229858.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_229858,
                                                          bytes_229853,
                                                          "mem_229858")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                if (futrts_builtinzhgpu_map_transpose_f64(ctx,
                                                                          mem_229858,
                                                                          (int64_t) 0,
                                                                          ext_mem_229362,
                                                                          (int64_t) 0,
                                                                          (int64_t) 1,
                                                                          s_n_m_203636,
                                                                          partition_sizze_203577 *
                                                                          n_p_203492) !=
                                    0) {
                                    if (memblock_unref_device(ctx, &mem_229858,
                                                              "mem_229858") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229854,
                                                              "mem_229854") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230042,
                                                              "ext_mem_230042") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230043,
                                                              "ext_mem_230043") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230056,
                                                              "ext_mem_230056") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230057,
                                                              "ext_mem_230057") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230417,
                                                              "ext_mem_230417") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230418,
                                                              "ext_mem_230418") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230419,
                                                              "ext_mem_230419") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230420,
                                                              "ext_mem_230420") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230486,
                                                              "ext_mem_230486") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230487,
                                                              "ext_mem_230487") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229515,
                                                              "mem_param_229515") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229507,
                                                              "mem_param_229507") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231517,
                                                              "ext_mem_231517") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231518,
                                                              "ext_mem_231518") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229493,
                                                              "mem_param_229493") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229485,
                                                              "mem_param_229485") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229477,
                                                              "mem_param_229477") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231860,
                                                              "ext_mem_231860") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231861,
                                                              "ext_mem_231861") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231862,
                                                              "ext_mem_231862") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230551,
                                                              "mem_230551") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230534,
                                                              "mem_230534") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230517,
                                                              "mem_230517") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230500,
                                                              "mem_230500") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229531,
                                                              "mem_229531") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229526,
                                                              "mem_229526") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229520,
                                                              "mem_229520") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229469,
                                                              "mem_229469") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229465,
                                                              "mem_229465") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229460,
                                                              "ext_mem_229460") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229461,
                                                              "ext_mem_229461") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229411,
                                                              "ext_mem_229411") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229412,
                                                              "ext_mem_229412") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229362,
                                                              "ext_mem_229362") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229363,
                                                              "ext_mem_229363") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229264,
                                                              "ext_mem_229264") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229265,
                                                              "ext_mem_229265") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229206,
                                                              "mem_229206") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229200,
                                                              "mem_229200") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229196,
                                                              "ext_mem_229196") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229197,
                                                              "ext_mem_229197") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229164,
                                                              "mem_229164") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229161,
                                                              "mem_229161") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229157,
                                                              "mem_229157") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229155,
                                                              "mem_229155") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229152,
                                                              "mem_229152") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229148,
                                                              "mem_229148") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_out_232249,
                                                              "mem_out_232249") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_out_232248,
                                                              "mem_out_232248") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_out_232247,
                                                              "mem_out_232247") !=
                                        0)
                                        return 1;
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device mem_229862;
                                
                                mem_229862.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_229862,
                                                          bytes_229861,
                                                          "mem_229862")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                if (futrts_builtinzhgpu_map_transpose_i64(ctx,
                                                                          mem_229862,
                                                                          (int64_t) 0,
                                                                          ext_mem_229265,
                                                                          (int64_t) 0,
                                                                          (int64_t) 1,
                                                                          defunc_0_f_res_203631,
                                                                          partition_sizze_203577 *
                                                                          n_p_203492) !=
                                    0) {
                                    if (memblock_unref_device(ctx, &mem_229862,
                                                              "mem_229862") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229858,
                                                              "mem_229858") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229854,
                                                              "mem_229854") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230042,
                                                              "ext_mem_230042") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230043,
                                                              "ext_mem_230043") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230056,
                                                              "ext_mem_230056") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230057,
                                                              "ext_mem_230057") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230417,
                                                              "ext_mem_230417") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230418,
                                                              "ext_mem_230418") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230419,
                                                              "ext_mem_230419") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230420,
                                                              "ext_mem_230420") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230486,
                                                              "ext_mem_230486") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230487,
                                                              "ext_mem_230487") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229515,
                                                              "mem_param_229515") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229507,
                                                              "mem_param_229507") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231517,
                                                              "ext_mem_231517") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231518,
                                                              "ext_mem_231518") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229493,
                                                              "mem_param_229493") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229485,
                                                              "mem_param_229485") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229477,
                                                              "mem_param_229477") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231860,
                                                              "ext_mem_231860") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231861,
                                                              "ext_mem_231861") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231862,
                                                              "ext_mem_231862") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230551,
                                                              "mem_230551") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230534,
                                                              "mem_230534") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230517,
                                                              "mem_230517") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230500,
                                                              "mem_230500") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229531,
                                                              "mem_229531") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229526,
                                                              "mem_229526") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229520,
                                                              "mem_229520") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229469,
                                                              "mem_229469") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229465,
                                                              "mem_229465") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229460,
                                                              "ext_mem_229460") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229461,
                                                              "ext_mem_229461") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229411,
                                                              "ext_mem_229411") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229412,
                                                              "ext_mem_229412") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229362,
                                                              "ext_mem_229362") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229363,
                                                              "ext_mem_229363") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229264,
                                                              "ext_mem_229264") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229265,
                                                              "ext_mem_229265") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229206,
                                                              "mem_229206") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229200,
                                                              "mem_229200") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229196,
                                                              "ext_mem_229196") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229197,
                                                              "ext_mem_229197") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229164,
                                                              "mem_229164") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229161,
                                                              "mem_229161") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229157,
                                                              "mem_229157") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229155,
                                                              "mem_229155") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229152,
                                                              "mem_229152") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229148,
                                                              "mem_229148") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_out_232249,
                                                              "mem_out_232249") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_out_232248,
                                                              "mem_out_232248") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_out_232247,
                                                              "mem_out_232247") !=
                                        0)
                                        return 1;
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device mem_229866;
                                
                                mem_229866.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_229866,
                                                          bytes_229861,
                                                          "mem_229866")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                if (futrts_builtinzhgpu_map_transpose_f64(ctx,
                                                                          mem_229866,
                                                                          (int64_t) 0,
                                                                          mem_229531,
                                                                          (int64_t) 0,
                                                                          (int64_t) 1,
                                                                          defunc_0_f_res_203631,
                                                                          partition_sizze_203577 *
                                                                          n_p_203492) !=
                                    0) {
                                    if (memblock_unref_device(ctx, &mem_229866,
                                                              "mem_229866") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229862,
                                                              "mem_229862") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229858,
                                                              "mem_229858") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229854,
                                                              "mem_229854") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230042,
                                                              "ext_mem_230042") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230043,
                                                              "ext_mem_230043") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230056,
                                                              "ext_mem_230056") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230057,
                                                              "ext_mem_230057") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230417,
                                                              "ext_mem_230417") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230418,
                                                              "ext_mem_230418") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230419,
                                                              "ext_mem_230419") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230420,
                                                              "ext_mem_230420") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230486,
                                                              "ext_mem_230486") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230487,
                                                              "ext_mem_230487") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229515,
                                                              "mem_param_229515") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229507,
                                                              "mem_param_229507") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231517,
                                                              "ext_mem_231517") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231518,
                                                              "ext_mem_231518") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229493,
                                                              "mem_param_229493") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229485,
                                                              "mem_param_229485") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229477,
                                                              "mem_param_229477") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231860,
                                                              "ext_mem_231860") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231861,
                                                              "ext_mem_231861") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231862,
                                                              "ext_mem_231862") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230551,
                                                              "mem_230551") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230534,
                                                              "mem_230534") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230517,
                                                              "mem_230517") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230500,
                                                              "mem_230500") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229531,
                                                              "mem_229531") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229526,
                                                              "mem_229526") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229520,
                                                              "mem_229520") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229469,
                                                              "mem_229469") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229465,
                                                              "mem_229465") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229460,
                                                              "ext_mem_229460") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229461,
                                                              "ext_mem_229461") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229411,
                                                              "ext_mem_229411") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229412,
                                                              "ext_mem_229412") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229362,
                                                              "ext_mem_229362") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229363,
                                                              "ext_mem_229363") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229264,
                                                              "ext_mem_229264") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229265,
                                                              "ext_mem_229265") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229206,
                                                              "mem_229206") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229200,
                                                              "mem_229200") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229196,
                                                              "ext_mem_229196") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229197,
                                                              "ext_mem_229197") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229164,
                                                              "mem_229164") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229161,
                                                              "mem_229161") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229157,
                                                              "mem_229157") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229155,
                                                              "mem_229155") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229152,
                                                              "mem_229152") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229148,
                                                              "mem_229148") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_out_232249,
                                                              "mem_out_232249") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_out_232248,
                                                              "mem_out_232248") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_out_232247,
                                                              "mem_out_232247") !=
                                        0)
                                        return 1;
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device mem_229870;
                                
                                mem_229870.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_229870,
                                                          bytes_229861,
                                                          "mem_229870")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                if (futrts_builtinzhgpu_map_transpose_f64(ctx,
                                                                          mem_229870,
                                                                          (int64_t) 0,
                                                                          mem_229526,
                                                                          (int64_t) 0,
                                                                          (int64_t) 1,
                                                                          defunc_0_f_res_203631,
                                                                          partition_sizze_203577 *
                                                                          n_p_203492) !=
                                    0) {
                                    if (memblock_unref_device(ctx, &mem_229870,
                                                              "mem_229870") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229866,
                                                              "mem_229866") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229862,
                                                              "mem_229862") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229858,
                                                              "mem_229858") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229854,
                                                              "mem_229854") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230042,
                                                              "ext_mem_230042") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230043,
                                                              "ext_mem_230043") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230056,
                                                              "ext_mem_230056") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230057,
                                                              "ext_mem_230057") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230417,
                                                              "ext_mem_230417") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230418,
                                                              "ext_mem_230418") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230419,
                                                              "ext_mem_230419") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230420,
                                                              "ext_mem_230420") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230486,
                                                              "ext_mem_230486") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230487,
                                                              "ext_mem_230487") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229515,
                                                              "mem_param_229515") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229507,
                                                              "mem_param_229507") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231517,
                                                              "ext_mem_231517") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231518,
                                                              "ext_mem_231518") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229493,
                                                              "mem_param_229493") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229485,
                                                              "mem_param_229485") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229477,
                                                              "mem_param_229477") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231860,
                                                              "ext_mem_231860") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231861,
                                                              "ext_mem_231861") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231862,
                                                              "ext_mem_231862") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230551,
                                                              "mem_230551") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230534,
                                                              "mem_230534") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230517,
                                                              "mem_230517") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230500,
                                                              "mem_230500") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229531,
                                                              "mem_229531") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229526,
                                                              "mem_229526") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229520,
                                                              "mem_229520") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229469,
                                                              "mem_229469") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229465,
                                                              "mem_229465") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229460,
                                                              "ext_mem_229460") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229461,
                                                              "ext_mem_229461") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229411,
                                                              "ext_mem_229411") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229412,
                                                              "ext_mem_229412") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229362,
                                                              "ext_mem_229362") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229363,
                                                              "ext_mem_229363") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229264,
                                                              "ext_mem_229264") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229265,
                                                              "ext_mem_229265") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229206,
                                                              "mem_229206") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229200,
                                                              "mem_229200") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229196,
                                                              "ext_mem_229196") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229197,
                                                              "ext_mem_229197") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229164,
                                                              "mem_229164") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229161,
                                                              "mem_229161") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229157,
                                                              "mem_229157") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229155,
                                                              "mem_229155") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229152,
                                                              "mem_229152") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229148,
                                                              "mem_229148") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_out_232249,
                                                              "mem_out_232249") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_out_232248,
                                                              "mem_out_232248") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_out_232247,
                                                              "mem_out_232247") !=
                                        0)
                                        return 1;
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device mem_229905;
                                
                                mem_229905.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_229905,
                                                          bytes_229853,
                                                          "mem_229905")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device mem_229909;
                                
                                mem_229909.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_229909,
                                                          bytes_229853,
                                                          "mem_229909")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device color_231994;
                                
                                color_231994.references = NULL;
                                if (memblock_alloc_device(ctx, &color_231994,
                                                          total_sizze_232123,
                                                          "color_231994")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device color_231995;
                                
                                color_231995.references = NULL;
                                if (memblock_alloc_device(ctx, &color_231995,
                                                          total_sizze_232124,
                                                          "color_231995")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s\n", "\n# SegMap");
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_213719,
                                                                        1,
                                                                        sizeof(n_p_203492),
                                                                        &n_p_203492));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_213719,
                                                                        2,
                                                                        sizeof(q_s_203493),
                                                                        &q_s_203493));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_213719,
                                                                        3,
                                                                        sizeof(jump_s_203499),
                                                                        &jump_s_203499));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_213719,
                                                                        4,
                                                                        sizeof(partition_sizze_203577),
                                                                        &partition_sizze_203577));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_213719,
                                                                        5,
                                                                        sizeof(defunc_0_f_res_203631),
                                                                        &defunc_0_f_res_203631));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_213719,
                                                                        6,
                                                                        sizeof(pad_css_len_203632),
                                                                        &pad_css_len_203632));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_213719,
                                                                        7,
                                                                        sizeof(s_n_m_203636),
                                                                        &s_n_m_203636));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_213719,
                                                                        8,
                                                                        sizeof(num_groups_213697),
                                                                        &num_groups_213697));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_213719,
                                                                        9,
                                                                        sizeof(num_threads_232122),
                                                                        &num_threads_232122));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_213719,
                                                                        10,
                                                                        sizeof(ext_mem_229264.mem),
                                                                        &ext_mem_229264.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_213719,
                                                                        11,
                                                                        sizeof(mem_229854.mem),
                                                                        &mem_229854.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_213719,
                                                                        12,
                                                                        sizeof(mem_229858.mem),
                                                                        &mem_229858.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_213719,
                                                                        13,
                                                                        sizeof(mem_229862.mem),
                                                                        &mem_229862.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_213719,
                                                                        14,
                                                                        sizeof(mem_229866.mem),
                                                                        &mem_229866.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_213719,
                                                                        15,
                                                                        sizeof(mem_229870.mem),
                                                                        &mem_229870.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_213719,
                                                                        16,
                                                                        sizeof(mem_229905.mem),
                                                                        &mem_229905.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_213719,
                                                                        17,
                                                                        sizeof(mem_229909.mem),
                                                                        &mem_229909.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_213719,
                                                                        18,
                                                                        sizeof(color_231994.mem),
                                                                        &color_231994.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_213719,
                                                                        19,
                                                                        sizeof(color_231995.mem),
                                                                        &color_231995.mem));
                                if (1 * ((size_t) num_groups_213697 *
                                         (size_t) segmap_group_sizze_213696) !=
                                    0) {
                                    const size_t global_work_sizze_236960[1] =
                                                 {(size_t) num_groups_213697 *
                                                 (size_t) segmap_group_sizze_213696};
                                    const size_t local_work_sizze_236964[1] =
                                                 {(size_t) segmap_group_sizze_213696};
                                    int64_t time_start_236961 = 0,
                                            time_end_236962 = 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_213719",
                                                global_work_sizze_236960[0],
                                                local_work_sizze_236964[0],
                                                (int) 0);
                                        time_start_236961 = get_wall_time();
                                    }
                                    OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                                    ctx->mainzisegmap_213719,
                                                                                    1,
                                                                                    NULL,
                                                                                    global_work_sizze_236960,
                                                                                    local_work_sizze_236964,
                                                                                    0,
                                                                                    NULL,
                                                                                    ctx->profiling_paused ||
                                                                                    !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                              &ctx->mainzisegmap_213719_runs,
                                                                                                                              &ctx->mainzisegmap_213719_total_runtime)));
                                    if (ctx->debugging) {
                                        OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                        time_end_236962 = get_wall_time();
                                        
                                        long time_diff_236963 =
                                             time_end_236962 -
                                             time_start_236961;
                                        
                                        fprintf(ctx->log,
                                                "kernel %s runtime: %ldus\n",
                                                "main.segmap_213719",
                                                time_diff_236963);
                                    }
                                }
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s\n", "");
                                if (memblock_unref_device(ctx, &mem_229854,
                                                          "mem_229854") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229858,
                                                          "mem_229858") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229862,
                                                          "mem_229862") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229866,
                                                          "mem_229866") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229870,
                                                          "mem_229870") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &color_231994,
                                                          "color_231994") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &color_231995,
                                                          "color_231995") != 0)
                                    return 1;
                                
                                struct memblock_device mem_230034;
                                
                                mem_230034.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_230034,
                                                          bytes_229297,
                                                          "mem_230034")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                if (futrts_builtinzhgpu_map_transpose_f64(ctx,
                                                                          mem_230034,
                                                                          (int64_t) 0,
                                                                          mem_229905,
                                                                          (int64_t) 0,
                                                                          (int64_t) 1,
                                                                          partition_sizze_203577 *
                                                                          n_p_203492,
                                                                          s_n_m_203636) !=
                                    0) {
                                    if (memblock_unref_device(ctx, &mem_230034,
                                                              "mem_230034") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &color_231995,
                                                              "color_231995") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &color_231994,
                                                              "color_231994") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229909,
                                                              "mem_229909") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229905,
                                                              "mem_229905") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229870,
                                                              "mem_229870") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229866,
                                                              "mem_229866") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229862,
                                                              "mem_229862") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229858,
                                                              "mem_229858") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229854,
                                                              "mem_229854") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230042,
                                                              "ext_mem_230042") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230043,
                                                              "ext_mem_230043") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230056,
                                                              "ext_mem_230056") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230057,
                                                              "ext_mem_230057") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230417,
                                                              "ext_mem_230417") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230418,
                                                              "ext_mem_230418") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230419,
                                                              "ext_mem_230419") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230420,
                                                              "ext_mem_230420") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230486,
                                                              "ext_mem_230486") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230487,
                                                              "ext_mem_230487") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229515,
                                                              "mem_param_229515") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229507,
                                                              "mem_param_229507") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231517,
                                                              "ext_mem_231517") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231518,
                                                              "ext_mem_231518") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229493,
                                                              "mem_param_229493") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229485,
                                                              "mem_param_229485") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229477,
                                                              "mem_param_229477") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231860,
                                                              "ext_mem_231860") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231861,
                                                              "ext_mem_231861") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231862,
                                                              "ext_mem_231862") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230551,
                                                              "mem_230551") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230534,
                                                              "mem_230534") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230517,
                                                              "mem_230517") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230500,
                                                              "mem_230500") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229531,
                                                              "mem_229531") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229526,
                                                              "mem_229526") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229520,
                                                              "mem_229520") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229469,
                                                              "mem_229469") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229465,
                                                              "mem_229465") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229460,
                                                              "ext_mem_229460") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229461,
                                                              "ext_mem_229461") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229411,
                                                              "ext_mem_229411") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229412,
                                                              "ext_mem_229412") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229362,
                                                              "ext_mem_229362") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229363,
                                                              "ext_mem_229363") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229264,
                                                              "ext_mem_229264") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229265,
                                                              "ext_mem_229265") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229206,
                                                              "mem_229206") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229200,
                                                              "mem_229200") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229196,
                                                              "ext_mem_229196") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229197,
                                                              "ext_mem_229197") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229164,
                                                              "mem_229164") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229161,
                                                              "mem_229161") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229157,
                                                              "mem_229157") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229155,
                                                              "mem_229155") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229152,
                                                              "mem_229152") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229148,
                                                              "mem_229148") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_out_232249,
                                                              "mem_out_232249") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_out_232248,
                                                              "mem_out_232248") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_out_232247,
                                                              "mem_out_232247") !=
                                        0)
                                        return 1;
                                    err = 1;
                                    goto cleanup;
                                }
                                if (memblock_unref_device(ctx, &mem_229905,
                                                          "mem_229905") != 0)
                                    return 1;
                                
                                struct memblock_device mem_230040;
                                
                                mem_230040.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_230040,
                                                          bytes_229297,
                                                          "mem_230040")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                if (futrts_builtinzhgpu_map_transpose_f64(ctx,
                                                                          mem_230040,
                                                                          (int64_t) 0,
                                                                          mem_229909,
                                                                          (int64_t) 0,
                                                                          (int64_t) 1,
                                                                          partition_sizze_203577 *
                                                                          n_p_203492,
                                                                          s_n_m_203636) !=
                                    0) {
                                    if (memblock_unref_device(ctx, &mem_230040,
                                                              "mem_230040") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230034,
                                                              "mem_230034") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &color_231995,
                                                              "color_231995") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &color_231994,
                                                              "color_231994") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229909,
                                                              "mem_229909") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229905,
                                                              "mem_229905") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229870,
                                                              "mem_229870") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229866,
                                                              "mem_229866") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229862,
                                                              "mem_229862") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229858,
                                                              "mem_229858") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229854,
                                                              "mem_229854") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230042,
                                                              "ext_mem_230042") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230043,
                                                              "ext_mem_230043") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230056,
                                                              "ext_mem_230056") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230057,
                                                              "ext_mem_230057") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230417,
                                                              "ext_mem_230417") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230418,
                                                              "ext_mem_230418") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230419,
                                                              "ext_mem_230419") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230420,
                                                              "ext_mem_230420") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230486,
                                                              "ext_mem_230486") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230487,
                                                              "ext_mem_230487") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229515,
                                                              "mem_param_229515") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229507,
                                                              "mem_param_229507") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231517,
                                                              "ext_mem_231517") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231518,
                                                              "ext_mem_231518") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229493,
                                                              "mem_param_229493") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229485,
                                                              "mem_param_229485") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229477,
                                                              "mem_param_229477") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231860,
                                                              "ext_mem_231860") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231861,
                                                              "ext_mem_231861") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231862,
                                                              "ext_mem_231862") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230551,
                                                              "mem_230551") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230534,
                                                              "mem_230534") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230517,
                                                              "mem_230517") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230500,
                                                              "mem_230500") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229531,
                                                              "mem_229531") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229526,
                                                              "mem_229526") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229520,
                                                              "mem_229520") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229469,
                                                              "mem_229469") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229465,
                                                              "mem_229465") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229460,
                                                              "ext_mem_229460") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229461,
                                                              "ext_mem_229461") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229411,
                                                              "ext_mem_229411") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229412,
                                                              "ext_mem_229412") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229362,
                                                              "ext_mem_229362") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229363,
                                                              "ext_mem_229363") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229264,
                                                              "ext_mem_229264") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229265,
                                                              "ext_mem_229265") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229206,
                                                              "mem_229206") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229200,
                                                              "mem_229200") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229196,
                                                              "ext_mem_229196") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229197,
                                                              "ext_mem_229197") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229164,
                                                              "mem_229164") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229161,
                                                              "mem_229161") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229157,
                                                              "mem_229157") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229155,
                                                              "mem_229155") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229152,
                                                              "mem_229152") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229148,
                                                              "mem_229148") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_out_232249,
                                                              "mem_out_232249") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_out_232248,
                                                              "mem_out_232248") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_out_232247,
                                                              "mem_out_232247") !=
                                        0)
                                        return 1;
                                    err = 1;
                                    goto cleanup;
                                }
                                if (memblock_unref_device(ctx, &mem_229909,
                                                          "mem_229909") != 0)
                                    return 1;
                                if (memblock_set_device(ctx, &ext_mem_230043,
                                                        &mem_230034,
                                                        "mem_230034") != 0)
                                    return 1;
                                if (memblock_set_device(ctx, &ext_mem_230042,
                                                        &mem_230040,
                                                        "mem_230040") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230040,
                                                          "mem_230040") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230034,
                                                          "mem_230034") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &color_231995,
                                                          "color_231995") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &color_231994,
                                                          "color_231994") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229909,
                                                          "mem_229909") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229905,
                                                          "mem_229905") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229870,
                                                          "mem_229870") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229866,
                                                          "mem_229866") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229862,
                                                          "mem_229862") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229858,
                                                          "mem_229858") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229854,
                                                          "mem_229854") != 0)
                                    return 1;
                            } else {
                                struct memblock_device ext_mem_230029;
                                
                                ext_mem_230029.references = NULL;
                                
                                struct memblock_device ext_mem_230028;
                                
                                ext_mem_230028.references = NULL;
                                
                                int32_t local_memory_capacity_233557;
                                
                                local_memory_capacity_233557 =
                                    ctx->opencl.max_local_memory;
                                if (sle64(bytes_229311 + srem64((int64_t) 8 -
                                                                srem64(bytes_229311,
                                                                       (int64_t) 8),
                                                                (int64_t) 8) +
                                          (bytes_229311 + srem64((int64_t) 8 -
                                                                 srem64(bytes_229311,
                                                                        (int64_t) 8),
                                                                 (int64_t) 8)) +
                                          (bytes_229311 + srem64((int64_t) 8 -
                                                                 srem64(bytes_229311,
                                                                        (int64_t) 8),
                                                                 (int64_t) 8)) +
                                          (bytes_229311 + srem64((int64_t) 8 -
                                                                 srem64(bytes_229311,
                                                                        (int64_t) 8),
                                                                 (int64_t) 8)) +
                                          (bytes_229311 + srem64((int64_t) 8 -
                                                                 srem64(bytes_229311,
                                                                        (int64_t) 8),
                                                                 (int64_t) 8)) +
                                          (bytes_229311 + srem64((int64_t) 8 -
                                                                 srem64(bytes_229311,
                                                                        (int64_t) 8),
                                                                 (int64_t) 8)) +
                                          (bytes_229311 + srem64((int64_t) 8 -
                                                                 srem64(bytes_229311,
                                                                        (int64_t) 8),
                                                                 (int64_t) 8)) +
                                          (bytes_229915 + srem64((int64_t) 8 -
                                                                 srem64(bytes_229915,
                                                                        (int64_t) 8),
                                                                 (int64_t) 8)) +
                                          ((int64_t) 8 * (s_n_m_203636 *
                                                          q_s_203493) +
                                           srem64((int64_t) 8 -
                                                  srem64((int64_t) 8 *
                                                         (s_n_m_203636 *
                                                          q_s_203493),
                                                         (int64_t) 8),
                                                  (int64_t) 8)) + ((int64_t) 8 *
                                                                   (s_n_m_203636 *
                                                                    q_s_203493) +
                                                                   srem64((int64_t) 8 -
                                                                          srem64((int64_t) 8 *
                                                                                 (s_n_m_203636 *
                                                                                  q_s_203493),
                                                                                 (int64_t) 8),
                                                                          (int64_t) 8)) +
                                          ((int64_t) 8 * (s_n_m_203636 *
                                                          q_s_203493) +
                                           srem64((int64_t) 8 -
                                                  srem64((int64_t) 8 *
                                                         (s_n_m_203636 *
                                                          q_s_203493),
                                                         (int64_t) 8),
                                                  (int64_t) 8)) + ((int64_t) 8 *
                                                                   (s_n_m_203636 *
                                                                    q_s_203493) +
                                                                   srem64((int64_t) 8 -
                                                                          srem64((int64_t) 8 *
                                                                                 (s_n_m_203636 *
                                                                                  q_s_203493),
                                                                                 (int64_t) 8),
                                                                          (int64_t) 8)) +
                                          ((int64_t) 8 * (s_n_m_203636 *
                                                          q_s_203493) +
                                           srem64((int64_t) 8 -
                                                  srem64((int64_t) 8 *
                                                         (s_n_m_203636 *
                                                          q_s_203493),
                                                         (int64_t) 8),
                                                  (int64_t) 8)),
                                          sext_i32_i64(local_memory_capacity_233557)) &&
                                    intra_suff_and_fits_213712) {
                                    struct memblock_device mem_229951;
                                    
                                    mem_229951.references = NULL;
                                    if (memblock_alloc_device(ctx, &mem_229951,
                                                              bytes_229297,
                                                              "mem_229951")) {
                                        err = 1;
                                        goto cleanup;
                                    }
                                    
                                    struct memblock_device mem_229956;
                                    
                                    mem_229956.references = NULL;
                                    if (memblock_alloc_device(ctx, &mem_229956,
                                                              bytes_229297,
                                                              "mem_229956")) {
                                        err = 1;
                                        goto cleanup;
                                    }
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s\n", "\n# SegMap");
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_213836,
                                                                            1,
                                                                            (size_t) ((int64_t) 8 *
                                                                                      (s_n_m_203636 *
                                                                                       q_s_203493)),
                                                                            NULL));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_213836,
                                                                            2,
                                                                            (size_t) ((int64_t) 8 *
                                                                                      (s_n_m_203636 *
                                                                                       q_s_203493)),
                                                                            NULL));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_213836,
                                                                            3,
                                                                            (size_t) ((int64_t) 8 *
                                                                                      (s_n_m_203636 *
                                                                                       q_s_203493)),
                                                                            NULL));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_213836,
                                                                            4,
                                                                            (size_t) ((int64_t) 8 *
                                                                                      (s_n_m_203636 *
                                                                                       q_s_203493)),
                                                                            NULL));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_213836,
                                                                            5,
                                                                            (size_t) ((int64_t) 8 *
                                                                                      (s_n_m_203636 *
                                                                                       q_s_203493)),
                                                                            NULL));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_213836,
                                                                            6,
                                                                            (size_t) bytes_229915,
                                                                            NULL));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_213836,
                                                                            7,
                                                                            (size_t) bytes_229311,
                                                                            NULL));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_213836,
                                                                            8,
                                                                            (size_t) bytes_229311,
                                                                            NULL));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_213836,
                                                                            9,
                                                                            (size_t) bytes_229311,
                                                                            NULL));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_213836,
                                                                            10,
                                                                            (size_t) bytes_229311,
                                                                            NULL));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_213836,
                                                                            11,
                                                                            (size_t) bytes_229311,
                                                                            NULL));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_213836,
                                                                            12,
                                                                            (size_t) bytes_229311,
                                                                            NULL));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_213836,
                                                                            13,
                                                                            (size_t) bytes_229311,
                                                                            NULL));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_213836,
                                                                            14,
                                                                            sizeof(n_p_203492),
                                                                            &n_p_203492));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_213836,
                                                                            15,
                                                                            sizeof(q_s_203493),
                                                                            &q_s_203493));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_213836,
                                                                            16,
                                                                            sizeof(jump_s_203499),
                                                                            &jump_s_203499));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_213836,
                                                                            17,
                                                                            sizeof(partition_sizze_203577),
                                                                            &partition_sizze_203577));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_213836,
                                                                            18,
                                                                            sizeof(defunc_0_f_res_203631),
                                                                            &defunc_0_f_res_203631));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_213836,
                                                                            19,
                                                                            sizeof(pad_css_len_203632),
                                                                            &pad_css_len_203632));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_213836,
                                                                            20,
                                                                            sizeof(s_n_m_203636),
                                                                            &s_n_m_203636));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_213836,
                                                                            21,
                                                                            sizeof(computed_group_sizze_213705),
                                                                            &computed_group_sizze_213705));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_213836,
                                                                            22,
                                                                            sizeof(ext_mem_229264.mem),
                                                                            &ext_mem_229264.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_213836,
                                                                            23,
                                                                            sizeof(ext_mem_229265.mem),
                                                                            &ext_mem_229265.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_213836,
                                                                            24,
                                                                            sizeof(ext_mem_229362.mem),
                                                                            &ext_mem_229362.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_213836,
                                                                            25,
                                                                            sizeof(ext_mem_229363.mem),
                                                                            &ext_mem_229363.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_213836,
                                                                            26,
                                                                            sizeof(mem_229526.mem),
                                                                            &mem_229526.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_213836,
                                                                            27,
                                                                            sizeof(mem_229531.mem),
                                                                            &mem_229531.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_213836,
                                                                            28,
                                                                            sizeof(mem_229951.mem),
                                                                            &mem_229951.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_213836,
                                                                            29,
                                                                            sizeof(mem_229956.mem),
                                                                            &mem_229956.mem));
                                    if (1 * ((size_t) binop_x_229202 *
                                             (size_t) computed_group_sizze_213705) !=
                                        0) {
                                        const size_t global_work_sizze_236965[1]
                                                     =
                                                     {(size_t) binop_x_229202 *
                                                     (size_t) computed_group_sizze_213705};
                                        const size_t local_work_sizze_236969[1]
                                                     =
                                                     {(size_t) computed_group_sizze_213705};
                                        int64_t time_start_236966 = 0,
                                                time_end_236967 = 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_213836",
                                                    global_work_sizze_236965[0],
                                                    local_work_sizze_236969[0],
                                                    (int) (0 + (int64_t) 8 *
                                                           (s_n_m_203636 *
                                                            q_s_203493) +
                                                           (int64_t) 8 *
                                                           (s_n_m_203636 *
                                                            q_s_203493) +
                                                           (int64_t) 8 *
                                                           (s_n_m_203636 *
                                                            q_s_203493) +
                                                           (int64_t) 8 *
                                                           (s_n_m_203636 *
                                                            q_s_203493) +
                                                           (int64_t) 8 *
                                                           (s_n_m_203636 *
                                                            q_s_203493) +
                                                           bytes_229915 +
                                                           bytes_229311 +
                                                           bytes_229311 +
                                                           bytes_229311 +
                                                           bytes_229311 +
                                                           bytes_229311 +
                                                           bytes_229311 +
                                                           bytes_229311));
                                            time_start_236966 = get_wall_time();
                                        }
                                        OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                                        ctx->mainzisegmap_intragroup_213836,
                                                                                        1,
                                                                                        NULL,
                                                                                        global_work_sizze_236965,
                                                                                        local_work_sizze_236969,
                                                                                        0,
                                                                                        NULL,
                                                                                        ctx->profiling_paused ||
                                                                                        !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                                  &ctx->mainzisegmap_intragroup_213836_runs,
                                                                                                                                  &ctx->mainzisegmap_intragroup_213836_total_runtime)));
                                        if (ctx->debugging) {
                                            OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                            time_end_236967 = get_wall_time();
                                            
                                            long time_diff_236968 =
                                                 time_end_236967 -
                                                 time_start_236966;
                                            
                                            fprintf(ctx->log,
                                                    "kernel %s runtime: %ldus\n",
                                                    "main.segmap_intragroup_213836",
                                                    time_diff_236968);
                                        }
                                    }
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s\n", "");
                                    if (memblock_set_device(ctx,
                                                            &ext_mem_230029,
                                                            &mem_229951,
                                                            "mem_229951") != 0)
                                        return 1;
                                    if (memblock_set_device(ctx,
                                                            &ext_mem_230028,
                                                            &mem_229956,
                                                            "mem_229956") != 0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229956,
                                                              "mem_229956") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229951,
                                                              "mem_229951") !=
                                        0)
                                        return 1;
                                } else {
                                    int64_t segmap_usable_groups_213982 =
                                            sdiv_up64(nest_sizze_208848,
                                                      segmap_group_sizze_213981);
                                    struct memblock_device ext_mem_230027;
                                    
                                    ext_mem_230027.references = NULL;
                                    
                                    struct memblock_device ext_mem_230026;
                                    
                                    ext_mem_230026.references = NULL;
                                    
                                    int32_t local_memory_capacity_233556;
                                    
                                    local_memory_capacity_233556 =
                                        ctx->opencl.max_local_memory;
                                    if (sle64((int64_t) 0,
                                              sext_i32_i64(local_memory_capacity_233556)) &&
                                        suff_outer_par_213986) {
                                        struct memblock_device mem_229962;
                                        
                                        mem_229962.references = NULL;
                                        if (memblock_alloc_device(ctx,
                                                                  &mem_229962,
                                                                  bytes_229297,
                                                                  "mem_229962")) {
                                            err = 1;
                                            goto cleanup;
                                        }
                                        
                                        struct memblock_device mem_229967;
                                        
                                        mem_229967.references = NULL;
                                        if (memblock_alloc_device(ctx,
                                                                  &mem_229967,
                                                                  bytes_229297,
                                                                  "mem_229967")) {
                                            err = 1;
                                            goto cleanup;
                                        }
                                        if (ctx->debugging)
                                            fprintf(ctx->log, "%s\n",
                                                    "\n# SegMap");
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_213994,
                                                                                1,
                                                                                sizeof(n_p_203492),
                                                                                &n_p_203492));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_213994,
                                                                                2,
                                                                                sizeof(q_s_203493),
                                                                                &q_s_203493));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_213994,
                                                                                3,
                                                                                sizeof(jump_s_203499),
                                                                                &jump_s_203499));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_213994,
                                                                                4,
                                                                                sizeof(partition_sizze_203577),
                                                                                &partition_sizze_203577));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_213994,
                                                                                5,
                                                                                sizeof(defunc_0_f_res_203631),
                                                                                &defunc_0_f_res_203631));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_213994,
                                                                                6,
                                                                                sizeof(pad_css_len_203632),
                                                                                &pad_css_len_203632));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_213994,
                                                                                7,
                                                                                sizeof(s_n_m_203636),
                                                                                &s_n_m_203636));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_213994,
                                                                                8,
                                                                                sizeof(ext_mem_229264.mem),
                                                                                &ext_mem_229264.mem));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_213994,
                                                                                9,
                                                                                sizeof(ext_mem_229265.mem),
                                                                                &ext_mem_229265.mem));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_213994,
                                                                                10,
                                                                                sizeof(ext_mem_229362.mem),
                                                                                &ext_mem_229362.mem));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_213994,
                                                                                11,
                                                                                sizeof(ext_mem_229363.mem),
                                                                                &ext_mem_229363.mem));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_213994,
                                                                                12,
                                                                                sizeof(mem_229526.mem),
                                                                                &mem_229526.mem));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_213994,
                                                                                13,
                                                                                sizeof(mem_229531.mem),
                                                                                &mem_229531.mem));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_213994,
                                                                                14,
                                                                                sizeof(mem_229962.mem),
                                                                                &mem_229962.mem));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_213994,
                                                                                15,
                                                                                sizeof(mem_229967.mem),
                                                                                &mem_229967.mem));
                                        if (1 *
                                            ((size_t) segmap_usable_groups_213982 *
                                             (size_t) segmap_group_sizze_213981) !=
                                            0) {
                                            const size_t
                                            global_work_sizze_236970[1] =
                                            {(size_t) segmap_usable_groups_213982 *
                                            (size_t) segmap_group_sizze_213981};
                                            const size_t
                                            local_work_sizze_236974[1] =
                                            {(size_t) segmap_group_sizze_213981};
                                            int64_t time_start_236971 = 0,
                                                    time_end_236972 = 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_213994",
                                                        global_work_sizze_236970[0],
                                                        local_work_sizze_236974[0],
                                                        (int) 0);
                                                time_start_236971 =
                                                    get_wall_time();
                                            }
                                            OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                                            ctx->mainzisegmap_213994,
                                                                                            1,
                                                                                            NULL,
                                                                                            global_work_sizze_236970,
                                                                                            local_work_sizze_236974,
                                                                                            0,
                                                                                            NULL,
                                                                                            ctx->profiling_paused ||
                                                                                            !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                                      &ctx->mainzisegmap_213994_runs,
                                                                                                                                      &ctx->mainzisegmap_213994_total_runtime)));
                                            if (ctx->debugging) {
                                                OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                                time_end_236972 =
                                                    get_wall_time();
                                                
                                                long time_diff_236973 =
                                                     time_end_236972 -
                                                     time_start_236971;
                                                
                                                fprintf(ctx->log,
                                                        "kernel %s runtime: %ldus\n",
                                                        "main.segmap_213994",
                                                        time_diff_236973);
                                            }
                                        }
                                        if (ctx->debugging)
                                            fprintf(ctx->log, "%s\n", "");
                                        if (memblock_set_device(ctx,
                                                                &ext_mem_230027,
                                                                &mem_229962,
                                                                "mem_229962") !=
                                            0)
                                            return 1;
                                        if (memblock_set_device(ctx,
                                                                &ext_mem_230026,
                                                                &mem_229967,
                                                                "mem_229967") !=
                                            0)
                                            return 1;
                                        if (memblock_unref_device(ctx,
                                                                  &mem_229967,
                                                                  "mem_229967") !=
                                            0)
                                            return 1;
                                        if (memblock_unref_device(ctx,
                                                                  &mem_229962,
                                                                  "mem_229962") !=
                                            0)
                                            return 1;
                                    } else {
                                        int64_t segmap_usable_groups_214105 =
                                                sdiv_up64(nest_sizze_208848,
                                                          segmap_group_sizze_214104);
                                        struct memblock_device mem_229973;
                                        
                                        mem_229973.references = NULL;
                                        if (memblock_alloc_device(ctx,
                                                                  &mem_229973,
                                                                  bytes_229297,
                                                                  "mem_229973")) {
                                            err = 1;
                                            goto cleanup;
                                        }
                                        
                                        struct memblock_device mem_229977;
                                        
                                        mem_229977.references = NULL;
                                        if (memblock_alloc_device(ctx,
                                                                  &mem_229977,
                                                                  bytes_229976,
                                                                  "mem_229977")) {
                                            err = 1;
                                            goto cleanup;
                                        }
                                        if (ctx->debugging)
                                            fprintf(ctx->log, "%s\n",
                                                    "\n# SegMap");
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_214111,
                                                                                1,
                                                                                sizeof(n_p_203492),
                                                                                &n_p_203492));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_214111,
                                                                                2,
                                                                                sizeof(jump_s_203499),
                                                                                &jump_s_203499));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_214111,
                                                                                3,
                                                                                sizeof(partition_sizze_203577),
                                                                                &partition_sizze_203577));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_214111,
                                                                                4,
                                                                                sizeof(defunc_0_f_res_203631),
                                                                                &defunc_0_f_res_203631));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_214111,
                                                                                5,
                                                                                sizeof(pad_css_len_203632),
                                                                                &pad_css_len_203632));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_214111,
                                                                                6,
                                                                                sizeof(s_n_m_203636),
                                                                                &s_n_m_203636));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_214111,
                                                                                7,
                                                                                sizeof(mem_229973.mem),
                                                                                &mem_229973.mem));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_214111,
                                                                                8,
                                                                                sizeof(mem_229977.mem),
                                                                                &mem_229977.mem));
                                        if (1 *
                                            ((size_t) segmap_usable_groups_214105 *
                                             (size_t) segmap_group_sizze_214104) !=
                                            0) {
                                            const size_t
                                            global_work_sizze_236975[1] =
                                            {(size_t) segmap_usable_groups_214105 *
                                            (size_t) segmap_group_sizze_214104};
                                            const size_t
                                            local_work_sizze_236979[1] =
                                            {(size_t) segmap_group_sizze_214104};
                                            int64_t time_start_236976 = 0,
                                                    time_end_236977 = 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_214111",
                                                        global_work_sizze_236975[0],
                                                        local_work_sizze_236979[0],
                                                        (int) 0);
                                                time_start_236976 =
                                                    get_wall_time();
                                            }
                                            OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                                            ctx->mainzisegmap_214111,
                                                                                            1,
                                                                                            NULL,
                                                                                            global_work_sizze_236975,
                                                                                            local_work_sizze_236979,
                                                                                            0,
                                                                                            NULL,
                                                                                            ctx->profiling_paused ||
                                                                                            !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                                      &ctx->mainzisegmap_214111_runs,
                                                                                                                                      &ctx->mainzisegmap_214111_total_runtime)));
                                            if (ctx->debugging) {
                                                OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                                time_end_236977 =
                                                    get_wall_time();
                                                
                                                long time_diff_236978 =
                                                     time_end_236977 -
                                                     time_start_236976;
                                                
                                                fprintf(ctx->log,
                                                        "kernel %s runtime: %ldus\n",
                                                        "main.segmap_214111",
                                                        time_diff_236978);
                                            }
                                        }
                                        if (ctx->debugging)
                                            fprintf(ctx->log, "%s\n", "");
                                        if (memblock_unref_device(ctx,
                                                                  &mem_229977,
                                                                  "mem_229977") !=
                                            0)
                                            return 1;
                                        
                                        struct memblock_device mem_229983;
                                        
                                        mem_229983.references = NULL;
                                        if (memblock_alloc_device(ctx,
                                                                  &mem_229983,
                                                                  bytes_229297,
                                                                  "mem_229983")) {
                                            err = 1;
                                            goto cleanup;
                                        }
                                        
                                        struct memblock_device mem_229988;
                                        
                                        mem_229988.references = NULL;
                                        if (memblock_alloc_device(ctx,
                                                                  &mem_229988,
                                                                  bytes_229297,
                                                                  "mem_229988")) {
                                            err = 1;
                                            goto cleanup;
                                        }
                                        
                                        struct memblock_device mem_229993;
                                        
                                        mem_229993.references = NULL;
                                        if (memblock_alloc_device(ctx,
                                                                  &mem_229993,
                                                                  bytes_229297,
                                                                  "mem_229993")) {
                                            err = 1;
                                            goto cleanup;
                                        }
                                        if (slt64(q_s_203493 * (int64_t) 2,
                                                  segred_group_sizze_214127)) {
                                            int64_t
                                            segment_sizze_nonzzero_233350 =
                                            smax64((int64_t) 1, q_s_203493);
                                            int64_t num_threads_233351 =
                                                    num_groups_214128 *
                                                    segred_group_sizze_214127;
                                            
                                            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_203577 *
                                                                     n_p_203492 *
                                                                     s_n_m_203636),
                                                        '\n');
                                            if (ctx->debugging)
                                                fprintf(ctx->log, "%s: %llu%c",
                                                        "segment_size",
                                                        (long long) q_s_203493,
                                                        '\n');
                                            if (ctx->debugging)
                                                fprintf(ctx->log, "%s: %llu%c",
                                                        "segments_per_group",
                                                        (long long) squot64(segred_group_sizze_214127,
                                                                            segment_sizze_nonzzero_233350),
                                                        '\n');
                                            if (ctx->debugging)
                                                fprintf(ctx->log, "%s: %llu%c",
                                                        "required_groups",
                                                        (long long) sext_i64_i32(sdiv_up64(partition_sizze_203577 *
                                                                                           n_p_203492 *
                                                                                           s_n_m_203636,
                                                                                           squot64(segred_group_sizze_214127,
                                                                                                   segment_sizze_nonzzero_233350))),
                                                        '\n');
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_214137,
                                                                                    1,
                                                                                    (size_t) ((int64_t) 8 *
                                                                                              segred_group_sizze_214127),
                                                                                    NULL));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_214137,
                                                                                    2,
                                                                                    (size_t) ((int64_t) 8 *
                                                                                              segred_group_sizze_214127),
                                                                                    NULL));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_214137,
                                                                                    3,
                                                                                    (size_t) ((int64_t) 8 *
                                                                                              segred_group_sizze_214127),
                                                                                    NULL));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_214137,
                                                                                    4,
                                                                                    sizeof(n_p_203492),
                                                                                    &n_p_203492));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_214137,
                                                                                    5,
                                                                                    sizeof(q_s_203493),
                                                                                    &q_s_203493));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_214137,
                                                                                    6,
                                                                                    sizeof(partition_sizze_203577),
                                                                                    &partition_sizze_203577));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_214137,
                                                                                    7,
                                                                                    sizeof(defunc_0_f_res_203631),
                                                                                    &defunc_0_f_res_203631));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_214137,
                                                                                    8,
                                                                                    sizeof(s_n_m_203636),
                                                                                    &s_n_m_203636));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_214137,
                                                                                    9,
                                                                                    sizeof(num_groups_214128),
                                                                                    &num_groups_214128));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_214137,
                                                                                    10,
                                                                                    sizeof(segment_sizze_nonzzero_233350),
                                                                                    &segment_sizze_nonzzero_233350));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_214137,
                                                                                    11,
                                                                                    sizeof(ext_mem_229264.mem),
                                                                                    &ext_mem_229264.mem));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_214137,
                                                                                    12,
                                                                                    sizeof(ext_mem_229265.mem),
                                                                                    &ext_mem_229265.mem));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_214137,
                                                                                    13,
                                                                                    sizeof(ext_mem_229362.mem),
                                                                                    &ext_mem_229362.mem));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_214137,
                                                                                    14,
                                                                                    sizeof(ext_mem_229363.mem),
                                                                                    &ext_mem_229363.mem));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_214137,
                                                                                    15,
                                                                                    sizeof(mem_229531.mem),
                                                                                    &mem_229531.mem));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_214137,
                                                                                    16,
                                                                                    sizeof(mem_229973.mem),
                                                                                    &mem_229973.mem));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_214137,
                                                                                    17,
                                                                                    sizeof(mem_229983.mem),
                                                                                    &mem_229983.mem));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_214137,
                                                                                    18,
                                                                                    sizeof(mem_229988.mem),
                                                                                    &mem_229988.mem));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_214137,
                                                                                    19,
                                                                                    sizeof(mem_229993.mem),
                                                                                    &mem_229993.mem));
                                            if (1 *
                                                ((size_t) num_groups_214128 *
                                                 (size_t) segred_group_sizze_214127) !=
                                                0) {
                                                const size_t
                                                global_work_sizze_236980[1] =
                                                {(size_t) num_groups_214128 *
                                                (size_t) segred_group_sizze_214127};
                                                const size_t
                                                local_work_sizze_236984[1] =
                                                {(size_t) segred_group_sizze_214127};
                                                int64_t time_start_236981 = 0,
                                                        time_end_236982 = 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_214137",
                                                            global_work_sizze_236980[0],
                                                            local_work_sizze_236984[0],
                                                            (int) (0 +
                                                                   (int64_t) 8 *
                                                                   segred_group_sizze_214127 +
                                                                   (int64_t) 8 *
                                                                   segred_group_sizze_214127 +
                                                                   (int64_t) 8 *
                                                                   segred_group_sizze_214127));
                                                    time_start_236981 =
                                                        get_wall_time();
                                                }
                                                OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                                                ctx->mainzisegred_small_214137,
                                                                                                1,
                                                                                                NULL,
                                                                                                global_work_sizze_236980,
                                                                                                local_work_sizze_236984,
                                                                                                0,
                                                                                                NULL,
                                                                                                ctx->profiling_paused ||
                                                                                                !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                                          &ctx->mainzisegred_small_214137_runs,
                                                                                                                                          &ctx->mainzisegred_small_214137_total_runtime)));
                                                if (ctx->debugging) {
                                                    OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                                    time_end_236982 =
                                                        get_wall_time();
                                                    
                                                    long time_diff_236983 =
                                                         time_end_236982 -
                                                         time_start_236981;
                                                    
                                                    fprintf(ctx->log,
                                                            "kernel %s runtime: %ldus\n",
                                                            "main.segred_small_214137",
                                                            time_diff_236983);
                                                }
                                            }
                                            if (ctx->debugging)
                                                fprintf(ctx->log, "%s\n", "");
                                        } else {
                                            int64_t groups_per_segment_233393 =
                                                    sdiv_up64(num_groups_214128,
                                                              smax64((int64_t) 1,
                                                                     partition_sizze_203577 *
                                                                     n_p_203492 *
                                                                     s_n_m_203636));
                                            int64_t elements_per_thread_233394 =
                                                    sdiv_up64(q_s_203493,
                                                              segred_group_sizze_214127 *
                                                              groups_per_segment_233393);
                                            int64_t virt_num_groups_233395 =
                                                    groups_per_segment_233393 *
                                                    (partition_sizze_203577 *
                                                     n_p_203492 * s_n_m_203636);
                                            int64_t num_threads_233396 =
                                                    num_groups_214128 *
                                                    segred_group_sizze_214127;
                                            int64_t threads_per_segment_233397 =
                                                    groups_per_segment_233393 *
                                                    segred_group_sizze_214127;
                                            
                                            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_203577 *
                                                                     n_p_203492 *
                                                                     s_n_m_203636),
                                                        '\n');
                                            if (ctx->debugging)
                                                fprintf(ctx->log, "%s: %llu%c",
                                                        "segment_size",
                                                        (long long) q_s_203493,
                                                        '\n');
                                            if (ctx->debugging)
                                                fprintf(ctx->log, "%s: %llu%c",
                                                        "virt_num_groups",
                                                        (long long) virt_num_groups_233395,
                                                        '\n');
                                            if (ctx->debugging)
                                                fprintf(ctx->log, "%s: %llu%c",
                                                        "num_groups",
                                                        (long long) num_groups_214128,
                                                        '\n');
                                            if (ctx->debugging)
                                                fprintf(ctx->log, "%s: %llu%c",
                                                        "group_size",
                                                        (long long) segred_group_sizze_214127,
                                                        '\n');
                                            if (ctx->debugging)
                                                fprintf(ctx->log, "%s: %llu%c",
                                                        "elems_per_thread",
                                                        (long long) elements_per_thread_233394,
                                                        '\n');
                                            if (ctx->debugging)
                                                fprintf(ctx->log, "%s: %llu%c",
                                                        "groups_per_segment",
                                                        (long long) groups_per_segment_233393,
                                                        '\n');
                                            
                                            struct memblock_device
                                            segred_tmp_mem_233398;
                                            
                                            segred_tmp_mem_233398.references =
                                                NULL;
                                            if (memblock_alloc_device(ctx,
                                                                      &segred_tmp_mem_233398,
                                                                      (int64_t) 8 *
                                                                      virt_num_groups_233395,
                                                                      "segred_tmp_mem_233398")) {
                                                err = 1;
                                                goto cleanup;
                                            }
                                            
                                            struct memblock_device
                                            segred_tmp_mem_233400;
                                            
                                            segred_tmp_mem_233400.references =
                                                NULL;
                                            if (memblock_alloc_device(ctx,
                                                                      &segred_tmp_mem_233400,
                                                                      (int64_t) 8 *
                                                                      virt_num_groups_233395,
                                                                      "segred_tmp_mem_233400")) {
                                                err = 1;
                                                goto cleanup;
                                            }
                                            
                                            struct memblock_device
                                            segred_tmp_mem_233402;
                                            
                                            segred_tmp_mem_233402.references =
                                                NULL;
                                            if (memblock_alloc_device(ctx,
                                                                      &segred_tmp_mem_233402,
                                                                      (int64_t) 8 *
                                                                      virt_num_groups_233395,
                                                                      "segred_tmp_mem_233402")) {
                                                err = 1;
                                                goto cleanup;
                                            }
                                            
                                            struct memblock_device
                                            mainzicounter_mem_233404 =
                                            ctx->mainzicounter_mem_233404;
                                            
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_214137,
                                                                                    1,
                                                                                    (size_t) 1,
                                                                                    NULL));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_214137,
                                                                                    2,
                                                                                    (size_t) ((int64_t) 8 *
                                                                                              segred_group_sizze_214127),
                                                                                    NULL));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_214137,
                                                                                    3,
                                                                                    (size_t) ((int64_t) 8 *
                                                                                              segred_group_sizze_214127),
                                                                                    NULL));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_214137,
                                                                                    4,
                                                                                    (size_t) ((int64_t) 8 *
                                                                                              segred_group_sizze_214127),
                                                                                    NULL));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_214137,
                                                                                    5,
                                                                                    sizeof(n_p_203492),
                                                                                    &n_p_203492));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_214137,
                                                                                    6,
                                                                                    sizeof(q_s_203493),
                                                                                    &q_s_203493));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_214137,
                                                                                    7,
                                                                                    sizeof(partition_sizze_203577),
                                                                                    &partition_sizze_203577));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_214137,
                                                                                    8,
                                                                                    sizeof(defunc_0_f_res_203631),
                                                                                    &defunc_0_f_res_203631));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_214137,
                                                                                    9,
                                                                                    sizeof(s_n_m_203636),
                                                                                    &s_n_m_203636));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_214137,
                                                                                    10,
                                                                                    sizeof(num_groups_214128),
                                                                                    &num_groups_214128));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_214137,
                                                                                    11,
                                                                                    sizeof(groups_per_segment_233393),
                                                                                    &groups_per_segment_233393));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_214137,
                                                                                    12,
                                                                                    sizeof(elements_per_thread_233394),
                                                                                    &elements_per_thread_233394));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_214137,
                                                                                    13,
                                                                                    sizeof(virt_num_groups_233395),
                                                                                    &virt_num_groups_233395));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_214137,
                                                                                    14,
                                                                                    sizeof(threads_per_segment_233397),
                                                                                    &threads_per_segment_233397));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_214137,
                                                                                    15,
                                                                                    sizeof(ext_mem_229264.mem),
                                                                                    &ext_mem_229264.mem));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_214137,
                                                                                    16,
                                                                                    sizeof(ext_mem_229265.mem),
                                                                                    &ext_mem_229265.mem));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_214137,
                                                                                    17,
                                                                                    sizeof(ext_mem_229362.mem),
                                                                                    &ext_mem_229362.mem));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_214137,
                                                                                    18,
                                                                                    sizeof(ext_mem_229363.mem),
                                                                                    &ext_mem_229363.mem));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_214137,
                                                                                    19,
                                                                                    sizeof(mem_229531.mem),
                                                                                    &mem_229531.mem));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_214137,
                                                                                    20,
                                                                                    sizeof(mem_229973.mem),
                                                                                    &mem_229973.mem));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_214137,
                                                                                    21,
                                                                                    sizeof(mem_229983.mem),
                                                                                    &mem_229983.mem));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_214137,
                                                                                    22,
                                                                                    sizeof(mem_229988.mem),
                                                                                    &mem_229988.mem));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_214137,
                                                                                    23,
                                                                                    sizeof(mem_229993.mem),
                                                                                    &mem_229993.mem));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_214137,
                                                                                    24,
                                                                                    sizeof(segred_tmp_mem_233398.mem),
                                                                                    &segred_tmp_mem_233398.mem));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_214137,
                                                                                    25,
                                                                                    sizeof(segred_tmp_mem_233400.mem),
                                                                                    &segred_tmp_mem_233400.mem));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_214137,
                                                                                    26,
                                                                                    sizeof(segred_tmp_mem_233402.mem),
                                                                                    &segred_tmp_mem_233402.mem));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_214137,
                                                                                    27,
                                                                                    sizeof(mainzicounter_mem_233404.mem),
                                                                                    &mainzicounter_mem_233404.mem));
                                            if (1 *
                                                ((size_t) num_groups_214128 *
                                                 (size_t) segred_group_sizze_214127) !=
                                                0) {
                                                const size_t
                                                global_work_sizze_236986[1] =
                                                {(size_t) num_groups_214128 *
                                                (size_t) segred_group_sizze_214127};
                                                const size_t
                                                local_work_sizze_236990[1] =
                                                {(size_t) segred_group_sizze_214127};
                                                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.segred_large_214137",
                                                            global_work_sizze_236986[0],
                                                            local_work_sizze_236990[0],
                                                            (int) (0 + 1 +
                                                                   (int64_t) 8 *
                                                                   segred_group_sizze_214127 +
                                                                   (int64_t) 8 *
                                                                   segred_group_sizze_214127 +
                                                                   (int64_t) 8 *
                                                                   segred_group_sizze_214127));
                                                    time_start_236987 =
                                                        get_wall_time();
                                                }
                                                OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                                                ctx->mainzisegred_large_214137,
                                                                                                1,
                                                                                                NULL,
                                                                                                global_work_sizze_236986,
                                                                                                local_work_sizze_236990,
                                                                                                0,
                                                                                                NULL,
                                                                                                ctx->profiling_paused ||
                                                                                                !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                                          &ctx->mainzisegred_large_214137_runs,
                                                                                                                                          &ctx->mainzisegred_large_214137_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.segred_large_214137",
                                                            time_diff_236989);
                                                }
                                            }
                                            if (ctx->debugging)
                                                fprintf(ctx->log, "%s\n", "");
                                            if (memblock_unref_device(ctx,
                                                                      &segred_tmp_mem_233402,
                                                                      "segred_tmp_mem_233402") !=
                                                0)
                                                return 1;
                                            if (memblock_unref_device(ctx,
                                                                      &segred_tmp_mem_233400,
                                                                      "segred_tmp_mem_233400") !=
                                                0)
                                                return 1;
                                            if (memblock_unref_device(ctx,
                                                                      &segred_tmp_mem_233398,
                                                                      "segred_tmp_mem_233398") !=
                                                0)
                                                return 1;
                                        }
                                        if (memblock_unref_device(ctx,
                                                                  &mem_229973,
                                                                  "mem_229973") !=
                                            0)
                                            return 1;
                                        
                                        int64_t segmap_usable_groups_214187 =
                                                sdiv_up64(nest_sizze_208848,
                                                          segmap_group_sizze_214186);
                                        struct memblock_device mem_229999;
                                        
                                        mem_229999.references = NULL;
                                        if (memblock_alloc_device(ctx,
                                                                  &mem_229999,
                                                                  bytes_229297,
                                                                  "mem_229999")) {
                                            err = 1;
                                            goto cleanup;
                                        }
                                        
                                        struct memblock_device mem_230004;
                                        
                                        mem_230004.references = NULL;
                                        if (memblock_alloc_device(ctx,
                                                                  &mem_230004,
                                                                  bytes_229297,
                                                                  "mem_230004")) {
                                            err = 1;
                                            goto cleanup;
                                        }
                                        
                                        struct memblock_device mem_230009;
                                        
                                        mem_230009.references = NULL;
                                        if (memblock_alloc_device(ctx,
                                                                  &mem_230009,
                                                                  bytes_229297,
                                                                  "mem_230009")) {
                                            err = 1;
                                            goto cleanup;
                                        }
                                        
                                        struct memblock_device mem_230014;
                                        
                                        mem_230014.references = NULL;
                                        if (memblock_alloc_device(ctx,
                                                                  &mem_230014,
                                                                  bytes_229297,
                                                                  "mem_230014")) {
                                            err = 1;
                                            goto cleanup;
                                        }
                                        if (ctx->debugging)
                                            fprintf(ctx->log, "%s\n",
                                                    "\n# SegMap");
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_214195,
                                                                                1,
                                                                                sizeof(n_p_203492),
                                                                                &n_p_203492));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_214195,
                                                                                2,
                                                                                sizeof(jump_s_203499),
                                                                                &jump_s_203499));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_214195,
                                                                                3,
                                                                                sizeof(partition_sizze_203577),
                                                                                &partition_sizze_203577));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_214195,
                                                                                4,
                                                                                sizeof(defunc_0_f_res_203631),
                                                                                &defunc_0_f_res_203631));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_214195,
                                                                                5,
                                                                                sizeof(pad_css_len_203632),
                                                                                &pad_css_len_203632));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_214195,
                                                                                6,
                                                                                sizeof(s_n_m_203636),
                                                                                &s_n_m_203636));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_214195,
                                                                                7,
                                                                                sizeof(mem_229983.mem),
                                                                                &mem_229983.mem));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_214195,
                                                                                8,
                                                                                sizeof(mem_229988.mem),
                                                                                &mem_229988.mem));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_214195,
                                                                                9,
                                                                                sizeof(mem_229993.mem),
                                                                                &mem_229993.mem));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_214195,
                                                                                10,
                                                                                sizeof(mem_229999.mem),
                                                                                &mem_229999.mem));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_214195,
                                                                                11,
                                                                                sizeof(mem_230004.mem),
                                                                                &mem_230004.mem));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_214195,
                                                                                12,
                                                                                sizeof(mem_230009.mem),
                                                                                &mem_230009.mem));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_214195,
                                                                                13,
                                                                                sizeof(mem_230014.mem),
                                                                                &mem_230014.mem));
                                        if (1 *
                                            ((size_t) segmap_usable_groups_214187 *
                                             (size_t) segmap_group_sizze_214186) !=
                                            0) {
                                            const size_t
                                            global_work_sizze_236991[1] =
                                            {(size_t) segmap_usable_groups_214187 *
                                            (size_t) segmap_group_sizze_214186};
                                            const size_t
                                            local_work_sizze_236995[1] =
                                            {(size_t) segmap_group_sizze_214186};
                                            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_214195",
                                                        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_214195,
                                                                                            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_214195_runs,
                                                                                                                                      &ctx->mainzisegmap_214195_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_214195",
                                                        time_diff_236994);
                                            }
                                        }
                                        if (ctx->debugging)
                                            fprintf(ctx->log, "%s\n", "");
                                        if (memblock_unref_device(ctx,
                                                                  &mem_229983,
                                                                  "mem_229983") !=
                                            0)
                                            return 1;
                                        if (memblock_unref_device(ctx,
                                                                  &mem_229988,
                                                                  "mem_229988") !=
                                            0)
                                            return 1;
                                        if (memblock_unref_device(ctx,
                                                                  &mem_229993,
                                                                  "mem_229993") !=
                                            0)
                                            return 1;
                                        
                                        struct memblock_device mem_230020;
                                        
                                        mem_230020.references = NULL;
                                        if (memblock_alloc_device(ctx,
                                                                  &mem_230020,
                                                                  bytes_229297,
                                                                  "mem_230020")) {
                                            err = 1;
                                            goto cleanup;
                                        }
                                        
                                        struct memblock_device mem_230025;
                                        
                                        mem_230025.references = NULL;
                                        if (memblock_alloc_device(ctx,
                                                                  &mem_230025,
                                                                  bytes_229297,
                                                                  "mem_230025")) {
                                            err = 1;
                                            goto cleanup;
                                        }
                                        if (slt64(q_s_203493 * (int64_t) 2,
                                                  segred_group_sizze_214222)) {
                                            int64_t
                                            segment_sizze_nonzzero_233466 =
                                            smax64((int64_t) 1, q_s_203493);
                                            int64_t num_threads_233467 =
                                                    num_groups_214223 *
                                                    segred_group_sizze_214222;
                                            
                                            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_203577 *
                                                                     n_p_203492 *
                                                                     s_n_m_203636),
                                                        '\n');
                                            if (ctx->debugging)
                                                fprintf(ctx->log, "%s: %llu%c",
                                                        "segment_size",
                                                        (long long) q_s_203493,
                                                        '\n');
                                            if (ctx->debugging)
                                                fprintf(ctx->log, "%s: %llu%c",
                                                        "segments_per_group",
                                                        (long long) squot64(segred_group_sizze_214222,
                                                                            segment_sizze_nonzzero_233466),
                                                        '\n');
                                            if (ctx->debugging)
                                                fprintf(ctx->log, "%s: %llu%c",
                                                        "required_groups",
                                                        (long long) sext_i64_i32(sdiv_up64(partition_sizze_203577 *
                                                                                           n_p_203492 *
                                                                                           s_n_m_203636,
                                                                                           squot64(segred_group_sizze_214222,
                                                                                                   segment_sizze_nonzzero_233466))),
                                                        '\n');
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_214231,
                                                                                    1,
                                                                                    (size_t) ((int64_t) 8 *
                                                                                              segred_group_sizze_214222),
                                                                                    NULL));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_214231,
                                                                                    2,
                                                                                    (size_t) ((int64_t) 8 *
                                                                                              segred_group_sizze_214222),
                                                                                    NULL));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_214231,
                                                                                    3,
                                                                                    sizeof(n_p_203492),
                                                                                    &n_p_203492));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_214231,
                                                                                    4,
                                                                                    sizeof(q_s_203493),
                                                                                    &q_s_203493));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_214231,
                                                                                    5,
                                                                                    sizeof(partition_sizze_203577),
                                                                                    &partition_sizze_203577));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_214231,
                                                                                    6,
                                                                                    sizeof(defunc_0_f_res_203631),
                                                                                    &defunc_0_f_res_203631));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_214231,
                                                                                    7,
                                                                                    sizeof(s_n_m_203636),
                                                                                    &s_n_m_203636));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_214231,
                                                                                    8,
                                                                                    sizeof(num_groups_214223),
                                                                                    &num_groups_214223));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_214231,
                                                                                    9,
                                                                                    sizeof(segment_sizze_nonzzero_233466),
                                                                                    &segment_sizze_nonzzero_233466));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_214231,
                                                                                    10,
                                                                                    sizeof(ext_mem_229264.mem),
                                                                                    &ext_mem_229264.mem));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_214231,
                                                                                    11,
                                                                                    sizeof(ext_mem_229265.mem),
                                                                                    &ext_mem_229265.mem));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_214231,
                                                                                    12,
                                                                                    sizeof(ext_mem_229362.mem),
                                                                                    &ext_mem_229362.mem));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_214231,
                                                                                    13,
                                                                                    sizeof(ext_mem_229363.mem),
                                                                                    &ext_mem_229363.mem));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_214231,
                                                                                    14,
                                                                                    sizeof(mem_229526.mem),
                                                                                    &mem_229526.mem));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_214231,
                                                                                    15,
                                                                                    sizeof(mem_229531.mem),
                                                                                    &mem_229531.mem));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_214231,
                                                                                    16,
                                                                                    sizeof(mem_229999.mem),
                                                                                    &mem_229999.mem));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_214231,
                                                                                    17,
                                                                                    sizeof(mem_230004.mem),
                                                                                    &mem_230004.mem));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_214231,
                                                                                    18,
                                                                                    sizeof(mem_230009.mem),
                                                                                    &mem_230009.mem));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_214231,
                                                                                    19,
                                                                                    sizeof(mem_230014.mem),
                                                                                    &mem_230014.mem));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_214231,
                                                                                    20,
                                                                                    sizeof(mem_230020.mem),
                                                                                    &mem_230020.mem));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_214231,
                                                                                    21,
                                                                                    sizeof(mem_230025.mem),
                                                                                    &mem_230025.mem));
                                            if (1 *
                                                ((size_t) num_groups_214223 *
                                                 (size_t) segred_group_sizze_214222) !=
                                                0) {
                                                const size_t
                                                global_work_sizze_236996[1] =
                                                {(size_t) num_groups_214223 *
                                                (size_t) segred_group_sizze_214222};
                                                const size_t
                                                local_work_sizze_237000[1] =
                                                {(size_t) segred_group_sizze_214222};
                                                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.segred_small_214231",
                                                            global_work_sizze_236996[0],
                                                            local_work_sizze_237000[0],
                                                            (int) (0 +
                                                                   (int64_t) 8 *
                                                                   segred_group_sizze_214222 +
                                                                   (int64_t) 8 *
                                                                   segred_group_sizze_214222));
                                                    time_start_236997 =
                                                        get_wall_time();
                                                }
                                                OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                                                ctx->mainzisegred_small_214231,
                                                                                                1,
                                                                                                NULL,
                                                                                                global_work_sizze_236996,
                                                                                                local_work_sizze_237000,
                                                                                                0,
                                                                                                NULL,
                                                                                                ctx->profiling_paused ||
                                                                                                !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                                          &ctx->mainzisegred_small_214231_runs,
                                                                                                                                          &ctx->mainzisegred_small_214231_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.segred_small_214231",
                                                            time_diff_236999);
                                                }
                                            }
                                            if (ctx->debugging)
                                                fprintf(ctx->log, "%s\n", "");
                                        } else {
                                            int64_t groups_per_segment_233503 =
                                                    sdiv_up64(num_groups_214223,
                                                              smax64((int64_t) 1,
                                                                     partition_sizze_203577 *
                                                                     n_p_203492 *
                                                                     s_n_m_203636));
                                            int64_t elements_per_thread_233504 =
                                                    sdiv_up64(q_s_203493,
                                                              segred_group_sizze_214222 *
                                                              groups_per_segment_233503);
                                            int64_t virt_num_groups_233505 =
                                                    groups_per_segment_233503 *
                                                    (partition_sizze_203577 *
                                                     n_p_203492 * s_n_m_203636);
                                            int64_t num_threads_233506 =
                                                    num_groups_214223 *
                                                    segred_group_sizze_214222;
                                            int64_t threads_per_segment_233507 =
                                                    groups_per_segment_233503 *
                                                    segred_group_sizze_214222;
                                            
                                            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_203577 *
                                                                     n_p_203492 *
                                                                     s_n_m_203636),
                                                        '\n');
                                            if (ctx->debugging)
                                                fprintf(ctx->log, "%s: %llu%c",
                                                        "segment_size",
                                                        (long long) q_s_203493,
                                                        '\n');
                                            if (ctx->debugging)
                                                fprintf(ctx->log, "%s: %llu%c",
                                                        "virt_num_groups",
                                                        (long long) virt_num_groups_233505,
                                                        '\n');
                                            if (ctx->debugging)
                                                fprintf(ctx->log, "%s: %llu%c",
                                                        "num_groups",
                                                        (long long) num_groups_214223,
                                                        '\n');
                                            if (ctx->debugging)
                                                fprintf(ctx->log, "%s: %llu%c",
                                                        "group_size",
                                                        (long long) segred_group_sizze_214222,
                                                        '\n');
                                            if (ctx->debugging)
                                                fprintf(ctx->log, "%s: %llu%c",
                                                        "elems_per_thread",
                                                        (long long) elements_per_thread_233504,
                                                        '\n');
                                            if (ctx->debugging)
                                                fprintf(ctx->log, "%s: %llu%c",
                                                        "groups_per_segment",
                                                        (long long) groups_per_segment_233503,
                                                        '\n');
                                            
                                            struct memblock_device
                                            segred_tmp_mem_233508;
                                            
                                            segred_tmp_mem_233508.references =
                                                NULL;
                                            if (memblock_alloc_device(ctx,
                                                                      &segred_tmp_mem_233508,
                                                                      (int64_t) 8 *
                                                                      virt_num_groups_233505,
                                                                      "segred_tmp_mem_233508")) {
                                                err = 1;
                                                goto cleanup;
                                            }
                                            
                                            struct memblock_device
                                            segred_tmp_mem_233510;
                                            
                                            segred_tmp_mem_233510.references =
                                                NULL;
                                            if (memblock_alloc_device(ctx,
                                                                      &segred_tmp_mem_233510,
                                                                      (int64_t) 8 *
                                                                      virt_num_groups_233505,
                                                                      "segred_tmp_mem_233510")) {
                                                err = 1;
                                                goto cleanup;
                                            }
                                            
                                            struct memblock_device
                                            mainzicounter_mem_233512 =
                                            ctx->mainzicounter_mem_233512;
                                            
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_214231,
                                                                                    1,
                                                                                    (size_t) 1,
                                                                                    NULL));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_214231,
                                                                                    2,
                                                                                    (size_t) ((int64_t) 8 *
                                                                                              segred_group_sizze_214222),
                                                                                    NULL));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_214231,
                                                                                    3,
                                                                                    (size_t) ((int64_t) 8 *
                                                                                              segred_group_sizze_214222),
                                                                                    NULL));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_214231,
                                                                                    4,
                                                                                    sizeof(n_p_203492),
                                                                                    &n_p_203492));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_214231,
                                                                                    5,
                                                                                    sizeof(q_s_203493),
                                                                                    &q_s_203493));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_214231,
                                                                                    6,
                                                                                    sizeof(partition_sizze_203577),
                                                                                    &partition_sizze_203577));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_214231,
                                                                                    7,
                                                                                    sizeof(defunc_0_f_res_203631),
                                                                                    &defunc_0_f_res_203631));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_214231,
                                                                                    8,
                                                                                    sizeof(s_n_m_203636),
                                                                                    &s_n_m_203636));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_214231,
                                                                                    9,
                                                                                    sizeof(num_groups_214223),
                                                                                    &num_groups_214223));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_214231,
                                                                                    10,
                                                                                    sizeof(groups_per_segment_233503),
                                                                                    &groups_per_segment_233503));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_214231,
                                                                                    11,
                                                                                    sizeof(elements_per_thread_233504),
                                                                                    &elements_per_thread_233504));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_214231,
                                                                                    12,
                                                                                    sizeof(virt_num_groups_233505),
                                                                                    &virt_num_groups_233505));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_214231,
                                                                                    13,
                                                                                    sizeof(threads_per_segment_233507),
                                                                                    &threads_per_segment_233507));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_214231,
                                                                                    14,
                                                                                    sizeof(ext_mem_229264.mem),
                                                                                    &ext_mem_229264.mem));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_214231,
                                                                                    15,
                                                                                    sizeof(ext_mem_229265.mem),
                                                                                    &ext_mem_229265.mem));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_214231,
                                                                                    16,
                                                                                    sizeof(ext_mem_229362.mem),
                                                                                    &ext_mem_229362.mem));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_214231,
                                                                                    17,
                                                                                    sizeof(ext_mem_229363.mem),
                                                                                    &ext_mem_229363.mem));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_214231,
                                                                                    18,
                                                                                    sizeof(mem_229526.mem),
                                                                                    &mem_229526.mem));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_214231,
                                                                                    19,
                                                                                    sizeof(mem_229531.mem),
                                                                                    &mem_229531.mem));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_214231,
                                                                                    20,
                                                                                    sizeof(mem_229999.mem),
                                                                                    &mem_229999.mem));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_214231,
                                                                                    21,
                                                                                    sizeof(mem_230004.mem),
                                                                                    &mem_230004.mem));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_214231,
                                                                                    22,
                                                                                    sizeof(mem_230009.mem),
                                                                                    &mem_230009.mem));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_214231,
                                                                                    23,
                                                                                    sizeof(mem_230014.mem),
                                                                                    &mem_230014.mem));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_214231,
                                                                                    24,
                                                                                    sizeof(mem_230020.mem),
                                                                                    &mem_230020.mem));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_214231,
                                                                                    25,
                                                                                    sizeof(mem_230025.mem),
                                                                                    &mem_230025.mem));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_214231,
                                                                                    26,
                                                                                    sizeof(segred_tmp_mem_233508.mem),
                                                                                    &segred_tmp_mem_233508.mem));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_214231,
                                                                                    27,
                                                                                    sizeof(segred_tmp_mem_233510.mem),
                                                                                    &segred_tmp_mem_233510.mem));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_214231,
                                                                                    28,
                                                                                    sizeof(mainzicounter_mem_233512.mem),
                                                                                    &mainzicounter_mem_233512.mem));
                                            if (1 *
                                                ((size_t) num_groups_214223 *
                                                 (size_t) segred_group_sizze_214222) !=
                                                0) {
                                                const size_t
                                                global_work_sizze_237002[1] =
                                                {(size_t) num_groups_214223 *
                                                (size_t) segred_group_sizze_214222};
                                                const size_t
                                                local_work_sizze_237006[1] =
                                                {(size_t) segred_group_sizze_214222};
                                                int64_t time_start_237003 = 0,
                                                        time_end_237004 = 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_214231",
                                                            global_work_sizze_237002[0],
                                                            local_work_sizze_237006[0],
                                                            (int) (0 + 1 +
                                                                   (int64_t) 8 *
                                                                   segred_group_sizze_214222 +
                                                                   (int64_t) 8 *
                                                                   segred_group_sizze_214222));
                                                    time_start_237003 =
                                                        get_wall_time();
                                                }
                                                OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                                                ctx->mainzisegred_large_214231,
                                                                                                1,
                                                                                                NULL,
                                                                                                global_work_sizze_237002,
                                                                                                local_work_sizze_237006,
                                                                                                0,
                                                                                                NULL,
                                                                                                ctx->profiling_paused ||
                                                                                                !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                                          &ctx->mainzisegred_large_214231_runs,
                                                                                                                                          &ctx->mainzisegred_large_214231_total_runtime)));
                                                if (ctx->debugging) {
                                                    OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                                    time_end_237004 =
                                                        get_wall_time();
                                                    
                                                    long time_diff_237005 =
                                                         time_end_237004 -
                                                         time_start_237003;
                                                    
                                                    fprintf(ctx->log,
                                                            "kernel %s runtime: %ldus\n",
                                                            "main.segred_large_214231",
                                                            time_diff_237005);
                                                }
                                            }
                                            if (ctx->debugging)
                                                fprintf(ctx->log, "%s\n", "");
                                            if (memblock_unref_device(ctx,
                                                                      &segred_tmp_mem_233510,
                                                                      "segred_tmp_mem_233510") !=
                                                0)
                                                return 1;
                                            if (memblock_unref_device(ctx,
                                                                      &segred_tmp_mem_233508,
                                                                      "segred_tmp_mem_233508") !=
                                                0)
                                                return 1;
                                        }
                                        if (memblock_unref_device(ctx,
                                                                  &mem_229999,
                                                                  "mem_229999") !=
                                            0)
                                            return 1;
                                        if (memblock_unref_device(ctx,
                                                                  &mem_230004,
                                                                  "mem_230004") !=
                                            0)
                                            return 1;
                                        if (memblock_unref_device(ctx,
                                                                  &mem_230009,
                                                                  "mem_230009") !=
                                            0)
                                            return 1;
                                        if (memblock_unref_device(ctx,
                                                                  &mem_230014,
                                                                  "mem_230014") !=
                                            0)
                                            return 1;
                                        if (memblock_set_device(ctx,
                                                                &ext_mem_230027,
                                                                &mem_230020,
                                                                "mem_230020") !=
                                            0)
                                            return 1;
                                        if (memblock_set_device(ctx,
                                                                &ext_mem_230026,
                                                                &mem_230025,
                                                                "mem_230025") !=
                                            0)
                                            return 1;
                                        if (memblock_unref_device(ctx,
                                                                  &mem_230025,
                                                                  "mem_230025") !=
                                            0)
                                            return 1;
                                        if (memblock_unref_device(ctx,
                                                                  &mem_230020,
                                                                  "mem_230020") !=
                                            0)
                                            return 1;
                                        if (memblock_unref_device(ctx,
                                                                  &mem_230014,
                                                                  "mem_230014") !=
                                            0)
                                            return 1;
                                        if (memblock_unref_device(ctx,
                                                                  &mem_230009,
                                                                  "mem_230009") !=
                                            0)
                                            return 1;
                                        if (memblock_unref_device(ctx,
                                                                  &mem_230004,
                                                                  "mem_230004") !=
                                            0)
                                            return 1;
                                        if (memblock_unref_device(ctx,
                                                                  &mem_229999,
                                                                  "mem_229999") !=
                                            0)
                                            return 1;
                                        if (memblock_unref_device(ctx,
                                                                  &mem_229993,
                                                                  "mem_229993") !=
                                            0)
                                            return 1;
                                        if (memblock_unref_device(ctx,
                                                                  &mem_229988,
                                                                  "mem_229988") !=
                                            0)
                                            return 1;
                                        if (memblock_unref_device(ctx,
                                                                  &mem_229983,
                                                                  "mem_229983") !=
                                            0)
                                            return 1;
                                        if (memblock_unref_device(ctx,
                                                                  &mem_229977,
                                                                  "mem_229977") !=
                                            0)
                                            return 1;
                                        if (memblock_unref_device(ctx,
                                                                  &mem_229973,
                                                                  "mem_229973") !=
                                            0)
                                            return 1;
                                    }
                                    if (memblock_set_device(ctx,
                                                            &ext_mem_230029,
                                                            &ext_mem_230027,
                                                            "ext_mem_230027") !=
                                        0)
                                        return 1;
                                    if (memblock_set_device(ctx,
                                                            &ext_mem_230028,
                                                            &ext_mem_230026,
                                                            "ext_mem_230026") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230026,
                                                              "ext_mem_230026") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230027,
                                                              "ext_mem_230027") !=
                                        0)
                                        return 1;
                                }
                                if (memblock_set_device(ctx, &ext_mem_230043,
                                                        &ext_mem_230029,
                                                        "ext_mem_230029") != 0)
                                    return 1;
                                if (memblock_set_device(ctx, &ext_mem_230042,
                                                        &ext_mem_230028,
                                                        "ext_mem_230028") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230028,
                                                          "ext_mem_230028") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230029,
                                                          "ext_mem_230029") !=
                                    0)
                                    return 1;
                            }
                            if (memblock_set_device(ctx, &ext_mem_230057,
                                                    &ext_mem_230043,
                                                    "ext_mem_230043") != 0)
                                return 1;
                            if (memblock_set_device(ctx, &ext_mem_230056,
                                                    &ext_mem_230042,
                                                    "ext_mem_230042") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230042,
                                                      "ext_mem_230042") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230043,
                                                      "ext_mem_230043") != 0)
                                return 1;
                        }
                        if (memblock_set_device(ctx, &ext_mem_230418,
                                                &ext_mem_230057,
                                                "ext_mem_230057") != 0)
                            return 1;
                        if (memblock_set_device(ctx, &ext_mem_230417,
                                                &ext_mem_230056,
                                                "ext_mem_230056") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_230056,
                                                  "ext_mem_230056") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_230057,
                                                  "ext_mem_230057") != 0)
                            return 1;
                    } else {
                        bool suff_outer_par_214302;
                        
                        suff_outer_par_214302 =
                            *ctx->tuning_params.mainzisuff_outer_par_15 <=
                            partition_sizze_203577;
                        if (ctx->logging)
                            fprintf(ctx->log, "Compared %s <= %ld: %s.\n",
                                    "main.suff_outer_par_15",
                                    (long) partition_sizze_203577,
                                    suff_outer_par_214302 ? "true" : "false");
                        
                        int64_t segmap_group_sizze_214464;
                        
                        segmap_group_sizze_214464 =
                            *ctx->tuning_params.mainzisegmap_group_sizze_214306;
                        
                        int64_t num_groups_214465;
                        int32_t max_num_groups_233560;
                        
                        max_num_groups_233560 =
                            *ctx->tuning_params.mainzisegmap_num_groups_214308;
                        num_groups_214465 = sext_i64_i32(smax64((int64_t) 1,
                                                                smin64(sdiv_up64(partition_sizze_203577,
                                                                                 segmap_group_sizze_214464),
                                                                       sext_i32_i64(max_num_groups_233560))));
                        
                        int64_t segmap_group_sizze_216239;
                        
                        segmap_group_sizze_216239 =
                            *ctx->tuning_params.mainzisegmap_group_sizze_214626;
                        
                        int64_t num_groups_216240;
                        int32_t max_num_groups_233561;
                        
                        max_num_groups_233561 =
                            *ctx->tuning_params.mainzisegmap_num_groups_214628;
                        num_groups_216240 = sext_i64_i32(smax64((int64_t) 1,
                                                                smin64(sdiv_up64(binop_x_229202,
                                                                                 segmap_group_sizze_216239),
                                                                       sext_i32_i64(max_num_groups_233561))));
                        
                        bool suff_outer_par_216244;
                        
                        suff_outer_par_216244 =
                            *ctx->tuning_params.mainzisuff_outer_par_16 <=
                            binop_x_229202;
                        if (ctx->logging)
                            fprintf(ctx->log, "Compared %s <= %ld: %s.\n",
                                    "main.suff_outer_par_16",
                                    (long) binop_x_229202,
                                    suff_outer_par_216244 ? "true" : "false");
                        
                        int64_t one_intra_par_min_216245 = q_s_203493 *
                                s_n_m_203636;
                        int64_t intra_avail_par_216247 = smin64(s_n_m_203636,
                                                                one_intra_par_min_216245);
                        int64_t computed_group_sizze_216248 =
                                smax64(s_n_m_203636, one_intra_par_min_216245);
                        bool fits_216252 = sle64(computed_group_sizze_216248,
                                                 max_group_sizze_206887);
                        bool suff_intra_par_216254;
                        
                        suff_intra_par_216254 =
                            *ctx->tuning_params.mainzisuff_intra_par_17 <=
                            intra_avail_par_216247;
                        if (ctx->logging)
                            fprintf(ctx->log, "Compared %s <= %ld: %s.\n",
                                    "main.suff_intra_par_17",
                                    (long) intra_avail_par_216247,
                                    suff_intra_par_216254 ? "true" : "false");
                        
                        bool intra_suff_and_fits_216255 = fits_216252 &&
                             suff_intra_par_216254;
                        int64_t segmap_group_sizze_216594;
                        
                        segmap_group_sizze_216594 =
                            *ctx->tuning_params.mainzisegmap_group_sizze_215167;
                        
                        bool suff_outer_par_216599;
                        
                        suff_outer_par_216599 =
                            *ctx->tuning_params.mainzisuff_outer_par_18 <=
                            nest_sizze_208848;
                        if (ctx->logging)
                            fprintf(ctx->log, "Compared %s <= %ld: %s.\n",
                                    "main.suff_outer_par_18",
                                    (long) nest_sizze_208848,
                                    suff_outer_par_216599 ? "true" : "false");
                        
                        int64_t segmap_group_sizze_216749;
                        
                        segmap_group_sizze_216749 =
                            *ctx->tuning_params.mainzisegmap_group_sizze_215584;
                        
                        int64_t nest_sizze_216771 = q_s_203493 *
                                nest_sizze_208848;
                        int64_t segred_group_sizze_216772;
                        
                        segred_group_sizze_216772 =
                            *ctx->tuning_params.mainzisegred_group_sizze_215512;
                        
                        int64_t num_groups_216773;
                        int32_t max_num_groups_233562;
                        
                        max_num_groups_233562 =
                            *ctx->tuning_params.mainzisegred_num_groups_215514;
                        num_groups_216773 = sext_i64_i32(smax64((int64_t) 1,
                                                                smin64(sdiv_up64(nest_sizze_216771,
                                                                                 segred_group_sizze_216772),
                                                                       sext_i32_i64(max_num_groups_233562))));
                        
                        int64_t segmap_group_sizze_216841;
                        
                        segmap_group_sizze_216841 =
                            *ctx->tuning_params.mainzisegmap_group_sizze_215454;
                        
                        int64_t segred_group_sizze_216898;
                        
                        segred_group_sizze_216898 =
                            *ctx->tuning_params.mainzisegred_group_sizze_215343;
                        
                        int64_t num_groups_216899;
                        int32_t max_num_groups_233563;
                        
                        max_num_groups_233563 =
                            *ctx->tuning_params.mainzisegred_num_groups_215345;
                        num_groups_216899 = sext_i64_i32(smax64((int64_t) 1,
                                                                smin64(sdiv_up64(nest_sizze_216771,
                                                                                 segred_group_sizze_216898),
                                                                       sext_i32_i64(max_num_groups_233563))));
                        
                        int64_t bytes_230060 = (int64_t) 8 * nest_sizze_208848;
                        int64_t bytes_230067 = (int64_t) 8 * nest_sizze_207163;
                        int64_t binop_x_230178 = partition_sizze_203577 *
                                s_n_m_203636;
                        int64_t binop_x_230179 = n_p_203492 * binop_x_230178;
                        int64_t bytes_230180 = (int64_t) 8 * binop_x_230179;
                        int64_t binop_x_230186 = partition_sizze_203577 *
                                defunc_0_f_res_203631;
                        int64_t binop_x_230187 = n_p_203492 * binop_x_230186;
                        int64_t bytes_230188 = (int64_t) 8 * binop_x_230187;
                        int64_t bytes_230242 = smax64((int64_t) 0,
                                                      s_n_m_203636);
                        int64_t bytes_230315 = smax64((int64_t) 0,
                                                      binop_x_229295);
                        int64_t num_threads_232131 = segmap_group_sizze_214464 *
                                num_groups_214465;
                        int64_t total_sizze_232132 = bytes_229288 *
                                num_threads_232131;
                        int64_t total_sizze_232133 = bytes_229288 *
                                num_threads_232131;
                        int64_t num_threads_232134 = segmap_group_sizze_216239 *
                                num_groups_216240;
                        int64_t total_sizze_232135 = bytes_229311 *
                                num_threads_232134;
                        int64_t total_sizze_232136 = bytes_229311 *
                                num_threads_232134;
                        struct memblock_device ext_mem_230416;
                        
                        ext_mem_230416.references = NULL;
                        
                        struct memblock_device ext_mem_230415;
                        
                        ext_mem_230415.references = NULL;
                        
                        int32_t local_memory_capacity_233984;
                        
                        local_memory_capacity_233984 =
                            ctx->opencl.max_local_memory;
                        if (sle64((int64_t) 0,
                                  sext_i32_i64(local_memory_capacity_233984)) &&
                            suff_outer_par_214302) {
                            struct memblock_device mem_230061;
                            
                            mem_230061.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_230061,
                                                      bytes_230060,
                                                      "mem_230061")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (futrts_builtinzhgpu_map_transpose_f64(ctx,
                                                                      mem_230061,
                                                                      (int64_t) 0,
                                                                      ext_mem_229362,
                                                                      (int64_t) 0,
                                                                      (int64_t) 1,
                                                                      n_p_203492 *
                                                                      s_n_m_203636,
                                                                      partition_sizze_203577) !=
                                0) {
                                if (memblock_unref_device(ctx, &mem_230061,
                                                          "mem_230061") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230415,
                                                          "ext_mem_230415") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230416,
                                                          "ext_mem_230416") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230417,
                                                          "ext_mem_230417") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230418,
                                                          "ext_mem_230418") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230419,
                                                          "ext_mem_230419") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230420,
                                                          "ext_mem_230420") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230486,
                                                          "ext_mem_230486") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230487,
                                                          "ext_mem_230487") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229515,
                                                          "mem_param_229515") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229507,
                                                          "mem_param_229507") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231517,
                                                          "ext_mem_231517") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231518,
                                                          "ext_mem_231518") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229493,
                                                          "mem_param_229493") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229485,
                                                          "mem_param_229485") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229477,
                                                          "mem_param_229477") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231860,
                                                          "ext_mem_231860") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231861,
                                                          "ext_mem_231861") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231862,
                                                          "ext_mem_231862") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230551,
                                                          "mem_230551") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230534,
                                                          "mem_230534") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230517,
                                                          "mem_230517") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230500,
                                                          "mem_230500") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229531,
                                                          "mem_229531") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229526,
                                                          "mem_229526") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229520,
                                                          "mem_229520") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229469,
                                                          "mem_229469") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229465,
                                                          "mem_229465") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229460,
                                                          "ext_mem_229460") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229461,
                                                          "ext_mem_229461") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229411,
                                                          "ext_mem_229411") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229412,
                                                          "ext_mem_229412") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229362,
                                                          "ext_mem_229362") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229363,
                                                          "ext_mem_229363") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229264,
                                                          "ext_mem_229264") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229265,
                                                          "ext_mem_229265") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229206,
                                                          "mem_229206") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229200,
                                                          "mem_229200") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229196,
                                                          "ext_mem_229196") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229197,
                                                          "ext_mem_229197") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229164,
                                                          "mem_229164") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229161,
                                                          "mem_229161") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229157,
                                                          "mem_229157") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229155,
                                                          "mem_229155") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229152,
                                                          "mem_229152") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229148,
                                                          "mem_229148") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232249,
                                                          "mem_out_232249") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232248,
                                                          "mem_out_232248") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232247,
                                                          "mem_out_232247") !=
                                    0)
                                    return 1;
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device mem_230064;
                            
                            mem_230064.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_230064,
                                                      binop_y_229224,
                                                      "mem_230064")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (futrts_builtinzhgpu_map_transpose_i64(ctx,
                                                                      mem_230064,
                                                                      (int64_t) 0,
                                                                      ext_mem_229264,
                                                                      (int64_t) 0,
                                                                      (int64_t) 1,
                                                                      n_p_203492,
                                                                      partition_sizze_203577) !=
                                0) {
                                if (memblock_unref_device(ctx, &mem_230064,
                                                          "mem_230064") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230061,
                                                          "mem_230061") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230415,
                                                          "ext_mem_230415") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230416,
                                                          "ext_mem_230416") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230417,
                                                          "ext_mem_230417") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230418,
                                                          "ext_mem_230418") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230419,
                                                          "ext_mem_230419") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230420,
                                                          "ext_mem_230420") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230486,
                                                          "ext_mem_230486") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230487,
                                                          "ext_mem_230487") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229515,
                                                          "mem_param_229515") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229507,
                                                          "mem_param_229507") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231517,
                                                          "ext_mem_231517") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231518,
                                                          "ext_mem_231518") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229493,
                                                          "mem_param_229493") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229485,
                                                          "mem_param_229485") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229477,
                                                          "mem_param_229477") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231860,
                                                          "ext_mem_231860") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231861,
                                                          "ext_mem_231861") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231862,
                                                          "ext_mem_231862") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230551,
                                                          "mem_230551") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230534,
                                                          "mem_230534") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230517,
                                                          "mem_230517") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230500,
                                                          "mem_230500") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229531,
                                                          "mem_229531") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229526,
                                                          "mem_229526") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229520,
                                                          "mem_229520") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229469,
                                                          "mem_229469") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229465,
                                                          "mem_229465") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229460,
                                                          "ext_mem_229460") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229461,
                                                          "ext_mem_229461") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229411,
                                                          "ext_mem_229411") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229412,
                                                          "ext_mem_229412") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229362,
                                                          "ext_mem_229362") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229363,
                                                          "ext_mem_229363") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229264,
                                                          "ext_mem_229264") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229265,
                                                          "ext_mem_229265") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229206,
                                                          "mem_229206") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229200,
                                                          "mem_229200") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229196,
                                                          "ext_mem_229196") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229197,
                                                          "ext_mem_229197") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229164,
                                                          "mem_229164") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229161,
                                                          "mem_229161") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229157,
                                                          "mem_229157") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229155,
                                                          "mem_229155") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229152,
                                                          "mem_229152") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229148,
                                                          "mem_229148") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232249,
                                                          "mem_out_232249") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232248,
                                                          "mem_out_232248") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232247,
                                                          "mem_out_232247") !=
                                    0)
                                    return 1;
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device mem_230068;
                            
                            mem_230068.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_230068,
                                                      bytes_230067,
                                                      "mem_230068")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (futrts_builtinzhgpu_map_transpose_f64(ctx,
                                                                      mem_230068,
                                                                      (int64_t) 0,
                                                                      mem_229531,
                                                                      (int64_t) 0,
                                                                      (int64_t) 1,
                                                                      n_p_203492 *
                                                                      defunc_0_f_res_203631,
                                                                      partition_sizze_203577) !=
                                0) {
                                if (memblock_unref_device(ctx, &mem_230068,
                                                          "mem_230068") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230064,
                                                          "mem_230064") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230061,
                                                          "mem_230061") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230415,
                                                          "ext_mem_230415") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230416,
                                                          "ext_mem_230416") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230417,
                                                          "ext_mem_230417") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230418,
                                                          "ext_mem_230418") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230419,
                                                          "ext_mem_230419") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230420,
                                                          "ext_mem_230420") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230486,
                                                          "ext_mem_230486") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230487,
                                                          "ext_mem_230487") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229515,
                                                          "mem_param_229515") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229507,
                                                          "mem_param_229507") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231517,
                                                          "ext_mem_231517") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231518,
                                                          "ext_mem_231518") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229493,
                                                          "mem_param_229493") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229485,
                                                          "mem_param_229485") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229477,
                                                          "mem_param_229477") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231860,
                                                          "ext_mem_231860") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231861,
                                                          "ext_mem_231861") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231862,
                                                          "ext_mem_231862") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230551,
                                                          "mem_230551") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230534,
                                                          "mem_230534") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230517,
                                                          "mem_230517") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230500,
                                                          "mem_230500") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229531,
                                                          "mem_229531") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229526,
                                                          "mem_229526") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229520,
                                                          "mem_229520") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229469,
                                                          "mem_229469") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229465,
                                                          "mem_229465") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229460,
                                                          "ext_mem_229460") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229461,
                                                          "ext_mem_229461") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229411,
                                                          "ext_mem_229411") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229412,
                                                          "ext_mem_229412") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229362,
                                                          "ext_mem_229362") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229363,
                                                          "ext_mem_229363") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229264,
                                                          "ext_mem_229264") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229265,
                                                          "ext_mem_229265") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229206,
                                                          "mem_229206") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229200,
                                                          "mem_229200") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229196,
                                                          "ext_mem_229196") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229197,
                                                          "ext_mem_229197") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229164,
                                                          "mem_229164") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229161,
                                                          "mem_229161") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229157,
                                                          "mem_229157") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229155,
                                                          "mem_229155") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229152,
                                                          "mem_229152") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229148,
                                                          "mem_229148") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232249,
                                                          "mem_out_232249") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232248,
                                                          "mem_out_232248") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232247,
                                                          "mem_out_232247") !=
                                    0)
                                    return 1;
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device mem_230072;
                            
                            mem_230072.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_230072,
                                                      bytes_230060,
                                                      "mem_230072")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (futrts_builtinzhgpu_map_transpose_i64(ctx,
                                                                      mem_230072,
                                                                      (int64_t) 0,
                                                                      ext_mem_229363,
                                                                      (int64_t) 0,
                                                                      (int64_t) 1,
                                                                      n_p_203492 *
                                                                      s_n_m_203636,
                                                                      partition_sizze_203577) !=
                                0) {
                                if (memblock_unref_device(ctx, &mem_230072,
                                                          "mem_230072") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230068,
                                                          "mem_230068") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230064,
                                                          "mem_230064") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230061,
                                                          "mem_230061") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230415,
                                                          "ext_mem_230415") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230416,
                                                          "ext_mem_230416") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230417,
                                                          "ext_mem_230417") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230418,
                                                          "ext_mem_230418") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230419,
                                                          "ext_mem_230419") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230420,
                                                          "ext_mem_230420") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230486,
                                                          "ext_mem_230486") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230487,
                                                          "ext_mem_230487") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229515,
                                                          "mem_param_229515") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229507,
                                                          "mem_param_229507") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231517,
                                                          "ext_mem_231517") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231518,
                                                          "ext_mem_231518") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229493,
                                                          "mem_param_229493") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229485,
                                                          "mem_param_229485") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229477,
                                                          "mem_param_229477") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231860,
                                                          "ext_mem_231860") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231861,
                                                          "ext_mem_231861") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231862,
                                                          "ext_mem_231862") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230551,
                                                          "mem_230551") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230534,
                                                          "mem_230534") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230517,
                                                          "mem_230517") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230500,
                                                          "mem_230500") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229531,
                                                          "mem_229531") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229526,
                                                          "mem_229526") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229520,
                                                          "mem_229520") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229469,
                                                          "mem_229469") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229465,
                                                          "mem_229465") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229460,
                                                          "ext_mem_229460") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229461,
                                                          "ext_mem_229461") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229411,
                                                          "ext_mem_229411") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229412,
                                                          "ext_mem_229412") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229362,
                                                          "ext_mem_229362") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229363,
                                                          "ext_mem_229363") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229264,
                                                          "ext_mem_229264") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229265,
                                                          "ext_mem_229265") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229206,
                                                          "mem_229206") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229200,
                                                          "mem_229200") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229196,
                                                          "ext_mem_229196") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229197,
                                                          "ext_mem_229197") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229164,
                                                          "mem_229164") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229161,
                                                          "mem_229161") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229157,
                                                          "mem_229157") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229155,
                                                          "mem_229155") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229152,
                                                          "mem_229152") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229148,
                                                          "mem_229148") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232249,
                                                          "mem_out_232249") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232248,
                                                          "mem_out_232248") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232247,
                                                          "mem_out_232247") !=
                                    0)
                                    return 1;
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device mem_230076;
                            
                            mem_230076.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_230076,
                                                      bytes_230067,
                                                      "mem_230076")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (futrts_builtinzhgpu_map_transpose_f64(ctx,
                                                                      mem_230076,
                                                                      (int64_t) 0,
                                                                      mem_229526,
                                                                      (int64_t) 0,
                                                                      (int64_t) 1,
                                                                      n_p_203492 *
                                                                      defunc_0_f_res_203631,
                                                                      partition_sizze_203577) !=
                                0) {
                                if (memblock_unref_device(ctx, &mem_230076,
                                                          "mem_230076") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230072,
                                                          "mem_230072") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230068,
                                                          "mem_230068") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230064,
                                                          "mem_230064") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230061,
                                                          "mem_230061") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230415,
                                                          "ext_mem_230415") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230416,
                                                          "ext_mem_230416") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230417,
                                                          "ext_mem_230417") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230418,
                                                          "ext_mem_230418") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230419,
                                                          "ext_mem_230419") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230420,
                                                          "ext_mem_230420") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230486,
                                                          "ext_mem_230486") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230487,
                                                          "ext_mem_230487") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229515,
                                                          "mem_param_229515") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229507,
                                                          "mem_param_229507") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231517,
                                                          "ext_mem_231517") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231518,
                                                          "ext_mem_231518") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229493,
                                                          "mem_param_229493") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229485,
                                                          "mem_param_229485") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229477,
                                                          "mem_param_229477") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231860,
                                                          "ext_mem_231860") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231861,
                                                          "ext_mem_231861") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231862,
                                                          "ext_mem_231862") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230551,
                                                          "mem_230551") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230534,
                                                          "mem_230534") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230517,
                                                          "mem_230517") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230500,
                                                          "mem_230500") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229531,
                                                          "mem_229531") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229526,
                                                          "mem_229526") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229520,
                                                          "mem_229520") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229469,
                                                          "mem_229469") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229465,
                                                          "mem_229465") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229460,
                                                          "ext_mem_229460") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229461,
                                                          "ext_mem_229461") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229411,
                                                          "ext_mem_229411") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229412,
                                                          "ext_mem_229412") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229362,
                                                          "ext_mem_229362") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229363,
                                                          "ext_mem_229363") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229264,
                                                          "ext_mem_229264") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229265,
                                                          "ext_mem_229265") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229206,
                                                          "mem_229206") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229200,
                                                          "mem_229200") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229196,
                                                          "ext_mem_229196") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229197,
                                                          "ext_mem_229197") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229164,
                                                          "mem_229164") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229161,
                                                          "mem_229161") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229157,
                                                          "mem_229157") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229155,
                                                          "mem_229155") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229152,
                                                          "mem_229152") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229148,
                                                          "mem_229148") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232249,
                                                          "mem_out_232249") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232248,
                                                          "mem_out_232248") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232247,
                                                          "mem_out_232247") !=
                                    0)
                                    return 1;
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device mem_230080;
                            
                            mem_230080.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_230080,
                                                      bytes_230067,
                                                      "mem_230080")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (futrts_builtinzhgpu_map_transpose_i64(ctx,
                                                                      mem_230080,
                                                                      (int64_t) 0,
                                                                      ext_mem_229265,
                                                                      (int64_t) 0,
                                                                      (int64_t) 1,
                                                                      n_p_203492 *
                                                                      defunc_0_f_res_203631,
                                                                      partition_sizze_203577) !=
                                0) {
                                if (memblock_unref_device(ctx, &mem_230080,
                                                          "mem_230080") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230076,
                                                          "mem_230076") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230072,
                                                          "mem_230072") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230068,
                                                          "mem_230068") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230064,
                                                          "mem_230064") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230061,
                                                          "mem_230061") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230415,
                                                          "ext_mem_230415") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230416,
                                                          "ext_mem_230416") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230417,
                                                          "ext_mem_230417") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230418,
                                                          "ext_mem_230418") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230419,
                                                          "ext_mem_230419") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230420,
                                                          "ext_mem_230420") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230486,
                                                          "ext_mem_230486") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230487,
                                                          "ext_mem_230487") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229515,
                                                          "mem_param_229515") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229507,
                                                          "mem_param_229507") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231517,
                                                          "ext_mem_231517") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231518,
                                                          "ext_mem_231518") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229493,
                                                          "mem_param_229493") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229485,
                                                          "mem_param_229485") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229477,
                                                          "mem_param_229477") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231860,
                                                          "ext_mem_231860") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231861,
                                                          "ext_mem_231861") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231862,
                                                          "ext_mem_231862") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230551,
                                                          "mem_230551") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230534,
                                                          "mem_230534") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230517,
                                                          "mem_230517") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230500,
                                                          "mem_230500") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229531,
                                                          "mem_229531") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229526,
                                                          "mem_229526") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229520,
                                                          "mem_229520") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229469,
                                                          "mem_229469") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229465,
                                                          "mem_229465") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229460,
                                                          "ext_mem_229460") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229461,
                                                          "ext_mem_229461") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229411,
                                                          "ext_mem_229411") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229412,
                                                          "ext_mem_229412") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229362,
                                                          "ext_mem_229362") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229363,
                                                          "ext_mem_229363") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229264,
                                                          "ext_mem_229264") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229265,
                                                          "ext_mem_229265") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229206,
                                                          "mem_229206") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229200,
                                                          "mem_229200") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229196,
                                                          "ext_mem_229196") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229197,
                                                          "ext_mem_229197") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229164,
                                                          "mem_229164") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229161,
                                                          "mem_229161") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229157,
                                                          "mem_229157") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229155,
                                                          "mem_229155") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229152,
                                                          "mem_229152") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229148,
                                                          "mem_229148") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232249,
                                                          "mem_out_232249") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232248,
                                                          "mem_out_232248") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232247,
                                                          "mem_out_232247") !=
                                    0)
                                    return 1;
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device mem_230173;
                            
                            mem_230173.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_230173,
                                                      bytes_230060,
                                                      "mem_230173")) {
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device mem_230177;
                            
                            mem_230177.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_230177,
                                                      bytes_230060,
                                                      "mem_230177")) {
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device color_232004;
                            
                            color_232004.references = NULL;
                            if (memblock_alloc_device(ctx, &color_232004,
                                                      total_sizze_232132,
                                                      "color_232004")) {
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device color_232005;
                            
                            color_232005.references = NULL;
                            if (memblock_alloc_device(ctx, &color_232005,
                                                      total_sizze_232133,
                                                      "color_232005")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s\n", "\n# SegMap");
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_214470,
                                                                    1,
                                                                    sizeof(n_p_203492),
                                                                    &n_p_203492));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_214470,
                                                                    2,
                                                                    sizeof(q_s_203493),
                                                                    &q_s_203493));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_214470,
                                                                    3,
                                                                    sizeof(jump_s_203499),
                                                                    &jump_s_203499));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_214470,
                                                                    4,
                                                                    sizeof(partition_sizze_203577),
                                                                    &partition_sizze_203577));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_214470,
                                                                    5,
                                                                    sizeof(defunc_0_f_res_203631),
                                                                    &defunc_0_f_res_203631));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_214470,
                                                                    6,
                                                                    sizeof(pad_css_len_203632),
                                                                    &pad_css_len_203632));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_214470,
                                                                    7,
                                                                    sizeof(s_n_m_203636),
                                                                    &s_n_m_203636));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_214470,
                                                                    8,
                                                                    sizeof(num_groups_214465),
                                                                    &num_groups_214465));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_214470,
                                                                    9,
                                                                    sizeof(num_threads_232131),
                                                                    &num_threads_232131));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_214470,
                                                                    10,
                                                                    sizeof(mem_230061.mem),
                                                                    &mem_230061.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_214470,
                                                                    11,
                                                                    sizeof(mem_230064.mem),
                                                                    &mem_230064.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_214470,
                                                                    12,
                                                                    sizeof(mem_230068.mem),
                                                                    &mem_230068.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_214470,
                                                                    13,
                                                                    sizeof(mem_230072.mem),
                                                                    &mem_230072.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_214470,
                                                                    14,
                                                                    sizeof(mem_230076.mem),
                                                                    &mem_230076.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_214470,
                                                                    15,
                                                                    sizeof(mem_230080.mem),
                                                                    &mem_230080.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_214470,
                                                                    16,
                                                                    sizeof(mem_230173.mem),
                                                                    &mem_230173.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_214470,
                                                                    17,
                                                                    sizeof(mem_230177.mem),
                                                                    &mem_230177.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_214470,
                                                                    18,
                                                                    sizeof(color_232004.mem),
                                                                    &color_232004.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_214470,
                                                                    19,
                                                                    sizeof(color_232005.mem),
                                                                    &color_232005.mem));
                            if (1 * ((size_t) num_groups_214465 *
                                     (size_t) segmap_group_sizze_214464) != 0) {
                                const size_t global_work_sizze_237007[1] =
                                             {(size_t) num_groups_214465 *
                                             (size_t) segmap_group_sizze_214464};
                                const size_t local_work_sizze_237011[1] =
                                             {(size_t) segmap_group_sizze_214464};
                                int64_t time_start_237008 = 0, time_end_237009 =
                                        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_214470",
                                            global_work_sizze_237007[0],
                                            local_work_sizze_237011[0],
                                            (int) 0);
                                    time_start_237008 = get_wall_time();
                                }
                                OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                                ctx->mainzisegmap_214470,
                                                                                1,
                                                                                NULL,
                                                                                global_work_sizze_237007,
                                                                                local_work_sizze_237011,
                                                                                0,
                                                                                NULL,
                                                                                ctx->profiling_paused ||
                                                                                !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                          &ctx->mainzisegmap_214470_runs,
                                                                                                                          &ctx->mainzisegmap_214470_total_runtime)));
                                if (ctx->debugging) {
                                    OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                    time_end_237009 = get_wall_time();
                                    
                                    long time_diff_237010 = time_end_237009 -
                                         time_start_237008;
                                    
                                    fprintf(ctx->log,
                                            "kernel %s runtime: %ldus\n",
                                            "main.segmap_214470",
                                            time_diff_237010);
                                }
                            }
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s\n", "");
                            if (memblock_unref_device(ctx, &mem_230061,
                                                      "mem_230061") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230064,
                                                      "mem_230064") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230068,
                                                      "mem_230068") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230072,
                                                      "mem_230072") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230076,
                                                      "mem_230076") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230080,
                                                      "mem_230080") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &color_232004,
                                                      "color_232004") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &color_232005,
                                                      "color_232005") != 0)
                                return 1;
                            
                            struct memblock_device mem_230407;
                            
                            mem_230407.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_230407,
                                                      bytes_229297,
                                                      "mem_230407")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (futrts_builtinzhgpu_map_transpose_f64(ctx,
                                                                      mem_230407,
                                                                      (int64_t) 0,
                                                                      mem_230173,
                                                                      (int64_t) 0,
                                                                      (int64_t) 1,
                                                                      partition_sizze_203577,
                                                                      n_p_203492 *
                                                                      s_n_m_203636) !=
                                0) {
                                if (memblock_unref_device(ctx, &mem_230407,
                                                          "mem_230407") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &color_232005,
                                                          "color_232005") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &color_232004,
                                                          "color_232004") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230177,
                                                          "mem_230177") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230173,
                                                          "mem_230173") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230080,
                                                          "mem_230080") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230076,
                                                          "mem_230076") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230072,
                                                          "mem_230072") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230068,
                                                          "mem_230068") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230064,
                                                          "mem_230064") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230061,
                                                          "mem_230061") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230415,
                                                          "ext_mem_230415") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230416,
                                                          "ext_mem_230416") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230417,
                                                          "ext_mem_230417") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230418,
                                                          "ext_mem_230418") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230419,
                                                          "ext_mem_230419") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230420,
                                                          "ext_mem_230420") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230486,
                                                          "ext_mem_230486") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230487,
                                                          "ext_mem_230487") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229515,
                                                          "mem_param_229515") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229507,
                                                          "mem_param_229507") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231517,
                                                          "ext_mem_231517") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231518,
                                                          "ext_mem_231518") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229493,
                                                          "mem_param_229493") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229485,
                                                          "mem_param_229485") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229477,
                                                          "mem_param_229477") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231860,
                                                          "ext_mem_231860") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231861,
                                                          "ext_mem_231861") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231862,
                                                          "ext_mem_231862") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230551,
                                                          "mem_230551") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230534,
                                                          "mem_230534") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230517,
                                                          "mem_230517") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230500,
                                                          "mem_230500") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229531,
                                                          "mem_229531") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229526,
                                                          "mem_229526") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229520,
                                                          "mem_229520") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229469,
                                                          "mem_229469") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229465,
                                                          "mem_229465") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229460,
                                                          "ext_mem_229460") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229461,
                                                          "ext_mem_229461") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229411,
                                                          "ext_mem_229411") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229412,
                                                          "ext_mem_229412") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229362,
                                                          "ext_mem_229362") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229363,
                                                          "ext_mem_229363") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229264,
                                                          "ext_mem_229264") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229265,
                                                          "ext_mem_229265") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229206,
                                                          "mem_229206") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229200,
                                                          "mem_229200") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229196,
                                                          "ext_mem_229196") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229197,
                                                          "ext_mem_229197") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229164,
                                                          "mem_229164") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229161,
                                                          "mem_229161") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229157,
                                                          "mem_229157") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229155,
                                                          "mem_229155") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229152,
                                                          "mem_229152") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229148,
                                                          "mem_229148") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232249,
                                                          "mem_out_232249") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232248,
                                                          "mem_out_232248") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232247,
                                                          "mem_out_232247") !=
                                    0)
                                    return 1;
                                err = 1;
                                goto cleanup;
                            }
                            if (memblock_unref_device(ctx, &mem_230173,
                                                      "mem_230173") != 0)
                                return 1;
                            
                            struct memblock_device mem_230413;
                            
                            mem_230413.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_230413,
                                                      bytes_229297,
                                                      "mem_230413")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (futrts_builtinzhgpu_map_transpose_f64(ctx,
                                                                      mem_230413,
                                                                      (int64_t) 0,
                                                                      mem_230177,
                                                                      (int64_t) 0,
                                                                      (int64_t) 1,
                                                                      partition_sizze_203577,
                                                                      n_p_203492 *
                                                                      s_n_m_203636) !=
                                0) {
                                if (memblock_unref_device(ctx, &mem_230413,
                                                          "mem_230413") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230407,
                                                          "mem_230407") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &color_232005,
                                                          "color_232005") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &color_232004,
                                                          "color_232004") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230177,
                                                          "mem_230177") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230173,
                                                          "mem_230173") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230080,
                                                          "mem_230080") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230076,
                                                          "mem_230076") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230072,
                                                          "mem_230072") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230068,
                                                          "mem_230068") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230064,
                                                          "mem_230064") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230061,
                                                          "mem_230061") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230415,
                                                          "ext_mem_230415") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230416,
                                                          "ext_mem_230416") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230417,
                                                          "ext_mem_230417") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230418,
                                                          "ext_mem_230418") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230419,
                                                          "ext_mem_230419") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230420,
                                                          "ext_mem_230420") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230486,
                                                          "ext_mem_230486") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230487,
                                                          "ext_mem_230487") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229515,
                                                          "mem_param_229515") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229507,
                                                          "mem_param_229507") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231517,
                                                          "ext_mem_231517") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231518,
                                                          "ext_mem_231518") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229493,
                                                          "mem_param_229493") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229485,
                                                          "mem_param_229485") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229477,
                                                          "mem_param_229477") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231860,
                                                          "ext_mem_231860") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231861,
                                                          "ext_mem_231861") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231862,
                                                          "ext_mem_231862") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230551,
                                                          "mem_230551") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230534,
                                                          "mem_230534") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230517,
                                                          "mem_230517") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230500,
                                                          "mem_230500") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229531,
                                                          "mem_229531") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229526,
                                                          "mem_229526") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229520,
                                                          "mem_229520") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229469,
                                                          "mem_229469") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229465,
                                                          "mem_229465") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229460,
                                                          "ext_mem_229460") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229461,
                                                          "ext_mem_229461") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229411,
                                                          "ext_mem_229411") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229412,
                                                          "ext_mem_229412") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229362,
                                                          "ext_mem_229362") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229363,
                                                          "ext_mem_229363") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229264,
                                                          "ext_mem_229264") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229265,
                                                          "ext_mem_229265") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229206,
                                                          "mem_229206") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229200,
                                                          "mem_229200") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229196,
                                                          "ext_mem_229196") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229197,
                                                          "ext_mem_229197") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229164,
                                                          "mem_229164") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229161,
                                                          "mem_229161") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229157,
                                                          "mem_229157") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229155,
                                                          "mem_229155") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229152,
                                                          "mem_229152") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229148,
                                                          "mem_229148") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232249,
                                                          "mem_out_232249") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232248,
                                                          "mem_out_232248") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232247,
                                                          "mem_out_232247") !=
                                    0)
                                    return 1;
                                err = 1;
                                goto cleanup;
                            }
                            if (memblock_unref_device(ctx, &mem_230177,
                                                      "mem_230177") != 0)
                                return 1;
                            if (memblock_set_device(ctx, &ext_mem_230416,
                                                    &mem_230407,
                                                    "mem_230407") != 0)
                                return 1;
                            if (memblock_set_device(ctx, &ext_mem_230415,
                                                    &mem_230413,
                                                    "mem_230413") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230413,
                                                      "mem_230413") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230407,
                                                      "mem_230407") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &color_232005,
                                                      "color_232005") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &color_232004,
                                                      "color_232004") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230177,
                                                      "mem_230177") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230173,
                                                      "mem_230173") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230080,
                                                      "mem_230080") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230076,
                                                      "mem_230076") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230072,
                                                      "mem_230072") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230068,
                                                      "mem_230068") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230064,
                                                      "mem_230064") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230061,
                                                      "mem_230061") != 0)
                                return 1;
                        } else {
                            struct memblock_device ext_mem_230402;
                            
                            ext_mem_230402.references = NULL;
                            
                            struct memblock_device ext_mem_230401;
                            
                            ext_mem_230401.references = NULL;
                            
                            int32_t local_memory_capacity_233983;
                            
                            local_memory_capacity_233983 =
                                ctx->opencl.max_local_memory;
                            if (sle64((int64_t) 0,
                                      sext_i32_i64(local_memory_capacity_233983)) &&
                                suff_outer_par_216244) {
                                struct memblock_device mem_230181;
                                
                                mem_230181.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_230181,
                                                          bytes_230180,
                                                          "mem_230181")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                if (futrts_builtinzhgpu_map_transpose_i64(ctx,
                                                                          mem_230181,
                                                                          (int64_t) 0,
                                                                          ext_mem_229363,
                                                                          (int64_t) 0,
                                                                          (int64_t) 1,
                                                                          s_n_m_203636,
                                                                          partition_sizze_203577 *
                                                                          n_p_203492) !=
                                    0) {
                                    if (memblock_unref_device(ctx, &mem_230181,
                                                              "mem_230181") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230401,
                                                              "ext_mem_230401") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230402,
                                                              "ext_mem_230402") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230415,
                                                              "ext_mem_230415") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230416,
                                                              "ext_mem_230416") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230417,
                                                              "ext_mem_230417") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230418,
                                                              "ext_mem_230418") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230419,
                                                              "ext_mem_230419") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230420,
                                                              "ext_mem_230420") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230486,
                                                              "ext_mem_230486") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230487,
                                                              "ext_mem_230487") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229515,
                                                              "mem_param_229515") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229507,
                                                              "mem_param_229507") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231517,
                                                              "ext_mem_231517") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231518,
                                                              "ext_mem_231518") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229493,
                                                              "mem_param_229493") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229485,
                                                              "mem_param_229485") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229477,
                                                              "mem_param_229477") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231860,
                                                              "ext_mem_231860") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231861,
                                                              "ext_mem_231861") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231862,
                                                              "ext_mem_231862") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230551,
                                                              "mem_230551") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230534,
                                                              "mem_230534") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230517,
                                                              "mem_230517") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230500,
                                                              "mem_230500") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229531,
                                                              "mem_229531") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229526,
                                                              "mem_229526") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229520,
                                                              "mem_229520") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229469,
                                                              "mem_229469") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229465,
                                                              "mem_229465") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229460,
                                                              "ext_mem_229460") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229461,
                                                              "ext_mem_229461") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229411,
                                                              "ext_mem_229411") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229412,
                                                              "ext_mem_229412") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229362,
                                                              "ext_mem_229362") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229363,
                                                              "ext_mem_229363") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229264,
                                                              "ext_mem_229264") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229265,
                                                              "ext_mem_229265") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229206,
                                                              "mem_229206") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229200,
                                                              "mem_229200") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229196,
                                                              "ext_mem_229196") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229197,
                                                              "ext_mem_229197") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229164,
                                                              "mem_229164") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229161,
                                                              "mem_229161") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229157,
                                                              "mem_229157") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229155,
                                                              "mem_229155") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229152,
                                                              "mem_229152") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229148,
                                                              "mem_229148") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_out_232249,
                                                              "mem_out_232249") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_out_232248,
                                                              "mem_out_232248") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_out_232247,
                                                              "mem_out_232247") !=
                                        0)
                                        return 1;
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device mem_230185;
                                
                                mem_230185.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_230185,
                                                          bytes_230180,
                                                          "mem_230185")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                if (futrts_builtinzhgpu_map_transpose_f64(ctx,
                                                                          mem_230185,
                                                                          (int64_t) 0,
                                                                          ext_mem_229362,
                                                                          (int64_t) 0,
                                                                          (int64_t) 1,
                                                                          s_n_m_203636,
                                                                          partition_sizze_203577 *
                                                                          n_p_203492) !=
                                    0) {
                                    if (memblock_unref_device(ctx, &mem_230185,
                                                              "mem_230185") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230181,
                                                              "mem_230181") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230401,
                                                              "ext_mem_230401") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230402,
                                                              "ext_mem_230402") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230415,
                                                              "ext_mem_230415") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230416,
                                                              "ext_mem_230416") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230417,
                                                              "ext_mem_230417") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230418,
                                                              "ext_mem_230418") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230419,
                                                              "ext_mem_230419") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230420,
                                                              "ext_mem_230420") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230486,
                                                              "ext_mem_230486") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230487,
                                                              "ext_mem_230487") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229515,
                                                              "mem_param_229515") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229507,
                                                              "mem_param_229507") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231517,
                                                              "ext_mem_231517") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231518,
                                                              "ext_mem_231518") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229493,
                                                              "mem_param_229493") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229485,
                                                              "mem_param_229485") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229477,
                                                              "mem_param_229477") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231860,
                                                              "ext_mem_231860") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231861,
                                                              "ext_mem_231861") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231862,
                                                              "ext_mem_231862") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230551,
                                                              "mem_230551") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230534,
                                                              "mem_230534") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230517,
                                                              "mem_230517") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230500,
                                                              "mem_230500") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229531,
                                                              "mem_229531") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229526,
                                                              "mem_229526") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229520,
                                                              "mem_229520") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229469,
                                                              "mem_229469") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229465,
                                                              "mem_229465") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229460,
                                                              "ext_mem_229460") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229461,
                                                              "ext_mem_229461") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229411,
                                                              "ext_mem_229411") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229412,
                                                              "ext_mem_229412") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229362,
                                                              "ext_mem_229362") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229363,
                                                              "ext_mem_229363") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229264,
                                                              "ext_mem_229264") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229265,
                                                              "ext_mem_229265") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229206,
                                                              "mem_229206") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229200,
                                                              "mem_229200") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229196,
                                                              "ext_mem_229196") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229197,
                                                              "ext_mem_229197") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229164,
                                                              "mem_229164") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229161,
                                                              "mem_229161") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229157,
                                                              "mem_229157") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229155,
                                                              "mem_229155") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229152,
                                                              "mem_229152") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229148,
                                                              "mem_229148") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_out_232249,
                                                              "mem_out_232249") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_out_232248,
                                                              "mem_out_232248") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_out_232247,
                                                              "mem_out_232247") !=
                                        0)
                                        return 1;
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device mem_230189;
                                
                                mem_230189.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_230189,
                                                          bytes_230188,
                                                          "mem_230189")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                if (futrts_builtinzhgpu_map_transpose_i64(ctx,
                                                                          mem_230189,
                                                                          (int64_t) 0,
                                                                          ext_mem_229265,
                                                                          (int64_t) 0,
                                                                          (int64_t) 1,
                                                                          defunc_0_f_res_203631,
                                                                          partition_sizze_203577 *
                                                                          n_p_203492) !=
                                    0) {
                                    if (memblock_unref_device(ctx, &mem_230189,
                                                              "mem_230189") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230185,
                                                              "mem_230185") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230181,
                                                              "mem_230181") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230401,
                                                              "ext_mem_230401") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230402,
                                                              "ext_mem_230402") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230415,
                                                              "ext_mem_230415") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230416,
                                                              "ext_mem_230416") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230417,
                                                              "ext_mem_230417") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230418,
                                                              "ext_mem_230418") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230419,
                                                              "ext_mem_230419") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230420,
                                                              "ext_mem_230420") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230486,
                                                              "ext_mem_230486") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230487,
                                                              "ext_mem_230487") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229515,
                                                              "mem_param_229515") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229507,
                                                              "mem_param_229507") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231517,
                                                              "ext_mem_231517") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231518,
                                                              "ext_mem_231518") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229493,
                                                              "mem_param_229493") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229485,
                                                              "mem_param_229485") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229477,
                                                              "mem_param_229477") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231860,
                                                              "ext_mem_231860") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231861,
                                                              "ext_mem_231861") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231862,
                                                              "ext_mem_231862") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230551,
                                                              "mem_230551") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230534,
                                                              "mem_230534") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230517,
                                                              "mem_230517") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230500,
                                                              "mem_230500") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229531,
                                                              "mem_229531") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229526,
                                                              "mem_229526") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229520,
                                                              "mem_229520") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229469,
                                                              "mem_229469") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229465,
                                                              "mem_229465") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229460,
                                                              "ext_mem_229460") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229461,
                                                              "ext_mem_229461") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229411,
                                                              "ext_mem_229411") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229412,
                                                              "ext_mem_229412") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229362,
                                                              "ext_mem_229362") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229363,
                                                              "ext_mem_229363") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229264,
                                                              "ext_mem_229264") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229265,
                                                              "ext_mem_229265") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229206,
                                                              "mem_229206") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229200,
                                                              "mem_229200") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229196,
                                                              "ext_mem_229196") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229197,
                                                              "ext_mem_229197") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229164,
                                                              "mem_229164") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229161,
                                                              "mem_229161") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229157,
                                                              "mem_229157") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229155,
                                                              "mem_229155") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229152,
                                                              "mem_229152") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229148,
                                                              "mem_229148") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_out_232249,
                                                              "mem_out_232249") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_out_232248,
                                                              "mem_out_232248") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_out_232247,
                                                              "mem_out_232247") !=
                                        0)
                                        return 1;
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device mem_230193;
                                
                                mem_230193.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_230193,
                                                          bytes_230188,
                                                          "mem_230193")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                if (futrts_builtinzhgpu_map_transpose_f64(ctx,
                                                                          mem_230193,
                                                                          (int64_t) 0,
                                                                          mem_229531,
                                                                          (int64_t) 0,
                                                                          (int64_t) 1,
                                                                          defunc_0_f_res_203631,
                                                                          partition_sizze_203577 *
                                                                          n_p_203492) !=
                                    0) {
                                    if (memblock_unref_device(ctx, &mem_230193,
                                                              "mem_230193") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230189,
                                                              "mem_230189") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230185,
                                                              "mem_230185") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230181,
                                                              "mem_230181") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230401,
                                                              "ext_mem_230401") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230402,
                                                              "ext_mem_230402") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230415,
                                                              "ext_mem_230415") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230416,
                                                              "ext_mem_230416") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230417,
                                                              "ext_mem_230417") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230418,
                                                              "ext_mem_230418") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230419,
                                                              "ext_mem_230419") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230420,
                                                              "ext_mem_230420") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230486,
                                                              "ext_mem_230486") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230487,
                                                              "ext_mem_230487") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229515,
                                                              "mem_param_229515") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229507,
                                                              "mem_param_229507") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231517,
                                                              "ext_mem_231517") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231518,
                                                              "ext_mem_231518") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229493,
                                                              "mem_param_229493") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229485,
                                                              "mem_param_229485") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229477,
                                                              "mem_param_229477") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231860,
                                                              "ext_mem_231860") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231861,
                                                              "ext_mem_231861") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231862,
                                                              "ext_mem_231862") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230551,
                                                              "mem_230551") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230534,
                                                              "mem_230534") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230517,
                                                              "mem_230517") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230500,
                                                              "mem_230500") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229531,
                                                              "mem_229531") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229526,
                                                              "mem_229526") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229520,
                                                              "mem_229520") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229469,
                                                              "mem_229469") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229465,
                                                              "mem_229465") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229460,
                                                              "ext_mem_229460") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229461,
                                                              "ext_mem_229461") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229411,
                                                              "ext_mem_229411") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229412,
                                                              "ext_mem_229412") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229362,
                                                              "ext_mem_229362") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229363,
                                                              "ext_mem_229363") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229264,
                                                              "ext_mem_229264") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229265,
                                                              "ext_mem_229265") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229206,
                                                              "mem_229206") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229200,
                                                              "mem_229200") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229196,
                                                              "ext_mem_229196") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229197,
                                                              "ext_mem_229197") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229164,
                                                              "mem_229164") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229161,
                                                              "mem_229161") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229157,
                                                              "mem_229157") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229155,
                                                              "mem_229155") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229152,
                                                              "mem_229152") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229148,
                                                              "mem_229148") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_out_232249,
                                                              "mem_out_232249") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_out_232248,
                                                              "mem_out_232248") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_out_232247,
                                                              "mem_out_232247") !=
                                        0)
                                        return 1;
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device mem_230197;
                                
                                mem_230197.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_230197,
                                                          bytes_230188,
                                                          "mem_230197")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                if (futrts_builtinzhgpu_map_transpose_f64(ctx,
                                                                          mem_230197,
                                                                          (int64_t) 0,
                                                                          mem_229526,
                                                                          (int64_t) 0,
                                                                          (int64_t) 1,
                                                                          defunc_0_f_res_203631,
                                                                          partition_sizze_203577 *
                                                                          n_p_203492) !=
                                    0) {
                                    if (memblock_unref_device(ctx, &mem_230197,
                                                              "mem_230197") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230193,
                                                              "mem_230193") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230189,
                                                              "mem_230189") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230185,
                                                              "mem_230185") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230181,
                                                              "mem_230181") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230401,
                                                              "ext_mem_230401") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230402,
                                                              "ext_mem_230402") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230415,
                                                              "ext_mem_230415") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230416,
                                                              "ext_mem_230416") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230417,
                                                              "ext_mem_230417") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230418,
                                                              "ext_mem_230418") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230419,
                                                              "ext_mem_230419") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230420,
                                                              "ext_mem_230420") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230486,
                                                              "ext_mem_230486") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230487,
                                                              "ext_mem_230487") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229515,
                                                              "mem_param_229515") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229507,
                                                              "mem_param_229507") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231517,
                                                              "ext_mem_231517") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231518,
                                                              "ext_mem_231518") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229493,
                                                              "mem_param_229493") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229485,
                                                              "mem_param_229485") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229477,
                                                              "mem_param_229477") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231860,
                                                              "ext_mem_231860") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231861,
                                                              "ext_mem_231861") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231862,
                                                              "ext_mem_231862") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230551,
                                                              "mem_230551") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230534,
                                                              "mem_230534") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230517,
                                                              "mem_230517") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230500,
                                                              "mem_230500") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229531,
                                                              "mem_229531") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229526,
                                                              "mem_229526") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229520,
                                                              "mem_229520") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229469,
                                                              "mem_229469") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229465,
                                                              "mem_229465") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229460,
                                                              "ext_mem_229460") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229461,
                                                              "ext_mem_229461") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229411,
                                                              "ext_mem_229411") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229412,
                                                              "ext_mem_229412") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229362,
                                                              "ext_mem_229362") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229363,
                                                              "ext_mem_229363") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229264,
                                                              "ext_mem_229264") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229265,
                                                              "ext_mem_229265") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229206,
                                                              "mem_229206") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229200,
                                                              "mem_229200") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229196,
                                                              "ext_mem_229196") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229197,
                                                              "ext_mem_229197") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229164,
                                                              "mem_229164") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229161,
                                                              "mem_229161") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229157,
                                                              "mem_229157") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229155,
                                                              "mem_229155") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229152,
                                                              "mem_229152") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229148,
                                                              "mem_229148") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_out_232249,
                                                              "mem_out_232249") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_out_232248,
                                                              "mem_out_232248") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_out_232247,
                                                              "mem_out_232247") !=
                                        0)
                                        return 1;
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device mem_230232;
                                
                                mem_230232.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_230232,
                                                          bytes_230180,
                                                          "mem_230232")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device mem_230236;
                                
                                mem_230236.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_230236,
                                                          bytes_230180,
                                                          "mem_230236")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device color_232006;
                                
                                color_232006.references = NULL;
                                if (memblock_alloc_device(ctx, &color_232006,
                                                          total_sizze_232135,
                                                          "color_232006")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device color_232007;
                                
                                color_232007.references = NULL;
                                if (memblock_alloc_device(ctx, &color_232007,
                                                          total_sizze_232136,
                                                          "color_232007")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s\n", "\n# SegMap");
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_216262,
                                                                        1,
                                                                        sizeof(n_p_203492),
                                                                        &n_p_203492));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_216262,
                                                                        2,
                                                                        sizeof(q_s_203493),
                                                                        &q_s_203493));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_216262,
                                                                        3,
                                                                        sizeof(jump_s_203499),
                                                                        &jump_s_203499));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_216262,
                                                                        4,
                                                                        sizeof(partition_sizze_203577),
                                                                        &partition_sizze_203577));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_216262,
                                                                        5,
                                                                        sizeof(defunc_0_f_res_203631),
                                                                        &defunc_0_f_res_203631));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_216262,
                                                                        6,
                                                                        sizeof(pad_css_len_203632),
                                                                        &pad_css_len_203632));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_216262,
                                                                        7,
                                                                        sizeof(s_n_m_203636),
                                                                        &s_n_m_203636));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_216262,
                                                                        8,
                                                                        sizeof(num_groups_216240),
                                                                        &num_groups_216240));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_216262,
                                                                        9,
                                                                        sizeof(num_threads_232134),
                                                                        &num_threads_232134));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_216262,
                                                                        10,
                                                                        sizeof(ext_mem_229264.mem),
                                                                        &ext_mem_229264.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_216262,
                                                                        11,
                                                                        sizeof(mem_230181.mem),
                                                                        &mem_230181.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_216262,
                                                                        12,
                                                                        sizeof(mem_230185.mem),
                                                                        &mem_230185.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_216262,
                                                                        13,
                                                                        sizeof(mem_230189.mem),
                                                                        &mem_230189.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_216262,
                                                                        14,
                                                                        sizeof(mem_230193.mem),
                                                                        &mem_230193.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_216262,
                                                                        15,
                                                                        sizeof(mem_230197.mem),
                                                                        &mem_230197.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_216262,
                                                                        16,
                                                                        sizeof(mem_230232.mem),
                                                                        &mem_230232.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_216262,
                                                                        17,
                                                                        sizeof(mem_230236.mem),
                                                                        &mem_230236.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_216262,
                                                                        18,
                                                                        sizeof(color_232006.mem),
                                                                        &color_232006.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_216262,
                                                                        19,
                                                                        sizeof(color_232007.mem),
                                                                        &color_232007.mem));
                                if (1 * ((size_t) num_groups_216240 *
                                         (size_t) segmap_group_sizze_216239) !=
                                    0) {
                                    const size_t global_work_sizze_237012[1] =
                                                 {(size_t) num_groups_216240 *
                                                 (size_t) segmap_group_sizze_216239};
                                    const size_t local_work_sizze_237016[1] =
                                                 {(size_t) segmap_group_sizze_216239};
                                    int64_t time_start_237013 = 0,
                                            time_end_237014 = 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_216262",
                                                global_work_sizze_237012[0],
                                                local_work_sizze_237016[0],
                                                (int) 0);
                                        time_start_237013 = get_wall_time();
                                    }
                                    OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                                    ctx->mainzisegmap_216262,
                                                                                    1,
                                                                                    NULL,
                                                                                    global_work_sizze_237012,
                                                                                    local_work_sizze_237016,
                                                                                    0,
                                                                                    NULL,
                                                                                    ctx->profiling_paused ||
                                                                                    !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                              &ctx->mainzisegmap_216262_runs,
                                                                                                                              &ctx->mainzisegmap_216262_total_runtime)));
                                    if (ctx->debugging) {
                                        OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                        time_end_237014 = get_wall_time();
                                        
                                        long time_diff_237015 =
                                             time_end_237014 -
                                             time_start_237013;
                                        
                                        fprintf(ctx->log,
                                                "kernel %s runtime: %ldus\n",
                                                "main.segmap_216262",
                                                time_diff_237015);
                                    }
                                }
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s\n", "");
                                if (memblock_unref_device(ctx, &mem_230181,
                                                          "mem_230181") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230185,
                                                          "mem_230185") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230189,
                                                          "mem_230189") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230193,
                                                          "mem_230193") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230197,
                                                          "mem_230197") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &color_232006,
                                                          "color_232006") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &color_232007,
                                                          "color_232007") != 0)
                                    return 1;
                                
                                struct memblock_device mem_230393;
                                
                                mem_230393.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_230393,
                                                          bytes_229297,
                                                          "mem_230393")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                if (futrts_builtinzhgpu_map_transpose_f64(ctx,
                                                                          mem_230393,
                                                                          (int64_t) 0,
                                                                          mem_230232,
                                                                          (int64_t) 0,
                                                                          (int64_t) 1,
                                                                          partition_sizze_203577 *
                                                                          n_p_203492,
                                                                          s_n_m_203636) !=
                                    0) {
                                    if (memblock_unref_device(ctx, &mem_230393,
                                                              "mem_230393") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &color_232007,
                                                              "color_232007") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &color_232006,
                                                              "color_232006") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230236,
                                                              "mem_230236") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230232,
                                                              "mem_230232") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230197,
                                                              "mem_230197") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230193,
                                                              "mem_230193") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230189,
                                                              "mem_230189") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230185,
                                                              "mem_230185") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230181,
                                                              "mem_230181") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230401,
                                                              "ext_mem_230401") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230402,
                                                              "ext_mem_230402") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230415,
                                                              "ext_mem_230415") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230416,
                                                              "ext_mem_230416") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230417,
                                                              "ext_mem_230417") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230418,
                                                              "ext_mem_230418") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230419,
                                                              "ext_mem_230419") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230420,
                                                              "ext_mem_230420") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230486,
                                                              "ext_mem_230486") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230487,
                                                              "ext_mem_230487") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229515,
                                                              "mem_param_229515") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229507,
                                                              "mem_param_229507") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231517,
                                                              "ext_mem_231517") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231518,
                                                              "ext_mem_231518") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229493,
                                                              "mem_param_229493") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229485,
                                                              "mem_param_229485") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229477,
                                                              "mem_param_229477") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231860,
                                                              "ext_mem_231860") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231861,
                                                              "ext_mem_231861") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231862,
                                                              "ext_mem_231862") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230551,
                                                              "mem_230551") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230534,
                                                              "mem_230534") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230517,
                                                              "mem_230517") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230500,
                                                              "mem_230500") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229531,
                                                              "mem_229531") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229526,
                                                              "mem_229526") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229520,
                                                              "mem_229520") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229469,
                                                              "mem_229469") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229465,
                                                              "mem_229465") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229460,
                                                              "ext_mem_229460") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229461,
                                                              "ext_mem_229461") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229411,
                                                              "ext_mem_229411") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229412,
                                                              "ext_mem_229412") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229362,
                                                              "ext_mem_229362") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229363,
                                                              "ext_mem_229363") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229264,
                                                              "ext_mem_229264") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229265,
                                                              "ext_mem_229265") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229206,
                                                              "mem_229206") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229200,
                                                              "mem_229200") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229196,
                                                              "ext_mem_229196") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229197,
                                                              "ext_mem_229197") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229164,
                                                              "mem_229164") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229161,
                                                              "mem_229161") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229157,
                                                              "mem_229157") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229155,
                                                              "mem_229155") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229152,
                                                              "mem_229152") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229148,
                                                              "mem_229148") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_out_232249,
                                                              "mem_out_232249") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_out_232248,
                                                              "mem_out_232248") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_out_232247,
                                                              "mem_out_232247") !=
                                        0)
                                        return 1;
                                    err = 1;
                                    goto cleanup;
                                }
                                if (memblock_unref_device(ctx, &mem_230232,
                                                          "mem_230232") != 0)
                                    return 1;
                                
                                struct memblock_device mem_230399;
                                
                                mem_230399.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_230399,
                                                          bytes_229297,
                                                          "mem_230399")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                if (futrts_builtinzhgpu_map_transpose_f64(ctx,
                                                                          mem_230399,
                                                                          (int64_t) 0,
                                                                          mem_230236,
                                                                          (int64_t) 0,
                                                                          (int64_t) 1,
                                                                          partition_sizze_203577 *
                                                                          n_p_203492,
                                                                          s_n_m_203636) !=
                                    0) {
                                    if (memblock_unref_device(ctx, &mem_230399,
                                                              "mem_230399") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230393,
                                                              "mem_230393") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &color_232007,
                                                              "color_232007") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &color_232006,
                                                              "color_232006") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230236,
                                                              "mem_230236") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230232,
                                                              "mem_230232") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230197,
                                                              "mem_230197") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230193,
                                                              "mem_230193") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230189,
                                                              "mem_230189") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230185,
                                                              "mem_230185") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230181,
                                                              "mem_230181") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230401,
                                                              "ext_mem_230401") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230402,
                                                              "ext_mem_230402") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230415,
                                                              "ext_mem_230415") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230416,
                                                              "ext_mem_230416") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230417,
                                                              "ext_mem_230417") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230418,
                                                              "ext_mem_230418") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230419,
                                                              "ext_mem_230419") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230420,
                                                              "ext_mem_230420") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230486,
                                                              "ext_mem_230486") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230487,
                                                              "ext_mem_230487") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229515,
                                                              "mem_param_229515") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229507,
                                                              "mem_param_229507") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231517,
                                                              "ext_mem_231517") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231518,
                                                              "ext_mem_231518") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229493,
                                                              "mem_param_229493") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229485,
                                                              "mem_param_229485") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_param_229477,
                                                              "mem_param_229477") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231860,
                                                              "ext_mem_231860") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231861,
                                                              "ext_mem_231861") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_231862,
                                                              "ext_mem_231862") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230551,
                                                              "mem_230551") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230534,
                                                              "mem_230534") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230517,
                                                              "mem_230517") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230500,
                                                              "mem_230500") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229531,
                                                              "mem_229531") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229526,
                                                              "mem_229526") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229520,
                                                              "mem_229520") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229469,
                                                              "mem_229469") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229465,
                                                              "mem_229465") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229460,
                                                              "ext_mem_229460") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229461,
                                                              "ext_mem_229461") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229411,
                                                              "ext_mem_229411") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229412,
                                                              "ext_mem_229412") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229362,
                                                              "ext_mem_229362") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229363,
                                                              "ext_mem_229363") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229264,
                                                              "ext_mem_229264") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229265,
                                                              "ext_mem_229265") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229206,
                                                              "mem_229206") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229200,
                                                              "mem_229200") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229196,
                                                              "ext_mem_229196") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_229197,
                                                              "ext_mem_229197") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229164,
                                                              "mem_229164") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229161,
                                                              "mem_229161") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229157,
                                                              "mem_229157") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229155,
                                                              "mem_229155") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229152,
                                                              "mem_229152") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_229148,
                                                              "mem_229148") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_out_232249,
                                                              "mem_out_232249") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_out_232248,
                                                              "mem_out_232248") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &mem_out_232247,
                                                              "mem_out_232247") !=
                                        0)
                                        return 1;
                                    err = 1;
                                    goto cleanup;
                                }
                                if (memblock_unref_device(ctx, &mem_230236,
                                                          "mem_230236") != 0)
                                    return 1;
                                if (memblock_set_device(ctx, &ext_mem_230402,
                                                        &mem_230393,
                                                        "mem_230393") != 0)
                                    return 1;
                                if (memblock_set_device(ctx, &ext_mem_230401,
                                                        &mem_230399,
                                                        "mem_230399") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230399,
                                                          "mem_230399") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230393,
                                                          "mem_230393") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &color_232007,
                                                          "color_232007") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &color_232006,
                                                          "color_232006") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230236,
                                                          "mem_230236") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230232,
                                                          "mem_230232") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230197,
                                                          "mem_230197") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230193,
                                                          "mem_230193") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230189,
                                                          "mem_230189") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230185,
                                                          "mem_230185") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230181,
                                                          "mem_230181") != 0)
                                    return 1;
                            } else {
                                struct memblock_device ext_mem_230388;
                                
                                ext_mem_230388.references = NULL;
                                
                                struct memblock_device ext_mem_230387;
                                
                                ext_mem_230387.references = NULL;
                                
                                int32_t local_memory_capacity_233982;
                                
                                local_memory_capacity_233982 =
                                    ctx->opencl.max_local_memory;
                                if (sle64(bytes_229311 + srem64((int64_t) 8 -
                                                                srem64(bytes_229311,
                                                                       (int64_t) 8),
                                                                (int64_t) 8) +
                                          (bytes_229311 + srem64((int64_t) 8 -
                                                                 srem64(bytes_229311,
                                                                        (int64_t) 8),
                                                                 (int64_t) 8)) +
                                          (bytes_229311 + srem64((int64_t) 8 -
                                                                 srem64(bytes_229311,
                                                                        (int64_t) 8),
                                                                 (int64_t) 8)) +
                                          (bytes_229311 + srem64((int64_t) 8 -
                                                                 srem64(bytes_229311,
                                                                        (int64_t) 8),
                                                                 (int64_t) 8)) +
                                          (bytes_229311 + srem64((int64_t) 8 -
                                                                 srem64(bytes_229311,
                                                                        (int64_t) 8),
                                                                 (int64_t) 8)) +
                                          (bytes_229311 + srem64((int64_t) 8 -
                                                                 srem64(bytes_229311,
                                                                        (int64_t) 8),
                                                                 (int64_t) 8)) +
                                          (bytes_229311 + srem64((int64_t) 8 -
                                                                 srem64(bytes_229311,
                                                                        (int64_t) 8),
                                                                 (int64_t) 8)) +
                                          (bytes_229311 + srem64((int64_t) 8 -
                                                                 srem64(bytes_229311,
                                                                        (int64_t) 8),
                                                                 (int64_t) 8)) +
                                          (bytes_229311 + srem64((int64_t) 8 -
                                                                 srem64(bytes_229311,
                                                                        (int64_t) 8),
                                                                 (int64_t) 8)) +
                                          (bytes_229311 + srem64((int64_t) 8 -
                                                                 srem64(bytes_229311,
                                                                        (int64_t) 8),
                                                                 (int64_t) 8)) +
                                          (bytes_229311 + srem64((int64_t) 8 -
                                                                 srem64(bytes_229311,
                                                                        (int64_t) 8),
                                                                 (int64_t) 8)) +
                                          (bytes_230242 + srem64((int64_t) 8 -
                                                                 srem64(bytes_230242,
                                                                        (int64_t) 8),
                                                                 (int64_t) 8)) +
                                          ((int64_t) 8 * (s_n_m_203636 *
                                                          q_s_203493) +
                                           srem64((int64_t) 8 -
                                                  srem64((int64_t) 8 *
                                                         (s_n_m_203636 *
                                                          q_s_203493),
                                                         (int64_t) 8),
                                                  (int64_t) 8)) + ((int64_t) 8 *
                                                                   (s_n_m_203636 *
                                                                    q_s_203493) +
                                                                   srem64((int64_t) 8 -
                                                                          srem64((int64_t) 8 *
                                                                                 (s_n_m_203636 *
                                                                                  q_s_203493),
                                                                                 (int64_t) 8),
                                                                          (int64_t) 8)) +
                                          ((int64_t) 8 * (s_n_m_203636 *
                                                          q_s_203493) +
                                           srem64((int64_t) 8 -
                                                  srem64((int64_t) 8 *
                                                         (s_n_m_203636 *
                                                          q_s_203493),
                                                         (int64_t) 8),
                                                  (int64_t) 8)) + ((int64_t) 8 *
                                                                   (s_n_m_203636 *
                                                                    q_s_203493) +
                                                                   srem64((int64_t) 8 -
                                                                          srem64((int64_t) 8 *
                                                                                 (s_n_m_203636 *
                                                                                  q_s_203493),
                                                                                 (int64_t) 8),
                                                                          (int64_t) 8)) +
                                          ((int64_t) 8 * (s_n_m_203636 *
                                                          q_s_203493) +
                                           srem64((int64_t) 8 -
                                                  srem64((int64_t) 8 *
                                                         (s_n_m_203636 *
                                                          q_s_203493),
                                                         (int64_t) 8),
                                                  (int64_t) 8)) + ((int64_t) 8 *
                                                                   (s_n_m_203636 *
                                                                    q_s_203493) +
                                                                   srem64((int64_t) 8 -
                                                                          srem64((int64_t) 8 *
                                                                                 (s_n_m_203636 *
                                                                                  q_s_203493),
                                                                                 (int64_t) 8),
                                                                          (int64_t) 8)) +
                                          ((int64_t) 8 * (s_n_m_203636 *
                                                          q_s_203493) +
                                           srem64((int64_t) 8 -
                                                  srem64((int64_t) 8 *
                                                         (s_n_m_203636 *
                                                          q_s_203493),
                                                         (int64_t) 8),
                                                  (int64_t) 8)),
                                          sext_i32_i64(local_memory_capacity_233982)) &&
                                    intra_suff_and_fits_216255) {
                                    struct memblock_device mem_230290;
                                    
                                    mem_230290.references = NULL;
                                    if (memblock_alloc_device(ctx, &mem_230290,
                                                              bytes_229297,
                                                              "mem_230290")) {
                                        err = 1;
                                        goto cleanup;
                                    }
                                    
                                    struct memblock_device mem_230295;
                                    
                                    mem_230295.references = NULL;
                                    if (memblock_alloc_device(ctx, &mem_230295,
                                                              bytes_229297,
                                                              "mem_230295")) {
                                        err = 1;
                                        goto cleanup;
                                    }
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s\n", "\n# SegMap");
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_216411,
                                                                            1,
                                                                            (size_t) ((int64_t) 8 *
                                                                                      (s_n_m_203636 *
                                                                                       q_s_203493)),
                                                                            NULL));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_216411,
                                                                            2,
                                                                            (size_t) ((int64_t) 8 *
                                                                                      (s_n_m_203636 *
                                                                                       q_s_203493)),
                                                                            NULL));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_216411,
                                                                            3,
                                                                            (size_t) ((int64_t) 8 *
                                                                                      (s_n_m_203636 *
                                                                                       q_s_203493)),
                                                                            NULL));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_216411,
                                                                            4,
                                                                            (size_t) ((int64_t) 8 *
                                                                                      (s_n_m_203636 *
                                                                                       q_s_203493)),
                                                                            NULL));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_216411,
                                                                            5,
                                                                            (size_t) ((int64_t) 8 *
                                                                                      (s_n_m_203636 *
                                                                                       q_s_203493)),
                                                                            NULL));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_216411,
                                                                            6,
                                                                            (size_t) ((int64_t) 8 *
                                                                                      (s_n_m_203636 *
                                                                                       q_s_203493)),
                                                                            NULL));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_216411,
                                                                            7,
                                                                            (size_t) ((int64_t) 8 *
                                                                                      (s_n_m_203636 *
                                                                                       q_s_203493)),
                                                                            NULL));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_216411,
                                                                            8,
                                                                            (size_t) bytes_230242,
                                                                            NULL));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_216411,
                                                                            9,
                                                                            (size_t) bytes_229311,
                                                                            NULL));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_216411,
                                                                            10,
                                                                            (size_t) bytes_229311,
                                                                            NULL));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_216411,
                                                                            11,
                                                                            (size_t) bytes_229311,
                                                                            NULL));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_216411,
                                                                            12,
                                                                            (size_t) bytes_229311,
                                                                            NULL));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_216411,
                                                                            13,
                                                                            (size_t) bytes_229311,
                                                                            NULL));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_216411,
                                                                            14,
                                                                            (size_t) bytes_229311,
                                                                            NULL));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_216411,
                                                                            15,
                                                                            (size_t) bytes_229311,
                                                                            NULL));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_216411,
                                                                            16,
                                                                            (size_t) bytes_229311,
                                                                            NULL));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_216411,
                                                                            17,
                                                                            (size_t) bytes_229311,
                                                                            NULL));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_216411,
                                                                            18,
                                                                            (size_t) bytes_229311,
                                                                            NULL));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_216411,
                                                                            19,
                                                                            (size_t) bytes_229311,
                                                                            NULL));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_216411,
                                                                            20,
                                                                            sizeof(n_p_203492),
                                                                            &n_p_203492));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_216411,
                                                                            21,
                                                                            sizeof(q_s_203493),
                                                                            &q_s_203493));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_216411,
                                                                            22,
                                                                            sizeof(jump_s_203499),
                                                                            &jump_s_203499));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_216411,
                                                                            23,
                                                                            sizeof(partition_sizze_203577),
                                                                            &partition_sizze_203577));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_216411,
                                                                            24,
                                                                            sizeof(defunc_0_f_res_203631),
                                                                            &defunc_0_f_res_203631));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_216411,
                                                                            25,
                                                                            sizeof(pad_css_len_203632),
                                                                            &pad_css_len_203632));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_216411,
                                                                            26,
                                                                            sizeof(s_n_m_203636),
                                                                            &s_n_m_203636));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_216411,
                                                                            27,
                                                                            sizeof(computed_group_sizze_216248),
                                                                            &computed_group_sizze_216248));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_216411,
                                                                            28,
                                                                            sizeof(ext_mem_229264.mem),
                                                                            &ext_mem_229264.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_216411,
                                                                            29,
                                                                            sizeof(ext_mem_229265.mem),
                                                                            &ext_mem_229265.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_216411,
                                                                            30,
                                                                            sizeof(ext_mem_229362.mem),
                                                                            &ext_mem_229362.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_216411,
                                                                            31,
                                                                            sizeof(ext_mem_229363.mem),
                                                                            &ext_mem_229363.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_216411,
                                                                            32,
                                                                            sizeof(mem_229526.mem),
                                                                            &mem_229526.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_216411,
                                                                            33,
                                                                            sizeof(mem_229531.mem),
                                                                            &mem_229531.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_216411,
                                                                            34,
                                                                            sizeof(mem_230290.mem),
                                                                            &mem_230290.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_216411,
                                                                            35,
                                                                            sizeof(mem_230295.mem),
                                                                            &mem_230295.mem));
                                    if (1 * ((size_t) binop_x_229202 *
                                             (size_t) computed_group_sizze_216248) !=
                                        0) {
                                        const size_t global_work_sizze_237017[1]
                                                     =
                                                     {(size_t) binop_x_229202 *
                                                     (size_t) computed_group_sizze_216248};
                                        const size_t local_work_sizze_237021[1]
                                                     =
                                                     {(size_t) computed_group_sizze_216248};
                                        int64_t time_start_237018 = 0,
                                                time_end_237019 = 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_216411",
                                                    global_work_sizze_237017[0],
                                                    local_work_sizze_237021[0],
                                                    (int) (0 + (int64_t) 8 *
                                                           (s_n_m_203636 *
                                                            q_s_203493) +
                                                           (int64_t) 8 *
                                                           (s_n_m_203636 *
                                                            q_s_203493) +
                                                           (int64_t) 8 *
                                                           (s_n_m_203636 *
                                                            q_s_203493) +
                                                           (int64_t) 8 *
                                                           (s_n_m_203636 *
                                                            q_s_203493) +
                                                           (int64_t) 8 *
                                                           (s_n_m_203636 *
                                                            q_s_203493) +
                                                           (int64_t) 8 *
                                                           (s_n_m_203636 *
                                                            q_s_203493) +
                                                           (int64_t) 8 *
                                                           (s_n_m_203636 *
                                                            q_s_203493) +
                                                           bytes_230242 +
                                                           bytes_229311 +
                                                           bytes_229311 +
                                                           bytes_229311 +
                                                           bytes_229311 +
                                                           bytes_229311 +
                                                           bytes_229311 +
                                                           bytes_229311 +
                                                           bytes_229311 +
                                                           bytes_229311 +
                                                           bytes_229311 +
                                                           bytes_229311));
                                            time_start_237018 = get_wall_time();
                                        }
                                        OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                                        ctx->mainzisegmap_intragroup_216411,
                                                                                        1,
                                                                                        NULL,
                                                                                        global_work_sizze_237017,
                                                                                        local_work_sizze_237021,
                                                                                        0,
                                                                                        NULL,
                                                                                        ctx->profiling_paused ||
                                                                                        !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                                  &ctx->mainzisegmap_intragroup_216411_runs,
                                                                                                                                  &ctx->mainzisegmap_intragroup_216411_total_runtime)));
                                        if (ctx->debugging) {
                                            OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                            time_end_237019 = get_wall_time();
                                            
                                            long time_diff_237020 =
                                                 time_end_237019 -
                                                 time_start_237018;
                                            
                                            fprintf(ctx->log,
                                                    "kernel %s runtime: %ldus\n",
                                                    "main.segmap_intragroup_216411",
                                                    time_diff_237020);
                                        }
                                    }
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s\n", "");
                                    if (memblock_set_device(ctx,
                                                            &ext_mem_230388,
                                                            &mem_230290,
                                                            "mem_230290") != 0)
                                        return 1;
                                    if (memblock_set_device(ctx,
                                                            &ext_mem_230387,
                                                            &mem_230295,
                                                            "mem_230295") != 0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230295,
                                                              "mem_230295") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx, &mem_230290,
                                                              "mem_230290") !=
                                        0)
                                        return 1;
                                } else {
                                    int64_t segmap_usable_groups_216595 =
                                            sdiv_up64(nest_sizze_208848,
                                                      segmap_group_sizze_216594);
                                    struct memblock_device ext_mem_230386;
                                    
                                    ext_mem_230386.references = NULL;
                                    
                                    struct memblock_device ext_mem_230385;
                                    
                                    ext_mem_230385.references = NULL;
                                    
                                    int32_t local_memory_capacity_233981;
                                    
                                    local_memory_capacity_233981 =
                                        ctx->opencl.max_local_memory;
                                    if (sle64((int64_t) 0,
                                              sext_i32_i64(local_memory_capacity_233981)) &&
                                        suff_outer_par_216599) {
                                        struct memblock_device mem_230301;
                                        
                                        mem_230301.references = NULL;
                                        if (memblock_alloc_device(ctx,
                                                                  &mem_230301,
                                                                  bytes_229297,
                                                                  "mem_230301")) {
                                            err = 1;
                                            goto cleanup;
                                        }
                                        
                                        struct memblock_device mem_230306;
                                        
                                        mem_230306.references = NULL;
                                        if (memblock_alloc_device(ctx,
                                                                  &mem_230306,
                                                                  bytes_229297,
                                                                  "mem_230306")) {
                                            err = 1;
                                            goto cleanup;
                                        }
                                        if (ctx->debugging)
                                            fprintf(ctx->log, "%s\n",
                                                    "\n# SegMap");
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_216607,
                                                                                1,
                                                                                sizeof(n_p_203492),
                                                                                &n_p_203492));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_216607,
                                                                                2,
                                                                                sizeof(q_s_203493),
                                                                                &q_s_203493));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_216607,
                                                                                3,
                                                                                sizeof(jump_s_203499),
                                                                                &jump_s_203499));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_216607,
                                                                                4,
                                                                                sizeof(partition_sizze_203577),
                                                                                &partition_sizze_203577));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_216607,
                                                                                5,
                                                                                sizeof(defunc_0_f_res_203631),
                                                                                &defunc_0_f_res_203631));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_216607,
                                                                                6,
                                                                                sizeof(pad_css_len_203632),
                                                                                &pad_css_len_203632));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_216607,
                                                                                7,
                                                                                sizeof(s_n_m_203636),
                                                                                &s_n_m_203636));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_216607,
                                                                                8,
                                                                                sizeof(ext_mem_229264.mem),
                                                                                &ext_mem_229264.mem));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_216607,
                                                                                9,
                                                                                sizeof(ext_mem_229265.mem),
                                                                                &ext_mem_229265.mem));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_216607,
                                                                                10,
                                                                                sizeof(ext_mem_229362.mem),
                                                                                &ext_mem_229362.mem));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_216607,
                                                                                11,
                                                                                sizeof(ext_mem_229363.mem),
                                                                                &ext_mem_229363.mem));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_216607,
                                                                                12,
                                                                                sizeof(mem_229526.mem),
                                                                                &mem_229526.mem));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_216607,
                                                                                13,
                                                                                sizeof(mem_229531.mem),
                                                                                &mem_229531.mem));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_216607,
                                                                                14,
                                                                                sizeof(mem_230301.mem),
                                                                                &mem_230301.mem));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_216607,
                                                                                15,
                                                                                sizeof(mem_230306.mem),
                                                                                &mem_230306.mem));
                                        if (1 *
                                            ((size_t) segmap_usable_groups_216595 *
                                             (size_t) segmap_group_sizze_216594) !=
                                            0) {
                                            const size_t
                                            global_work_sizze_237022[1] =
                                            {(size_t) segmap_usable_groups_216595 *
                                            (size_t) segmap_group_sizze_216594};
                                            const size_t
                                            local_work_sizze_237026[1] =
                                            {(size_t) segmap_group_sizze_216594};
                                            int64_t time_start_237023 = 0,
                                                    time_end_237024 = 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_216607",
                                                        global_work_sizze_237022[0],
                                                        local_work_sizze_237026[0],
                                                        (int) 0);
                                                time_start_237023 =
                                                    get_wall_time();
                                            }
                                            OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                                            ctx->mainzisegmap_216607,
                                                                                            1,
                                                                                            NULL,
                                                                                            global_work_sizze_237022,
                                                                                            local_work_sizze_237026,
                                                                                            0,
                                                                                            NULL,
                                                                                            ctx->profiling_paused ||
                                                                                            !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                                      &ctx->mainzisegmap_216607_runs,
                                                                                                                                      &ctx->mainzisegmap_216607_total_runtime)));
                                            if (ctx->debugging) {
                                                OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                                time_end_237024 =
                                                    get_wall_time();
                                                
                                                long time_diff_237025 =
                                                     time_end_237024 -
                                                     time_start_237023;
                                                
                                                fprintf(ctx->log,
                                                        "kernel %s runtime: %ldus\n",
                                                        "main.segmap_216607",
                                                        time_diff_237025);
                                            }
                                        }
                                        if (ctx->debugging)
                                            fprintf(ctx->log, "%s\n", "");
                                        if (memblock_set_device(ctx,
                                                                &ext_mem_230386,
                                                                &mem_230301,
                                                                "mem_230301") !=
                                            0)
                                            return 1;
                                        if (memblock_set_device(ctx,
                                                                &ext_mem_230385,
                                                                &mem_230306,
                                                                "mem_230306") !=
                                            0)
                                            return 1;
                                        if (memblock_unref_device(ctx,
                                                                  &mem_230306,
                                                                  "mem_230306") !=
                                            0)
                                            return 1;
                                        if (memblock_unref_device(ctx,
                                                                  &mem_230301,
                                                                  "mem_230301") !=
                                            0)
                                            return 1;
                                    } else {
                                        int64_t segmap_usable_groups_216750 =
                                                sdiv_up64(nest_sizze_208848,
                                                          segmap_group_sizze_216749);
                                        struct memblock_device mem_230312;
                                        
                                        mem_230312.references = NULL;
                                        if (memblock_alloc_device(ctx,
                                                                  &mem_230312,
                                                                  bytes_229297,
                                                                  "mem_230312")) {
                                            err = 1;
                                            goto cleanup;
                                        }
                                        
                                        struct memblock_device mem_230316;
                                        
                                        mem_230316.references = NULL;
                                        if (memblock_alloc_device(ctx,
                                                                  &mem_230316,
                                                                  bytes_230315,
                                                                  "mem_230316")) {
                                            err = 1;
                                            goto cleanup;
                                        }
                                        if (ctx->debugging)
                                            fprintf(ctx->log, "%s\n",
                                                    "\n# SegMap");
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_216756,
                                                                                1,
                                                                                sizeof(n_p_203492),
                                                                                &n_p_203492));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_216756,
                                                                                2,
                                                                                sizeof(jump_s_203499),
                                                                                &jump_s_203499));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_216756,
                                                                                3,
                                                                                sizeof(partition_sizze_203577),
                                                                                &partition_sizze_203577));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_216756,
                                                                                4,
                                                                                sizeof(defunc_0_f_res_203631),
                                                                                &defunc_0_f_res_203631));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_216756,
                                                                                5,
                                                                                sizeof(pad_css_len_203632),
                                                                                &pad_css_len_203632));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_216756,
                                                                                6,
                                                                                sizeof(s_n_m_203636),
                                                                                &s_n_m_203636));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_216756,
                                                                                7,
                                                                                sizeof(mem_230312.mem),
                                                                                &mem_230312.mem));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_216756,
                                                                                8,
                                                                                sizeof(mem_230316.mem),
                                                                                &mem_230316.mem));
                                        if (1 *
                                            ((size_t) segmap_usable_groups_216750 *
                                             (size_t) segmap_group_sizze_216749) !=
                                            0) {
                                            const size_t
                                            global_work_sizze_237027[1] =
                                            {(size_t) segmap_usable_groups_216750 *
                                            (size_t) segmap_group_sizze_216749};
                                            const size_t
                                            local_work_sizze_237031[1] =
                                            {(size_t) segmap_group_sizze_216749};
                                            int64_t time_start_237028 = 0,
                                                    time_end_237029 = 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_216756",
                                                        global_work_sizze_237027[0],
                                                        local_work_sizze_237031[0],
                                                        (int) 0);
                                                time_start_237028 =
                                                    get_wall_time();
                                            }
                                            OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                                            ctx->mainzisegmap_216756,
                                                                                            1,
                                                                                            NULL,
                                                                                            global_work_sizze_237027,
                                                                                            local_work_sizze_237031,
                                                                                            0,
                                                                                            NULL,
                                                                                            ctx->profiling_paused ||
                                                                                            !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                                      &ctx->mainzisegmap_216756_runs,
                                                                                                                                      &ctx->mainzisegmap_216756_total_runtime)));
                                            if (ctx->debugging) {
                                                OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                                time_end_237029 =
                                                    get_wall_time();
                                                
                                                long time_diff_237030 =
                                                     time_end_237029 -
                                                     time_start_237028;
                                                
                                                fprintf(ctx->log,
                                                        "kernel %s runtime: %ldus\n",
                                                        "main.segmap_216756",
                                                        time_diff_237030);
                                            }
                                        }
                                        if (ctx->debugging)
                                            fprintf(ctx->log, "%s\n", "");
                                        if (memblock_unref_device(ctx,
                                                                  &mem_230316,
                                                                  "mem_230316") !=
                                            0)
                                            return 1;
                                        
                                        struct memblock_device mem_230322;
                                        
                                        mem_230322.references = NULL;
                                        if (memblock_alloc_device(ctx,
                                                                  &mem_230322,
                                                                  bytes_229297,
                                                                  "mem_230322")) {
                                            err = 1;
                                            goto cleanup;
                                        }
                                        
                                        struct memblock_device mem_230327;
                                        
                                        mem_230327.references = NULL;
                                        if (memblock_alloc_device(ctx,
                                                                  &mem_230327,
                                                                  bytes_229297,
                                                                  "mem_230327")) {
                                            err = 1;
                                            goto cleanup;
                                        }
                                        
                                        struct memblock_device mem_230332;
                                        
                                        mem_230332.references = NULL;
                                        if (memblock_alloc_device(ctx,
                                                                  &mem_230332,
                                                                  bytes_229297,
                                                                  "mem_230332")) {
                                            err = 1;
                                            goto cleanup;
                                        }
                                        
                                        struct memblock_device mem_230337;
                                        
                                        mem_230337.references = NULL;
                                        if (memblock_alloc_device(ctx,
                                                                  &mem_230337,
                                                                  bytes_229297,
                                                                  "mem_230337")) {
                                            err = 1;
                                            goto cleanup;
                                        }
                                        
                                        struct memblock_device mem_230342;
                                        
                                        mem_230342.references = NULL;
                                        if (memblock_alloc_device(ctx,
                                                                  &mem_230342,
                                                                  bytes_229297,
                                                                  "mem_230342")) {
                                            err = 1;
                                            goto cleanup;
                                        }
                                        if (slt64(q_s_203493 * (int64_t) 2,
                                                  segred_group_sizze_216772)) {
                                            int64_t
                                            segment_sizze_nonzzero_233747 =
                                            smax64((int64_t) 1, q_s_203493);
                                            int64_t num_threads_233748 =
                                                    num_groups_216773 *
                                                    segred_group_sizze_216772;
                                            
                                            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_203577 *
                                                                     n_p_203492 *
                                                                     s_n_m_203636),
                                                        '\n');
                                            if (ctx->debugging)
                                                fprintf(ctx->log, "%s: %llu%c",
                                                        "segment_size",
                                                        (long long) q_s_203493,
                                                        '\n');
                                            if (ctx->debugging)
                                                fprintf(ctx->log, "%s: %llu%c",
                                                        "segments_per_group",
                                                        (long long) squot64(segred_group_sizze_216772,
                                                                            segment_sizze_nonzzero_233747),
                                                        '\n');
                                            if (ctx->debugging)
                                                fprintf(ctx->log, "%s: %llu%c",
                                                        "required_groups",
                                                        (long long) sext_i64_i32(sdiv_up64(partition_sizze_203577 *
                                                                                           n_p_203492 *
                                                                                           s_n_m_203636,
                                                                                           squot64(segred_group_sizze_216772,
                                                                                                   segment_sizze_nonzzero_233747))),
                                                        '\n');
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_216784,
                                                                                    1,
                                                                                    (size_t) ((int64_t) 8 *
                                                                                              segred_group_sizze_216772),
                                                                                    NULL));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_216784,
                                                                                    2,
                                                                                    (size_t) ((int64_t) 8 *
                                                                                              segred_group_sizze_216772),
                                                                                    NULL));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_216784,
                                                                                    3,
                                                                                    (size_t) ((int64_t) 8 *
                                                                                              segred_group_sizze_216772),
                                                                                    NULL));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_216784,
                                                                                    4,
                                                                                    (size_t) ((int64_t) 8 *
                                                                                              segred_group_sizze_216772),
                                                                                    NULL));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_216784,
                                                                                    5,
                                                                                    (size_t) ((int64_t) 8 *
                                                                                              segred_group_sizze_216772),
                                                                                    NULL));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_216784,
                                                                                    6,
                                                                                    sizeof(n_p_203492),
                                                                                    &n_p_203492));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_216784,
                                                                                    7,
                                                                                    sizeof(q_s_203493),
                                                                                    &q_s_203493));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_216784,
                                                                                    8,
                                                                                    sizeof(partition_sizze_203577),
                                                                                    &partition_sizze_203577));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_216784,
                                                                                    9,
                                                                                    sizeof(defunc_0_f_res_203631),
                                                                                    &defunc_0_f_res_203631));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_216784,
                                                                                    10,
                                                                                    sizeof(s_n_m_203636),
                                                                                    &s_n_m_203636));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_216784,
                                                                                    11,
                                                                                    sizeof(num_groups_216773),
                                                                                    &num_groups_216773));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_216784,
                                                                                    12,
                                                                                    sizeof(segment_sizze_nonzzero_233747),
                                                                                    &segment_sizze_nonzzero_233747));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_216784,
                                                                                    13,
                                                                                    sizeof(ext_mem_229264.mem),
                                                                                    &ext_mem_229264.mem));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_216784,
                                                                                    14,
                                                                                    sizeof(ext_mem_229265.mem),
                                                                                    &ext_mem_229265.mem));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_216784,
                                                                                    15,
                                                                                    sizeof(ext_mem_229362.mem),
                                                                                    &ext_mem_229362.mem));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_216784,
                                                                                    16,
                                                                                    sizeof(ext_mem_229363.mem),
                                                                                    &ext_mem_229363.mem));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_216784,
                                                                                    17,
                                                                                    sizeof(mem_229531.mem),
                                                                                    &mem_229531.mem));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_216784,
                                                                                    18,
                                                                                    sizeof(mem_230312.mem),
                                                                                    &mem_230312.mem));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_216784,
                                                                                    19,
                                                                                    sizeof(mem_230322.mem),
                                                                                    &mem_230322.mem));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_216784,
                                                                                    20,
                                                                                    sizeof(mem_230327.mem),
                                                                                    &mem_230327.mem));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_216784,
                                                                                    21,
                                                                                    sizeof(mem_230332.mem),
                                                                                    &mem_230332.mem));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_216784,
                                                                                    22,
                                                                                    sizeof(mem_230337.mem),
                                                                                    &mem_230337.mem));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_216784,
                                                                                    23,
                                                                                    sizeof(mem_230342.mem),
                                                                                    &mem_230342.mem));
                                            if (1 *
                                                ((size_t) num_groups_216773 *
                                                 (size_t) segred_group_sizze_216772) !=
                                                0) {
                                                const size_t
                                                global_work_sizze_237032[1] =
                                                {(size_t) num_groups_216773 *
                                                (size_t) segred_group_sizze_216772};
                                                const size_t
                                                local_work_sizze_237036[1] =
                                                {(size_t) segred_group_sizze_216772};
                                                int64_t time_start_237033 = 0,
                                                        time_end_237034 = 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_216784",
                                                            global_work_sizze_237032[0],
                                                            local_work_sizze_237036[0],
                                                            (int) (0 +
                                                                   (int64_t) 8 *
                                                                   segred_group_sizze_216772 +
                                                                   (int64_t) 8 *
                                                                   segred_group_sizze_216772 +
                                                                   (int64_t) 8 *
                                                                   segred_group_sizze_216772 +
                                                                   (int64_t) 8 *
                                                                   segred_group_sizze_216772 +
                                                                   (int64_t) 8 *
                                                                   segred_group_sizze_216772));
                                                    time_start_237033 =
                                                        get_wall_time();
                                                }
                                                OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                                                ctx->mainzisegred_small_216784,
                                                                                                1,
                                                                                                NULL,
                                                                                                global_work_sizze_237032,
                                                                                                local_work_sizze_237036,
                                                                                                0,
                                                                                                NULL,
                                                                                                ctx->profiling_paused ||
                                                                                                !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                                          &ctx->mainzisegred_small_216784_runs,
                                                                                                                                          &ctx->mainzisegred_small_216784_total_runtime)));
                                                if (ctx->debugging) {
                                                    OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                                    time_end_237034 =
                                                        get_wall_time();
                                                    
                                                    long time_diff_237035 =
                                                         time_end_237034 -
                                                         time_start_237033;
                                                    
                                                    fprintf(ctx->log,
                                                            "kernel %s runtime: %ldus\n",
                                                            "main.segred_small_216784",
                                                            time_diff_237035);
                                                }
                                            }
                                            if (ctx->debugging)
                                                fprintf(ctx->log, "%s\n", "");
                                        } else {
                                            int64_t groups_per_segment_233802 =
                                                    sdiv_up64(num_groups_216773,
                                                              smax64((int64_t) 1,
                                                                     partition_sizze_203577 *
                                                                     n_p_203492 *
                                                                     s_n_m_203636));
                                            int64_t elements_per_thread_233803 =
                                                    sdiv_up64(q_s_203493,
                                                              segred_group_sizze_216772 *
                                                              groups_per_segment_233802);
                                            int64_t virt_num_groups_233804 =
                                                    groups_per_segment_233802 *
                                                    (partition_sizze_203577 *
                                                     n_p_203492 * s_n_m_203636);
                                            int64_t num_threads_233805 =
                                                    num_groups_216773 *
                                                    segred_group_sizze_216772;
                                            int64_t threads_per_segment_233806 =
                                                    groups_per_segment_233802 *
                                                    segred_group_sizze_216772;
                                            
                                            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_203577 *
                                                                     n_p_203492 *
                                                                     s_n_m_203636),
                                                        '\n');
                                            if (ctx->debugging)
                                                fprintf(ctx->log, "%s: %llu%c",
                                                        "segment_size",
                                                        (long long) q_s_203493,
                                                        '\n');
                                            if (ctx->debugging)
                                                fprintf(ctx->log, "%s: %llu%c",
                                                        "virt_num_groups",
                                                        (long long) virt_num_groups_233804,
                                                        '\n');
                                            if (ctx->debugging)
                                                fprintf(ctx->log, "%s: %llu%c",
                                                        "num_groups",
                                                        (long long) num_groups_216773,
                                                        '\n');
                                            if (ctx->debugging)
                                                fprintf(ctx->log, "%s: %llu%c",
                                                        "group_size",
                                                        (long long) segred_group_sizze_216772,
                                                        '\n');
                                            if (ctx->debugging)
                                                fprintf(ctx->log, "%s: %llu%c",
                                                        "elems_per_thread",
                                                        (long long) elements_per_thread_233803,
                                                        '\n');
                                            if (ctx->debugging)
                                                fprintf(ctx->log, "%s: %llu%c",
                                                        "groups_per_segment",
                                                        (long long) groups_per_segment_233802,
                                                        '\n');
                                            
                                            struct memblock_device
                                            segred_tmp_mem_233807;
                                            
                                            segred_tmp_mem_233807.references =
                                                NULL;
                                            if (memblock_alloc_device(ctx,
                                                                      &segred_tmp_mem_233807,
                                                                      (int64_t) 8 *
                                                                      virt_num_groups_233804,
                                                                      "segred_tmp_mem_233807")) {
                                                err = 1;
                                                goto cleanup;
                                            }
                                            
                                            struct memblock_device
                                            segred_tmp_mem_233809;
                                            
                                            segred_tmp_mem_233809.references =
                                                NULL;
                                            if (memblock_alloc_device(ctx,
                                                                      &segred_tmp_mem_233809,
                                                                      (int64_t) 8 *
                                                                      virt_num_groups_233804,
                                                                      "segred_tmp_mem_233809")) {
                                                err = 1;
                                                goto cleanup;
                                            }
                                            
                                            struct memblock_device
                                            segred_tmp_mem_233811;
                                            
                                            segred_tmp_mem_233811.references =
                                                NULL;
                                            if (memblock_alloc_device(ctx,
                                                                      &segred_tmp_mem_233811,
                                                                      (int64_t) 8 *
                                                                      virt_num_groups_233804,
                                                                      "segred_tmp_mem_233811")) {
                                                err = 1;
                                                goto cleanup;
                                            }
                                            
                                            struct memblock_device
                                            segred_tmp_mem_233813;
                                            
                                            segred_tmp_mem_233813.references =
                                                NULL;
                                            if (memblock_alloc_device(ctx,
                                                                      &segred_tmp_mem_233813,
                                                                      (int64_t) 8 *
                                                                      virt_num_groups_233804,
                                                                      "segred_tmp_mem_233813")) {
                                                err = 1;
                                                goto cleanup;
                                            }
                                            
                                            struct memblock_device
                                            segred_tmp_mem_233815;
                                            
                                            segred_tmp_mem_233815.references =
                                                NULL;
                                            if (memblock_alloc_device(ctx,
                                                                      &segred_tmp_mem_233815,
                                                                      (int64_t) 8 *
                                                                      virt_num_groups_233804,
                                                                      "segred_tmp_mem_233815")) {
                                                err = 1;
                                                goto cleanup;
                                            }
                                            
                                            struct memblock_device
                                            mainzicounter_mem_233817 =
                                            ctx->mainzicounter_mem_233817;
                                            
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_216784,
                                                                                    1,
                                                                                    (size_t) 1,
                                                                                    NULL));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_216784,
                                                                                    2,
                                                                                    (size_t) ((int64_t) 8 *
                                                                                              segred_group_sizze_216772),
                                                                                    NULL));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_216784,
                                                                                    3,
                                                                                    (size_t) ((int64_t) 8 *
                                                                                              segred_group_sizze_216772),
                                                                                    NULL));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_216784,
                                                                                    4,
                                                                                    (size_t) ((int64_t) 8 *
                                                                                              segred_group_sizze_216772),
                                                                                    NULL));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_216784,
                                                                                    5,
                                                                                    (size_t) ((int64_t) 8 *
                                                                                              segred_group_sizze_216772),
                                                                                    NULL));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_216784,
                                                                                    6,
                                                                                    (size_t) ((int64_t) 8 *
                                                                                              segred_group_sizze_216772),
                                                                                    NULL));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_216784,
                                                                                    7,
                                                                                    sizeof(n_p_203492),
                                                                                    &n_p_203492));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_216784,
                                                                                    8,
                                                                                    sizeof(q_s_203493),
                                                                                    &q_s_203493));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_216784,
                                                                                    9,
                                                                                    sizeof(partition_sizze_203577),
                                                                                    &partition_sizze_203577));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_216784,
                                                                                    10,
                                                                                    sizeof(defunc_0_f_res_203631),
                                                                                    &defunc_0_f_res_203631));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_216784,
                                                                                    11,
                                                                                    sizeof(s_n_m_203636),
                                                                                    &s_n_m_203636));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_216784,
                                                                                    12,
                                                                                    sizeof(num_groups_216773),
                                                                                    &num_groups_216773));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_216784,
                                                                                    13,
                                                                                    sizeof(groups_per_segment_233802),
                                                                                    &groups_per_segment_233802));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_216784,
                                                                                    14,
                                                                                    sizeof(elements_per_thread_233803),
                                                                                    &elements_per_thread_233803));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_216784,
                                                                                    15,
                                                                                    sizeof(virt_num_groups_233804),
                                                                                    &virt_num_groups_233804));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_216784,
                                                                                    16,
                                                                                    sizeof(threads_per_segment_233806),
                                                                                    &threads_per_segment_233806));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_216784,
                                                                                    17,
                                                                                    sizeof(ext_mem_229264.mem),
                                                                                    &ext_mem_229264.mem));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_216784,
                                                                                    18,
                                                                                    sizeof(ext_mem_229265.mem),
                                                                                    &ext_mem_229265.mem));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_216784,
                                                                                    19,
                                                                                    sizeof(ext_mem_229362.mem),
                                                                                    &ext_mem_229362.mem));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_216784,
                                                                                    20,
                                                                                    sizeof(ext_mem_229363.mem),
                                                                                    &ext_mem_229363.mem));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_216784,
                                                                                    21,
                                                                                    sizeof(mem_229531.mem),
                                                                                    &mem_229531.mem));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_216784,
                                                                                    22,
                                                                                    sizeof(mem_230312.mem),
                                                                                    &mem_230312.mem));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_216784,
                                                                                    23,
                                                                                    sizeof(mem_230322.mem),
                                                                                    &mem_230322.mem));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_216784,
                                                                                    24,
                                                                                    sizeof(mem_230327.mem),
                                                                                    &mem_230327.mem));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_216784,
                                                                                    25,
                                                                                    sizeof(mem_230332.mem),
                                                                                    &mem_230332.mem));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_216784,
                                                                                    26,
                                                                                    sizeof(mem_230337.mem),
                                                                                    &mem_230337.mem));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_216784,
                                                                                    27,
                                                                                    sizeof(mem_230342.mem),
                                                                                    &mem_230342.mem));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_216784,
                                                                                    28,
                                                                                    sizeof(segred_tmp_mem_233807.mem),
                                                                                    &segred_tmp_mem_233807.mem));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_216784,
                                                                                    29,
                                                                                    sizeof(segred_tmp_mem_233809.mem),
                                                                                    &segred_tmp_mem_233809.mem));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_216784,
                                                                                    30,
                                                                                    sizeof(segred_tmp_mem_233811.mem),
                                                                                    &segred_tmp_mem_233811.mem));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_216784,
                                                                                    31,
                                                                                    sizeof(segred_tmp_mem_233813.mem),
                                                                                    &segred_tmp_mem_233813.mem));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_216784,
                                                                                    32,
                                                                                    sizeof(segred_tmp_mem_233815.mem),
                                                                                    &segred_tmp_mem_233815.mem));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_216784,
                                                                                    33,
                                                                                    sizeof(mainzicounter_mem_233817.mem),
                                                                                    &mainzicounter_mem_233817.mem));
                                            if (1 *
                                                ((size_t) num_groups_216773 *
                                                 (size_t) segred_group_sizze_216772) !=
                                                0) {
                                                const size_t
                                                global_work_sizze_237038[1] =
                                                {(size_t) num_groups_216773 *
                                                (size_t) segred_group_sizze_216772};
                                                const size_t
                                                local_work_sizze_237042[1] =
                                                {(size_t) segred_group_sizze_216772};
                                                int64_t time_start_237039 = 0,
                                                        time_end_237040 = 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_216784",
                                                            global_work_sizze_237038[0],
                                                            local_work_sizze_237042[0],
                                                            (int) (0 + 1 +
                                                                   (int64_t) 8 *
                                                                   segred_group_sizze_216772 +
                                                                   (int64_t) 8 *
                                                                   segred_group_sizze_216772 +
                                                                   (int64_t) 8 *
                                                                   segred_group_sizze_216772 +
                                                                   (int64_t) 8 *
                                                                   segred_group_sizze_216772 +
                                                                   (int64_t) 8 *
                                                                   segred_group_sizze_216772));
                                                    time_start_237039 =
                                                        get_wall_time();
                                                }
                                                OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                                                ctx->mainzisegred_large_216784,
                                                                                                1,
                                                                                                NULL,
                                                                                                global_work_sizze_237038,
                                                                                                local_work_sizze_237042,
                                                                                                0,
                                                                                                NULL,
                                                                                                ctx->profiling_paused ||
                                                                                                !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                                          &ctx->mainzisegred_large_216784_runs,
                                                                                                                                          &ctx->mainzisegred_large_216784_total_runtime)));
                                                if (ctx->debugging) {
                                                    OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                                    time_end_237040 =
                                                        get_wall_time();
                                                    
                                                    long time_diff_237041 =
                                                         time_end_237040 -
                                                         time_start_237039;
                                                    
                                                    fprintf(ctx->log,
                                                            "kernel %s runtime: %ldus\n",
                                                            "main.segred_large_216784",
                                                            time_diff_237041);
                                                }
                                            }
                                            if (ctx->debugging)
                                                fprintf(ctx->log, "%s\n", "");
                                            if (memblock_unref_device(ctx,
                                                                      &segred_tmp_mem_233815,
                                                                      "segred_tmp_mem_233815") !=
                                                0)
                                                return 1;
                                            if (memblock_unref_device(ctx,
                                                                      &segred_tmp_mem_233813,
                                                                      "segred_tmp_mem_233813") !=
                                                0)
                                                return 1;
                                            if (memblock_unref_device(ctx,
                                                                      &segred_tmp_mem_233811,
                                                                      "segred_tmp_mem_233811") !=
                                                0)
                                                return 1;
                                            if (memblock_unref_device(ctx,
                                                                      &segred_tmp_mem_233809,
                                                                      "segred_tmp_mem_233809") !=
                                                0)
                                                return 1;
                                            if (memblock_unref_device(ctx,
                                                                      &segred_tmp_mem_233807,
                                                                      "segred_tmp_mem_233807") !=
                                                0)
                                                return 1;
                                        }
                                        if (memblock_unref_device(ctx,
                                                                  &mem_230312,
                                                                  "mem_230312") !=
                                            0)
                                            return 1;
                                        
                                        int64_t segmap_usable_groups_216842 =
                                                sdiv_up64(nest_sizze_208848,
                                                          segmap_group_sizze_216841);
                                        struct memblock_device mem_230348;
                                        
                                        mem_230348.references = NULL;
                                        if (memblock_alloc_device(ctx,
                                                                  &mem_230348,
                                                                  bytes_229297,
                                                                  "mem_230348")) {
                                            err = 1;
                                            goto cleanup;
                                        }
                                        
                                        struct memblock_device mem_230353;
                                        
                                        mem_230353.references = NULL;
                                        if (memblock_alloc_device(ctx,
                                                                  &mem_230353,
                                                                  bytes_229297,
                                                                  "mem_230353")) {
                                            err = 1;
                                            goto cleanup;
                                        }
                                        
                                        struct memblock_device mem_230358;
                                        
                                        mem_230358.references = NULL;
                                        if (memblock_alloc_device(ctx,
                                                                  &mem_230358,
                                                                  bytes_229297,
                                                                  "mem_230358")) {
                                            err = 1;
                                            goto cleanup;
                                        }
                                        
                                        struct memblock_device mem_230363;
                                        
                                        mem_230363.references = NULL;
                                        if (memblock_alloc_device(ctx,
                                                                  &mem_230363,
                                                                  bytes_229297,
                                                                  "mem_230363")) {
                                            err = 1;
                                            goto cleanup;
                                        }
                                        
                                        struct memblock_device mem_230368;
                                        
                                        mem_230368.references = NULL;
                                        if (memblock_alloc_device(ctx,
                                                                  &mem_230368,
                                                                  bytes_229297,
                                                                  "mem_230368")) {
                                            err = 1;
                                            goto cleanup;
                                        }
                                        
                                        struct memblock_device mem_230373;
                                        
                                        mem_230373.references = NULL;
                                        if (memblock_alloc_device(ctx,
                                                                  &mem_230373,
                                                                  bytes_229297,
                                                                  "mem_230373")) {
                                            err = 1;
                                            goto cleanup;
                                        }
                                        if (ctx->debugging)
                                            fprintf(ctx->log, "%s\n",
                                                    "\n# SegMap");
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_216852,
                                                                                1,
                                                                                sizeof(n_p_203492),
                                                                                &n_p_203492));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_216852,
                                                                                2,
                                                                                sizeof(jump_s_203499),
                                                                                &jump_s_203499));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_216852,
                                                                                3,
                                                                                sizeof(partition_sizze_203577),
                                                                                &partition_sizze_203577));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_216852,
                                                                                4,
                                                                                sizeof(defunc_0_f_res_203631),
                                                                                &defunc_0_f_res_203631));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_216852,
                                                                                5,
                                                                                sizeof(pad_css_len_203632),
                                                                                &pad_css_len_203632));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_216852,
                                                                                6,
                                                                                sizeof(s_n_m_203636),
                                                                                &s_n_m_203636));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_216852,
                                                                                7,
                                                                                sizeof(mem_230322.mem),
                                                                                &mem_230322.mem));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_216852,
                                                                                8,
                                                                                sizeof(mem_230327.mem),
                                                                                &mem_230327.mem));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_216852,
                                                                                9,
                                                                                sizeof(mem_230332.mem),
                                                                                &mem_230332.mem));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_216852,
                                                                                10,
                                                                                sizeof(mem_230337.mem),
                                                                                &mem_230337.mem));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_216852,
                                                                                11,
                                                                                sizeof(mem_230342.mem),
                                                                                &mem_230342.mem));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_216852,
                                                                                12,
                                                                                sizeof(mem_230348.mem),
                                                                                &mem_230348.mem));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_216852,
                                                                                13,
                                                                                sizeof(mem_230353.mem),
                                                                                &mem_230353.mem));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_216852,
                                                                                14,
                                                                                sizeof(mem_230358.mem),
                                                                                &mem_230358.mem));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_216852,
                                                                                15,
                                                                                sizeof(mem_230363.mem),
                                                                                &mem_230363.mem));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_216852,
                                                                                16,
                                                                                sizeof(mem_230368.mem),
                                                                                &mem_230368.mem));
                                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_216852,
                                                                                17,
                                                                                sizeof(mem_230373.mem),
                                                                                &mem_230373.mem));
                                        if (1 *
                                            ((size_t) segmap_usable_groups_216842 *
                                             (size_t) segmap_group_sizze_216841) !=
                                            0) {
                                            const size_t
                                            global_work_sizze_237043[1] =
                                            {(size_t) segmap_usable_groups_216842 *
                                            (size_t) segmap_group_sizze_216841};
                                            const size_t
                                            local_work_sizze_237047[1] =
                                            {(size_t) segmap_group_sizze_216841};
                                            int64_t time_start_237044 = 0,
                                                    time_end_237045 = 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_216852",
                                                        global_work_sizze_237043[0],
                                                        local_work_sizze_237047[0],
                                                        (int) 0);
                                                time_start_237044 =
                                                    get_wall_time();
                                            }
                                            OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                                            ctx->mainzisegmap_216852,
                                                                                            1,
                                                                                            NULL,
                                                                                            global_work_sizze_237043,
                                                                                            local_work_sizze_237047,
                                                                                            0,
                                                                                            NULL,
                                                                                            ctx->profiling_paused ||
                                                                                            !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                                      &ctx->mainzisegmap_216852_runs,
                                                                                                                                      &ctx->mainzisegmap_216852_total_runtime)));
                                            if (ctx->debugging) {
                                                OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                                time_end_237045 =
                                                    get_wall_time();
                                                
                                                long time_diff_237046 =
                                                     time_end_237045 -
                                                     time_start_237044;
                                                
                                                fprintf(ctx->log,
                                                        "kernel %s runtime: %ldus\n",
                                                        "main.segmap_216852",
                                                        time_diff_237046);
                                            }
                                        }
                                        if (ctx->debugging)
                                            fprintf(ctx->log, "%s\n", "");
                                        if (memblock_unref_device(ctx,
                                                                  &mem_230322,
                                                                  "mem_230322") !=
                                            0)
                                            return 1;
                                        if (memblock_unref_device(ctx,
                                                                  &mem_230327,
                                                                  "mem_230327") !=
                                            0)
                                            return 1;
                                        if (memblock_unref_device(ctx,
                                                                  &mem_230332,
                                                                  "mem_230332") !=
                                            0)
                                            return 1;
                                        if (memblock_unref_device(ctx,
                                                                  &mem_230337,
                                                                  "mem_230337") !=
                                            0)
                                            return 1;
                                        if (memblock_unref_device(ctx,
                                                                  &mem_230342,
                                                                  "mem_230342") !=
                                            0)
                                            return 1;
                                        
                                        struct memblock_device mem_230379;
                                        
                                        mem_230379.references = NULL;
                                        if (memblock_alloc_device(ctx,
                                                                  &mem_230379,
                                                                  bytes_229297,
                                                                  "mem_230379")) {
                                            err = 1;
                                            goto cleanup;
                                        }
                                        
                                        struct memblock_device mem_230384;
                                        
                                        mem_230384.references = NULL;
                                        if (memblock_alloc_device(ctx,
                                                                  &mem_230384,
                                                                  bytes_229297,
                                                                  "mem_230384")) {
                                            err = 1;
                                            goto cleanup;
                                        }
                                        if (slt64(q_s_203493 * (int64_t) 2,
                                                  segred_group_sizze_216898)) {
                                            int64_t
                                            segment_sizze_nonzzero_233891 =
                                            smax64((int64_t) 1, q_s_203493);
                                            int64_t num_threads_233892 =
                                                    num_groups_216899 *
                                                    segred_group_sizze_216898;
                                            
                                            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_203577 *
                                                                     n_p_203492 *
                                                                     s_n_m_203636),
                                                        '\n');
                                            if (ctx->debugging)
                                                fprintf(ctx->log, "%s: %llu%c",
                                                        "segment_size",
                                                        (long long) q_s_203493,
                                                        '\n');
                                            if (ctx->debugging)
                                                fprintf(ctx->log, "%s: %llu%c",
                                                        "segments_per_group",
                                                        (long long) squot64(segred_group_sizze_216898,
                                                                            segment_sizze_nonzzero_233891),
                                                        '\n');
                                            if (ctx->debugging)
                                                fprintf(ctx->log, "%s: %llu%c",
                                                        "required_groups",
                                                        (long long) sext_i64_i32(sdiv_up64(partition_sizze_203577 *
                                                                                           n_p_203492 *
                                                                                           s_n_m_203636,
                                                                                           squot64(segred_group_sizze_216898,
                                                                                                   segment_sizze_nonzzero_233891))),
                                                        '\n');
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_216907,
                                                                                    1,
                                                                                    (size_t) ((int64_t) 8 *
                                                                                              segred_group_sizze_216898),
                                                                                    NULL));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_216907,
                                                                                    2,
                                                                                    (size_t) ((int64_t) 8 *
                                                                                              segred_group_sizze_216898),
                                                                                    NULL));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_216907,
                                                                                    3,
                                                                                    sizeof(n_p_203492),
                                                                                    &n_p_203492));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_216907,
                                                                                    4,
                                                                                    sizeof(q_s_203493),
                                                                                    &q_s_203493));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_216907,
                                                                                    5,
                                                                                    sizeof(partition_sizze_203577),
                                                                                    &partition_sizze_203577));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_216907,
                                                                                    6,
                                                                                    sizeof(defunc_0_f_res_203631),
                                                                                    &defunc_0_f_res_203631));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_216907,
                                                                                    7,
                                                                                    sizeof(s_n_m_203636),
                                                                                    &s_n_m_203636));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_216907,
                                                                                    8,
                                                                                    sizeof(num_groups_216899),
                                                                                    &num_groups_216899));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_216907,
                                                                                    9,
                                                                                    sizeof(segment_sizze_nonzzero_233891),
                                                                                    &segment_sizze_nonzzero_233891));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_216907,
                                                                                    10,
                                                                                    sizeof(ext_mem_229264.mem),
                                                                                    &ext_mem_229264.mem));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_216907,
                                                                                    11,
                                                                                    sizeof(ext_mem_229265.mem),
                                                                                    &ext_mem_229265.mem));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_216907,
                                                                                    12,
                                                                                    sizeof(ext_mem_229362.mem),
                                                                                    &ext_mem_229362.mem));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_216907,
                                                                                    13,
                                                                                    sizeof(ext_mem_229363.mem),
                                                                                    &ext_mem_229363.mem));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_216907,
                                                                                    14,
                                                                                    sizeof(mem_229526.mem),
                                                                                    &mem_229526.mem));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_216907,
                                                                                    15,
                                                                                    sizeof(mem_229531.mem),
                                                                                    &mem_229531.mem));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_216907,
                                                                                    16,
                                                                                    sizeof(mem_230348.mem),
                                                                                    &mem_230348.mem));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_216907,
                                                                                    17,
                                                                                    sizeof(mem_230353.mem),
                                                                                    &mem_230353.mem));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_216907,
                                                                                    18,
                                                                                    sizeof(mem_230358.mem),
                                                                                    &mem_230358.mem));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_216907,
                                                                                    19,
                                                                                    sizeof(mem_230363.mem),
                                                                                    &mem_230363.mem));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_216907,
                                                                                    20,
                                                                                    sizeof(mem_230368.mem),
                                                                                    &mem_230368.mem));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_216907,
                                                                                    21,
                                                                                    sizeof(mem_230373.mem),
                                                                                    &mem_230373.mem));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_216907,
                                                                                    22,
                                                                                    sizeof(mem_230379.mem),
                                                                                    &mem_230379.mem));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_216907,
                                                                                    23,
                                                                                    sizeof(mem_230384.mem),
                                                                                    &mem_230384.mem));
                                            if (1 *
                                                ((size_t) num_groups_216899 *
                                                 (size_t) segred_group_sizze_216898) !=
                                                0) {
                                                const size_t
                                                global_work_sizze_237048[1] =
                                                {(size_t) num_groups_216899 *
                                                (size_t) segred_group_sizze_216898};
                                                const size_t
                                                local_work_sizze_237052[1] =
                                                {(size_t) segred_group_sizze_216898};
                                                int64_t time_start_237049 = 0,
                                                        time_end_237050 = 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_216907",
                                                            global_work_sizze_237048[0],
                                                            local_work_sizze_237052[0],
                                                            (int) (0 +
                                                                   (int64_t) 8 *
                                                                   segred_group_sizze_216898 +
                                                                   (int64_t) 8 *
                                                                   segred_group_sizze_216898));
                                                    time_start_237049 =
                                                        get_wall_time();
                                                }
                                                OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                                                ctx->mainzisegred_small_216907,
                                                                                                1,
                                                                                                NULL,
                                                                                                global_work_sizze_237048,
                                                                                                local_work_sizze_237052,
                                                                                                0,
                                                                                                NULL,
                                                                                                ctx->profiling_paused ||
                                                                                                !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                                          &ctx->mainzisegred_small_216907_runs,
                                                                                                                                          &ctx->mainzisegred_small_216907_total_runtime)));
                                                if (ctx->debugging) {
                                                    OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                                    time_end_237050 =
                                                        get_wall_time();
                                                    
                                                    long time_diff_237051 =
                                                         time_end_237050 -
                                                         time_start_237049;
                                                    
                                                    fprintf(ctx->log,
                                                            "kernel %s runtime: %ldus\n",
                                                            "main.segred_small_216907",
                                                            time_diff_237051);
                                                }
                                            }
                                            if (ctx->debugging)
                                                fprintf(ctx->log, "%s\n", "");
                                        } else {
                                            int64_t groups_per_segment_233928 =
                                                    sdiv_up64(num_groups_216899,
                                                              smax64((int64_t) 1,
                                                                     partition_sizze_203577 *
                                                                     n_p_203492 *
                                                                     s_n_m_203636));
                                            int64_t elements_per_thread_233929 =
                                                    sdiv_up64(q_s_203493,
                                                              segred_group_sizze_216898 *
                                                              groups_per_segment_233928);
                                            int64_t virt_num_groups_233930 =
                                                    groups_per_segment_233928 *
                                                    (partition_sizze_203577 *
                                                     n_p_203492 * s_n_m_203636);
                                            int64_t num_threads_233931 =
                                                    num_groups_216899 *
                                                    segred_group_sizze_216898;
                                            int64_t threads_per_segment_233932 =
                                                    groups_per_segment_233928 *
                                                    segred_group_sizze_216898;
                                            
                                            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_203577 *
                                                                     n_p_203492 *
                                                                     s_n_m_203636),
                                                        '\n');
                                            if (ctx->debugging)
                                                fprintf(ctx->log, "%s: %llu%c",
                                                        "segment_size",
                                                        (long long) q_s_203493,
                                                        '\n');
                                            if (ctx->debugging)
                                                fprintf(ctx->log, "%s: %llu%c",
                                                        "virt_num_groups",
                                                        (long long) virt_num_groups_233930,
                                                        '\n');
                                            if (ctx->debugging)
                                                fprintf(ctx->log, "%s: %llu%c",
                                                        "num_groups",
                                                        (long long) num_groups_216899,
                                                        '\n');
                                            if (ctx->debugging)
                                                fprintf(ctx->log, "%s: %llu%c",
                                                        "group_size",
                                                        (long long) segred_group_sizze_216898,
                                                        '\n');
                                            if (ctx->debugging)
                                                fprintf(ctx->log, "%s: %llu%c",
                                                        "elems_per_thread",
                                                        (long long) elements_per_thread_233929,
                                                        '\n');
                                            if (ctx->debugging)
                                                fprintf(ctx->log, "%s: %llu%c",
                                                        "groups_per_segment",
                                                        (long long) groups_per_segment_233928,
                                                        '\n');
                                            
                                            struct memblock_device
                                            segred_tmp_mem_233933;
                                            
                                            segred_tmp_mem_233933.references =
                                                NULL;
                                            if (memblock_alloc_device(ctx,
                                                                      &segred_tmp_mem_233933,
                                                                      (int64_t) 8 *
                                                                      virt_num_groups_233930,
                                                                      "segred_tmp_mem_233933")) {
                                                err = 1;
                                                goto cleanup;
                                            }
                                            
                                            struct memblock_device
                                            segred_tmp_mem_233935;
                                            
                                            segred_tmp_mem_233935.references =
                                                NULL;
                                            if (memblock_alloc_device(ctx,
                                                                      &segred_tmp_mem_233935,
                                                                      (int64_t) 8 *
                                                                      virt_num_groups_233930,
                                                                      "segred_tmp_mem_233935")) {
                                                err = 1;
                                                goto cleanup;
                                            }
                                            
                                            struct memblock_device
                                            mainzicounter_mem_233937 =
                                            ctx->mainzicounter_mem_233937;
                                            
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_216907,
                                                                                    1,
                                                                                    (size_t) 1,
                                                                                    NULL));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_216907,
                                                                                    2,
                                                                                    (size_t) ((int64_t) 8 *
                                                                                              segred_group_sizze_216898),
                                                                                    NULL));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_216907,
                                                                                    3,
                                                                                    (size_t) ((int64_t) 8 *
                                                                                              segred_group_sizze_216898),
                                                                                    NULL));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_216907,
                                                                                    4,
                                                                                    sizeof(n_p_203492),
                                                                                    &n_p_203492));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_216907,
                                                                                    5,
                                                                                    sizeof(q_s_203493),
                                                                                    &q_s_203493));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_216907,
                                                                                    6,
                                                                                    sizeof(partition_sizze_203577),
                                                                                    &partition_sizze_203577));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_216907,
                                                                                    7,
                                                                                    sizeof(defunc_0_f_res_203631),
                                                                                    &defunc_0_f_res_203631));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_216907,
                                                                                    8,
                                                                                    sizeof(s_n_m_203636),
                                                                                    &s_n_m_203636));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_216907,
                                                                                    9,
                                                                                    sizeof(num_groups_216899),
                                                                                    &num_groups_216899));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_216907,
                                                                                    10,
                                                                                    sizeof(groups_per_segment_233928),
                                                                                    &groups_per_segment_233928));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_216907,
                                                                                    11,
                                                                                    sizeof(elements_per_thread_233929),
                                                                                    &elements_per_thread_233929));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_216907,
                                                                                    12,
                                                                                    sizeof(virt_num_groups_233930),
                                                                                    &virt_num_groups_233930));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_216907,
                                                                                    13,
                                                                                    sizeof(threads_per_segment_233932),
                                                                                    &threads_per_segment_233932));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_216907,
                                                                                    14,
                                                                                    sizeof(ext_mem_229264.mem),
                                                                                    &ext_mem_229264.mem));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_216907,
                                                                                    15,
                                                                                    sizeof(ext_mem_229265.mem),
                                                                                    &ext_mem_229265.mem));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_216907,
                                                                                    16,
                                                                                    sizeof(ext_mem_229362.mem),
                                                                                    &ext_mem_229362.mem));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_216907,
                                                                                    17,
                                                                                    sizeof(ext_mem_229363.mem),
                                                                                    &ext_mem_229363.mem));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_216907,
                                                                                    18,
                                                                                    sizeof(mem_229526.mem),
                                                                                    &mem_229526.mem));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_216907,
                                                                                    19,
                                                                                    sizeof(mem_229531.mem),
                                                                                    &mem_229531.mem));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_216907,
                                                                                    20,
                                                                                    sizeof(mem_230348.mem),
                                                                                    &mem_230348.mem));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_216907,
                                                                                    21,
                                                                                    sizeof(mem_230353.mem),
                                                                                    &mem_230353.mem));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_216907,
                                                                                    22,
                                                                                    sizeof(mem_230358.mem),
                                                                                    &mem_230358.mem));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_216907,
                                                                                    23,
                                                                                    sizeof(mem_230363.mem),
                                                                                    &mem_230363.mem));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_216907,
                                                                                    24,
                                                                                    sizeof(mem_230368.mem),
                                                                                    &mem_230368.mem));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_216907,
                                                                                    25,
                                                                                    sizeof(mem_230373.mem),
                                                                                    &mem_230373.mem));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_216907,
                                                                                    26,
                                                                                    sizeof(mem_230379.mem),
                                                                                    &mem_230379.mem));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_216907,
                                                                                    27,
                                                                                    sizeof(mem_230384.mem),
                                                                                    &mem_230384.mem));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_216907,
                                                                                    28,
                                                                                    sizeof(segred_tmp_mem_233933.mem),
                                                                                    &segred_tmp_mem_233933.mem));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_216907,
                                                                                    29,
                                                                                    sizeof(segred_tmp_mem_233935.mem),
                                                                                    &segred_tmp_mem_233935.mem));
                                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_216907,
                                                                                    30,
                                                                                    sizeof(mainzicounter_mem_233937.mem),
                                                                                    &mainzicounter_mem_233937.mem));
                                            if (1 *
                                                ((size_t) num_groups_216899 *
                                                 (size_t) segred_group_sizze_216898) !=
                                                0) {
                                                const size_t
                                                global_work_sizze_237054[1] =
                                                {(size_t) num_groups_216899 *
                                                (size_t) segred_group_sizze_216898};
                                                const size_t
                                                local_work_sizze_237058[1] =
                                                {(size_t) segred_group_sizze_216898};
                                                int64_t time_start_237055 = 0,
                                                        time_end_237056 = 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_216907",
                                                            global_work_sizze_237054[0],
                                                            local_work_sizze_237058[0],
                                                            (int) (0 + 1 +
                                                                   (int64_t) 8 *
                                                                   segred_group_sizze_216898 +
                                                                   (int64_t) 8 *
                                                                   segred_group_sizze_216898));
                                                    time_start_237055 =
                                                        get_wall_time();
                                                }
                                                OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                                                ctx->mainzisegred_large_216907,
                                                                                                1,
                                                                                                NULL,
                                                                                                global_work_sizze_237054,
                                                                                                local_work_sizze_237058,
                                                                                                0,
                                                                                                NULL,
                                                                                                ctx->profiling_paused ||
                                                                                                !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                                          &ctx->mainzisegred_large_216907_runs,
                                                                                                                                          &ctx->mainzisegred_large_216907_total_runtime)));
                                                if (ctx->debugging) {
                                                    OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                                    time_end_237056 =
                                                        get_wall_time();
                                                    
                                                    long time_diff_237057 =
                                                         time_end_237056 -
                                                         time_start_237055;
                                                    
                                                    fprintf(ctx->log,
                                                            "kernel %s runtime: %ldus\n",
                                                            "main.segred_large_216907",
                                                            time_diff_237057);
                                                }
                                            }
                                            if (ctx->debugging)
                                                fprintf(ctx->log, "%s\n", "");
                                            if (memblock_unref_device(ctx,
                                                                      &segred_tmp_mem_233935,
                                                                      "segred_tmp_mem_233935") !=
                                                0)
                                                return 1;
                                            if (memblock_unref_device(ctx,
                                                                      &segred_tmp_mem_233933,
                                                                      "segred_tmp_mem_233933") !=
                                                0)
                                                return 1;
                                        }
                                        if (memblock_unref_device(ctx,
                                                                  &mem_230348,
                                                                  "mem_230348") !=
                                            0)
                                            return 1;
                                        if (memblock_unref_device(ctx,
                                                                  &mem_230353,
                                                                  "mem_230353") !=
                                            0)
                                            return 1;
                                        if (memblock_unref_device(ctx,
                                                                  &mem_230358,
                                                                  "mem_230358") !=
                                            0)
                                            return 1;
                                        if (memblock_unref_device(ctx,
                                                                  &mem_230363,
                                                                  "mem_230363") !=
                                            0)
                                            return 1;
                                        if (memblock_unref_device(ctx,
                                                                  &mem_230368,
                                                                  "mem_230368") !=
                                            0)
                                            return 1;
                                        if (memblock_unref_device(ctx,
                                                                  &mem_230373,
                                                                  "mem_230373") !=
                                            0)
                                            return 1;
                                        if (memblock_set_device(ctx,
                                                                &ext_mem_230386,
                                                                &mem_230379,
                                                                "mem_230379") !=
                                            0)
                                            return 1;
                                        if (memblock_set_device(ctx,
                                                                &ext_mem_230385,
                                                                &mem_230384,
                                                                "mem_230384") !=
                                            0)
                                            return 1;
                                        if (memblock_unref_device(ctx,
                                                                  &mem_230384,
                                                                  "mem_230384") !=
                                            0)
                                            return 1;
                                        if (memblock_unref_device(ctx,
                                                                  &mem_230379,
                                                                  "mem_230379") !=
                                            0)
                                            return 1;
                                        if (memblock_unref_device(ctx,
                                                                  &mem_230373,
                                                                  "mem_230373") !=
                                            0)
                                            return 1;
                                        if (memblock_unref_device(ctx,
                                                                  &mem_230368,
                                                                  "mem_230368") !=
                                            0)
                                            return 1;
                                        if (memblock_unref_device(ctx,
                                                                  &mem_230363,
                                                                  "mem_230363") !=
                                            0)
                                            return 1;
                                        if (memblock_unref_device(ctx,
                                                                  &mem_230358,
                                                                  "mem_230358") !=
                                            0)
                                            return 1;
                                        if (memblock_unref_device(ctx,
                                                                  &mem_230353,
                                                                  "mem_230353") !=
                                            0)
                                            return 1;
                                        if (memblock_unref_device(ctx,
                                                                  &mem_230348,
                                                                  "mem_230348") !=
                                            0)
                                            return 1;
                                        if (memblock_unref_device(ctx,
                                                                  &mem_230342,
                                                                  "mem_230342") !=
                                            0)
                                            return 1;
                                        if (memblock_unref_device(ctx,
                                                                  &mem_230337,
                                                                  "mem_230337") !=
                                            0)
                                            return 1;
                                        if (memblock_unref_device(ctx,
                                                                  &mem_230332,
                                                                  "mem_230332") !=
                                            0)
                                            return 1;
                                        if (memblock_unref_device(ctx,
                                                                  &mem_230327,
                                                                  "mem_230327") !=
                                            0)
                                            return 1;
                                        if (memblock_unref_device(ctx,
                                                                  &mem_230322,
                                                                  "mem_230322") !=
                                            0)
                                            return 1;
                                        if (memblock_unref_device(ctx,
                                                                  &mem_230316,
                                                                  "mem_230316") !=
                                            0)
                                            return 1;
                                        if (memblock_unref_device(ctx,
                                                                  &mem_230312,
                                                                  "mem_230312") !=
                                            0)
                                            return 1;
                                    }
                                    if (memblock_set_device(ctx,
                                                            &ext_mem_230388,
                                                            &ext_mem_230386,
                                                            "ext_mem_230386") !=
                                        0)
                                        return 1;
                                    if (memblock_set_device(ctx,
                                                            &ext_mem_230387,
                                                            &ext_mem_230385,
                                                            "ext_mem_230385") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230385,
                                                              "ext_mem_230385") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &ext_mem_230386,
                                                              "ext_mem_230386") !=
                                        0)
                                        return 1;
                                }
                                if (memblock_set_device(ctx, &ext_mem_230402,
                                                        &ext_mem_230388,
                                                        "ext_mem_230388") != 0)
                                    return 1;
                                if (memblock_set_device(ctx, &ext_mem_230401,
                                                        &ext_mem_230387,
                                                        "ext_mem_230387") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230387,
                                                          "ext_mem_230387") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230388,
                                                          "ext_mem_230388") !=
                                    0)
                                    return 1;
                            }
                            if (memblock_set_device(ctx, &ext_mem_230416,
                                                    &ext_mem_230402,
                                                    "ext_mem_230402") != 0)
                                return 1;
                            if (memblock_set_device(ctx, &ext_mem_230415,
                                                    &ext_mem_230401,
                                                    "ext_mem_230401") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230401,
                                                      "ext_mem_230401") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230402,
                                                      "ext_mem_230402") != 0)
                                return 1;
                        }
                        if (memblock_set_device(ctx, &ext_mem_230418,
                                                &ext_mem_230416,
                                                "ext_mem_230416") != 0)
                            return 1;
                        if (memblock_set_device(ctx, &ext_mem_230417,
                                                &ext_mem_230415,
                                                "ext_mem_230415") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_230415,
                                                  "ext_mem_230415") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_230416,
                                                  "ext_mem_230416") != 0)
                            return 1;
                    }
                    if (memblock_set_device(ctx, &ext_mem_230420,
                                            &ext_mem_230418,
                                            "ext_mem_230418") != 0)
                        return 1;
                    if (memblock_set_device(ctx, &ext_mem_230419,
                                            &ext_mem_230417,
                                            "ext_mem_230417") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_230417,
                                              "ext_mem_230417") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_230418,
                                              "ext_mem_230418") != 0)
                        return 1;
                }
                if (memblock_set_device(ctx, &ext_mem_230487, &ext_mem_230420,
                                        "ext_mem_230420") != 0)
                    return 1;
                if (memblock_set_device(ctx, &ext_mem_230486, &ext_mem_230419,
                                        "ext_mem_230419") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_230419,
                                          "ext_mem_230419") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_230420,
                                          "ext_mem_230420") != 0)
                    return 1;
            } else {
                bool match_lit_204617 = (int64_t) 0 == d_s_203496;
                int64_t binop_y_230428 = (int64_t) 8 * q_s_203493;
                int64_t bytes_230429 = smax64((int64_t) 0, binop_y_230428);
                struct memblock_device ext_mem_230485;
                
                ext_mem_230485.references = NULL;
                
                struct memblock_device ext_mem_230484;
                
                ext_mem_230484.references = NULL;
                if (match_lit_204617) {
                    struct memblock_device mem_230425;
                    
                    mem_230425.references = NULL;
                    if (memblock_alloc_device(ctx, &mem_230425, bytes_229297,
                                              "mem_230425")) {
                        err = 1;
                        goto cleanup;
                    }
                    if (futrts_builtinzhreplicate_f64(ctx, mem_230425,
                                                      partition_sizze_203577 *
                                                      n_p_203492 * s_n_m_203636,
                                                      0.0) != 0) {
                        if (memblock_unref_device(ctx, &mem_230425,
                                                  "mem_230425") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_230484,
                                                  "ext_mem_230484") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_230485,
                                                  "ext_mem_230485") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_230486,
                                                  "ext_mem_230486") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_230487,
                                                  "ext_mem_230487") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_param_229515,
                                                  "mem_param_229515") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_param_229507,
                                                  "mem_param_229507") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_231517,
                                                  "ext_mem_231517") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_231518,
                                                  "ext_mem_231518") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_param_229493,
                                                  "mem_param_229493") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_param_229485,
                                                  "mem_param_229485") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_param_229477,
                                                  "mem_param_229477") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_231860,
                                                  "ext_mem_231860") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_231861,
                                                  "ext_mem_231861") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_231862,
                                                  "ext_mem_231862") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_230551,
                                                  "mem_230551") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_230534,
                                                  "mem_230534") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_230517,
                                                  "mem_230517") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_230500,
                                                  "mem_230500") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229531,
                                                  "mem_229531") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229526,
                                                  "mem_229526") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229520,
                                                  "mem_229520") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229469,
                                                  "mem_229469") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229465,
                                                  "mem_229465") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_229460,
                                                  "ext_mem_229460") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_229461,
                                                  "ext_mem_229461") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_229411,
                                                  "ext_mem_229411") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_229412,
                                                  "ext_mem_229412") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_229362,
                                                  "ext_mem_229362") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_229363,
                                                  "ext_mem_229363") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_229264,
                                                  "ext_mem_229264") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_229265,
                                                  "ext_mem_229265") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229206,
                                                  "mem_229206") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229200,
                                                  "mem_229200") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_229196,
                                                  "ext_mem_229196") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_229197,
                                                  "ext_mem_229197") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229164,
                                                  "mem_229164") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229161,
                                                  "mem_229161") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229157,
                                                  "mem_229157") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229155,
                                                  "mem_229155") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229152,
                                                  "mem_229152") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229148,
                                                  "mem_229148") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_out_232249,
                                                  "mem_out_232249") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_out_232248,
                                                  "mem_out_232248") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_out_232247,
                                                  "mem_out_232247") != 0)
                            return 1;
                        err = 1;
                        goto cleanup;
                    }
                    
                    struct memblock_device mem_230436;
                    
                    mem_230436.references = NULL;
                    if (memblock_alloc_device(ctx, &mem_230436, bytes_229297,
                                              "mem_230436")) {
                        err = 1;
                        goto cleanup;
                    }
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s\n", "\n# SegMap");
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_217183,
                                                            1,
                                                            (size_t) ((int64_t) 8 *
                                                                      q_s_203493),
                                                            NULL));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_217183,
                                                            2,
                                                            (size_t) ((int64_t) 8 *
                                                                      q_s_203493),
                                                            NULL));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_217183,
                                                            3,
                                                            (size_t) bytes_230429,
                                                            NULL));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_217183,
                                                            4,
                                                            sizeof(n_p_203492),
                                                            &n_p_203492));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_217183,
                                                            5,
                                                            sizeof(q_s_203493),
                                                            &q_s_203493));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_217183,
                                                            6,
                                                            sizeof(jump_s_203499),
                                                            &jump_s_203499));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_217183,
                                                            7,
                                                            sizeof(partition_sizze_203577),
                                                            &partition_sizze_203577));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_217183,
                                                            8,
                                                            sizeof(defunc_0_f_res_203631),
                                                            &defunc_0_f_res_203631));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_217183,
                                                            9,
                                                            sizeof(pad_css_len_203632),
                                                            &pad_css_len_203632));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_217183,
                                                            10,
                                                            sizeof(s_n_m_203636),
                                                            &s_n_m_203636));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_217183,
                                                            11,
                                                            sizeof(ext_mem_229264.mem),
                                                            &ext_mem_229264.mem));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_217183,
                                                            12,
                                                            sizeof(ext_mem_229265.mem),
                                                            &ext_mem_229265.mem));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_217183,
                                                            13,
                                                            sizeof(ext_mem_229362.mem),
                                                            &ext_mem_229362.mem));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_217183,
                                                            14,
                                                            sizeof(ext_mem_229363.mem),
                                                            &ext_mem_229363.mem));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_217183,
                                                            15,
                                                            sizeof(mem_229526.mem),
                                                            &mem_229526.mem));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_217183,
                                                            16,
                                                            sizeof(mem_229531.mem),
                                                            &mem_229531.mem));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_217183,
                                                            17,
                                                            sizeof(mem_230436.mem),
                                                            &mem_230436.mem));
                    if (1 * ((size_t) nest_sizze_208848 *
                             (size_t) q_s_203493) != 0) {
                        const size_t global_work_sizze_237059[1] =
                                     {(size_t) nest_sizze_208848 *
                                     (size_t) q_s_203493};
                        const size_t local_work_sizze_237063[1] =
                                     {(size_t) q_s_203493};
                        int64_t time_start_237060 = 0, time_end_237061 = 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_217183",
                                    global_work_sizze_237059[0],
                                    local_work_sizze_237063[0], (int) (0 +
                                                                       (int64_t) 8 *
                                                                       q_s_203493 +
                                                                       (int64_t) 8 *
                                                                       q_s_203493 +
                                                                       bytes_230429));
                            time_start_237060 = get_wall_time();
                        }
                        OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                        ctx->mainzisegmap_intragroup_217183,
                                                                        1, NULL,
                                                                        global_work_sizze_237059,
                                                                        local_work_sizze_237063,
                                                                        0, NULL,
                                                                        ctx->profiling_paused ||
                                                                        !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                  &ctx->mainzisegmap_intragroup_217183_runs,
                                                                                                                  &ctx->mainzisegmap_intragroup_217183_total_runtime)));
                        if (ctx->debugging) {
                            OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                            time_end_237061 = get_wall_time();
                            
                            long time_diff_237062 = time_end_237061 -
                                 time_start_237060;
                            
                            fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                                    "main.segmap_intragroup_217183",
                                    time_diff_237062);
                        }
                    }
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s\n", "");
                    if (memblock_set_device(ctx, &ext_mem_230485, &mem_230436,
                                            "mem_230436") != 0)
                        return 1;
                    if (memblock_set_device(ctx, &ext_mem_230484, &mem_230425,
                                            "mem_230425") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_230436, "mem_230436") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_230425, "mem_230425") !=
                        0)
                        return 1;
                } else {
                    bool match_lit_204689 = (int64_t) 1 == d_s_203496;
                    struct memblock_device ext_mem_230483;
                    
                    ext_mem_230483.references = NULL;
                    
                    struct memblock_device ext_mem_230482;
                    
                    ext_mem_230482.references = NULL;
                    if (match_lit_204689) {
                        struct memblock_device mem_230450;
                        
                        mem_230450.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_230450,
                                                  bytes_229297, "mem_230450")) {
                            err = 1;
                            goto cleanup;
                        }
                        
                        struct memblock_device mem_230455;
                        
                        mem_230455.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_230455,
                                                  bytes_229297, "mem_230455")) {
                            err = 1;
                            goto cleanup;
                        }
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s\n", "\n# SegMap");
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_217504,
                                                                1,
                                                                (size_t) ((int64_t) 8 *
                                                                          q_s_203493),
                                                                NULL));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_217504,
                                                                2,
                                                                (size_t) ((int64_t) 8 *
                                                                          q_s_203493),
                                                                NULL));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_217504,
                                                                3,
                                                                (size_t) ((int64_t) 8 *
                                                                          q_s_203493),
                                                                NULL));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_217504,
                                                                4,
                                                                (size_t) ((int64_t) 8 *
                                                                          q_s_203493),
                                                                NULL));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_217504,
                                                                5,
                                                                (size_t) ((int64_t) 8 *
                                                                          q_s_203493),
                                                                NULL));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_217504,
                                                                6,
                                                                (size_t) bytes_230429,
                                                                NULL));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_217504,
                                                                7,
                                                                (size_t) bytes_230429,
                                                                NULL));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_217504,
                                                                8,
                                                                sizeof(n_p_203492),
                                                                &n_p_203492));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_217504,
                                                                9,
                                                                sizeof(q_s_203493),
                                                                &q_s_203493));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_217504,
                                                                10,
                                                                sizeof(jump_s_203499),
                                                                &jump_s_203499));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_217504,
                                                                11,
                                                                sizeof(partition_sizze_203577),
                                                                &partition_sizze_203577));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_217504,
                                                                12,
                                                                sizeof(defunc_0_f_res_203631),
                                                                &defunc_0_f_res_203631));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_217504,
                                                                13,
                                                                sizeof(pad_css_len_203632),
                                                                &pad_css_len_203632));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_217504,
                                                                14,
                                                                sizeof(s_n_m_203636),
                                                                &s_n_m_203636));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_217504,
                                                                15,
                                                                sizeof(ext_mem_229264.mem),
                                                                &ext_mem_229264.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_217504,
                                                                16,
                                                                sizeof(ext_mem_229265.mem),
                                                                &ext_mem_229265.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_217504,
                                                                17,
                                                                sizeof(ext_mem_229362.mem),
                                                                &ext_mem_229362.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_217504,
                                                                18,
                                                                sizeof(ext_mem_229363.mem),
                                                                &ext_mem_229363.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_217504,
                                                                19,
                                                                sizeof(mem_229526.mem),
                                                                &mem_229526.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_217504,
                                                                20,
                                                                sizeof(mem_229531.mem),
                                                                &mem_229531.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_217504,
                                                                21,
                                                                sizeof(mem_230450.mem),
                                                                &mem_230450.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_217504,
                                                                22,
                                                                sizeof(mem_230455.mem),
                                                                &mem_230455.mem));
                        if (1 * ((size_t) nest_sizze_208848 *
                                 (size_t) q_s_203493) != 0) {
                            const size_t global_work_sizze_237064[1] =
                                         {(size_t) nest_sizze_208848 *
                                         (size_t) q_s_203493};
                            const size_t local_work_sizze_237068[1] =
                                         {(size_t) q_s_203493};
                            int64_t time_start_237065 = 0, time_end_237066 = 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_217504",
                                        global_work_sizze_237064[0],
                                        local_work_sizze_237068[0], (int) (0 +
                                                                           (int64_t) 8 *
                                                                           q_s_203493 +
                                                                           (int64_t) 8 *
                                                                           q_s_203493 +
                                                                           (int64_t) 8 *
                                                                           q_s_203493 +
                                                                           (int64_t) 8 *
                                                                           q_s_203493 +
                                                                           (int64_t) 8 *
                                                                           q_s_203493 +
                                                                           bytes_230429 +
                                                                           bytes_230429));
                                time_start_237065 = get_wall_time();
                            }
                            OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                            ctx->mainzisegmap_intragroup_217504,
                                                                            1,
                                                                            NULL,
                                                                            global_work_sizze_237064,
                                                                            local_work_sizze_237068,
                                                                            0,
                                                                            NULL,
                                                                            ctx->profiling_paused ||
                                                                            !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                      &ctx->mainzisegmap_intragroup_217504_runs,
                                                                                                                      &ctx->mainzisegmap_intragroup_217504_total_runtime)));
                            if (ctx->debugging) {
                                OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                time_end_237066 = get_wall_time();
                                
                                long time_diff_237067 = time_end_237066 -
                                     time_start_237065;
                                
                                fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                                        "main.segmap_intragroup_217504",
                                        time_diff_237067);
                            }
                        }
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s\n", "");
                        if (memblock_set_device(ctx, &ext_mem_230483,
                                                &mem_230450, "mem_230450") != 0)
                            return 1;
                        if (memblock_set_device(ctx, &ext_mem_230482,
                                                &mem_230455, "mem_230455") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_230455,
                                                  "mem_230455") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_230450,
                                                  "mem_230450") != 0)
                            return 1;
                    } else {
                        struct memblock_device mem_230476;
                        
                        mem_230476.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_230476,
                                                  bytes_229297, "mem_230476")) {
                            err = 1;
                            goto cleanup;
                        }
                        
                        struct memblock_device mem_230481;
                        
                        mem_230481.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_230481,
                                                  bytes_229297, "mem_230481")) {
                            err = 1;
                            goto cleanup;
                        }
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s\n", "\n# SegMap");
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_217955,
                                                                1,
                                                                (size_t) ((int64_t) 8 *
                                                                          q_s_203493),
                                                                NULL));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_217955,
                                                                2,
                                                                (size_t) ((int64_t) 8 *
                                                                          q_s_203493),
                                                                NULL));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_217955,
                                                                3,
                                                                (size_t) ((int64_t) 8 *
                                                                          q_s_203493),
                                                                NULL));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_217955,
                                                                4,
                                                                (size_t) ((int64_t) 8 *
                                                                          q_s_203493),
                                                                NULL));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_217955,
                                                                5,
                                                                (size_t) ((int64_t) 8 *
                                                                          q_s_203493),
                                                                NULL));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_217955,
                                                                6,
                                                                (size_t) ((int64_t) 8 *
                                                                          q_s_203493),
                                                                NULL));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_217955,
                                                                7,
                                                                (size_t) ((int64_t) 8 *
                                                                          q_s_203493),
                                                                NULL));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_217955,
                                                                8,
                                                                (size_t) bytes_230429,
                                                                NULL));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_217955,
                                                                9,
                                                                (size_t) bytes_230429,
                                                                NULL));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_217955,
                                                                10,
                                                                (size_t) bytes_230429,
                                                                NULL));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_217955,
                                                                11,
                                                                (size_t) bytes_230429,
                                                                NULL));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_217955,
                                                                12,
                                                                sizeof(n_p_203492),
                                                                &n_p_203492));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_217955,
                                                                13,
                                                                sizeof(q_s_203493),
                                                                &q_s_203493));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_217955,
                                                                14,
                                                                sizeof(jump_s_203499),
                                                                &jump_s_203499));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_217955,
                                                                15,
                                                                sizeof(partition_sizze_203577),
                                                                &partition_sizze_203577));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_217955,
                                                                16,
                                                                sizeof(defunc_0_f_res_203631),
                                                                &defunc_0_f_res_203631));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_217955,
                                                                17,
                                                                sizeof(pad_css_len_203632),
                                                                &pad_css_len_203632));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_217955,
                                                                18,
                                                                sizeof(s_n_m_203636),
                                                                &s_n_m_203636));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_217955,
                                                                19,
                                                                sizeof(ext_mem_229264.mem),
                                                                &ext_mem_229264.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_217955,
                                                                20,
                                                                sizeof(ext_mem_229265.mem),
                                                                &ext_mem_229265.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_217955,
                                                                21,
                                                                sizeof(ext_mem_229362.mem),
                                                                &ext_mem_229362.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_217955,
                                                                22,
                                                                sizeof(ext_mem_229363.mem),
                                                                &ext_mem_229363.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_217955,
                                                                23,
                                                                sizeof(mem_229526.mem),
                                                                &mem_229526.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_217955,
                                                                24,
                                                                sizeof(mem_229531.mem),
                                                                &mem_229531.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_217955,
                                                                25,
                                                                sizeof(mem_230476.mem),
                                                                &mem_230476.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_217955,
                                                                26,
                                                                sizeof(mem_230481.mem),
                                                                &mem_230481.mem));
                        if (1 * ((size_t) nest_sizze_208848 *
                                 (size_t) q_s_203493) != 0) {
                            const size_t global_work_sizze_237069[1] =
                                         {(size_t) nest_sizze_208848 *
                                         (size_t) q_s_203493};
                            const size_t local_work_sizze_237073[1] =
                                         {(size_t) q_s_203493};
                            int64_t time_start_237070 = 0, time_end_237071 = 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_217955",
                                        global_work_sizze_237069[0],
                                        local_work_sizze_237073[0], (int) (0 +
                                                                           (int64_t) 8 *
                                                                           q_s_203493 +
                                                                           (int64_t) 8 *
                                                                           q_s_203493 +
                                                                           (int64_t) 8 *
                                                                           q_s_203493 +
                                                                           (int64_t) 8 *
                                                                           q_s_203493 +
                                                                           (int64_t) 8 *
                                                                           q_s_203493 +
                                                                           (int64_t) 8 *
                                                                           q_s_203493 +
                                                                           (int64_t) 8 *
                                                                           q_s_203493 +
                                                                           bytes_230429 +
                                                                           bytes_230429 +
                                                                           bytes_230429 +
                                                                           bytes_230429));
                                time_start_237070 = get_wall_time();
                            }
                            OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                            ctx->mainzisegmap_intragroup_217955,
                                                                            1,
                                                                            NULL,
                                                                            global_work_sizze_237069,
                                                                            local_work_sizze_237073,
                                                                            0,
                                                                            NULL,
                                                                            ctx->profiling_paused ||
                                                                            !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                      &ctx->mainzisegmap_intragroup_217955_runs,
                                                                                                                      &ctx->mainzisegmap_intragroup_217955_total_runtime)));
                            if (ctx->debugging) {
                                OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                time_end_237071 = get_wall_time();
                                
                                long time_diff_237072 = time_end_237071 -
                                     time_start_237070;
                                
                                fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                                        "main.segmap_intragroup_217955",
                                        time_diff_237072);
                            }
                        }
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s\n", "");
                        if (memblock_set_device(ctx, &ext_mem_230483,
                                                &mem_230476, "mem_230476") != 0)
                            return 1;
                        if (memblock_set_device(ctx, &ext_mem_230482,
                                                &mem_230481, "mem_230481") != 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_set_device(ctx, &ext_mem_230485,
                                            &ext_mem_230483,
                                            "ext_mem_230483") != 0)
                        return 1;
                    if (memblock_set_device(ctx, &ext_mem_230484,
                                            &ext_mem_230482,
                                            "ext_mem_230482") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_230482,
                                              "ext_mem_230482") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_230483,
                                              "ext_mem_230483") != 0)
                        return 1;
                }
                if (memblock_set_device(ctx, &ext_mem_230487, &ext_mem_230485,
                                        "ext_mem_230485") != 0)
                    return 1;
                if (memblock_set_device(ctx, &ext_mem_230486, &ext_mem_230484,
                                        "ext_mem_230484") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_230484,
                                          "ext_mem_230484") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_230485,
                                          "ext_mem_230485") != 0)
                    return 1;
            }
            
            struct memblock_device ext_mem_230494;
            
            ext_mem_230494.references = NULL;
            if (cond_203635) {
                if (memblock_set_device(ctx, &ext_mem_230494, &ext_mem_230487,
                                        "ext_mem_230487") != 0)
                    return 1;
            } else {
                bool bounds_invalid_upwards_204971 = slt64(pad_css_len_203632,
                                                           (int64_t) 0);
                bool valid_204972 = !bounds_invalid_upwards_204971;
                bool range_valid_c_204973;
                
                if (!valid_204972) {
                    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_203632,
                                  " 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_230494,
                                              "ext_mem_230494") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_230486,
                                              "ext_mem_230486") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_230487,
                                              "ext_mem_230487") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_229515,
                                              "mem_param_229515") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_229507,
                                              "mem_param_229507") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231517,
                                              "ext_mem_231517") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231518,
                                              "ext_mem_231518") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_229493,
                                              "mem_param_229493") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_229485,
                                              "mem_param_229485") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_229477,
                                              "mem_param_229477") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231860,
                                              "ext_mem_231860") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231861,
                                              "ext_mem_231861") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231862,
                                              "ext_mem_231862") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_230551, "mem_230551") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_230534, "mem_230534") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_230517, "mem_230517") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_230500, "mem_230500") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229531, "mem_229531") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229526, "mem_229526") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229520, "mem_229520") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229469, "mem_229469") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229465, "mem_229465") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229460,
                                              "ext_mem_229460") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229461,
                                              "ext_mem_229461") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229411,
                                              "ext_mem_229411") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229412,
                                              "ext_mem_229412") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229362,
                                              "ext_mem_229362") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229363,
                                              "ext_mem_229363") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229264,
                                              "ext_mem_229264") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229265,
                                              "ext_mem_229265") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229206, "mem_229206") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229200, "mem_229200") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229196,
                                              "ext_mem_229196") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229197,
                                              "ext_mem_229197") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229164, "mem_229164") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229161, "mem_229161") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229157, "mem_229157") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229155, "mem_229155") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229152, "mem_229152") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229148, "mem_229148") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_out_232249,
                                              "mem_out_232249") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_out_232248,
                                              "mem_out_232248") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_out_232247,
                                              "mem_out_232247") != 0)
                        return 1;
                    err = 1;
                    goto cleanup;
                }
                
                int64_t y_218405 = n_p_203492 * pad_css_len_203632;
                int64_t nest_sizze_218406 = partition_sizze_203577 * y_218405;
                int64_t segmap_group_sizze_218407;
                
                segmap_group_sizze_218407 =
                    *ctx->tuning_params.mainzisegmap_group_sizze_218115;
                
                int64_t segmap_usable_groups_218408 =
                        sdiv_up64(nest_sizze_218406, segmap_group_sizze_218407);
                struct memblock_device mem_230493;
                
                mem_230493.references = NULL;
                if (memblock_alloc_device(ctx, &mem_230493, bytes_230492,
                                          "mem_230493")) {
                    err = 1;
                    goto cleanup;
                }
                if (ctx->debugging)
                    fprintf(ctx->log, "%s\n", "\n# SegMap");
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_218413,
                                                        1,
                                                        sizeof(ctx->failure_is_an_option),
                                                        &ctx->failure_is_an_option));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_218413,
                                                        3, sizeof(n_p_203492),
                                                        &n_p_203492));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_218413,
                                                        4,
                                                        sizeof(jump_s_203499),
                                                        &jump_s_203499));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_218413,
                                                        5,
                                                        sizeof(partition_sizze_203577),
                                                        &partition_sizze_203577));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_218413,
                                                        6,
                                                        sizeof(defunc_0_f_res_203631),
                                                        &defunc_0_f_res_203631));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_218413,
                                                        7,
                                                        sizeof(pad_css_len_203632),
                                                        &pad_css_len_203632));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_218413,
                                                        8, sizeof(s_n_m_203636),
                                                        &s_n_m_203636));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_218413,
                                                        9,
                                                        sizeof(ext_mem_230486.mem),
                                                        &ext_mem_230486.mem));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_218413,
                                                        10,
                                                        sizeof(ext_mem_230487.mem),
                                                        &ext_mem_230487.mem));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_218413,
                                                        11,
                                                        sizeof(mem_230493.mem),
                                                        &mem_230493.mem));
                if (1 * ((size_t) segmap_usable_groups_218408 *
                         (size_t) segmap_group_sizze_218407) != 0) {
                    const size_t global_work_sizze_237074[1] =
                                 {(size_t) segmap_usable_groups_218408 *
                                 (size_t) segmap_group_sizze_218407};
                    const size_t local_work_sizze_237078[1] =
                                 {(size_t) segmap_group_sizze_218407};
                    int64_t time_start_237075 = 0, time_end_237076 = 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_218413",
                                global_work_sizze_237074[0],
                                local_work_sizze_237078[0], (int) 0);
                        time_start_237075 = get_wall_time();
                    }
                    OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                    ctx->mainzisegmap_218413,
                                                                    1, NULL,
                                                                    global_work_sizze_237074,
                                                                    local_work_sizze_237078,
                                                                    0, NULL,
                                                                    ctx->profiling_paused ||
                                                                    !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                              &ctx->mainzisegmap_218413_runs,
                                                                                                              &ctx->mainzisegmap_218413_total_runtime)));
                    if (ctx->debugging) {
                        OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                        time_end_237076 = get_wall_time();
                        
                        long time_diff_237077 = time_end_237076 -
                             time_start_237075;
                        
                        fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                                "main.segmap_218413", time_diff_237077);
                    }
                }
                ctx->failure_is_an_option = 1;
                if (ctx->debugging)
                    fprintf(ctx->log, "%s\n", "");
                if (memblock_set_device(ctx, &ext_mem_230494, &mem_230493,
                                        "mem_230493") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_230493, "mem_230493") != 0)
                    return 1;
            }
            if (memblock_unref_device(ctx, &ext_mem_230486, "ext_mem_230486") !=
                0)
                return 1;
            if (memblock_unref_device(ctx, &ext_mem_230487, "ext_mem_230487") !=
                0)
                return 1;
            if (ctx->debugging)
                fprintf(ctx->log, "%s\n", "\n# SegMap");
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_218562, 1,
                                                    sizeof(ctx->failure_is_an_option),
                                                    &ctx->failure_is_an_option));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_218562, 3,
                                                    sizeof(n_p_203492),
                                                    &n_p_203492));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_218562, 4,
                                                    sizeof(partition_sizze_203577),
                                                    &partition_sizze_203577));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_218562, 5,
                                                    sizeof(C_len_203634),
                                                    &C_len_203634));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_218562, 6,
                                                    sizeof(css_results_l_204110),
                                                    &css_results_l_204110));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_218562, 7,
                                                    sizeof(ext_mem_230494.mem),
                                                    &ext_mem_230494.mem));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_218562, 8,
                                                    sizeof(mem_230500.mem),
                                                    &mem_230500.mem));
            if (1 * ((size_t) segmap_usable_groups_218558 *
                     (size_t) segmap_group_sizze_218557) != 0) {
                const size_t global_work_sizze_237079[1] =
                             {(size_t) segmap_usable_groups_218558 *
                             (size_t) segmap_group_sizze_218557};
                const size_t local_work_sizze_237083[1] =
                             {(size_t) segmap_group_sizze_218557};
                int64_t time_start_237080 = 0, time_end_237081 = 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_218562", global_work_sizze_237079[0],
                            local_work_sizze_237083[0], (int) 0);
                    time_start_237080 = get_wall_time();
                }
                OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                ctx->mainzisegmap_218562,
                                                                1, NULL,
                                                                global_work_sizze_237079,
                                                                local_work_sizze_237083,
                                                                0, NULL,
                                                                ctx->profiling_paused ||
                                                                !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                          &ctx->mainzisegmap_218562_runs,
                                                                                                          &ctx->mainzisegmap_218562_total_runtime)));
                if (ctx->debugging) {
                    OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                    time_end_237081 = get_wall_time();
                    
                    long time_diff_237082 = time_end_237081 - time_start_237080;
                    
                    fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                            "main.segmap_218562", time_diff_237082);
                }
            }
            ctx->failure_is_an_option = 1;
            if (ctx->debugging)
                fprintf(ctx->log, "%s\n", "");
            if (memblock_unref_device(ctx, &ext_mem_230494, "ext_mem_230494") !=
                0)
                return 1;
            
            struct memblock_device ext_mem_230512;
            
            ext_mem_230512.references = NULL;
            
            int32_t local_memory_capacity_234166;
            
            local_memory_capacity_234166 = ctx->opencl.max_local_memory;
            if (sle64((int64_t) 0,
                      sext_i32_i64(local_memory_capacity_234166)) &&
                suff_outer_par_218578) {
                struct memblock_device mem_230503;
                
                mem_230503.references = NULL;
                if (memblock_alloc_device(ctx, &mem_230503, binop_y_230498,
                                          "mem_230503")) {
                    err = 1;
                    goto cleanup;
                }
                if (futrts_builtinzhgpu_map_transpose_f64(ctx, mem_230503,
                                                          (int64_t) 0,
                                                          mem_230500,
                                                          (int64_t) 0,
                                                          (int64_t) 1,
                                                          C_len_203634,
                                                          partition_sizze_203577) !=
                    0) {
                    if (memblock_unref_device(ctx, &mem_230503, "mem_230503") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_230512,
                                              "ext_mem_230512") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_230494,
                                              "ext_mem_230494") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_230486,
                                              "ext_mem_230486") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_230487,
                                              "ext_mem_230487") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_229515,
                                              "mem_param_229515") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_229507,
                                              "mem_param_229507") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231517,
                                              "ext_mem_231517") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231518,
                                              "ext_mem_231518") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_229493,
                                              "mem_param_229493") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_229485,
                                              "mem_param_229485") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_229477,
                                              "mem_param_229477") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231860,
                                              "ext_mem_231860") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231861,
                                              "ext_mem_231861") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231862,
                                              "ext_mem_231862") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_230551, "mem_230551") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_230534, "mem_230534") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_230517, "mem_230517") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_230500, "mem_230500") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229531, "mem_229531") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229526, "mem_229526") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229520, "mem_229520") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229469, "mem_229469") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229465, "mem_229465") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229460,
                                              "ext_mem_229460") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229461,
                                              "ext_mem_229461") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229411,
                                              "ext_mem_229411") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229412,
                                              "ext_mem_229412") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229362,
                                              "ext_mem_229362") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229363,
                                              "ext_mem_229363") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229264,
                                              "ext_mem_229264") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229265,
                                              "ext_mem_229265") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229206, "mem_229206") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229200, "mem_229200") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229196,
                                              "ext_mem_229196") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229197,
                                              "ext_mem_229197") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229164, "mem_229164") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229161, "mem_229161") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229157, "mem_229157") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229155, "mem_229155") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229152, "mem_229152") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229148, "mem_229148") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_out_232249,
                                              "mem_out_232249") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_out_232248,
                                              "mem_out_232248") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_out_232247,
                                              "mem_out_232247") != 0)
                        return 1;
                    err = 1;
                    goto cleanup;
                }
                
                struct memblock_device mem_230507;
                
                mem_230507.references = NULL;
                if (memblock_alloc_device(ctx, &mem_230507, bytes_229180,
                                          "mem_230507")) {
                    err = 1;
                    goto cleanup;
                }
                if (ctx->debugging)
                    fprintf(ctx->log, "%s\n", "\n# SegMap");
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_218598,
                                                        1, sizeof(n_p_203492),
                                                        &n_p_203492));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_218598,
                                                        2,
                                                        sizeof(partition_sizze_203577),
                                                        &partition_sizze_203577));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_218598,
                                                        3,
                                                        sizeof(mem_230503.mem),
                                                        &mem_230503.mem));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_218598,
                                                        4,
                                                        sizeof(mem_230507.mem),
                                                        &mem_230507.mem));
                if (1 * ((size_t) segmap_usable_groups_218595 *
                         (size_t) segmap_group_sizze_218594) != 0) {
                    const size_t global_work_sizze_237084[1] =
                                 {(size_t) segmap_usable_groups_218595 *
                                 (size_t) segmap_group_sizze_218594};
                    const size_t local_work_sizze_237088[1] =
                                 {(size_t) segmap_group_sizze_218594};
                    int64_t time_start_237085 = 0, time_end_237086 = 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_218598",
                                global_work_sizze_237084[0],
                                local_work_sizze_237088[0], (int) 0);
                        time_start_237085 = get_wall_time();
                    }
                    OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                    ctx->mainzisegmap_218598,
                                                                    1, NULL,
                                                                    global_work_sizze_237084,
                                                                    local_work_sizze_237088,
                                                                    0, NULL,
                                                                    ctx->profiling_paused ||
                                                                    !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                              &ctx->mainzisegmap_218598_runs,
                                                                                                              &ctx->mainzisegmap_218598_total_runtime)));
                    if (ctx->debugging) {
                        OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                        time_end_237086 = get_wall_time();
                        
                        long time_diff_237087 = time_end_237086 -
                             time_start_237085;
                        
                        fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                                "main.segmap_218598", time_diff_237087);
                    }
                }
                if (ctx->debugging)
                    fprintf(ctx->log, "%s\n", "");
                if (memblock_unref_device(ctx, &mem_230503, "mem_230503") != 0)
                    return 1;
                if (memblock_set_device(ctx, &ext_mem_230512, &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_230503, "mem_230503") != 0)
                    return 1;
            } else {
                struct memblock_device mem_230511;
                
                mem_230511.references = NULL;
                if (memblock_alloc_device(ctx, &mem_230511, bytes_229180,
                                          "mem_230511")) {
                    err = 1;
                    goto cleanup;
                }
                if (slt64(n_p_203492 * (int64_t) 2,
                          segred_group_sizze_218625)) {
                    int64_t segment_sizze_nonzzero_234098 = smax64((int64_t) 1,
                                                                   n_p_203492);
                    int64_t num_threads_234099 = num_groups_218626 *
                            segred_group_sizze_218625;
                    
                    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_203577, '\n');
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s: %llu%c", "segment_size",
                                (long long) n_p_203492, '\n');
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s: %llu%c", "segments_per_group",
                                (long long) squot64(segred_group_sizze_218625,
                                                    segment_sizze_nonzzero_234098),
                                '\n');
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s: %llu%c", "required_groups",
                                (long long) sext_i64_i32(sdiv_up64(partition_sizze_203577,
                                                                   squot64(segred_group_sizze_218625,
                                                                           segment_sizze_nonzzero_234098))),
                                '\n');
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_218631,
                                                            1,
                                                            (size_t) ((int64_t) 8 *
                                                                      segred_group_sizze_218625),
                                                            NULL));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_218631,
                                                            2,
                                                            sizeof(n_p_203492),
                                                            &n_p_203492));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_218631,
                                                            3,
                                                            sizeof(partition_sizze_203577),
                                                            &partition_sizze_203577));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_218631,
                                                            4,
                                                            sizeof(C_len_203634),
                                                            &C_len_203634));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_218631,
                                                            5,
                                                            sizeof(num_groups_218626),
                                                            &num_groups_218626));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_218631,
                                                            6,
                                                            sizeof(segment_sizze_nonzzero_234098),
                                                            &segment_sizze_nonzzero_234098));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_218631,
                                                            7,
                                                            sizeof(mem_230500.mem),
                                                            &mem_230500.mem));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_218631,
                                                            8,
                                                            sizeof(mem_230511.mem),
                                                            &mem_230511.mem));
                    if (1 * ((size_t) num_groups_218626 *
                             (size_t) segred_group_sizze_218625) != 0) {
                        const size_t global_work_sizze_237089[1] =
                                     {(size_t) num_groups_218626 *
                                     (size_t) segred_group_sizze_218625};
                        const size_t local_work_sizze_237093[1] =
                                     {(size_t) segred_group_sizze_218625};
                        int64_t time_start_237090 = 0, time_end_237091 = 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_218631",
                                    global_work_sizze_237089[0],
                                    local_work_sizze_237093[0], (int) (0 +
                                                                       (int64_t) 8 *
                                                                       segred_group_sizze_218625));
                            time_start_237090 = get_wall_time();
                        }
                        OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                        ctx->mainzisegred_small_218631,
                                                                        1, NULL,
                                                                        global_work_sizze_237089,
                                                                        local_work_sizze_237093,
                                                                        0, NULL,
                                                                        ctx->profiling_paused ||
                                                                        !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                  &ctx->mainzisegred_small_218631_runs,
                                                                                                                  &ctx->mainzisegred_small_218631_total_runtime)));
                        if (ctx->debugging) {
                            OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                            time_end_237091 = get_wall_time();
                            
                            long time_diff_237092 = time_end_237091 -
                                 time_start_237090;
                            
                            fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                                    "main.segred_small_218631",
                                    time_diff_237092);
                        }
                    }
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s\n", "");
                } else {
                    int64_t groups_per_segment_234125 =
                            sdiv_up64(num_groups_218626, smax64((int64_t) 1,
                                                                partition_sizze_203577));
                    int64_t elements_per_thread_234126 = sdiv_up64(n_p_203492,
                                                                   segred_group_sizze_218625 *
                                                                   groups_per_segment_234125);
                    int64_t virt_num_groups_234127 = groups_per_segment_234125 *
                            partition_sizze_203577;
                    int64_t num_threads_234128 = num_groups_218626 *
                            segred_group_sizze_218625;
                    int64_t threads_per_segment_234129 =
                            groups_per_segment_234125 *
                            segred_group_sizze_218625;
                    
                    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_203577, '\n');
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s: %llu%c", "segment_size",
                                (long long) n_p_203492, '\n');
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s: %llu%c", "virt_num_groups",
                                (long long) virt_num_groups_234127, '\n');
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s: %llu%c", "num_groups",
                                (long long) num_groups_218626, '\n');
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s: %llu%c", "group_size",
                                (long long) segred_group_sizze_218625, '\n');
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s: %llu%c", "elems_per_thread",
                                (long long) elements_per_thread_234126, '\n');
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s: %llu%c", "groups_per_segment",
                                (long long) groups_per_segment_234125, '\n');
                    
                    struct memblock_device segred_tmp_mem_234130;
                    
                    segred_tmp_mem_234130.references = NULL;
                    if (memblock_alloc_device(ctx, &segred_tmp_mem_234130,
                                              (int64_t) 8 *
                                              virt_num_groups_234127,
                                              "segred_tmp_mem_234130")) {
                        err = 1;
                        goto cleanup;
                    }
                    
                    struct memblock_device mainzicounter_mem_234132 =
                                           ctx->mainzicounter_mem_234132;
                    
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_218631,
                                                            1, (size_t) 1,
                                                            NULL));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_218631,
                                                            2,
                                                            (size_t) ((int64_t) 8 *
                                                                      segred_group_sizze_218625),
                                                            NULL));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_218631,
                                                            3,
                                                            sizeof(n_p_203492),
                                                            &n_p_203492));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_218631,
                                                            4,
                                                            sizeof(partition_sizze_203577),
                                                            &partition_sizze_203577));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_218631,
                                                            5,
                                                            sizeof(C_len_203634),
                                                            &C_len_203634));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_218631,
                                                            6,
                                                            sizeof(num_groups_218626),
                                                            &num_groups_218626));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_218631,
                                                            7,
                                                            sizeof(groups_per_segment_234125),
                                                            &groups_per_segment_234125));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_218631,
                                                            8,
                                                            sizeof(elements_per_thread_234126),
                                                            &elements_per_thread_234126));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_218631,
                                                            9,
                                                            sizeof(virt_num_groups_234127),
                                                            &virt_num_groups_234127));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_218631,
                                                            10,
                                                            sizeof(threads_per_segment_234129),
                                                            &threads_per_segment_234129));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_218631,
                                                            11,
                                                            sizeof(mem_230500.mem),
                                                            &mem_230500.mem));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_218631,
                                                            12,
                                                            sizeof(mem_230511.mem),
                                                            &mem_230511.mem));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_218631,
                                                            13,
                                                            sizeof(segred_tmp_mem_234130.mem),
                                                            &segred_tmp_mem_234130.mem));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_218631,
                                                            14,
                                                            sizeof(mainzicounter_mem_234132.mem),
                                                            &mainzicounter_mem_234132.mem));
                    if (1 * ((size_t) num_groups_218626 *
                             (size_t) segred_group_sizze_218625) != 0) {
                        const size_t global_work_sizze_237095[1] =
                                     {(size_t) num_groups_218626 *
                                     (size_t) segred_group_sizze_218625};
                        const size_t local_work_sizze_237099[1] =
                                     {(size_t) segred_group_sizze_218625};
                        int64_t time_start_237096 = 0, time_end_237097 = 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_218631",
                                    global_work_sizze_237095[0],
                                    local_work_sizze_237099[0], (int) (0 + 1 +
                                                                       (int64_t) 8 *
                                                                       segred_group_sizze_218625));
                            time_start_237096 = get_wall_time();
                        }
                        OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                        ctx->mainzisegred_large_218631,
                                                                        1, NULL,
                                                                        global_work_sizze_237095,
                                                                        local_work_sizze_237099,
                                                                        0, NULL,
                                                                        ctx->profiling_paused ||
                                                                        !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                  &ctx->mainzisegred_large_218631_runs,
                                                                                                                  &ctx->mainzisegred_large_218631_total_runtime)));
                        if (ctx->debugging) {
                            OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                            time_end_237097 = get_wall_time();
                            
                            long time_diff_237098 = time_end_237097 -
                                 time_start_237096;
                            
                            fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                                    "main.segred_large_218631",
                                    time_diff_237098);
                        }
                    }
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s\n", "");
                    if (memblock_unref_device(ctx, &segred_tmp_mem_234130,
                                              "segred_tmp_mem_234130") != 0)
                        return 1;
                }
                if (memblock_set_device(ctx, &ext_mem_230512, &mem_230511,
                                        "mem_230511") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_230511, "mem_230511") != 0)
                    return 1;
            }
            if (slt64((int64_t) 0, partition_sizze_203577 *
                      lifted_single_ma_l_arg_204134)) {
                if (ctx->debugging)
                    fprintf(ctx->log, "%s\n", "\n# SegScan");
                
                int64_t stage1_max_num_groups_234167;
                
                stage1_max_num_groups_234167 = ctx->opencl.max_group_size;
                
                int64_t stage1_num_groups_234168 =
                        smin64(stage1_max_num_groups_234167, num_groups_218678);
                int32_t num_threads_234169 =
                        sext_i64_i32(stage1_num_groups_234168 *
                        segscan_group_sizze_218677);
                
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage1_218683,
                                                        1,
                                                        sizeof(ctx->failure_is_an_option),
                                                        &ctx->failure_is_an_option));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage1_218683,
                                                        3,
                                                        (size_t) smax64((int64_t) 1,
                                                                        (int64_t) 8 *
                                                                        segscan_group_sizze_218677),
                                                        NULL));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage1_218683,
                                                        4, sizeof(n_p_203492),
                                                        &n_p_203492));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage1_218683,
                                                        5,
                                                        sizeof(i64_res_203507),
                                                        &i64_res_203507));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage1_218683,
                                                        6,
                                                        sizeof(partition_sizze_203577),
                                                        &partition_sizze_203577));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage1_218683,
                                                        7, sizeof(C_len_203634),
                                                        &C_len_203634));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage1_218683,
                                                        8,
                                                        sizeof(lifted_single_ma_l_arg_204134),
                                                        &lifted_single_ma_l_arg_204134));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage1_218683,
                                                        9,
                                                        sizeof(num_threads_234169),
                                                        &num_threads_234169));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage1_218683,
                                                        10,
                                                        sizeof(mem_230500.mem),
                                                        &mem_230500.mem));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage1_218683,
                                                        11,
                                                        sizeof(ext_mem_230512.mem),
                                                        &ext_mem_230512.mem));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage1_218683,
                                                        12,
                                                        sizeof(mem_230517.mem),
                                                        &mem_230517.mem));
                if (1 * ((size_t) stage1_num_groups_234168 *
                         (size_t) segscan_group_sizze_218677) != 0) {
                    const size_t global_work_sizze_237100[1] =
                                 {(size_t) stage1_num_groups_234168 *
                                 (size_t) segscan_group_sizze_218677};
                    const size_t local_work_sizze_237104[1] =
                                 {(size_t) segscan_group_sizze_218677};
                    int64_t time_start_237101 = 0, time_end_237102 = 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_218683",
                                global_work_sizze_237100[0],
                                local_work_sizze_237104[0], (int) (0 +
                                                                   smax64((int64_t) 1,
                                                                          (int64_t) 8 *
                                                                          segscan_group_sizze_218677)));
                        time_start_237101 = get_wall_time();
                    }
                    OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                    ctx->mainziscan_stage1_218683,
                                                                    1, NULL,
                                                                    global_work_sizze_237100,
                                                                    local_work_sizze_237104,
                                                                    0, NULL,
                                                                    ctx->profiling_paused ||
                                                                    !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                              &ctx->mainziscan_stage1_218683_runs,
                                                                                                              &ctx->mainziscan_stage1_218683_total_runtime)));
                    if (ctx->debugging) {
                        OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                        time_end_237102 = get_wall_time();
                        
                        long time_diff_237103 = time_end_237102 -
                             time_start_237101;
                        
                        fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                                "main.scan_stage1_218683", time_diff_237103);
                    }
                }
                ctx->failure_is_an_option = 1;
                if (ctx->debugging)
                    fprintf(ctx->log, "%s: %llu%c", "elems_per_group",
                            (long long) (segscan_group_sizze_218677 *
                                         sdiv_up64(partition_sizze_203577 *
                                                   lifted_single_ma_l_arg_204134,
                                                   sext_i32_i64(num_threads_234169))),
                            '\n');
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage2_218683,
                                                        1,
                                                        (size_t) smax64((int64_t) 1,
                                                                        (int64_t) 8 *
                                                                        stage1_num_groups_234168),
                                                        NULL));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage2_218683,
                                                        2,
                                                        sizeof(partition_sizze_203577),
                                                        &partition_sizze_203577));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage2_218683,
                                                        3,
                                                        sizeof(lifted_single_ma_l_arg_204134),
                                                        &lifted_single_ma_l_arg_204134));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage2_218683,
                                                        4,
                                                        sizeof(stage1_num_groups_234168),
                                                        &stage1_num_groups_234168));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage2_218683,
                                                        5,
                                                        sizeof(num_threads_234169),
                                                        &num_threads_234169));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage2_218683,
                                                        6,
                                                        sizeof(mem_230517.mem),
                                                        &mem_230517.mem));
                if (1 * ((size_t) (int64_t) 1 *
                         (size_t) stage1_num_groups_234168) != 0) {
                    const size_t global_work_sizze_237105[1] =
                                 {(size_t) (int64_t) 1 *
                                 (size_t) stage1_num_groups_234168};
                    const size_t local_work_sizze_237109[1] =
                                 {(size_t) stage1_num_groups_234168};
                    int64_t time_start_237106 = 0, time_end_237107 = 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_218683",
                                global_work_sizze_237105[0],
                                local_work_sizze_237109[0], (int) (0 +
                                                                   smax64((int64_t) 1,
                                                                          (int64_t) 8 *
                                                                          stage1_num_groups_234168)));
                        time_start_237106 = get_wall_time();
                    }
                    OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                    ctx->mainziscan_stage2_218683,
                                                                    1, NULL,
                                                                    global_work_sizze_237105,
                                                                    local_work_sizze_237109,
                                                                    0, NULL,
                                                                    ctx->profiling_paused ||
                                                                    !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                              &ctx->mainziscan_stage2_218683_runs,
                                                                                                              &ctx->mainziscan_stage2_218683_total_runtime)));
                    if (ctx->debugging) {
                        OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                        time_end_237107 = get_wall_time();
                        
                        long time_diff_237108 = time_end_237107 -
                             time_start_237106;
                        
                        fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                                "main.scan_stage2_218683", time_diff_237108);
                    }
                }
                
                int32_t required_groups_234220 =
                        sext_i64_i32(sdiv_up64(partition_sizze_203577 *
                                               lifted_single_ma_l_arg_204134,
                                               segscan_group_sizze_218677));
                
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage3_218683,
                                                        1,
                                                        sizeof(partition_sizze_203577),
                                                        &partition_sizze_203577));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage3_218683,
                                                        2,
                                                        sizeof(lifted_single_ma_l_arg_204134),
                                                        &lifted_single_ma_l_arg_204134));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage3_218683,
                                                        3,
                                                        sizeof(num_groups_218678),
                                                        &num_groups_218678));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage3_218683,
                                                        4,
                                                        sizeof(num_threads_234169),
                                                        &num_threads_234169));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage3_218683,
                                                        5,
                                                        sizeof(required_groups_234220),
                                                        &required_groups_234220));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage3_218683,
                                                        6,
                                                        sizeof(mem_230517.mem),
                                                        &mem_230517.mem));
                if (1 * ((size_t) num_groups_218678 *
                         (size_t) segscan_group_sizze_218677) != 0) {
                    const size_t global_work_sizze_237110[1] =
                                 {(size_t) num_groups_218678 *
                                 (size_t) segscan_group_sizze_218677};
                    const size_t local_work_sizze_237114[1] =
                                 {(size_t) segscan_group_sizze_218677};
                    int64_t time_start_237111 = 0, time_end_237112 = 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_218683",
                                global_work_sizze_237110[0],
                                local_work_sizze_237114[0], (int) 0);
                        time_start_237111 = get_wall_time();
                    }
                    OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                    ctx->mainziscan_stage3_218683,
                                                                    1, NULL,
                                                                    global_work_sizze_237110,
                                                                    local_work_sizze_237114,
                                                                    0, NULL,
                                                                    ctx->profiling_paused ||
                                                                    !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                              &ctx->mainziscan_stage3_218683_runs,
                                                                                                              &ctx->mainziscan_stage3_218683_total_runtime)));
                    if (ctx->debugging) {
                        OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                        time_end_237112 = get_wall_time();
                        
                        long time_diff_237113 = time_end_237112 -
                             time_start_237111;
                        
                        fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                                "main.scan_stage3_218683", time_diff_237113);
                    }
                }
            }
            if (memblock_unref_device(ctx, &ext_mem_230512, "ext_mem_230512") !=
                0)
                return 1;
            
            struct memblock_device ext_mem_230529;
            
            ext_mem_230529.references = NULL;
            
            int32_t local_memory_capacity_234309;
            
            local_memory_capacity_234309 = ctx->opencl.max_local_memory;
            if (sle64((int64_t) 0,
                      sext_i32_i64(local_memory_capacity_234309)) &&
                suff_outer_par_218709) {
                struct memblock_device mem_230520;
                
                mem_230520.references = NULL;
                if (memblock_alloc_device(ctx, &mem_230520, binop_y_230515,
                                          "mem_230520")) {
                    err = 1;
                    goto cleanup;
                }
                if (futrts_builtinzhgpu_map_transpose_f64(ctx, mem_230520,
                                                          (int64_t) 0,
                                                          mem_230517,
                                                          (int64_t) 0,
                                                          (int64_t) 1,
                                                          lifted_single_ma_l_arg_204134,
                                                          partition_sizze_203577) !=
                    0) {
                    if (memblock_unref_device(ctx, &mem_230520, "mem_230520") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_230529,
                                              "ext_mem_230529") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_230512,
                                              "ext_mem_230512") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_230494,
                                              "ext_mem_230494") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_230486,
                                              "ext_mem_230486") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_230487,
                                              "ext_mem_230487") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_229515,
                                              "mem_param_229515") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_229507,
                                              "mem_param_229507") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231517,
                                              "ext_mem_231517") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231518,
                                              "ext_mem_231518") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_229493,
                                              "mem_param_229493") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_229485,
                                              "mem_param_229485") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_229477,
                                              "mem_param_229477") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231860,
                                              "ext_mem_231860") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231861,
                                              "ext_mem_231861") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231862,
                                              "ext_mem_231862") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_230551, "mem_230551") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_230534, "mem_230534") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_230517, "mem_230517") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_230500, "mem_230500") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229531, "mem_229531") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229526, "mem_229526") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229520, "mem_229520") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229469, "mem_229469") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229465, "mem_229465") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229460,
                                              "ext_mem_229460") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229461,
                                              "ext_mem_229461") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229411,
                                              "ext_mem_229411") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229412,
                                              "ext_mem_229412") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229362,
                                              "ext_mem_229362") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229363,
                                              "ext_mem_229363") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229264,
                                              "ext_mem_229264") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229265,
                                              "ext_mem_229265") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229206, "mem_229206") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229200, "mem_229200") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229196,
                                              "ext_mem_229196") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229197,
                                              "ext_mem_229197") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229164, "mem_229164") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229161, "mem_229161") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229157, "mem_229157") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229155, "mem_229155") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229152, "mem_229152") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229148, "mem_229148") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_out_232249,
                                              "mem_out_232249") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_out_232248,
                                              "mem_out_232248") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_out_232247,
                                              "mem_out_232247") != 0)
                        return 1;
                    err = 1;
                    goto cleanup;
                }
                
                struct memblock_device mem_230524;
                
                mem_230524.references = NULL;
                if (memblock_alloc_device(ctx, &mem_230524, bytes_229180,
                                          "mem_230524")) {
                    err = 1;
                    goto cleanup;
                }
                if (ctx->debugging)
                    fprintf(ctx->log, "%s\n", "\n# SegMap");
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_218729,
                                                        1, sizeof(n_p_203492),
                                                        &n_p_203492));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_218729,
                                                        2,
                                                        sizeof(partition_sizze_203577),
                                                        &partition_sizze_203577));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_218729,
                                                        3,
                                                        sizeof(mem_230520.mem),
                                                        &mem_230520.mem));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_218729,
                                                        4,
                                                        sizeof(mem_230524.mem),
                                                        &mem_230524.mem));
                if (1 * ((size_t) segmap_usable_groups_218726 *
                         (size_t) segmap_group_sizze_218725) != 0) {
                    const size_t global_work_sizze_237115[1] =
                                 {(size_t) segmap_usable_groups_218726 *
                                 (size_t) segmap_group_sizze_218725};
                    const size_t local_work_sizze_237119[1] =
                                 {(size_t) segmap_group_sizze_218725};
                    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.segmap_218729",
                                global_work_sizze_237115[0],
                                local_work_sizze_237119[0], (int) 0);
                        time_start_237116 = get_wall_time();
                    }
                    OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                    ctx->mainzisegmap_218729,
                                                                    1, NULL,
                                                                    global_work_sizze_237115,
                                                                    local_work_sizze_237119,
                                                                    0, NULL,
                                                                    ctx->profiling_paused ||
                                                                    !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                              &ctx->mainzisegmap_218729_runs,
                                                                                                              &ctx->mainzisegmap_218729_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.segmap_218729", time_diff_237118);
                    }
                }
                if (ctx->debugging)
                    fprintf(ctx->log, "%s\n", "");
                if (memblock_unref_device(ctx, &mem_230520, "mem_230520") != 0)
                    return 1;
                if (memblock_set_device(ctx, &ext_mem_230529, &mem_230524,
                                        "mem_230524") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_230524, "mem_230524") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_230520, "mem_230520") != 0)
                    return 1;
            } else {
                struct memblock_device mem_230528;
                
                mem_230528.references = NULL;
                if (memblock_alloc_device(ctx, &mem_230528, bytes_229180,
                                          "mem_230528")) {
                    err = 1;
                    goto cleanup;
                }
                if (slt64(n_p_203492 * (int64_t) 2,
                          segred_group_sizze_218756)) {
                    int64_t segment_sizze_nonzzero_234241 = smax64((int64_t) 1,
                                                                   n_p_203492);
                    int64_t num_threads_234242 = num_groups_218757 *
                            segred_group_sizze_218756;
                    
                    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_203577, '\n');
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s: %llu%c", "segment_size",
                                (long long) n_p_203492, '\n');
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s: %llu%c", "segments_per_group",
                                (long long) squot64(segred_group_sizze_218756,
                                                    segment_sizze_nonzzero_234241),
                                '\n');
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s: %llu%c", "required_groups",
                                (long long) sext_i64_i32(sdiv_up64(partition_sizze_203577,
                                                                   squot64(segred_group_sizze_218756,
                                                                           segment_sizze_nonzzero_234241))),
                                '\n');
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_218762,
                                                            1,
                                                            (size_t) ((int64_t) 8 *
                                                                      segred_group_sizze_218756),
                                                            NULL));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_218762,
                                                            2,
                                                            sizeof(n_p_203492),
                                                            &n_p_203492));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_218762,
                                                            3,
                                                            sizeof(partition_sizze_203577),
                                                            &partition_sizze_203577));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_218762,
                                                            4,
                                                            sizeof(lifted_single_ma_l_arg_204134),
                                                            &lifted_single_ma_l_arg_204134));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_218762,
                                                            5,
                                                            sizeof(num_groups_218757),
                                                            &num_groups_218757));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_218762,
                                                            6,
                                                            sizeof(segment_sizze_nonzzero_234241),
                                                            &segment_sizze_nonzzero_234241));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_218762,
                                                            7,
                                                            sizeof(mem_230517.mem),
                                                            &mem_230517.mem));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_218762,
                                                            8,
                                                            sizeof(mem_230528.mem),
                                                            &mem_230528.mem));
                    if (1 * ((size_t) num_groups_218757 *
                             (size_t) segred_group_sizze_218756) != 0) {
                        const size_t global_work_sizze_237120[1] =
                                     {(size_t) num_groups_218757 *
                                     (size_t) segred_group_sizze_218756};
                        const size_t local_work_sizze_237124[1] =
                                     {(size_t) segred_group_sizze_218756};
                        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.segred_small_218762",
                                    global_work_sizze_237120[0],
                                    local_work_sizze_237124[0], (int) (0 +
                                                                       (int64_t) 8 *
                                                                       segred_group_sizze_218756));
                            time_start_237121 = get_wall_time();
                        }
                        OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                        ctx->mainzisegred_small_218762,
                                                                        1, NULL,
                                                                        global_work_sizze_237120,
                                                                        local_work_sizze_237124,
                                                                        0, NULL,
                                                                        ctx->profiling_paused ||
                                                                        !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                  &ctx->mainzisegred_small_218762_runs,
                                                                                                                  &ctx->mainzisegred_small_218762_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.segred_small_218762",
                                    time_diff_237123);
                        }
                    }
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s\n", "");
                } else {
                    int64_t groups_per_segment_234268 =
                            sdiv_up64(num_groups_218757, smax64((int64_t) 1,
                                                                partition_sizze_203577));
                    int64_t elements_per_thread_234269 = sdiv_up64(n_p_203492,
                                                                   segred_group_sizze_218756 *
                                                                   groups_per_segment_234268);
                    int64_t virt_num_groups_234270 = groups_per_segment_234268 *
                            partition_sizze_203577;
                    int64_t num_threads_234271 = num_groups_218757 *
                            segred_group_sizze_218756;
                    int64_t threads_per_segment_234272 =
                            groups_per_segment_234268 *
                            segred_group_sizze_218756;
                    
                    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_203577, '\n');
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s: %llu%c", "segment_size",
                                (long long) n_p_203492, '\n');
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s: %llu%c", "virt_num_groups",
                                (long long) virt_num_groups_234270, '\n');
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s: %llu%c", "num_groups",
                                (long long) num_groups_218757, '\n');
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s: %llu%c", "group_size",
                                (long long) segred_group_sizze_218756, '\n');
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s: %llu%c", "elems_per_thread",
                                (long long) elements_per_thread_234269, '\n');
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s: %llu%c", "groups_per_segment",
                                (long long) groups_per_segment_234268, '\n');
                    
                    struct memblock_device segred_tmp_mem_234273;
                    
                    segred_tmp_mem_234273.references = NULL;
                    if (memblock_alloc_device(ctx, &segred_tmp_mem_234273,
                                              (int64_t) 8 *
                                              virt_num_groups_234270,
                                              "segred_tmp_mem_234273")) {
                        err = 1;
                        goto cleanup;
                    }
                    
                    struct memblock_device mainzicounter_mem_234275 =
                                           ctx->mainzicounter_mem_234275;
                    
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_218762,
                                                            1, (size_t) 1,
                                                            NULL));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_218762,
                                                            2,
                                                            (size_t) ((int64_t) 8 *
                                                                      segred_group_sizze_218756),
                                                            NULL));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_218762,
                                                            3,
                                                            sizeof(n_p_203492),
                                                            &n_p_203492));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_218762,
                                                            4,
                                                            sizeof(partition_sizze_203577),
                                                            &partition_sizze_203577));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_218762,
                                                            5,
                                                            sizeof(lifted_single_ma_l_arg_204134),
                                                            &lifted_single_ma_l_arg_204134));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_218762,
                                                            6,
                                                            sizeof(num_groups_218757),
                                                            &num_groups_218757));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_218762,
                                                            7,
                                                            sizeof(groups_per_segment_234268),
                                                            &groups_per_segment_234268));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_218762,
                                                            8,
                                                            sizeof(elements_per_thread_234269),
                                                            &elements_per_thread_234269));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_218762,
                                                            9,
                                                            sizeof(virt_num_groups_234270),
                                                            &virt_num_groups_234270));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_218762,
                                                            10,
                                                            sizeof(threads_per_segment_234272),
                                                            &threads_per_segment_234272));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_218762,
                                                            11,
                                                            sizeof(mem_230517.mem),
                                                            &mem_230517.mem));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_218762,
                                                            12,
                                                            sizeof(mem_230528.mem),
                                                            &mem_230528.mem));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_218762,
                                                            13,
                                                            sizeof(segred_tmp_mem_234273.mem),
                                                            &segred_tmp_mem_234273.mem));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_218762,
                                                            14,
                                                            sizeof(mainzicounter_mem_234275.mem),
                                                            &mainzicounter_mem_234275.mem));
                    if (1 * ((size_t) num_groups_218757 *
                             (size_t) segred_group_sizze_218756) != 0) {
                        const size_t global_work_sizze_237126[1] =
                                     {(size_t) num_groups_218757 *
                                     (size_t) segred_group_sizze_218756};
                        const size_t local_work_sizze_237130[1] =
                                     {(size_t) segred_group_sizze_218756};
                        int64_t time_start_237127 = 0, time_end_237128 = 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_218762",
                                    global_work_sizze_237126[0],
                                    local_work_sizze_237130[0], (int) (0 + 1 +
                                                                       (int64_t) 8 *
                                                                       segred_group_sizze_218756));
                            time_start_237127 = get_wall_time();
                        }
                        OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                        ctx->mainzisegred_large_218762,
                                                                        1, NULL,
                                                                        global_work_sizze_237126,
                                                                        local_work_sizze_237130,
                                                                        0, NULL,
                                                                        ctx->profiling_paused ||
                                                                        !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                  &ctx->mainzisegred_large_218762_runs,
                                                                                                                  &ctx->mainzisegred_large_218762_total_runtime)));
                        if (ctx->debugging) {
                            OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                            time_end_237128 = get_wall_time();
                            
                            long time_diff_237129 = time_end_237128 -
                                 time_start_237127;
                            
                            fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                                    "main.segred_large_218762",
                                    time_diff_237129);
                        }
                    }
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s\n", "");
                    if (memblock_unref_device(ctx, &segred_tmp_mem_234273,
                                              "segred_tmp_mem_234273") != 0)
                        return 1;
                }
                if (memblock_set_device(ctx, &ext_mem_230529, &mem_230528,
                                        "mem_230528") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_230528, "mem_230528") != 0)
                    return 1;
            }
            if (slt64((int64_t) 0, partition_sizze_203577 *
                      dyn_lifted_single_ma_l_arg_204144)) {
                if (ctx->debugging)
                    fprintf(ctx->log, "%s\n", "\n# SegScan");
                
                int64_t stage1_max_num_groups_234310;
                
                stage1_max_num_groups_234310 = ctx->opencl.max_group_size;
                
                int64_t stage1_num_groups_234311 =
                        smin64(stage1_max_num_groups_234310, num_groups_218809);
                int32_t num_threads_234312 =
                        sext_i64_i32(stage1_num_groups_234311 *
                        segscan_group_sizze_218808);
                
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage1_218814,
                                                        1,
                                                        sizeof(ctx->failure_is_an_option),
                                                        &ctx->failure_is_an_option));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage1_218814,
                                                        3,
                                                        (size_t) smax64((int64_t) 1,
                                                                        (int64_t) 8 *
                                                                        segscan_group_sizze_218808),
                                                        NULL));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage1_218814,
                                                        4, sizeof(n_p_203492),
                                                        &n_p_203492));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage1_218814,
                                                        5,
                                                        sizeof(i64_res_203507),
                                                        &i64_res_203507));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage1_218814,
                                                        6,
                                                        sizeof(partition_sizze_203577),
                                                        &partition_sizze_203577));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage1_218814,
                                                        7,
                                                        sizeof(lifted_single_ma_l_arg_204134),
                                                        &lifted_single_ma_l_arg_204134));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage1_218814,
                                                        8,
                                                        sizeof(dyn_lifted_single_ma_l_arg_204144),
                                                        &dyn_lifted_single_ma_l_arg_204144));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage1_218814,
                                                        9,
                                                        sizeof(num_threads_234312),
                                                        &num_threads_234312));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage1_218814,
                                                        10,
                                                        sizeof(mem_230517.mem),
                                                        &mem_230517.mem));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage1_218814,
                                                        11,
                                                        sizeof(ext_mem_230529.mem),
                                                        &ext_mem_230529.mem));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage1_218814,
                                                        12,
                                                        sizeof(mem_230534.mem),
                                                        &mem_230534.mem));
                if (1 * ((size_t) stage1_num_groups_234311 *
                         (size_t) segscan_group_sizze_218808) != 0) {
                    const size_t global_work_sizze_237131[1] =
                                 {(size_t) stage1_num_groups_234311 *
                                 (size_t) segscan_group_sizze_218808};
                    const size_t local_work_sizze_237135[1] =
                                 {(size_t) segscan_group_sizze_218808};
                    int64_t time_start_237132 = 0, time_end_237133 = 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_218814",
                                global_work_sizze_237131[0],
                                local_work_sizze_237135[0], (int) (0 +
                                                                   smax64((int64_t) 1,
                                                                          (int64_t) 8 *
                                                                          segscan_group_sizze_218808)));
                        time_start_237132 = get_wall_time();
                    }
                    OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                    ctx->mainziscan_stage1_218814,
                                                                    1, NULL,
                                                                    global_work_sizze_237131,
                                                                    local_work_sizze_237135,
                                                                    0, NULL,
                                                                    ctx->profiling_paused ||
                                                                    !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                              &ctx->mainziscan_stage1_218814_runs,
                                                                                                              &ctx->mainziscan_stage1_218814_total_runtime)));
                    if (ctx->debugging) {
                        OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                        time_end_237133 = get_wall_time();
                        
                        long time_diff_237134 = time_end_237133 -
                             time_start_237132;
                        
                        fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                                "main.scan_stage1_218814", time_diff_237134);
                    }
                }
                ctx->failure_is_an_option = 1;
                if (ctx->debugging)
                    fprintf(ctx->log, "%s: %llu%c", "elems_per_group",
                            (long long) (segscan_group_sizze_218808 *
                                         sdiv_up64(partition_sizze_203577 *
                                                   dyn_lifted_single_ma_l_arg_204144,
                                                   sext_i32_i64(num_threads_234312))),
                            '\n');
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage2_218814,
                                                        1,
                                                        (size_t) smax64((int64_t) 1,
                                                                        (int64_t) 8 *
                                                                        stage1_num_groups_234311),
                                                        NULL));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage2_218814,
                                                        2,
                                                        sizeof(partition_sizze_203577),
                                                        &partition_sizze_203577));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage2_218814,
                                                        3,
                                                        sizeof(dyn_lifted_single_ma_l_arg_204144),
                                                        &dyn_lifted_single_ma_l_arg_204144));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage2_218814,
                                                        4,
                                                        sizeof(stage1_num_groups_234311),
                                                        &stage1_num_groups_234311));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage2_218814,
                                                        5,
                                                        sizeof(num_threads_234312),
                                                        &num_threads_234312));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage2_218814,
                                                        6,
                                                        sizeof(mem_230534.mem),
                                                        &mem_230534.mem));
                if (1 * ((size_t) (int64_t) 1 *
                         (size_t) stage1_num_groups_234311) != 0) {
                    const size_t global_work_sizze_237136[1] =
                                 {(size_t) (int64_t) 1 *
                                 (size_t) stage1_num_groups_234311};
                    const size_t local_work_sizze_237140[1] =
                                 {(size_t) stage1_num_groups_234311};
                    int64_t time_start_237137 = 0, time_end_237138 = 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_218814",
                                global_work_sizze_237136[0],
                                local_work_sizze_237140[0], (int) (0 +
                                                                   smax64((int64_t) 1,
                                                                          (int64_t) 8 *
                                                                          stage1_num_groups_234311)));
                        time_start_237137 = get_wall_time();
                    }
                    OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                    ctx->mainziscan_stage2_218814,
                                                                    1, NULL,
                                                                    global_work_sizze_237136,
                                                                    local_work_sizze_237140,
                                                                    0, NULL,
                                                                    ctx->profiling_paused ||
                                                                    !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                              &ctx->mainziscan_stage2_218814_runs,
                                                                                                              &ctx->mainziscan_stage2_218814_total_runtime)));
                    if (ctx->debugging) {
                        OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                        time_end_237138 = get_wall_time();
                        
                        long time_diff_237139 = time_end_237138 -
                             time_start_237137;
                        
                        fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                                "main.scan_stage2_218814", time_diff_237139);
                    }
                }
                
                int32_t required_groups_234363 =
                        sext_i64_i32(sdiv_up64(partition_sizze_203577 *
                                               dyn_lifted_single_ma_l_arg_204144,
                                               segscan_group_sizze_218808));
                
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage3_218814,
                                                        1,
                                                        sizeof(partition_sizze_203577),
                                                        &partition_sizze_203577));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage3_218814,
                                                        2,
                                                        sizeof(dyn_lifted_single_ma_l_arg_204144),
                                                        &dyn_lifted_single_ma_l_arg_204144));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage3_218814,
                                                        3,
                                                        sizeof(num_groups_218809),
                                                        &num_groups_218809));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage3_218814,
                                                        4,
                                                        sizeof(num_threads_234312),
                                                        &num_threads_234312));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage3_218814,
                                                        5,
                                                        sizeof(required_groups_234363),
                                                        &required_groups_234363));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage3_218814,
                                                        6,
                                                        sizeof(mem_230534.mem),
                                                        &mem_230534.mem));
                if (1 * ((size_t) num_groups_218809 *
                         (size_t) segscan_group_sizze_218808) != 0) {
                    const size_t global_work_sizze_237141[1] =
                                 {(size_t) num_groups_218809 *
                                 (size_t) segscan_group_sizze_218808};
                    const size_t local_work_sizze_237145[1] =
                                 {(size_t) segscan_group_sizze_218808};
                    int64_t time_start_237142 = 0, time_end_237143 = 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_218814",
                                global_work_sizze_237141[0],
                                local_work_sizze_237145[0], (int) 0);
                        time_start_237142 = get_wall_time();
                    }
                    OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                    ctx->mainziscan_stage3_218814,
                                                                    1, NULL,
                                                                    global_work_sizze_237141,
                                                                    local_work_sizze_237145,
                                                                    0, NULL,
                                                                    ctx->profiling_paused ||
                                                                    !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                              &ctx->mainziscan_stage3_218814_runs,
                                                                                                              &ctx->mainziscan_stage3_218814_total_runtime)));
                    if (ctx->debugging) {
                        OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                        time_end_237143 = get_wall_time();
                        
                        long time_diff_237144 = time_end_237143 -
                             time_start_237142;
                        
                        fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                                "main.scan_stage3_218814", time_diff_237144);
                    }
                }
            }
            if (memblock_unref_device(ctx, &ext_mem_230529, "ext_mem_230529") !=
                0)
                return 1;
            
            struct memblock_device ext_mem_230546;
            
            ext_mem_230546.references = NULL;
            
            int32_t local_memory_capacity_234452;
            
            local_memory_capacity_234452 = ctx->opencl.max_local_memory;
            if (sle64((int64_t) 0,
                      sext_i32_i64(local_memory_capacity_234452)) &&
                suff_outer_par_218840) {
                struct memblock_device mem_230537;
                
                mem_230537.references = NULL;
                if (memblock_alloc_device(ctx, &mem_230537, binop_y_230532,
                                          "mem_230537")) {
                    err = 1;
                    goto cleanup;
                }
                if (futrts_builtinzhgpu_map_transpose_f64(ctx, mem_230537,
                                                          (int64_t) 0,
                                                          mem_230534,
                                                          (int64_t) 0,
                                                          (int64_t) 1,
                                                          dyn_lifted_single_ma_l_arg_204144,
                                                          partition_sizze_203577) !=
                    0) {
                    if (memblock_unref_device(ctx, &mem_230537, "mem_230537") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_230546,
                                              "ext_mem_230546") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_230529,
                                              "ext_mem_230529") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_230512,
                                              "ext_mem_230512") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_230494,
                                              "ext_mem_230494") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_230486,
                                              "ext_mem_230486") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_230487,
                                              "ext_mem_230487") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_229515,
                                              "mem_param_229515") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_229507,
                                              "mem_param_229507") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231517,
                                              "ext_mem_231517") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231518,
                                              "ext_mem_231518") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_229493,
                                              "mem_param_229493") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_229485,
                                              "mem_param_229485") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_229477,
                                              "mem_param_229477") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231860,
                                              "ext_mem_231860") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231861,
                                              "ext_mem_231861") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231862,
                                              "ext_mem_231862") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_230551, "mem_230551") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_230534, "mem_230534") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_230517, "mem_230517") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_230500, "mem_230500") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229531, "mem_229531") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229526, "mem_229526") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229520, "mem_229520") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229469, "mem_229469") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229465, "mem_229465") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229460,
                                              "ext_mem_229460") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229461,
                                              "ext_mem_229461") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229411,
                                              "ext_mem_229411") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229412,
                                              "ext_mem_229412") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229362,
                                              "ext_mem_229362") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229363,
                                              "ext_mem_229363") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229264,
                                              "ext_mem_229264") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229265,
                                              "ext_mem_229265") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229206, "mem_229206") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229200, "mem_229200") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229196,
                                              "ext_mem_229196") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229197,
                                              "ext_mem_229197") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229164, "mem_229164") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229161, "mem_229161") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229157, "mem_229157") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229155, "mem_229155") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229152, "mem_229152") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229148, "mem_229148") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_out_232249,
                                              "mem_out_232249") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_out_232248,
                                              "mem_out_232248") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_out_232247,
                                              "mem_out_232247") != 0)
                        return 1;
                    err = 1;
                    goto cleanup;
                }
                
                struct memblock_device mem_230541;
                
                mem_230541.references = NULL;
                if (memblock_alloc_device(ctx, &mem_230541, bytes_229180,
                                          "mem_230541")) {
                    err = 1;
                    goto cleanup;
                }
                if (ctx->debugging)
                    fprintf(ctx->log, "%s\n", "\n# SegMap");
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_218860,
                                                        1,
                                                        sizeof(partition_sizze_203577),
                                                        &partition_sizze_203577));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_218860,
                                                        2,
                                                        sizeof(mem_230537.mem),
                                                        &mem_230537.mem));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_218860,
                                                        3,
                                                        sizeof(mem_230541.mem),
                                                        &mem_230541.mem));
                if (1 * ((size_t) segmap_usable_groups_218857 *
                         (size_t) segmap_group_sizze_218856) != 0) {
                    const size_t global_work_sizze_237146[1] =
                                 {(size_t) segmap_usable_groups_218857 *
                                 (size_t) segmap_group_sizze_218856};
                    const size_t local_work_sizze_237150[1] =
                                 {(size_t) segmap_group_sizze_218856};
                    int64_t time_start_237147 = 0, time_end_237148 = 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_218860",
                                global_work_sizze_237146[0],
                                local_work_sizze_237150[0], (int) 0);
                        time_start_237147 = get_wall_time();
                    }
                    OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                    ctx->mainzisegmap_218860,
                                                                    1, NULL,
                                                                    global_work_sizze_237146,
                                                                    local_work_sizze_237150,
                                                                    0, NULL,
                                                                    ctx->profiling_paused ||
                                                                    !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                              &ctx->mainzisegmap_218860_runs,
                                                                                                              &ctx->mainzisegmap_218860_total_runtime)));
                    if (ctx->debugging) {
                        OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                        time_end_237148 = get_wall_time();
                        
                        long time_diff_237149 = time_end_237148 -
                             time_start_237147;
                        
                        fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                                "main.segmap_218860", time_diff_237149);
                    }
                }
                if (ctx->debugging)
                    fprintf(ctx->log, "%s\n", "");
                if (memblock_unref_device(ctx, &mem_230537, "mem_230537") != 0)
                    return 1;
                if (memblock_set_device(ctx, &ext_mem_230546, &mem_230541,
                                        "mem_230541") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_230541, "mem_230541") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_230537, "mem_230537") != 0)
                    return 1;
            } else {
                struct memblock_device mem_230545;
                
                mem_230545.references = NULL;
                if (memblock_alloc_device(ctx, &mem_230545, bytes_229180,
                                          "mem_230545")) {
                    err = 1;
                    goto cleanup;
                }
                if (slt64((int64_t) 6, segred_group_sizze_218887)) {
                    int64_t segment_sizze_nonzzero_234384 = smax64((int64_t) 1,
                                                                   (int64_t) 3);
                    int64_t num_threads_234385 = num_groups_218888 *
                            segred_group_sizze_218887;
                    
                    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_203577, '\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_218887,
                                                    segment_sizze_nonzzero_234384),
                                '\n');
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s: %llu%c", "required_groups",
                                (long long) sext_i64_i32(sdiv_up64(partition_sizze_203577,
                                                                   squot64(segred_group_sizze_218887,
                                                                           segment_sizze_nonzzero_234384))),
                                '\n');
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_218893,
                                                            1,
                                                            (size_t) ((int64_t) 8 *
                                                                      segred_group_sizze_218887),
                                                            NULL));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_218893,
                                                            2,
                                                            sizeof(partition_sizze_203577),
                                                            &partition_sizze_203577));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_218893,
                                                            3,
                                                            sizeof(dyn_lifted_single_ma_l_arg_204144),
                                                            &dyn_lifted_single_ma_l_arg_204144));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_218893,
                                                            4,
                                                            sizeof(num_groups_218888),
                                                            &num_groups_218888));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_218893,
                                                            5,
                                                            sizeof(segment_sizze_nonzzero_234384),
                                                            &segment_sizze_nonzzero_234384));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_218893,
                                                            6,
                                                            sizeof(mem_230534.mem),
                                                            &mem_230534.mem));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_218893,
                                                            7,
                                                            sizeof(mem_230545.mem),
                                                            &mem_230545.mem));
                    if (1 * ((size_t) num_groups_218888 *
                             (size_t) segred_group_sizze_218887) != 0) {
                        const size_t global_work_sizze_237151[1] =
                                     {(size_t) num_groups_218888 *
                                     (size_t) segred_group_sizze_218887};
                        const size_t local_work_sizze_237155[1] =
                                     {(size_t) segred_group_sizze_218887};
                        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_small_218893",
                                    global_work_sizze_237151[0],
                                    local_work_sizze_237155[0], (int) (0 +
                                                                       (int64_t) 8 *
                                                                       segred_group_sizze_218887));
                            time_start_237152 = get_wall_time();
                        }
                        OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                        ctx->mainzisegred_small_218893,
                                                                        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_small_218893_runs,
                                                                                                                  &ctx->mainzisegred_small_218893_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_small_218893",
                                    time_diff_237154);
                        }
                    }
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s\n", "");
                } else {
                    int64_t groups_per_segment_234411 =
                            sdiv_up64(num_groups_218888, smax64((int64_t) 1,
                                                                partition_sizze_203577));
                    int64_t elements_per_thread_234412 = sdiv_up64((int64_t) 3,
                                                                   segred_group_sizze_218887 *
                                                                   groups_per_segment_234411);
                    int64_t virt_num_groups_234413 = groups_per_segment_234411 *
                            partition_sizze_203577;
                    int64_t num_threads_234414 = num_groups_218888 *
                            segred_group_sizze_218887;
                    int64_t threads_per_segment_234415 =
                            groups_per_segment_234411 *
                            segred_group_sizze_218887;
                    
                    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_203577, '\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_234413, '\n');
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s: %llu%c", "num_groups",
                                (long long) num_groups_218888, '\n');
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s: %llu%c", "group_size",
                                (long long) segred_group_sizze_218887, '\n');
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s: %llu%c", "elems_per_thread",
                                (long long) elements_per_thread_234412, '\n');
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s: %llu%c", "groups_per_segment",
                                (long long) groups_per_segment_234411, '\n');
                    
                    struct memblock_device segred_tmp_mem_234416;
                    
                    segred_tmp_mem_234416.references = NULL;
                    if (memblock_alloc_device(ctx, &segred_tmp_mem_234416,
                                              (int64_t) 8 *
                                              virt_num_groups_234413,
                                              "segred_tmp_mem_234416")) {
                        err = 1;
                        goto cleanup;
                    }
                    
                    struct memblock_device mainzicounter_mem_234418 =
                                           ctx->mainzicounter_mem_234418;
                    
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_218893,
                                                            1, (size_t) 1,
                                                            NULL));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_218893,
                                                            2,
                                                            (size_t) ((int64_t) 8 *
                                                                      segred_group_sizze_218887),
                                                            NULL));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_218893,
                                                            3,
                                                            sizeof(partition_sizze_203577),
                                                            &partition_sizze_203577));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_218893,
                                                            4,
                                                            sizeof(dyn_lifted_single_ma_l_arg_204144),
                                                            &dyn_lifted_single_ma_l_arg_204144));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_218893,
                                                            5,
                                                            sizeof(num_groups_218888),
                                                            &num_groups_218888));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_218893,
                                                            6,
                                                            sizeof(groups_per_segment_234411),
                                                            &groups_per_segment_234411));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_218893,
                                                            7,
                                                            sizeof(elements_per_thread_234412),
                                                            &elements_per_thread_234412));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_218893,
                                                            8,
                                                            sizeof(virt_num_groups_234413),
                                                            &virt_num_groups_234413));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_218893,
                                                            9,
                                                            sizeof(threads_per_segment_234415),
                                                            &threads_per_segment_234415));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_218893,
                                                            10,
                                                            sizeof(mem_230534.mem),
                                                            &mem_230534.mem));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_218893,
                                                            11,
                                                            sizeof(mem_230545.mem),
                                                            &mem_230545.mem));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_218893,
                                                            12,
                                                            sizeof(segred_tmp_mem_234416.mem),
                                                            &segred_tmp_mem_234416.mem));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_218893,
                                                            13,
                                                            sizeof(mainzicounter_mem_234418.mem),
                                                            &mainzicounter_mem_234418.mem));
                    if (1 * ((size_t) num_groups_218888 *
                             (size_t) segred_group_sizze_218887) != 0) {
                        const size_t global_work_sizze_237157[1] =
                                     {(size_t) num_groups_218888 *
                                     (size_t) segred_group_sizze_218887};
                        const size_t local_work_sizze_237161[1] =
                                     {(size_t) segred_group_sizze_218887};
                        int64_t time_start_237158 = 0, time_end_237159 = 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_218893",
                                    global_work_sizze_237157[0],
                                    local_work_sizze_237161[0], (int) (0 + 1 +
                                                                       (int64_t) 8 *
                                                                       segred_group_sizze_218887));
                            time_start_237158 = get_wall_time();
                        }
                        OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                        ctx->mainzisegred_large_218893,
                                                                        1, NULL,
                                                                        global_work_sizze_237157,
                                                                        local_work_sizze_237161,
                                                                        0, NULL,
                                                                        ctx->profiling_paused ||
                                                                        !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                  &ctx->mainzisegred_large_218893_runs,
                                                                                                                  &ctx->mainzisegred_large_218893_total_runtime)));
                        if (ctx->debugging) {
                            OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                            time_end_237159 = get_wall_time();
                            
                            long time_diff_237160 = time_end_237159 -
                                 time_start_237158;
                            
                            fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                                    "main.segred_large_218893",
                                    time_diff_237160);
                        }
                    }
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s\n", "");
                    if (memblock_unref_device(ctx, &segred_tmp_mem_234416,
                                              "segred_tmp_mem_234416") != 0)
                        return 1;
                }
                if (memblock_set_device(ctx, &ext_mem_230546, &mem_230545,
                                        "mem_230545") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_230545, "mem_230545") != 0)
                    return 1;
            }
            if (slt64((int64_t) 0, partition_sizze_203577 * n_203490)) {
                if (ctx->debugging)
                    fprintf(ctx->log, "%s\n", "\n# SegScan");
                
                int64_t stage1_max_num_groups_234453;
                
                stage1_max_num_groups_234453 = ctx->opencl.max_group_size;
                
                int64_t stage1_num_groups_234454 =
                        smin64(stage1_max_num_groups_234453, num_groups_218940);
                int32_t num_threads_234455 =
                        sext_i64_i32(stage1_num_groups_234454 *
                        segscan_group_sizze_218939);
                
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage1_218945,
                                                        1,
                                                        sizeof(ctx->failure_is_an_option),
                                                        &ctx->failure_is_an_option));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage1_218945,
                                                        3,
                                                        (size_t) smax64((int64_t) 1,
                                                                        (int64_t) 8 *
                                                                        segscan_group_sizze_218939),
                                                        NULL));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage1_218945,
                                                        4, sizeof(n_203490),
                                                        &n_203490));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage1_218945,
                                                        5,
                                                        sizeof(partition_sizze_203577),
                                                        &partition_sizze_203577));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage1_218945,
                                                        6,
                                                        sizeof(dyn_lifted_single_ma_l_arg_204144),
                                                        &dyn_lifted_single_ma_l_arg_204144));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage1_218945,
                                                        7,
                                                        sizeof(num_threads_234455),
                                                        &num_threads_234455));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage1_218945,
                                                        8,
                                                        sizeof(mem_230534.mem),
                                                        &mem_230534.mem));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage1_218945,
                                                        9,
                                                        sizeof(ext_mem_230546.mem),
                                                        &ext_mem_230546.mem));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage1_218945,
                                                        10,
                                                        sizeof(mem_230551.mem),
                                                        &mem_230551.mem));
                if (1 * ((size_t) stage1_num_groups_234454 *
                         (size_t) segscan_group_sizze_218939) != 0) {
                    const size_t global_work_sizze_237162[1] =
                                 {(size_t) stage1_num_groups_234454 *
                                 (size_t) segscan_group_sizze_218939};
                    const size_t local_work_sizze_237166[1] =
                                 {(size_t) segscan_group_sizze_218939};
                    int64_t time_start_237163 = 0, time_end_237164 = 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_218945",
                                global_work_sizze_237162[0],
                                local_work_sizze_237166[0], (int) (0 +
                                                                   smax64((int64_t) 1,
                                                                          (int64_t) 8 *
                                                                          segscan_group_sizze_218939)));
                        time_start_237163 = get_wall_time();
                    }
                    OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                    ctx->mainziscan_stage1_218945,
                                                                    1, NULL,
                                                                    global_work_sizze_237162,
                                                                    local_work_sizze_237166,
                                                                    0, NULL,
                                                                    ctx->profiling_paused ||
                                                                    !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                              &ctx->mainziscan_stage1_218945_runs,
                                                                                                              &ctx->mainziscan_stage1_218945_total_runtime)));
                    if (ctx->debugging) {
                        OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                        time_end_237164 = get_wall_time();
                        
                        long time_diff_237165 = time_end_237164 -
                             time_start_237163;
                        
                        fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                                "main.scan_stage1_218945", time_diff_237165);
                    }
                }
                ctx->failure_is_an_option = 1;
                if (ctx->debugging)
                    fprintf(ctx->log, "%s: %llu%c", "elems_per_group",
                            (long long) (segscan_group_sizze_218939 *
                                         sdiv_up64(partition_sizze_203577 *
                                                   n_203490,
                                                   sext_i32_i64(num_threads_234455))),
                            '\n');
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage2_218945,
                                                        1,
                                                        (size_t) smax64((int64_t) 1,
                                                                        (int64_t) 8 *
                                                                        stage1_num_groups_234454),
                                                        NULL));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage2_218945,
                                                        2, sizeof(n_203490),
                                                        &n_203490));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage2_218945,
                                                        3,
                                                        sizeof(partition_sizze_203577),
                                                        &partition_sizze_203577));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage2_218945,
                                                        4,
                                                        sizeof(stage1_num_groups_234454),
                                                        &stage1_num_groups_234454));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage2_218945,
                                                        5,
                                                        sizeof(num_threads_234455),
                                                        &num_threads_234455));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage2_218945,
                                                        6,
                                                        sizeof(mem_230551.mem),
                                                        &mem_230551.mem));
                if (1 * ((size_t) (int64_t) 1 *
                         (size_t) stage1_num_groups_234454) != 0) {
                    const size_t global_work_sizze_237167[1] =
                                 {(size_t) (int64_t) 1 *
                                 (size_t) stage1_num_groups_234454};
                    const size_t local_work_sizze_237171[1] =
                                 {(size_t) stage1_num_groups_234454};
                    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.scan_stage2_218945",
                                global_work_sizze_237167[0],
                                local_work_sizze_237171[0], (int) (0 +
                                                                   smax64((int64_t) 1,
                                                                          (int64_t) 8 *
                                                                          stage1_num_groups_234454)));
                        time_start_237168 = get_wall_time();
                    }
                    OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                    ctx->mainziscan_stage2_218945,
                                                                    1, NULL,
                                                                    global_work_sizze_237167,
                                                                    local_work_sizze_237171,
                                                                    0, NULL,
                                                                    ctx->profiling_paused ||
                                                                    !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                              &ctx->mainziscan_stage2_218945_runs,
                                                                                                              &ctx->mainziscan_stage2_218945_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.scan_stage2_218945", time_diff_237170);
                    }
                }
                
                int32_t required_groups_234506 =
                        sext_i64_i32(sdiv_up64(partition_sizze_203577 *
                                               n_203490,
                                               segscan_group_sizze_218939));
                
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage3_218945,
                                                        1, sizeof(n_203490),
                                                        &n_203490));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage3_218945,
                                                        2,
                                                        sizeof(partition_sizze_203577),
                                                        &partition_sizze_203577));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage3_218945,
                                                        3,
                                                        sizeof(num_groups_218940),
                                                        &num_groups_218940));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage3_218945,
                                                        4,
                                                        sizeof(num_threads_234455),
                                                        &num_threads_234455));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage3_218945,
                                                        5,
                                                        sizeof(required_groups_234506),
                                                        &required_groups_234506));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage3_218945,
                                                        6,
                                                        sizeof(mem_230551.mem),
                                                        &mem_230551.mem));
                if (1 * ((size_t) num_groups_218940 *
                         (size_t) segscan_group_sizze_218939) != 0) {
                    const size_t global_work_sizze_237172[1] =
                                 {(size_t) num_groups_218940 *
                                 (size_t) segscan_group_sizze_218939};
                    const size_t local_work_sizze_237176[1] =
                                 {(size_t) segscan_group_sizze_218939};
                    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.scan_stage3_218945",
                                global_work_sizze_237172[0],
                                local_work_sizze_237176[0], (int) 0);
                        time_start_237173 = get_wall_time();
                    }
                    OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                    ctx->mainziscan_stage3_218945,
                                                                    1, NULL,
                                                                    global_work_sizze_237172,
                                                                    local_work_sizze_237176,
                                                                    0, NULL,
                                                                    ctx->profiling_paused ||
                                                                    !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                              &ctx->mainziscan_stage3_218945_runs,
                                                                                                              &ctx->mainziscan_stage3_218945_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.scan_stage3_218945", time_diff_237175);
                    }
                }
            }
            if (memblock_unref_device(ctx, &ext_mem_230546, "ext_mem_230546") !=
                0)
                return 1;
            
            struct memblock_device ext_mem_230908;
            
            ext_mem_230908.references = NULL;
            
            struct memblock_device ext_mem_230907;
            
            ext_mem_230907.references = NULL;
            if (cond_204160) {
                bool match_lit_205190 = (int64_t) 0 == d_l_203498;
                struct memblock_device ext_mem_230847;
                
                ext_mem_230847.references = NULL;
                
                struct memblock_device ext_mem_230846;
                
                ext_mem_230846.references = NULL;
                if (match_lit_205190) {
                    struct memblock_device mem_230555;
                    
                    mem_230555.references = NULL;
                    if (memblock_alloc_device(ctx, &mem_230555, bytes_229378,
                                              "mem_230555")) {
                        err = 1;
                        goto cleanup;
                    }
                    if (futrts_builtinzhreplicate_f64(ctx, mem_230555,
                                                      partition_sizze_203577 *
                                                      l_n_m_203643, 0.0) != 0) {
                        if (memblock_unref_device(ctx, &mem_230555,
                                                  "mem_230555") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_230846,
                                                  "ext_mem_230846") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_230847,
                                                  "ext_mem_230847") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_230907,
                                                  "ext_mem_230907") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_230908,
                                                  "ext_mem_230908") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_230546,
                                                  "ext_mem_230546") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_230529,
                                                  "ext_mem_230529") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_230512,
                                                  "ext_mem_230512") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_230494,
                                                  "ext_mem_230494") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_230486,
                                                  "ext_mem_230486") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_230487,
                                                  "ext_mem_230487") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_param_229515,
                                                  "mem_param_229515") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_param_229507,
                                                  "mem_param_229507") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_231517,
                                                  "ext_mem_231517") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_231518,
                                                  "ext_mem_231518") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_param_229493,
                                                  "mem_param_229493") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_param_229485,
                                                  "mem_param_229485") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_param_229477,
                                                  "mem_param_229477") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_231860,
                                                  "ext_mem_231860") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_231861,
                                                  "ext_mem_231861") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_231862,
                                                  "ext_mem_231862") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_230551,
                                                  "mem_230551") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_230534,
                                                  "mem_230534") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_230517,
                                                  "mem_230517") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_230500,
                                                  "mem_230500") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229531,
                                                  "mem_229531") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229526,
                                                  "mem_229526") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229520,
                                                  "mem_229520") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229469,
                                                  "mem_229469") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229465,
                                                  "mem_229465") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_229460,
                                                  "ext_mem_229460") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_229461,
                                                  "ext_mem_229461") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_229411,
                                                  "ext_mem_229411") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_229412,
                                                  "ext_mem_229412") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_229362,
                                                  "ext_mem_229362") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_229363,
                                                  "ext_mem_229363") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_229264,
                                                  "ext_mem_229264") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_229265,
                                                  "ext_mem_229265") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229206,
                                                  "mem_229206") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229200,
                                                  "mem_229200") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_229196,
                                                  "ext_mem_229196") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_229197,
                                                  "ext_mem_229197") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229164,
                                                  "mem_229164") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229161,
                                                  "mem_229161") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229157,
                                                  "mem_229157") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229155,
                                                  "mem_229155") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229152,
                                                  "mem_229152") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229148,
                                                  "mem_229148") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_out_232249,
                                                  "mem_out_232249") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_out_232248,
                                                  "mem_out_232248") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_out_232247,
                                                  "mem_out_232247") != 0)
                            return 1;
                        err = 1;
                        goto cleanup;
                    }
                    
                    bool suff_outer_par_218971;
                    
                    suff_outer_par_218971 =
                        *ctx->tuning_params.mainzisuff_outer_par_22 <=
                        partition_sizze_203577;
                    if (ctx->logging)
                        fprintf(ctx->log, "Compared %s <= %ld: %s.\n",
                                "main.suff_outer_par_22",
                                (long) partition_sizze_203577,
                                suff_outer_par_218971 ? "true" : "false");
                    
                    int64_t segmap_group_sizze_219044;
                    
                    segmap_group_sizze_219044 =
                        *ctx->tuning_params.mainzisegmap_group_sizze_218975;
                    
                    int64_t num_groups_219045;
                    int32_t max_num_groups_234518;
                    
                    max_num_groups_234518 =
                        *ctx->tuning_params.mainzisegmap_num_groups_218977;
                    num_groups_219045 = sext_i64_i32(smax64((int64_t) 1,
                                                            smin64(sdiv_up64(partition_sizze_203577,
                                                                             segmap_group_sizze_219044),
                                                                   sext_i32_i64(max_num_groups_234518))));
                    
                    int64_t segmap_group_sizze_219425;
                    
                    segmap_group_sizze_219425 =
                        *ctx->tuning_params.mainzisegmap_group_sizze_219116;
                    
                    bool suff_outer_par_219429;
                    
                    suff_outer_par_219429 =
                        *ctx->tuning_params.mainzisuff_outer_par_23 <=
                        nest_sizze_209492;
                    if (ctx->logging)
                        fprintf(ctx->log, "Compared %s <= %ld: %s.\n",
                                "main.suff_outer_par_23",
                                (long) nest_sizze_209492,
                                suff_outer_par_219429 ? "true" : "false");
                    
                    int64_t nest_sizze_219507 = q_l_203495 * nest_sizze_209492;
                    int64_t segred_group_sizze_219508;
                    
                    segred_group_sizze_219508 =
                        *ctx->tuning_params.mainzisegred_group_sizze_219260;
                    
                    int64_t num_groups_219509;
                    int32_t max_num_groups_234519;
                    
                    max_num_groups_234519 =
                        *ctx->tuning_params.mainzisegred_num_groups_219262;
                    num_groups_219509 = sext_i64_i32(smax64((int64_t) 1,
                                                            smin64(sdiv_up64(nest_sizze_219507,
                                                                             segred_group_sizze_219508),
                                                                   sext_i32_i64(max_num_groups_234519))));
                    
                    int64_t segmap_group_sizze_219546;
                    
                    segmap_group_sizze_219546 =
                        *ctx->tuning_params.mainzisegmap_group_sizze_219247;
                    
                    int64_t segred_group_sizze_219557;
                    
                    segred_group_sizze_219557 =
                        *ctx->tuning_params.mainzisegred_group_sizze_219193;
                    
                    int64_t num_groups_219558;
                    int32_t max_num_groups_234520;
                    
                    max_num_groups_234520 =
                        *ctx->tuning_params.mainzisegred_num_groups_219195;
                    num_groups_219558 = sext_i64_i32(smax64((int64_t) 1,
                                                            smin64(sdiv_up64(nest_sizze_219507,
                                                                             segred_group_sizze_219557),
                                                                   sext_i32_i64(max_num_groups_234520))));
                    
                    int64_t num_threads_232157 = segmap_group_sizze_219044 *
                            num_groups_219045;
                    int64_t total_sizze_232158 = bytes_229371 *
                            num_threads_232157;
                    struct memblock_device ext_mem_230613;
                    
                    ext_mem_230613.references = NULL;
                    
                    int32_t local_memory_capacity_234716;
                    
                    local_memory_capacity_234716 = ctx->opencl.max_local_memory;
                    if ((sle64((int64_t) 0,
                               sext_i32_i64(local_memory_capacity_234716)) &&
                         sle64((int64_t) 0,
                               sext_i32_i64(local_memory_capacity_234716))) &&
                        suff_outer_par_218971) {
                        struct memblock_device mem_230558;
                        
                        mem_230558.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_230558,
                                                  binop_y_229377,
                                                  "mem_230558")) {
                            err = 1;
                            goto cleanup;
                        }
                        if (futrts_builtinzhgpu_map_transpose_i64(ctx,
                                                                  mem_230558,
                                                                  (int64_t) 0,
                                                                  ext_mem_229412,
                                                                  (int64_t) 0,
                                                                  (int64_t) 1,
                                                                  l_n_m_203643,
                                                                  partition_sizze_203577) !=
                            0) {
                            if (memblock_unref_device(ctx, &mem_230558,
                                                      "mem_230558") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230613,
                                                      "ext_mem_230613") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230555,
                                                      "mem_230555") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230846,
                                                      "ext_mem_230846") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230847,
                                                      "ext_mem_230847") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230907,
                                                      "ext_mem_230907") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230908,
                                                      "ext_mem_230908") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230546,
                                                      "ext_mem_230546") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230529,
                                                      "ext_mem_230529") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230512,
                                                      "ext_mem_230512") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230494,
                                                      "ext_mem_230494") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230486,
                                                      "ext_mem_230486") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230487,
                                                      "ext_mem_230487") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229515,
                                                      "mem_param_229515") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229507,
                                                      "mem_param_229507") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231517,
                                                      "ext_mem_231517") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231518,
                                                      "ext_mem_231518") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229493,
                                                      "mem_param_229493") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229485,
                                                      "mem_param_229485") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229477,
                                                      "mem_param_229477") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231860,
                                                      "ext_mem_231860") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231861,
                                                      "ext_mem_231861") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231862,
                                                      "ext_mem_231862") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230551,
                                                      "mem_230551") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230534,
                                                      "mem_230534") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230517,
                                                      "mem_230517") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230500,
                                                      "mem_230500") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229531,
                                                      "mem_229531") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229526,
                                                      "mem_229526") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229520,
                                                      "mem_229520") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229469,
                                                      "mem_229469") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229465,
                                                      "mem_229465") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229460,
                                                      "ext_mem_229460") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229461,
                                                      "ext_mem_229461") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229411,
                                                      "ext_mem_229411") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229412,
                                                      "ext_mem_229412") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229362,
                                                      "ext_mem_229362") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229363,
                                                      "ext_mem_229363") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229264,
                                                      "ext_mem_229264") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229265,
                                                      "ext_mem_229265") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229206,
                                                      "mem_229206") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229200,
                                                      "mem_229200") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229196,
                                                      "ext_mem_229196") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229197,
                                                      "ext_mem_229197") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229164,
                                                      "mem_229164") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229161,
                                                      "mem_229161") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229157,
                                                      "mem_229157") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229155,
                                                      "mem_229155") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229152,
                                                      "mem_229152") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229148,
                                                      "mem_229148") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_out_232249,
                                                      "mem_out_232249") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_out_232248,
                                                      "mem_out_232248") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_out_232247,
                                                      "mem_out_232247") != 0)
                                return 1;
                            err = 1;
                            goto cleanup;
                        }
                        
                        struct memblock_device mem_230561;
                        
                        mem_230561.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_230561,
                                                  binop_y_229377,
                                                  "mem_230561")) {
                            err = 1;
                            goto cleanup;
                        }
                        if (futrts_builtinzhgpu_map_transpose_f64(ctx,
                                                                  mem_230561,
                                                                  (int64_t) 0,
                                                                  ext_mem_229411,
                                                                  (int64_t) 0,
                                                                  (int64_t) 1,
                                                                  l_n_m_203643,
                                                                  partition_sizze_203577) !=
                            0) {
                            if (memblock_unref_device(ctx, &mem_230561,
                                                      "mem_230561") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230558,
                                                      "mem_230558") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230613,
                                                      "ext_mem_230613") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230555,
                                                      "mem_230555") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230846,
                                                      "ext_mem_230846") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230847,
                                                      "ext_mem_230847") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230907,
                                                      "ext_mem_230907") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230908,
                                                      "ext_mem_230908") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230546,
                                                      "ext_mem_230546") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230529,
                                                      "ext_mem_230529") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230512,
                                                      "ext_mem_230512") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230494,
                                                      "ext_mem_230494") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230486,
                                                      "ext_mem_230486") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230487,
                                                      "ext_mem_230487") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229515,
                                                      "mem_param_229515") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229507,
                                                      "mem_param_229507") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231517,
                                                      "ext_mem_231517") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231518,
                                                      "ext_mem_231518") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229493,
                                                      "mem_param_229493") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229485,
                                                      "mem_param_229485") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229477,
                                                      "mem_param_229477") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231860,
                                                      "ext_mem_231860") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231861,
                                                      "ext_mem_231861") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231862,
                                                      "ext_mem_231862") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230551,
                                                      "mem_230551") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230534,
                                                      "mem_230534") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230517,
                                                      "mem_230517") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230500,
                                                      "mem_230500") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229531,
                                                      "mem_229531") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229526,
                                                      "mem_229526") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229520,
                                                      "mem_229520") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229469,
                                                      "mem_229469") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229465,
                                                      "mem_229465") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229460,
                                                      "ext_mem_229460") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229461,
                                                      "ext_mem_229461") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229411,
                                                      "ext_mem_229411") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229412,
                                                      "ext_mem_229412") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229362,
                                                      "ext_mem_229362") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229363,
                                                      "ext_mem_229363") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229264,
                                                      "ext_mem_229264") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229265,
                                                      "ext_mem_229265") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229206,
                                                      "mem_229206") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229200,
                                                      "mem_229200") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229196,
                                                      "ext_mem_229196") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229197,
                                                      "ext_mem_229197") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229164,
                                                      "mem_229164") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229161,
                                                      "mem_229161") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229157,
                                                      "mem_229157") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229155,
                                                      "mem_229155") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229152,
                                                      "mem_229152") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229148,
                                                      "mem_229148") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_out_232249,
                                                      "mem_out_232249") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_out_232248,
                                                      "mem_out_232248") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_out_232247,
                                                      "mem_out_232247") != 0)
                                return 1;
                            err = 1;
                            goto cleanup;
                        }
                        
                        struct memblock_device mem_230564;
                        
                        mem_230564.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_230564,
                                                  binop_y_229176,
                                                  "mem_230564")) {
                            err = 1;
                            goto cleanup;
                        }
                        
                        int64_t group_sizze_234524;
                        
                        group_sizze_234524 =
                            *ctx->tuning_params.mainzigroup_sizze_234524;
                        
                        int64_t num_groups_234525 =
                                sdiv_up64(partition_sizze_203577 * n_203490,
                                          group_sizze_234524);
                        
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzicopy_234521,
                                                                0,
                                                                sizeof(n_203490),
                                                                &n_203490));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzicopy_234521,
                                                                1,
                                                                sizeof(partition_sizze_203577),
                                                                &partition_sizze_203577));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzicopy_234521,
                                                                2,
                                                                sizeof(ctx_param_ext_229488),
                                                                &ctx_param_ext_229488));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzicopy_234521,
                                                                3,
                                                                sizeof(ctx_param_ext_229489),
                                                                &ctx_param_ext_229489));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzicopy_234521,
                                                                4,
                                                                sizeof(ctx_param_ext_229491),
                                                                &ctx_param_ext_229491));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzicopy_234521,
                                                                5,
                                                                sizeof(mem_param_229493.mem),
                                                                &mem_param_229493.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzicopy_234521,
                                                                6,
                                                                sizeof(mem_230564.mem),
                                                                &mem_230564.mem));
                        if (1 * ((size_t) num_groups_234525 *
                                 (size_t) group_sizze_234524) != 0) {
                            const size_t global_work_sizze_237177[1] =
                                         {(size_t) num_groups_234525 *
                                         (size_t) group_sizze_234524};
                            const size_t local_work_sizze_237181[1] =
                                         {(size_t) group_sizze_234524};
                            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.copy_234521",
                                        global_work_sizze_237177[0],
                                        local_work_sizze_237181[0], (int) 0);
                                time_start_237178 = get_wall_time();
                            }
                            OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                            ctx->mainzicopy_234521,
                                                                            1,
                                                                            NULL,
                                                                            global_work_sizze_237177,
                                                                            local_work_sizze_237181,
                                                                            0,
                                                                            NULL,
                                                                            ctx->profiling_paused ||
                                                                            !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                      &ctx->mainzicopy_234521_runs,
                                                                                                                      &ctx->mainzicopy_234521_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.copy_234521", time_diff_237180);
                            }
                        }
                        
                        struct memblock_device mem_230567;
                        
                        mem_230567.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_230567,
                                                  binop_y_229176,
                                                  "mem_230567")) {
                            err = 1;
                            goto cleanup;
                        }
                        if (futrts_builtinzhgpu_map_transpose_f64(ctx,
                                                                  mem_230567,
                                                                  (int64_t) 0,
                                                                  mem_230551,
                                                                  (int64_t) 0,
                                                                  (int64_t) 1,
                                                                  n_203490,
                                                                  partition_sizze_203577) !=
                            0) {
                            if (memblock_unref_device(ctx, &mem_230567,
                                                      "mem_230567") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230564,
                                                      "mem_230564") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230561,
                                                      "mem_230561") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230558,
                                                      "mem_230558") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230613,
                                                      "ext_mem_230613") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230555,
                                                      "mem_230555") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230846,
                                                      "ext_mem_230846") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230847,
                                                      "ext_mem_230847") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230907,
                                                      "ext_mem_230907") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230908,
                                                      "ext_mem_230908") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230546,
                                                      "ext_mem_230546") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230529,
                                                      "ext_mem_230529") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230512,
                                                      "ext_mem_230512") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230494,
                                                      "ext_mem_230494") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230486,
                                                      "ext_mem_230486") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230487,
                                                      "ext_mem_230487") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229515,
                                                      "mem_param_229515") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229507,
                                                      "mem_param_229507") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231517,
                                                      "ext_mem_231517") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231518,
                                                      "ext_mem_231518") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229493,
                                                      "mem_param_229493") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229485,
                                                      "mem_param_229485") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229477,
                                                      "mem_param_229477") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231860,
                                                      "ext_mem_231860") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231861,
                                                      "ext_mem_231861") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231862,
                                                      "ext_mem_231862") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230551,
                                                      "mem_230551") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230534,
                                                      "mem_230534") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230517,
                                                      "mem_230517") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230500,
                                                      "mem_230500") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229531,
                                                      "mem_229531") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229526,
                                                      "mem_229526") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229520,
                                                      "mem_229520") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229469,
                                                      "mem_229469") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229465,
                                                      "mem_229465") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229460,
                                                      "ext_mem_229460") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229461,
                                                      "ext_mem_229461") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229411,
                                                      "ext_mem_229411") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229412,
                                                      "ext_mem_229412") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229362,
                                                      "ext_mem_229362") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229363,
                                                      "ext_mem_229363") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229264,
                                                      "ext_mem_229264") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229265,
                                                      "ext_mem_229265") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229206,
                                                      "mem_229206") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229200,
                                                      "mem_229200") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229196,
                                                      "ext_mem_229196") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229197,
                                                      "ext_mem_229197") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229164,
                                                      "mem_229164") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229161,
                                                      "mem_229161") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229157,
                                                      "mem_229157") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229155,
                                                      "mem_229155") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229152,
                                                      "mem_229152") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229148,
                                                      "mem_229148") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_out_232249,
                                                      "mem_out_232249") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_out_232248,
                                                      "mem_out_232248") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_out_232247,
                                                      "mem_out_232247") != 0)
                                return 1;
                            err = 1;
                            goto cleanup;
                        }
                        
                        struct memblock_device mem_230586;
                        
                        mem_230586.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_230586,
                                                  binop_y_229377,
                                                  "mem_230586")) {
                            err = 1;
                            goto cleanup;
                        }
                        
                        struct memblock_device color_232027;
                        
                        color_232027.references = NULL;
                        if (memblock_alloc_device(ctx, &color_232027,
                                                  total_sizze_232158,
                                                  "color_232027")) {
                            err = 1;
                            goto cleanup;
                        }
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s\n", "\n# SegMap");
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_219049,
                                                                1,
                                                                sizeof(n_203490),
                                                                &n_203490));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_219049,
                                                                2,
                                                                sizeof(q_l_203495),
                                                                &q_l_203495));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_219049,
                                                                3,
                                                                sizeof(jump_t_203500),
                                                                &jump_t_203500));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_219049,
                                                                4,
                                                                sizeof(partition_sizze_203577),
                                                                &partition_sizze_203577));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_219049,
                                                                5,
                                                                sizeof(l_n_m_203643),
                                                                &l_n_m_203643));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_219049,
                                                                6,
                                                                sizeof(i_203670),
                                                                &i_203670));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_219049,
                                                                7,
                                                                sizeof(num_groups_219045),
                                                                &num_groups_219045));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_219049,
                                                                8,
                                                                sizeof(num_threads_232157),
                                                                &num_threads_232157));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_219049,
                                                                9,
                                                                sizeof(mem_230558.mem),
                                                                &mem_230558.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_219049,
                                                                10,
                                                                sizeof(mem_230561.mem),
                                                                &mem_230561.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_219049,
                                                                11,
                                                                sizeof(mem_230564.mem),
                                                                &mem_230564.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_219049,
                                                                12,
                                                                sizeof(mem_230567.mem),
                                                                &mem_230567.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_219049,
                                                                13,
                                                                sizeof(mem_230586.mem),
                                                                &mem_230586.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_219049,
                                                                14,
                                                                sizeof(color_232027.mem),
                                                                &color_232027.mem));
                        if (1 * ((size_t) num_groups_219045 *
                                 (size_t) segmap_group_sizze_219044) != 0) {
                            const size_t global_work_sizze_237182[1] =
                                         {(size_t) num_groups_219045 *
                                         (size_t) segmap_group_sizze_219044};
                            const size_t local_work_sizze_237186[1] =
                                         {(size_t) segmap_group_sizze_219044};
                            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_219049",
                                        global_work_sizze_237182[0],
                                        local_work_sizze_237186[0], (int) 0);
                                time_start_237183 = get_wall_time();
                            }
                            OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                            ctx->mainzisegmap_219049,
                                                                            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_219049_runs,
                                                                                                                      &ctx->mainzisegmap_219049_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_219049", time_diff_237185);
                            }
                        }
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s\n", "");
                        if (memblock_unref_device(ctx, &mem_230558,
                                                  "mem_230558") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_230561,
                                                  "mem_230561") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_230564,
                                                  "mem_230564") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_230567,
                                                  "mem_230567") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &color_232027,
                                                  "color_232027") != 0)
                            return 1;
                        
                        struct memblock_device mem_230611;
                        
                        mem_230611.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_230611,
                                                  bytes_229378, "mem_230611")) {
                            err = 1;
                            goto cleanup;
                        }
                        if (futrts_builtinzhgpu_map_transpose_f64(ctx,
                                                                  mem_230611,
                                                                  (int64_t) 0,
                                                                  mem_230586,
                                                                  (int64_t) 0,
                                                                  (int64_t) 1,
                                                                  partition_sizze_203577,
                                                                  l_n_m_203643) !=
                            0) {
                            if (memblock_unref_device(ctx, &mem_230611,
                                                      "mem_230611") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &color_232027,
                                                      "color_232027") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230586,
                                                      "mem_230586") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230567,
                                                      "mem_230567") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230564,
                                                      "mem_230564") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230561,
                                                      "mem_230561") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230558,
                                                      "mem_230558") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230613,
                                                      "ext_mem_230613") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230555,
                                                      "mem_230555") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230846,
                                                      "ext_mem_230846") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230847,
                                                      "ext_mem_230847") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230907,
                                                      "ext_mem_230907") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230908,
                                                      "ext_mem_230908") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230546,
                                                      "ext_mem_230546") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230529,
                                                      "ext_mem_230529") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230512,
                                                      "ext_mem_230512") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230494,
                                                      "ext_mem_230494") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230486,
                                                      "ext_mem_230486") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230487,
                                                      "ext_mem_230487") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229515,
                                                      "mem_param_229515") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229507,
                                                      "mem_param_229507") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231517,
                                                      "ext_mem_231517") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231518,
                                                      "ext_mem_231518") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229493,
                                                      "mem_param_229493") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229485,
                                                      "mem_param_229485") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229477,
                                                      "mem_param_229477") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231860,
                                                      "ext_mem_231860") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231861,
                                                      "ext_mem_231861") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231862,
                                                      "ext_mem_231862") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230551,
                                                      "mem_230551") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230534,
                                                      "mem_230534") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230517,
                                                      "mem_230517") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230500,
                                                      "mem_230500") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229531,
                                                      "mem_229531") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229526,
                                                      "mem_229526") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229520,
                                                      "mem_229520") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229469,
                                                      "mem_229469") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229465,
                                                      "mem_229465") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229460,
                                                      "ext_mem_229460") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229461,
                                                      "ext_mem_229461") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229411,
                                                      "ext_mem_229411") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229412,
                                                      "ext_mem_229412") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229362,
                                                      "ext_mem_229362") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229363,
                                                      "ext_mem_229363") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229264,
                                                      "ext_mem_229264") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229265,
                                                      "ext_mem_229265") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229206,
                                                      "mem_229206") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229200,
                                                      "mem_229200") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229196,
                                                      "ext_mem_229196") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229197,
                                                      "ext_mem_229197") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229164,
                                                      "mem_229164") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229161,
                                                      "mem_229161") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229157,
                                                      "mem_229157") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229155,
                                                      "mem_229155") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229152,
                                                      "mem_229152") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229148,
                                                      "mem_229148") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_out_232249,
                                                      "mem_out_232249") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_out_232248,
                                                      "mem_out_232248") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_out_232247,
                                                      "mem_out_232247") != 0)
                                return 1;
                            err = 1;
                            goto cleanup;
                        }
                        if (memblock_unref_device(ctx, &mem_230586,
                                                  "mem_230586") != 0)
                            return 1;
                        if (memblock_set_device(ctx, &ext_mem_230613,
                                                &mem_230611, "mem_230611") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_230611,
                                                  "mem_230611") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &color_232027,
                                                  "color_232027") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_230586,
                                                  "mem_230586") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_230567,
                                                  "mem_230567") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_230564,
                                                  "mem_230564") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_230561,
                                                  "mem_230561") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_230558,
                                                  "mem_230558") != 0)
                            return 1;
                    } else {
                        int64_t segmap_usable_groups_219426 =
                                sdiv_up64(nest_sizze_209492,
                                          segmap_group_sizze_219425);
                        struct memblock_device ext_mem_230607;
                        
                        ext_mem_230607.references = NULL;
                        
                        int32_t local_memory_capacity_234715;
                        
                        local_memory_capacity_234715 =
                            ctx->opencl.max_local_memory;
                        if (sle64((int64_t) 0,
                                  sext_i32_i64(local_memory_capacity_234715)) &&
                            suff_outer_par_219429) {
                            struct memblock_device mem_230591;
                            
                            mem_230591.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_230591,
                                                      bytes_229378,
                                                      "mem_230591")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s\n", "\n# SegMap");
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_219434,
                                                                    1,
                                                                    sizeof(n_203490),
                                                                    &n_203490));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_219434,
                                                                    2,
                                                                    sizeof(q_l_203495),
                                                                    &q_l_203495));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_219434,
                                                                    3,
                                                                    sizeof(jump_t_203500),
                                                                    &jump_t_203500));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_219434,
                                                                    4,
                                                                    sizeof(partition_sizze_203577),
                                                                    &partition_sizze_203577));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_219434,
                                                                    5,
                                                                    sizeof(l_n_m_203643),
                                                                    &l_n_m_203643));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_219434,
                                                                    6,
                                                                    sizeof(i_203670),
                                                                    &i_203670));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_219434,
                                                                    7,
                                                                    sizeof(ctx_param_ext_229488),
                                                                    &ctx_param_ext_229488));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_219434,
                                                                    8,
                                                                    sizeof(ctx_param_ext_229489),
                                                                    &ctx_param_ext_229489));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_219434,
                                                                    9,
                                                                    sizeof(ctx_param_ext_229491),
                                                                    &ctx_param_ext_229491));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_219434,
                                                                    10,
                                                                    sizeof(ext_mem_229411.mem),
                                                                    &ext_mem_229411.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_219434,
                                                                    11,
                                                                    sizeof(ext_mem_229412.mem),
                                                                    &ext_mem_229412.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_219434,
                                                                    12,
                                                                    sizeof(mem_param_229493.mem),
                                                                    &mem_param_229493.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_219434,
                                                                    13,
                                                                    sizeof(mem_230551.mem),
                                                                    &mem_230551.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_219434,
                                                                    14,
                                                                    sizeof(mem_230591.mem),
                                                                    &mem_230591.mem));
                            if (1 * ((size_t) segmap_usable_groups_219426 *
                                     (size_t) segmap_group_sizze_219425) != 0) {
                                const size_t global_work_sizze_237187[1] =
                                             {(size_t) segmap_usable_groups_219426 *
                                             (size_t) segmap_group_sizze_219425};
                                const size_t local_work_sizze_237191[1] =
                                             {(size_t) segmap_group_sizze_219425};
                                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_219434",
                                            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_219434,
                                                                                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_219434_runs,
                                                                                                                          &ctx->mainzisegmap_219434_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_219434",
                                            time_diff_237190);
                                }
                            }
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s\n", "");
                            if (memblock_set_device(ctx, &ext_mem_230607,
                                                    &mem_230591,
                                                    "mem_230591") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230591,
                                                      "mem_230591") != 0)
                                return 1;
                        } else {
                            struct memblock_device mem_230596;
                            
                            mem_230596.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_230596,
                                                      bytes_229378,
                                                      "mem_230596")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (slt64(q_l_203495 * (int64_t) 2,
                                      segred_group_sizze_219508)) {
                                int64_t segment_sizze_nonzzero_234561 =
                                        smax64((int64_t) 1, q_l_203495);
                                int64_t num_threads_234562 = num_groups_219509 *
                                        segred_group_sizze_219508;
                                
                                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_203577 *
                                                         l_n_m_203643), '\n');
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s: %llu%c",
                                            "segment_size",
                                            (long long) q_l_203495, '\n');
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s: %llu%c",
                                            "segments_per_group",
                                            (long long) squot64(segred_group_sizze_219508,
                                                                segment_sizze_nonzzero_234561),
                                            '\n');
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s: %llu%c",
                                            "required_groups",
                                            (long long) sext_i64_i32(sdiv_up64(partition_sizze_203577 *
                                                                               l_n_m_203643,
                                                                               squot64(segred_group_sizze_219508,
                                                                                       segment_sizze_nonzzero_234561))),
                                            '\n');
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_219515,
                                                                        1,
                                                                        (size_t) ((int64_t) 8 *
                                                                                  segred_group_sizze_219508),
                                                                        NULL));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_219515,
                                                                        2,
                                                                        sizeof(n_203490),
                                                                        &n_203490));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_219515,
                                                                        3,
                                                                        sizeof(q_l_203495),
                                                                        &q_l_203495));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_219515,
                                                                        4,
                                                                        sizeof(jump_t_203500),
                                                                        &jump_t_203500));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_219515,
                                                                        5,
                                                                        sizeof(partition_sizze_203577),
                                                                        &partition_sizze_203577));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_219515,
                                                                        6,
                                                                        sizeof(l_n_m_203643),
                                                                        &l_n_m_203643));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_219515,
                                                                        7,
                                                                        sizeof(i_203670),
                                                                        &i_203670));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_219515,
                                                                        8,
                                                                        sizeof(num_groups_219509),
                                                                        &num_groups_219509));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_219515,
                                                                        9,
                                                                        sizeof(ctx_param_ext_229488),
                                                                        &ctx_param_ext_229488));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_219515,
                                                                        10,
                                                                        sizeof(ctx_param_ext_229489),
                                                                        &ctx_param_ext_229489));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_219515,
                                                                        11,
                                                                        sizeof(ctx_param_ext_229491),
                                                                        &ctx_param_ext_229491));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_219515,
                                                                        12,
                                                                        sizeof(segment_sizze_nonzzero_234561),
                                                                        &segment_sizze_nonzzero_234561));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_219515,
                                                                        13,
                                                                        sizeof(ext_mem_229411.mem),
                                                                        &ext_mem_229411.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_219515,
                                                                        14,
                                                                        sizeof(ext_mem_229412.mem),
                                                                        &ext_mem_229412.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_219515,
                                                                        15,
                                                                        sizeof(mem_param_229493.mem),
                                                                        &mem_param_229493.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_219515,
                                                                        16,
                                                                        sizeof(mem_230596.mem),
                                                                        &mem_230596.mem));
                                if (1 * ((size_t) num_groups_219509 *
                                         (size_t) segred_group_sizze_219508) !=
                                    0) {
                                    const size_t global_work_sizze_237192[1] =
                                                 {(size_t) num_groups_219509 *
                                                 (size_t) segred_group_sizze_219508};
                                    const size_t local_work_sizze_237196[1] =
                                                 {(size_t) segred_group_sizze_219508};
                                    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.segred_small_219515",
                                                global_work_sizze_237192[0],
                                                local_work_sizze_237196[0],
                                                (int) (0 + (int64_t) 8 *
                                                       segred_group_sizze_219508));
                                        time_start_237193 = get_wall_time();
                                    }
                                    OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                                    ctx->mainzisegred_small_219515,
                                                                                    1,
                                                                                    NULL,
                                                                                    global_work_sizze_237192,
                                                                                    local_work_sizze_237196,
                                                                                    0,
                                                                                    NULL,
                                                                                    ctx->profiling_paused ||
                                                                                    !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                              &ctx->mainzisegred_small_219515_runs,
                                                                                                                              &ctx->mainzisegred_small_219515_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.segred_small_219515",
                                                time_diff_237195);
                                    }
                                }
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s\n", "");
                            } else {
                                int64_t groups_per_segment_234590 =
                                        sdiv_up64(num_groups_219509,
                                                  smax64((int64_t) 1,
                                                         partition_sizze_203577 *
                                                         l_n_m_203643));
                                int64_t elements_per_thread_234591 =
                                        sdiv_up64(q_l_203495,
                                                  segred_group_sizze_219508 *
                                                  groups_per_segment_234590);
                                int64_t virt_num_groups_234592 =
                                        groups_per_segment_234590 *
                                        (partition_sizze_203577 * l_n_m_203643);
                                int64_t num_threads_234593 = num_groups_219509 *
                                        segred_group_sizze_219508;
                                int64_t threads_per_segment_234594 =
                                        groups_per_segment_234590 *
                                        segred_group_sizze_219508;
                                
                                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_203577 *
                                                         l_n_m_203643), '\n');
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s: %llu%c",
                                            "segment_size",
                                            (long long) q_l_203495, '\n');
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s: %llu%c",
                                            "virt_num_groups",
                                            (long long) virt_num_groups_234592,
                                            '\n');
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s: %llu%c",
                                            "num_groups",
                                            (long long) num_groups_219509,
                                            '\n');
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s: %llu%c",
                                            "group_size",
                                            (long long) segred_group_sizze_219508,
                                            '\n');
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s: %llu%c",
                                            "elems_per_thread",
                                            (long long) elements_per_thread_234591,
                                            '\n');
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s: %llu%c",
                                            "groups_per_segment",
                                            (long long) groups_per_segment_234590,
                                            '\n');
                                
                                struct memblock_device segred_tmp_mem_234595;
                                
                                segred_tmp_mem_234595.references = NULL;
                                if (memblock_alloc_device(ctx,
                                                          &segred_tmp_mem_234595,
                                                          (int64_t) 8 *
                                                          virt_num_groups_234592,
                                                          "segred_tmp_mem_234595")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device mainzicounter_mem_234597
                                                       =
                                                       ctx->mainzicounter_mem_234597;
                                
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_219515,
                                                                        1,
                                                                        (size_t) 1,
                                                                        NULL));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_219515,
                                                                        2,
                                                                        (size_t) ((int64_t) 8 *
                                                                                  segred_group_sizze_219508),
                                                                        NULL));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_219515,
                                                                        3,
                                                                        sizeof(n_203490),
                                                                        &n_203490));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_219515,
                                                                        4,
                                                                        sizeof(q_l_203495),
                                                                        &q_l_203495));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_219515,
                                                                        5,
                                                                        sizeof(jump_t_203500),
                                                                        &jump_t_203500));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_219515,
                                                                        6,
                                                                        sizeof(partition_sizze_203577),
                                                                        &partition_sizze_203577));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_219515,
                                                                        7,
                                                                        sizeof(l_n_m_203643),
                                                                        &l_n_m_203643));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_219515,
                                                                        8,
                                                                        sizeof(i_203670),
                                                                        &i_203670));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_219515,
                                                                        9,
                                                                        sizeof(num_groups_219509),
                                                                        &num_groups_219509));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_219515,
                                                                        10,
                                                                        sizeof(ctx_param_ext_229488),
                                                                        &ctx_param_ext_229488));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_219515,
                                                                        11,
                                                                        sizeof(ctx_param_ext_229489),
                                                                        &ctx_param_ext_229489));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_219515,
                                                                        12,
                                                                        sizeof(ctx_param_ext_229491),
                                                                        &ctx_param_ext_229491));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_219515,
                                                                        13,
                                                                        sizeof(groups_per_segment_234590),
                                                                        &groups_per_segment_234590));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_219515,
                                                                        14,
                                                                        sizeof(elements_per_thread_234591),
                                                                        &elements_per_thread_234591));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_219515,
                                                                        15,
                                                                        sizeof(virt_num_groups_234592),
                                                                        &virt_num_groups_234592));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_219515,
                                                                        16,
                                                                        sizeof(threads_per_segment_234594),
                                                                        &threads_per_segment_234594));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_219515,
                                                                        17,
                                                                        sizeof(ext_mem_229411.mem),
                                                                        &ext_mem_229411.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_219515,
                                                                        18,
                                                                        sizeof(ext_mem_229412.mem),
                                                                        &ext_mem_229412.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_219515,
                                                                        19,
                                                                        sizeof(mem_param_229493.mem),
                                                                        &mem_param_229493.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_219515,
                                                                        20,
                                                                        sizeof(mem_230596.mem),
                                                                        &mem_230596.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_219515,
                                                                        21,
                                                                        sizeof(segred_tmp_mem_234595.mem),
                                                                        &segred_tmp_mem_234595.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_219515,
                                                                        22,
                                                                        sizeof(mainzicounter_mem_234597.mem),
                                                                        &mainzicounter_mem_234597.mem));
                                if (1 * ((size_t) num_groups_219509 *
                                         (size_t) segred_group_sizze_219508) !=
                                    0) {
                                    const size_t global_work_sizze_237198[1] =
                                                 {(size_t) num_groups_219509 *
                                                 (size_t) segred_group_sizze_219508};
                                    const size_t local_work_sizze_237202[1] =
                                                 {(size_t) segred_group_sizze_219508};
                                    int64_t time_start_237199 = 0,
                                            time_end_237200 = 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_219515",
                                                global_work_sizze_237198[0],
                                                local_work_sizze_237202[0],
                                                (int) (0 + 1 + (int64_t) 8 *
                                                       segred_group_sizze_219508));
                                        time_start_237199 = get_wall_time();
                                    }
                                    OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                                    ctx->mainzisegred_large_219515,
                                                                                    1,
                                                                                    NULL,
                                                                                    global_work_sizze_237198,
                                                                                    local_work_sizze_237202,
                                                                                    0,
                                                                                    NULL,
                                                                                    ctx->profiling_paused ||
                                                                                    !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                              &ctx->mainzisegred_large_219515_runs,
                                                                                                                              &ctx->mainzisegred_large_219515_total_runtime)));
                                    if (ctx->debugging) {
                                        OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                        time_end_237200 = get_wall_time();
                                        
                                        long time_diff_237201 =
                                             time_end_237200 -
                                             time_start_237199;
                                        
                                        fprintf(ctx->log,
                                                "kernel %s runtime: %ldus\n",
                                                "main.segred_large_219515",
                                                time_diff_237201);
                                    }
                                }
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s\n", "");
                                if (memblock_unref_device(ctx,
                                                          &segred_tmp_mem_234595,
                                                          "segred_tmp_mem_234595") !=
                                    0)
                                    return 1;
                            }
                            
                            int64_t segmap_usable_groups_219547 =
                                    sdiv_up64(nest_sizze_209492,
                                              segmap_group_sizze_219546);
                            struct memblock_device mem_230601;
                            
                            mem_230601.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_230601,
                                                      bytes_229378,
                                                      "mem_230601")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s\n", "\n# SegMap");
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_219551,
                                                                    1,
                                                                    sizeof(partition_sizze_203577),
                                                                    &partition_sizze_203577));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_219551,
                                                                    2,
                                                                    sizeof(l_n_m_203643),
                                                                    &l_n_m_203643));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_219551,
                                                                    3,
                                                                    sizeof(mem_230596.mem),
                                                                    &mem_230596.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_219551,
                                                                    4,
                                                                    sizeof(mem_230601.mem),
                                                                    &mem_230601.mem));
                            if (1 * ((size_t) segmap_usable_groups_219547 *
                                     (size_t) segmap_group_sizze_219546) != 0) {
                                const size_t global_work_sizze_237203[1] =
                                             {(size_t) segmap_usable_groups_219547 *
                                             (size_t) segmap_group_sizze_219546};
                                const size_t local_work_sizze_237207[1] =
                                             {(size_t) segmap_group_sizze_219546};
                                int64_t time_start_237204 = 0, time_end_237205 =
                                        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_219551",
                                            global_work_sizze_237203[0],
                                            local_work_sizze_237207[0],
                                            (int) 0);
                                    time_start_237204 = get_wall_time();
                                }
                                OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                                ctx->mainzisegmap_219551,
                                                                                1,
                                                                                NULL,
                                                                                global_work_sizze_237203,
                                                                                local_work_sizze_237207,
                                                                                0,
                                                                                NULL,
                                                                                ctx->profiling_paused ||
                                                                                !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                          &ctx->mainzisegmap_219551_runs,
                                                                                                                          &ctx->mainzisegmap_219551_total_runtime)));
                                if (ctx->debugging) {
                                    OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                    time_end_237205 = get_wall_time();
                                    
                                    long time_diff_237206 = time_end_237205 -
                                         time_start_237204;
                                    
                                    fprintf(ctx->log,
                                            "kernel %s runtime: %ldus\n",
                                            "main.segmap_219551",
                                            time_diff_237206);
                                }
                            }
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s\n", "");
                            if (memblock_unref_device(ctx, &mem_230596,
                                                      "mem_230596") != 0)
                                return 1;
                            
                            struct memblock_device mem_230606;
                            
                            mem_230606.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_230606,
                                                      bytes_229378,
                                                      "mem_230606")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (slt64(q_l_203495 * (int64_t) 2,
                                      segred_group_sizze_219557)) {
                                int64_t segment_sizze_nonzzero_234643 =
                                        smax64((int64_t) 1, q_l_203495);
                                int64_t num_threads_234644 = num_groups_219558 *
                                        segred_group_sizze_219557;
                                
                                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_203577 *
                                                         l_n_m_203643), '\n');
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s: %llu%c",
                                            "segment_size",
                                            (long long) q_l_203495, '\n');
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s: %llu%c",
                                            "segments_per_group",
                                            (long long) squot64(segred_group_sizze_219557,
                                                                segment_sizze_nonzzero_234643),
                                            '\n');
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s: %llu%c",
                                            "required_groups",
                                            (long long) sext_i64_i32(sdiv_up64(partition_sizze_203577 *
                                                                               l_n_m_203643,
                                                                               squot64(segred_group_sizze_219557,
                                                                                       segment_sizze_nonzzero_234643))),
                                            '\n');
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_219564,
                                                                        1,
                                                                        (size_t) ((int64_t) 8 *
                                                                                  segred_group_sizze_219557),
                                                                        NULL));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_219564,
                                                                        2,
                                                                        sizeof(n_203490),
                                                                        &n_203490));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_219564,
                                                                        3,
                                                                        sizeof(q_l_203495),
                                                                        &q_l_203495));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_219564,
                                                                        4,
                                                                        sizeof(jump_t_203500),
                                                                        &jump_t_203500));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_219564,
                                                                        5,
                                                                        sizeof(partition_sizze_203577),
                                                                        &partition_sizze_203577));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_219564,
                                                                        6,
                                                                        sizeof(l_n_m_203643),
                                                                        &l_n_m_203643));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_219564,
                                                                        7,
                                                                        sizeof(i_203670),
                                                                        &i_203670));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_219564,
                                                                        8,
                                                                        sizeof(num_groups_219558),
                                                                        &num_groups_219558));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_219564,
                                                                        9,
                                                                        sizeof(ctx_param_ext_229488),
                                                                        &ctx_param_ext_229488));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_219564,
                                                                        10,
                                                                        sizeof(ctx_param_ext_229489),
                                                                        &ctx_param_ext_229489));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_219564,
                                                                        11,
                                                                        sizeof(ctx_param_ext_229491),
                                                                        &ctx_param_ext_229491));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_219564,
                                                                        12,
                                                                        sizeof(segment_sizze_nonzzero_234643),
                                                                        &segment_sizze_nonzzero_234643));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_219564,
                                                                        13,
                                                                        sizeof(ext_mem_229411.mem),
                                                                        &ext_mem_229411.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_219564,
                                                                        14,
                                                                        sizeof(ext_mem_229412.mem),
                                                                        &ext_mem_229412.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_219564,
                                                                        15,
                                                                        sizeof(mem_param_229493.mem),
                                                                        &mem_param_229493.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_219564,
                                                                        16,
                                                                        sizeof(mem_230551.mem),
                                                                        &mem_230551.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_219564,
                                                                        17,
                                                                        sizeof(mem_230601.mem),
                                                                        &mem_230601.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_219564,
                                                                        18,
                                                                        sizeof(mem_230606.mem),
                                                                        &mem_230606.mem));
                                if (1 * ((size_t) num_groups_219558 *
                                         (size_t) segred_group_sizze_219557) !=
                                    0) {
                                    const size_t global_work_sizze_237208[1] =
                                                 {(size_t) num_groups_219558 *
                                                 (size_t) segred_group_sizze_219557};
                                    const size_t local_work_sizze_237212[1] =
                                                 {(size_t) segred_group_sizze_219557};
                                    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_small_219564",
                                                global_work_sizze_237208[0],
                                                local_work_sizze_237212[0],
                                                (int) (0 + (int64_t) 8 *
                                                       segred_group_sizze_219557));
                                        time_start_237209 = get_wall_time();
                                    }
                                    OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                                    ctx->mainzisegred_small_219564,
                                                                                    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_small_219564_runs,
                                                                                                                              &ctx->mainzisegred_small_219564_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_small_219564",
                                                time_diff_237211);
                                    }
                                }
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s\n", "");
                            } else {
                                int64_t groups_per_segment_234672 =
                                        sdiv_up64(num_groups_219558,
                                                  smax64((int64_t) 1,
                                                         partition_sizze_203577 *
                                                         l_n_m_203643));
                                int64_t elements_per_thread_234673 =
                                        sdiv_up64(q_l_203495,
                                                  segred_group_sizze_219557 *
                                                  groups_per_segment_234672);
                                int64_t virt_num_groups_234674 =
                                        groups_per_segment_234672 *
                                        (partition_sizze_203577 * l_n_m_203643);
                                int64_t num_threads_234675 = num_groups_219558 *
                                        segred_group_sizze_219557;
                                int64_t threads_per_segment_234676 =
                                        groups_per_segment_234672 *
                                        segred_group_sizze_219557;
                                
                                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_203577 *
                                                         l_n_m_203643), '\n');
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s: %llu%c",
                                            "segment_size",
                                            (long long) q_l_203495, '\n');
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s: %llu%c",
                                            "virt_num_groups",
                                            (long long) virt_num_groups_234674,
                                            '\n');
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s: %llu%c",
                                            "num_groups",
                                            (long long) num_groups_219558,
                                            '\n');
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s: %llu%c",
                                            "group_size",
                                            (long long) segred_group_sizze_219557,
                                            '\n');
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s: %llu%c",
                                            "elems_per_thread",
                                            (long long) elements_per_thread_234673,
                                            '\n');
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s: %llu%c",
                                            "groups_per_segment",
                                            (long long) groups_per_segment_234672,
                                            '\n');
                                
                                struct memblock_device segred_tmp_mem_234677;
                                
                                segred_tmp_mem_234677.references = NULL;
                                if (memblock_alloc_device(ctx,
                                                          &segred_tmp_mem_234677,
                                                          (int64_t) 8 *
                                                          virt_num_groups_234674,
                                                          "segred_tmp_mem_234677")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device mainzicounter_mem_234679
                                                       =
                                                       ctx->mainzicounter_mem_234679;
                                
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_219564,
                                                                        1,
                                                                        (size_t) 1,
                                                                        NULL));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_219564,
                                                                        2,
                                                                        (size_t) ((int64_t) 8 *
                                                                                  segred_group_sizze_219557),
                                                                        NULL));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_219564,
                                                                        3,
                                                                        sizeof(n_203490),
                                                                        &n_203490));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_219564,
                                                                        4,
                                                                        sizeof(q_l_203495),
                                                                        &q_l_203495));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_219564,
                                                                        5,
                                                                        sizeof(jump_t_203500),
                                                                        &jump_t_203500));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_219564,
                                                                        6,
                                                                        sizeof(partition_sizze_203577),
                                                                        &partition_sizze_203577));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_219564,
                                                                        7,
                                                                        sizeof(l_n_m_203643),
                                                                        &l_n_m_203643));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_219564,
                                                                        8,
                                                                        sizeof(i_203670),
                                                                        &i_203670));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_219564,
                                                                        9,
                                                                        sizeof(num_groups_219558),
                                                                        &num_groups_219558));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_219564,
                                                                        10,
                                                                        sizeof(ctx_param_ext_229488),
                                                                        &ctx_param_ext_229488));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_219564,
                                                                        11,
                                                                        sizeof(ctx_param_ext_229489),
                                                                        &ctx_param_ext_229489));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_219564,
                                                                        12,
                                                                        sizeof(ctx_param_ext_229491),
                                                                        &ctx_param_ext_229491));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_219564,
                                                                        13,
                                                                        sizeof(groups_per_segment_234672),
                                                                        &groups_per_segment_234672));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_219564,
                                                                        14,
                                                                        sizeof(elements_per_thread_234673),
                                                                        &elements_per_thread_234673));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_219564,
                                                                        15,
                                                                        sizeof(virt_num_groups_234674),
                                                                        &virt_num_groups_234674));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_219564,
                                                                        16,
                                                                        sizeof(threads_per_segment_234676),
                                                                        &threads_per_segment_234676));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_219564,
                                                                        17,
                                                                        sizeof(ext_mem_229411.mem),
                                                                        &ext_mem_229411.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_219564,
                                                                        18,
                                                                        sizeof(ext_mem_229412.mem),
                                                                        &ext_mem_229412.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_219564,
                                                                        19,
                                                                        sizeof(mem_param_229493.mem),
                                                                        &mem_param_229493.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_219564,
                                                                        20,
                                                                        sizeof(mem_230551.mem),
                                                                        &mem_230551.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_219564,
                                                                        21,
                                                                        sizeof(mem_230601.mem),
                                                                        &mem_230601.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_219564,
                                                                        22,
                                                                        sizeof(mem_230606.mem),
                                                                        &mem_230606.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_219564,
                                                                        23,
                                                                        sizeof(segred_tmp_mem_234677.mem),
                                                                        &segred_tmp_mem_234677.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_219564,
                                                                        24,
                                                                        sizeof(mainzicounter_mem_234679.mem),
                                                                        &mainzicounter_mem_234679.mem));
                                if (1 * ((size_t) num_groups_219558 *
                                         (size_t) segred_group_sizze_219557) !=
                                    0) {
                                    const size_t global_work_sizze_237214[1] =
                                                 {(size_t) num_groups_219558 *
                                                 (size_t) segred_group_sizze_219557};
                                    const size_t local_work_sizze_237218[1] =
                                                 {(size_t) segred_group_sizze_219557};
                                    int64_t time_start_237215 = 0,
                                            time_end_237216 = 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_219564",
                                                global_work_sizze_237214[0],
                                                local_work_sizze_237218[0],
                                                (int) (0 + 1 + (int64_t) 8 *
                                                       segred_group_sizze_219557));
                                        time_start_237215 = get_wall_time();
                                    }
                                    OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                                    ctx->mainzisegred_large_219564,
                                                                                    1,
                                                                                    NULL,
                                                                                    global_work_sizze_237214,
                                                                                    local_work_sizze_237218,
                                                                                    0,
                                                                                    NULL,
                                                                                    ctx->profiling_paused ||
                                                                                    !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                              &ctx->mainzisegred_large_219564_runs,
                                                                                                                              &ctx->mainzisegred_large_219564_total_runtime)));
                                    if (ctx->debugging) {
                                        OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                        time_end_237216 = get_wall_time();
                                        
                                        long time_diff_237217 =
                                             time_end_237216 -
                                             time_start_237215;
                                        
                                        fprintf(ctx->log,
                                                "kernel %s runtime: %ldus\n",
                                                "main.segred_large_219564",
                                                time_diff_237217);
                                    }
                                }
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s\n", "");
                                if (memblock_unref_device(ctx,
                                                          &segred_tmp_mem_234677,
                                                          "segred_tmp_mem_234677") !=
                                    0)
                                    return 1;
                            }
                            if (memblock_unref_device(ctx, &mem_230601,
                                                      "mem_230601") != 0)
                                return 1;
                            if (memblock_set_device(ctx, &ext_mem_230607,
                                                    &mem_230606,
                                                    "mem_230606") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230606,
                                                      "mem_230606") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230601,
                                                      "mem_230601") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230596,
                                                      "mem_230596") != 0)
                                return 1;
                        }
                        if (memblock_set_device(ctx, &ext_mem_230613,
                                                &ext_mem_230607,
                                                "ext_mem_230607") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_230607,
                                                  "ext_mem_230607") != 0)
                            return 1;
                    }
                    if (memblock_set_device(ctx, &ext_mem_230847,
                                            &ext_mem_230613,
                                            "ext_mem_230613") != 0)
                        return 1;
                    if (memblock_set_device(ctx, &ext_mem_230846, &mem_230555,
                                            "mem_230555") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_230613,
                                              "ext_mem_230613") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_230555, "mem_230555") !=
                        0)
                        return 1;
                } else {
                    bool match_lit_205259 = (int64_t) 1 == d_l_203498;
                    struct memblock_device ext_mem_230845;
                    
                    ext_mem_230845.references = NULL;
                    
                    struct memblock_device ext_mem_230844;
                    
                    ext_mem_230844.references = NULL;
                    if (match_lit_205259) {
                        bool suff_outer_par_219604;
                        
                        suff_outer_par_219604 =
                            *ctx->tuning_params.mainzisuff_outer_par_24 <=
                            partition_sizze_203577;
                        if (ctx->logging)
                            fprintf(ctx->log, "Compared %s <= %ld: %s.\n",
                                    "main.suff_outer_par_24",
                                    (long) partition_sizze_203577,
                                    suff_outer_par_219604 ? "true" : "false");
                        
                        int64_t segmap_group_sizze_219706;
                        
                        segmap_group_sizze_219706 =
                            *ctx->tuning_params.mainzisegmap_group_sizze_219608;
                        
                        int64_t num_groups_219707;
                        int32_t max_num_groups_234717;
                        
                        max_num_groups_234717 =
                            *ctx->tuning_params.mainzisegmap_num_groups_219610;
                        num_groups_219707 = sext_i64_i32(smax64((int64_t) 1,
                                                                smin64(sdiv_up64(partition_sizze_203577,
                                                                                 segmap_group_sizze_219706),
                                                                       sext_i32_i64(max_num_groups_234717))));
                        
                        int64_t segmap_group_sizze_220222;
                        
                        segmap_group_sizze_220222 =
                            *ctx->tuning_params.mainzisegmap_group_sizze_219808;
                        
                        bool suff_outer_par_220226;
                        
                        suff_outer_par_220226 =
                            *ctx->tuning_params.mainzisuff_outer_par_25 <=
                            nest_sizze_209492;
                        if (ctx->logging)
                            fprintf(ctx->log, "Compared %s <= %ld: %s.\n",
                                    "main.suff_outer_par_25",
                                    (long) nest_sizze_209492,
                                    suff_outer_par_220226 ? "true" : "false");
                        
                        int64_t nest_sizze_220334 = q_l_203495 *
                                nest_sizze_209492;
                        int64_t segred_group_sizze_220335;
                        
                        segred_group_sizze_220335 =
                            *ctx->tuning_params.mainzisegred_group_sizze_220012;
                        
                        int64_t num_groups_220336;
                        int32_t max_num_groups_234718;
                        
                        max_num_groups_234718 =
                            *ctx->tuning_params.mainzisegred_num_groups_220014;
                        num_groups_220336 = sext_i64_i32(smax64((int64_t) 1,
                                                                smin64(sdiv_up64(nest_sizze_220334,
                                                                                 segred_group_sizze_220335),
                                                                       sext_i32_i64(max_num_groups_234718))));
                        
                        int64_t segmap_group_sizze_220383;
                        
                        segmap_group_sizze_220383 =
                            *ctx->tuning_params.mainzisegmap_group_sizze_219990;
                        
                        int64_t segred_group_sizze_220405;
                        
                        segred_group_sizze_220405 =
                            *ctx->tuning_params.mainzisegred_group_sizze_219918;
                        
                        int64_t num_groups_220406;
                        int32_t max_num_groups_234719;
                        
                        max_num_groups_234719 =
                            *ctx->tuning_params.mainzisegred_num_groups_219920;
                        num_groups_220406 = sext_i64_i32(smax64((int64_t) 1,
                                                                smin64(sdiv_up64(nest_sizze_220334,
                                                                                 segred_group_sizze_220405),
                                                                       sext_i32_i64(max_num_groups_234719))));
                        
                        int64_t num_threads_232163 = segmap_group_sizze_219706 *
                                num_groups_219707;
                        int64_t total_sizze_232164 = bytes_229371 *
                                num_threads_232163;
                        int64_t total_sizze_232165 = bytes_229371 *
                                num_threads_232163;
                        struct memblock_device ext_mem_230720;
                        
                        ext_mem_230720.references = NULL;
                        
                        struct memblock_device ext_mem_230719;
                        
                        ext_mem_230719.references = NULL;
                        
                        int32_t local_memory_capacity_234966;
                        
                        local_memory_capacity_234966 =
                            ctx->opencl.max_local_memory;
                        if ((sle64((int64_t) 0,
                                   sext_i32_i64(local_memory_capacity_234966)) &&
                             sle64((int64_t) 0,
                                   sext_i32_i64(local_memory_capacity_234966))) &&
                            suff_outer_par_219604) {
                            struct memblock_device mem_230616;
                            
                            mem_230616.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_230616,
                                                      binop_y_229377,
                                                      "mem_230616")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (futrts_builtinzhgpu_map_transpose_i64(ctx,
                                                                      mem_230616,
                                                                      (int64_t) 0,
                                                                      ext_mem_229412,
                                                                      (int64_t) 0,
                                                                      (int64_t) 1,
                                                                      l_n_m_203643,
                                                                      partition_sizze_203577) !=
                                0) {
                                if (memblock_unref_device(ctx, &mem_230616,
                                                          "mem_230616") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230719,
                                                          "ext_mem_230719") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230720,
                                                          "ext_mem_230720") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230844,
                                                          "ext_mem_230844") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230845,
                                                          "ext_mem_230845") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230846,
                                                          "ext_mem_230846") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230847,
                                                          "ext_mem_230847") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230907,
                                                          "ext_mem_230907") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230908,
                                                          "ext_mem_230908") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230546,
                                                          "ext_mem_230546") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230529,
                                                          "ext_mem_230529") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230512,
                                                          "ext_mem_230512") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230494,
                                                          "ext_mem_230494") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230486,
                                                          "ext_mem_230486") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230487,
                                                          "ext_mem_230487") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229515,
                                                          "mem_param_229515") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229507,
                                                          "mem_param_229507") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231517,
                                                          "ext_mem_231517") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231518,
                                                          "ext_mem_231518") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229493,
                                                          "mem_param_229493") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229485,
                                                          "mem_param_229485") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229477,
                                                          "mem_param_229477") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231860,
                                                          "ext_mem_231860") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231861,
                                                          "ext_mem_231861") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231862,
                                                          "ext_mem_231862") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230551,
                                                          "mem_230551") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230534,
                                                          "mem_230534") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230517,
                                                          "mem_230517") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230500,
                                                          "mem_230500") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229531,
                                                          "mem_229531") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229526,
                                                          "mem_229526") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229520,
                                                          "mem_229520") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229469,
                                                          "mem_229469") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229465,
                                                          "mem_229465") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229460,
                                                          "ext_mem_229460") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229461,
                                                          "ext_mem_229461") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229411,
                                                          "ext_mem_229411") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229412,
                                                          "ext_mem_229412") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229362,
                                                          "ext_mem_229362") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229363,
                                                          "ext_mem_229363") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229264,
                                                          "ext_mem_229264") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229265,
                                                          "ext_mem_229265") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229206,
                                                          "mem_229206") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229200,
                                                          "mem_229200") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229196,
                                                          "ext_mem_229196") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229197,
                                                          "ext_mem_229197") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229164,
                                                          "mem_229164") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229161,
                                                          "mem_229161") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229157,
                                                          "mem_229157") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229155,
                                                          "mem_229155") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229152,
                                                          "mem_229152") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229148,
                                                          "mem_229148") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232249,
                                                          "mem_out_232249") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232248,
                                                          "mem_out_232248") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232247,
                                                          "mem_out_232247") !=
                                    0)
                                    return 1;
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device mem_230619;
                            
                            mem_230619.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_230619,
                                                      binop_y_229377,
                                                      "mem_230619")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (futrts_builtinzhgpu_map_transpose_f64(ctx,
                                                                      mem_230619,
                                                                      (int64_t) 0,
                                                                      ext_mem_229411,
                                                                      (int64_t) 0,
                                                                      (int64_t) 1,
                                                                      l_n_m_203643,
                                                                      partition_sizze_203577) !=
                                0) {
                                if (memblock_unref_device(ctx, &mem_230619,
                                                          "mem_230619") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230616,
                                                          "mem_230616") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230719,
                                                          "ext_mem_230719") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230720,
                                                          "ext_mem_230720") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230844,
                                                          "ext_mem_230844") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230845,
                                                          "ext_mem_230845") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230846,
                                                          "ext_mem_230846") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230847,
                                                          "ext_mem_230847") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230907,
                                                          "ext_mem_230907") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230908,
                                                          "ext_mem_230908") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230546,
                                                          "ext_mem_230546") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230529,
                                                          "ext_mem_230529") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230512,
                                                          "ext_mem_230512") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230494,
                                                          "ext_mem_230494") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230486,
                                                          "ext_mem_230486") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230487,
                                                          "ext_mem_230487") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229515,
                                                          "mem_param_229515") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229507,
                                                          "mem_param_229507") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231517,
                                                          "ext_mem_231517") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231518,
                                                          "ext_mem_231518") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229493,
                                                          "mem_param_229493") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229485,
                                                          "mem_param_229485") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229477,
                                                          "mem_param_229477") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231860,
                                                          "ext_mem_231860") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231861,
                                                          "ext_mem_231861") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231862,
                                                          "ext_mem_231862") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230551,
                                                          "mem_230551") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230534,
                                                          "mem_230534") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230517,
                                                          "mem_230517") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230500,
                                                          "mem_230500") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229531,
                                                          "mem_229531") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229526,
                                                          "mem_229526") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229520,
                                                          "mem_229520") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229469,
                                                          "mem_229469") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229465,
                                                          "mem_229465") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229460,
                                                          "ext_mem_229460") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229461,
                                                          "ext_mem_229461") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229411,
                                                          "ext_mem_229411") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229412,
                                                          "ext_mem_229412") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229362,
                                                          "ext_mem_229362") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229363,
                                                          "ext_mem_229363") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229264,
                                                          "ext_mem_229264") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229265,
                                                          "ext_mem_229265") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229206,
                                                          "mem_229206") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229200,
                                                          "mem_229200") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229196,
                                                          "ext_mem_229196") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229197,
                                                          "ext_mem_229197") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229164,
                                                          "mem_229164") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229161,
                                                          "mem_229161") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229157,
                                                          "mem_229157") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229155,
                                                          "mem_229155") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229152,
                                                          "mem_229152") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229148,
                                                          "mem_229148") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232249,
                                                          "mem_out_232249") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232248,
                                                          "mem_out_232248") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232247,
                                                          "mem_out_232247") !=
                                    0)
                                    return 1;
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device mem_230622;
                            
                            mem_230622.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_230622,
                                                      binop_y_229176,
                                                      "mem_230622")) {
                                err = 1;
                                goto cleanup;
                            }
                            
                            int64_t group_sizze_234723;
                            
                            group_sizze_234723 =
                                *ctx->tuning_params.mainzigroup_sizze_234723;
                            
                            int64_t num_groups_234724 =
                                    sdiv_up64(partition_sizze_203577 * n_203490,
                                              group_sizze_234723);
                            
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzicopy_234720,
                                                                    0,
                                                                    sizeof(n_203490),
                                                                    &n_203490));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzicopy_234720,
                                                                    1,
                                                                    sizeof(partition_sizze_203577),
                                                                    &partition_sizze_203577));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzicopy_234720,
                                                                    2,
                                                                    sizeof(ctx_param_ext_229488),
                                                                    &ctx_param_ext_229488));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzicopy_234720,
                                                                    3,
                                                                    sizeof(ctx_param_ext_229489),
                                                                    &ctx_param_ext_229489));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzicopy_234720,
                                                                    4,
                                                                    sizeof(ctx_param_ext_229491),
                                                                    &ctx_param_ext_229491));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzicopy_234720,
                                                                    5,
                                                                    sizeof(mem_param_229493.mem),
                                                                    &mem_param_229493.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzicopy_234720,
                                                                    6,
                                                                    sizeof(mem_230622.mem),
                                                                    &mem_230622.mem));
                            if (1 * ((size_t) num_groups_234724 *
                                     (size_t) group_sizze_234723) != 0) {
                                const size_t global_work_sizze_237219[1] =
                                             {(size_t) num_groups_234724 *
                                             (size_t) group_sizze_234723};
                                const size_t local_work_sizze_237223[1] =
                                             {(size_t) group_sizze_234723};
                                int64_t time_start_237220 = 0, time_end_237221 =
                                        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_234720",
                                            global_work_sizze_237219[0],
                                            local_work_sizze_237223[0],
                                            (int) 0);
                                    time_start_237220 = get_wall_time();
                                }
                                OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                                ctx->mainzicopy_234720,
                                                                                1,
                                                                                NULL,
                                                                                global_work_sizze_237219,
                                                                                local_work_sizze_237223,
                                                                                0,
                                                                                NULL,
                                                                                ctx->profiling_paused ||
                                                                                !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                          &ctx->mainzicopy_234720_runs,
                                                                                                                          &ctx->mainzicopy_234720_total_runtime)));
                                if (ctx->debugging) {
                                    OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                    time_end_237221 = get_wall_time();
                                    
                                    long time_diff_237222 = time_end_237221 -
                                         time_start_237220;
                                    
                                    fprintf(ctx->log,
                                            "kernel %s runtime: %ldus\n",
                                            "main.copy_234720",
                                            time_diff_237222);
                                }
                            }
                            
                            struct memblock_device mem_230625;
                            
                            mem_230625.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_230625,
                                                      binop_y_229176,
                                                      "mem_230625")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (futrts_builtinzhgpu_map_transpose_f64(ctx,
                                                                      mem_230625,
                                                                      (int64_t) 0,
                                                                      mem_230551,
                                                                      (int64_t) 0,
                                                                      (int64_t) 1,
                                                                      n_203490,
                                                                      partition_sizze_203577) !=
                                0) {
                                if (memblock_unref_device(ctx, &mem_230625,
                                                          "mem_230625") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230622,
                                                          "mem_230622") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230619,
                                                          "mem_230619") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230616,
                                                          "mem_230616") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230719,
                                                          "ext_mem_230719") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230720,
                                                          "ext_mem_230720") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230844,
                                                          "ext_mem_230844") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230845,
                                                          "ext_mem_230845") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230846,
                                                          "ext_mem_230846") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230847,
                                                          "ext_mem_230847") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230907,
                                                          "ext_mem_230907") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230908,
                                                          "ext_mem_230908") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230546,
                                                          "ext_mem_230546") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230529,
                                                          "ext_mem_230529") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230512,
                                                          "ext_mem_230512") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230494,
                                                          "ext_mem_230494") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230486,
                                                          "ext_mem_230486") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230487,
                                                          "ext_mem_230487") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229515,
                                                          "mem_param_229515") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229507,
                                                          "mem_param_229507") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231517,
                                                          "ext_mem_231517") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231518,
                                                          "ext_mem_231518") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229493,
                                                          "mem_param_229493") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229485,
                                                          "mem_param_229485") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229477,
                                                          "mem_param_229477") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231860,
                                                          "ext_mem_231860") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231861,
                                                          "ext_mem_231861") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231862,
                                                          "ext_mem_231862") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230551,
                                                          "mem_230551") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230534,
                                                          "mem_230534") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230517,
                                                          "mem_230517") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230500,
                                                          "mem_230500") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229531,
                                                          "mem_229531") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229526,
                                                          "mem_229526") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229520,
                                                          "mem_229520") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229469,
                                                          "mem_229469") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229465,
                                                          "mem_229465") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229460,
                                                          "ext_mem_229460") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229461,
                                                          "ext_mem_229461") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229411,
                                                          "ext_mem_229411") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229412,
                                                          "ext_mem_229412") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229362,
                                                          "ext_mem_229362") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229363,
                                                          "ext_mem_229363") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229264,
                                                          "ext_mem_229264") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229265,
                                                          "ext_mem_229265") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229206,
                                                          "mem_229206") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229200,
                                                          "mem_229200") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229196,
                                                          "ext_mem_229196") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229197,
                                                          "ext_mem_229197") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229164,
                                                          "mem_229164") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229161,
                                                          "mem_229161") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229157,
                                                          "mem_229157") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229155,
                                                          "mem_229155") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229152,
                                                          "mem_229152") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229148,
                                                          "mem_229148") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232249,
                                                          "mem_out_232249") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232248,
                                                          "mem_out_232248") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232247,
                                                          "mem_out_232247") !=
                                    0)
                                    return 1;
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device mem_230659;
                            
                            mem_230659.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_230659,
                                                      binop_y_229377,
                                                      "mem_230659")) {
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device mem_230662;
                            
                            mem_230662.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_230662,
                                                      binop_y_229377,
                                                      "mem_230662")) {
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device color_232028;
                            
                            color_232028.references = NULL;
                            if (memblock_alloc_device(ctx, &color_232028,
                                                      total_sizze_232164,
                                                      "color_232028")) {
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device color_232029;
                            
                            color_232029.references = NULL;
                            if (memblock_alloc_device(ctx, &color_232029,
                                                      total_sizze_232165,
                                                      "color_232029")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s\n", "\n# SegMap");
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_219712,
                                                                    1,
                                                                    sizeof(n_203490),
                                                                    &n_203490));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_219712,
                                                                    2,
                                                                    sizeof(q_l_203495),
                                                                    &q_l_203495));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_219712,
                                                                    3,
                                                                    sizeof(jump_t_203500),
                                                                    &jump_t_203500));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_219712,
                                                                    4,
                                                                    sizeof(partition_sizze_203577),
                                                                    &partition_sizze_203577));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_219712,
                                                                    5,
                                                                    sizeof(l_n_m_203643),
                                                                    &l_n_m_203643));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_219712,
                                                                    6,
                                                                    sizeof(i_203670),
                                                                    &i_203670));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_219712,
                                                                    7,
                                                                    sizeof(num_groups_219707),
                                                                    &num_groups_219707));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_219712,
                                                                    8,
                                                                    sizeof(num_threads_232163),
                                                                    &num_threads_232163));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_219712,
                                                                    9,
                                                                    sizeof(mem_230616.mem),
                                                                    &mem_230616.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_219712,
                                                                    10,
                                                                    sizeof(mem_230619.mem),
                                                                    &mem_230619.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_219712,
                                                                    11,
                                                                    sizeof(mem_230622.mem),
                                                                    &mem_230622.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_219712,
                                                                    12,
                                                                    sizeof(mem_230625.mem),
                                                                    &mem_230625.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_219712,
                                                                    13,
                                                                    sizeof(mem_230659.mem),
                                                                    &mem_230659.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_219712,
                                                                    14,
                                                                    sizeof(mem_230662.mem),
                                                                    &mem_230662.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_219712,
                                                                    15,
                                                                    sizeof(color_232028.mem),
                                                                    &color_232028.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_219712,
                                                                    16,
                                                                    sizeof(color_232029.mem),
                                                                    &color_232029.mem));
                            if (1 * ((size_t) num_groups_219707 *
                                     (size_t) segmap_group_sizze_219706) != 0) {
                                const size_t global_work_sizze_237224[1] =
                                             {(size_t) num_groups_219707 *
                                             (size_t) segmap_group_sizze_219706};
                                const size_t local_work_sizze_237228[1] =
                                             {(size_t) segmap_group_sizze_219706};
                                int64_t time_start_237225 = 0, time_end_237226 =
                                        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_219712",
                                            global_work_sizze_237224[0],
                                            local_work_sizze_237228[0],
                                            (int) 0);
                                    time_start_237225 = get_wall_time();
                                }
                                OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                                ctx->mainzisegmap_219712,
                                                                                1,
                                                                                NULL,
                                                                                global_work_sizze_237224,
                                                                                local_work_sizze_237228,
                                                                                0,
                                                                                NULL,
                                                                                ctx->profiling_paused ||
                                                                                !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                          &ctx->mainzisegmap_219712_runs,
                                                                                                                          &ctx->mainzisegmap_219712_total_runtime)));
                                if (ctx->debugging) {
                                    OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                    time_end_237226 = get_wall_time();
                                    
                                    long time_diff_237227 = time_end_237226 -
                                         time_start_237225;
                                    
                                    fprintf(ctx->log,
                                            "kernel %s runtime: %ldus\n",
                                            "main.segmap_219712",
                                            time_diff_237227);
                                }
                            }
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s\n", "");
                            if (memblock_unref_device(ctx, &mem_230616,
                                                      "mem_230616") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230619,
                                                      "mem_230619") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230622,
                                                      "mem_230622") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230625,
                                                      "mem_230625") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &color_232028,
                                                      "color_232028") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &color_232029,
                                                      "color_232029") != 0)
                                return 1;
                            
                            struct memblock_device mem_230712;
                            
                            mem_230712.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_230712,
                                                      bytes_229378,
                                                      "mem_230712")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (futrts_builtinzhgpu_map_transpose_f64(ctx,
                                                                      mem_230712,
                                                                      (int64_t) 0,
                                                                      mem_230659,
                                                                      (int64_t) 0,
                                                                      (int64_t) 1,
                                                                      partition_sizze_203577,
                                                                      l_n_m_203643) !=
                                0) {
                                if (memblock_unref_device(ctx, &mem_230712,
                                                          "mem_230712") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &color_232029,
                                                          "color_232029") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &color_232028,
                                                          "color_232028") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230662,
                                                          "mem_230662") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230659,
                                                          "mem_230659") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230625,
                                                          "mem_230625") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230622,
                                                          "mem_230622") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230619,
                                                          "mem_230619") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230616,
                                                          "mem_230616") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230719,
                                                          "ext_mem_230719") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230720,
                                                          "ext_mem_230720") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230844,
                                                          "ext_mem_230844") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230845,
                                                          "ext_mem_230845") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230846,
                                                          "ext_mem_230846") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230847,
                                                          "ext_mem_230847") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230907,
                                                          "ext_mem_230907") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230908,
                                                          "ext_mem_230908") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230546,
                                                          "ext_mem_230546") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230529,
                                                          "ext_mem_230529") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230512,
                                                          "ext_mem_230512") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230494,
                                                          "ext_mem_230494") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230486,
                                                          "ext_mem_230486") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230487,
                                                          "ext_mem_230487") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229515,
                                                          "mem_param_229515") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229507,
                                                          "mem_param_229507") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231517,
                                                          "ext_mem_231517") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231518,
                                                          "ext_mem_231518") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229493,
                                                          "mem_param_229493") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229485,
                                                          "mem_param_229485") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229477,
                                                          "mem_param_229477") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231860,
                                                          "ext_mem_231860") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231861,
                                                          "ext_mem_231861") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231862,
                                                          "ext_mem_231862") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230551,
                                                          "mem_230551") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230534,
                                                          "mem_230534") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230517,
                                                          "mem_230517") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230500,
                                                          "mem_230500") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229531,
                                                          "mem_229531") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229526,
                                                          "mem_229526") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229520,
                                                          "mem_229520") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229469,
                                                          "mem_229469") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229465,
                                                          "mem_229465") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229460,
                                                          "ext_mem_229460") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229461,
                                                          "ext_mem_229461") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229411,
                                                          "ext_mem_229411") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229412,
                                                          "ext_mem_229412") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229362,
                                                          "ext_mem_229362") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229363,
                                                          "ext_mem_229363") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229264,
                                                          "ext_mem_229264") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229265,
                                                          "ext_mem_229265") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229206,
                                                          "mem_229206") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229200,
                                                          "mem_229200") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229196,
                                                          "ext_mem_229196") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229197,
                                                          "ext_mem_229197") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229164,
                                                          "mem_229164") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229161,
                                                          "mem_229161") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229157,
                                                          "mem_229157") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229155,
                                                          "mem_229155") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229152,
                                                          "mem_229152") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229148,
                                                          "mem_229148") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232249,
                                                          "mem_out_232249") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232248,
                                                          "mem_out_232248") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232247,
                                                          "mem_out_232247") !=
                                    0)
                                    return 1;
                                err = 1;
                                goto cleanup;
                            }
                            if (memblock_unref_device(ctx, &mem_230659,
                                                      "mem_230659") != 0)
                                return 1;
                            
                            struct memblock_device mem_230717;
                            
                            mem_230717.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_230717,
                                                      bytes_229378,
                                                      "mem_230717")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (futrts_builtinzhgpu_map_transpose_f64(ctx,
                                                                      mem_230717,
                                                                      (int64_t) 0,
                                                                      mem_230662,
                                                                      (int64_t) 0,
                                                                      (int64_t) 1,
                                                                      partition_sizze_203577,
                                                                      l_n_m_203643) !=
                                0) {
                                if (memblock_unref_device(ctx, &mem_230717,
                                                          "mem_230717") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230712,
                                                          "mem_230712") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &color_232029,
                                                          "color_232029") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &color_232028,
                                                          "color_232028") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230662,
                                                          "mem_230662") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230659,
                                                          "mem_230659") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230625,
                                                          "mem_230625") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230622,
                                                          "mem_230622") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230619,
                                                          "mem_230619") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230616,
                                                          "mem_230616") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230719,
                                                          "ext_mem_230719") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230720,
                                                          "ext_mem_230720") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230844,
                                                          "ext_mem_230844") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230845,
                                                          "ext_mem_230845") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230846,
                                                          "ext_mem_230846") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230847,
                                                          "ext_mem_230847") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230907,
                                                          "ext_mem_230907") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230908,
                                                          "ext_mem_230908") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230546,
                                                          "ext_mem_230546") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230529,
                                                          "ext_mem_230529") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230512,
                                                          "ext_mem_230512") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230494,
                                                          "ext_mem_230494") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230486,
                                                          "ext_mem_230486") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230487,
                                                          "ext_mem_230487") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229515,
                                                          "mem_param_229515") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229507,
                                                          "mem_param_229507") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231517,
                                                          "ext_mem_231517") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231518,
                                                          "ext_mem_231518") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229493,
                                                          "mem_param_229493") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229485,
                                                          "mem_param_229485") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229477,
                                                          "mem_param_229477") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231860,
                                                          "ext_mem_231860") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231861,
                                                          "ext_mem_231861") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231862,
                                                          "ext_mem_231862") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230551,
                                                          "mem_230551") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230534,
                                                          "mem_230534") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230517,
                                                          "mem_230517") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230500,
                                                          "mem_230500") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229531,
                                                          "mem_229531") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229526,
                                                          "mem_229526") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229520,
                                                          "mem_229520") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229469,
                                                          "mem_229469") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229465,
                                                          "mem_229465") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229460,
                                                          "ext_mem_229460") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229461,
                                                          "ext_mem_229461") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229411,
                                                          "ext_mem_229411") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229412,
                                                          "ext_mem_229412") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229362,
                                                          "ext_mem_229362") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229363,
                                                          "ext_mem_229363") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229264,
                                                          "ext_mem_229264") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229265,
                                                          "ext_mem_229265") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229206,
                                                          "mem_229206") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229200,
                                                          "mem_229200") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229196,
                                                          "ext_mem_229196") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229197,
                                                          "ext_mem_229197") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229164,
                                                          "mem_229164") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229161,
                                                          "mem_229161") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229157,
                                                          "mem_229157") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229155,
                                                          "mem_229155") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229152,
                                                          "mem_229152") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229148,
                                                          "mem_229148") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232249,
                                                          "mem_out_232249") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232248,
                                                          "mem_out_232248") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232247,
                                                          "mem_out_232247") !=
                                    0)
                                    return 1;
                                err = 1;
                                goto cleanup;
                            }
                            if (memblock_unref_device(ctx, &mem_230662,
                                                      "mem_230662") != 0)
                                return 1;
                            if (memblock_set_device(ctx, &ext_mem_230720,
                                                    &mem_230712,
                                                    "mem_230712") != 0)
                                return 1;
                            if (memblock_set_device(ctx, &ext_mem_230719,
                                                    &mem_230717,
                                                    "mem_230717") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230717,
                                                      "mem_230717") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230712,
                                                      "mem_230712") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &color_232029,
                                                      "color_232029") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &color_232028,
                                                      "color_232028") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230662,
                                                      "mem_230662") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230659,
                                                      "mem_230659") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230625,
                                                      "mem_230625") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230622,
                                                      "mem_230622") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230619,
                                                      "mem_230619") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230616,
                                                      "mem_230616") != 0)
                                return 1;
                        } else {
                            int64_t segmap_usable_groups_220223 =
                                    sdiv_up64(nest_sizze_209492,
                                              segmap_group_sizze_220222);
                            struct memblock_device ext_mem_230708;
                            
                            ext_mem_230708.references = NULL;
                            
                            struct memblock_device ext_mem_230707;
                            
                            ext_mem_230707.references = NULL;
                            
                            int32_t local_memory_capacity_234965;
                            
                            local_memory_capacity_234965 =
                                ctx->opencl.max_local_memory;
                            if (sle64((int64_t) 0,
                                      sext_i32_i64(local_memory_capacity_234965)) &&
                                suff_outer_par_220226) {
                                struct memblock_device mem_230667;
                                
                                mem_230667.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_230667,
                                                          bytes_229378,
                                                          "mem_230667")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device mem_230671;
                                
                                mem_230671.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_230671,
                                                          bytes_229378,
                                                          "mem_230671")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s\n", "\n# SegMap");
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_220233,
                                                                        1,
                                                                        sizeof(n_203490),
                                                                        &n_203490));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_220233,
                                                                        2,
                                                                        sizeof(q_l_203495),
                                                                        &q_l_203495));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_220233,
                                                                        3,
                                                                        sizeof(jump_t_203500),
                                                                        &jump_t_203500));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_220233,
                                                                        4,
                                                                        sizeof(partition_sizze_203577),
                                                                        &partition_sizze_203577));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_220233,
                                                                        5,
                                                                        sizeof(l_n_m_203643),
                                                                        &l_n_m_203643));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_220233,
                                                                        6,
                                                                        sizeof(i_203670),
                                                                        &i_203670));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_220233,
                                                                        7,
                                                                        sizeof(ctx_param_ext_229488),
                                                                        &ctx_param_ext_229488));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_220233,
                                                                        8,
                                                                        sizeof(ctx_param_ext_229489),
                                                                        &ctx_param_ext_229489));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_220233,
                                                                        9,
                                                                        sizeof(ctx_param_ext_229491),
                                                                        &ctx_param_ext_229491));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_220233,
                                                                        10,
                                                                        sizeof(ext_mem_229411.mem),
                                                                        &ext_mem_229411.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_220233,
                                                                        11,
                                                                        sizeof(ext_mem_229412.mem),
                                                                        &ext_mem_229412.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_220233,
                                                                        12,
                                                                        sizeof(mem_param_229493.mem),
                                                                        &mem_param_229493.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_220233,
                                                                        13,
                                                                        sizeof(mem_230551.mem),
                                                                        &mem_230551.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_220233,
                                                                        14,
                                                                        sizeof(mem_230667.mem),
                                                                        &mem_230667.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_220233,
                                                                        15,
                                                                        sizeof(mem_230671.mem),
                                                                        &mem_230671.mem));
                                if (1 * ((size_t) segmap_usable_groups_220223 *
                                         (size_t) segmap_group_sizze_220222) !=
                                    0) {
                                    const size_t global_work_sizze_237229[1] =
                                                 {(size_t) segmap_usable_groups_220223 *
                                                 (size_t) segmap_group_sizze_220222};
                                    const size_t local_work_sizze_237233[1] =
                                                 {(size_t) segmap_group_sizze_220222};
                                    int64_t time_start_237230 = 0,
                                            time_end_237231 = 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_220233",
                                                global_work_sizze_237229[0],
                                                local_work_sizze_237233[0],
                                                (int) 0);
                                        time_start_237230 = get_wall_time();
                                    }
                                    OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                                    ctx->mainzisegmap_220233,
                                                                                    1,
                                                                                    NULL,
                                                                                    global_work_sizze_237229,
                                                                                    local_work_sizze_237233,
                                                                                    0,
                                                                                    NULL,
                                                                                    ctx->profiling_paused ||
                                                                                    !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                              &ctx->mainzisegmap_220233_runs,
                                                                                                                              &ctx->mainzisegmap_220233_total_runtime)));
                                    if (ctx->debugging) {
                                        OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                        time_end_237231 = get_wall_time();
                                        
                                        long time_diff_237232 =
                                             time_end_237231 -
                                             time_start_237230;
                                        
                                        fprintf(ctx->log,
                                                "kernel %s runtime: %ldus\n",
                                                "main.segmap_220233",
                                                time_diff_237232);
                                    }
                                }
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s\n", "");
                                if (memblock_set_device(ctx, &ext_mem_230708,
                                                        &mem_230667,
                                                        "mem_230667") != 0)
                                    return 1;
                                if (memblock_set_device(ctx, &ext_mem_230707,
                                                        &mem_230671,
                                                        "mem_230671") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230671,
                                                          "mem_230671") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230667,
                                                          "mem_230667") != 0)
                                    return 1;
                            } else {
                                struct memblock_device mem_230676;
                                
                                mem_230676.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_230676,
                                                          bytes_229378,
                                                          "mem_230676")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device mem_230680;
                                
                                mem_230680.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_230680,
                                                          bytes_229378,
                                                          "mem_230680")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device mem_230684;
                                
                                mem_230684.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_230684,
                                                          bytes_229378,
                                                          "mem_230684")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                if (slt64(q_l_203495 * (int64_t) 2,
                                          segred_group_sizze_220335)) {
                                    int64_t segment_sizze_nonzzero_234769 =
                                            smax64((int64_t) 1, q_l_203495);
                                    int64_t num_threads_234770 =
                                            num_groups_220336 *
                                            segred_group_sizze_220335;
                                    
                                    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_203577 *
                                                             l_n_m_203643),
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "segment_size",
                                                (long long) q_l_203495, '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "segments_per_group",
                                                (long long) squot64(segred_group_sizze_220335,
                                                                    segment_sizze_nonzzero_234769),
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "required_groups",
                                                (long long) sext_i64_i32(sdiv_up64(partition_sizze_203577 *
                                                                                   l_n_m_203643,
                                                                                   squot64(segred_group_sizze_220335,
                                                                                           segment_sizze_nonzzero_234769))),
                                                '\n');
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_220344,
                                                                            1,
                                                                            (size_t) ((int64_t) 8 *
                                                                                      segred_group_sizze_220335),
                                                                            NULL));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_220344,
                                                                            2,
                                                                            (size_t) ((int64_t) 8 *
                                                                                      segred_group_sizze_220335),
                                                                            NULL));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_220344,
                                                                            3,
                                                                            (size_t) ((int64_t) 8 *
                                                                                      segred_group_sizze_220335),
                                                                            NULL));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_220344,
                                                                            4,
                                                                            sizeof(n_203490),
                                                                            &n_203490));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_220344,
                                                                            5,
                                                                            sizeof(q_l_203495),
                                                                            &q_l_203495));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_220344,
                                                                            6,
                                                                            sizeof(jump_t_203500),
                                                                            &jump_t_203500));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_220344,
                                                                            7,
                                                                            sizeof(partition_sizze_203577),
                                                                            &partition_sizze_203577));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_220344,
                                                                            8,
                                                                            sizeof(l_n_m_203643),
                                                                            &l_n_m_203643));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_220344,
                                                                            9,
                                                                            sizeof(i_203670),
                                                                            &i_203670));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_220344,
                                                                            10,
                                                                            sizeof(num_groups_220336),
                                                                            &num_groups_220336));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_220344,
                                                                            11,
                                                                            sizeof(ctx_param_ext_229488),
                                                                            &ctx_param_ext_229488));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_220344,
                                                                            12,
                                                                            sizeof(ctx_param_ext_229489),
                                                                            &ctx_param_ext_229489));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_220344,
                                                                            13,
                                                                            sizeof(ctx_param_ext_229491),
                                                                            &ctx_param_ext_229491));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_220344,
                                                                            14,
                                                                            sizeof(segment_sizze_nonzzero_234769),
                                                                            &segment_sizze_nonzzero_234769));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_220344,
                                                                            15,
                                                                            sizeof(ext_mem_229411.mem),
                                                                            &ext_mem_229411.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_220344,
                                                                            16,
                                                                            sizeof(ext_mem_229412.mem),
                                                                            &ext_mem_229412.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_220344,
                                                                            17,
                                                                            sizeof(mem_param_229493.mem),
                                                                            &mem_param_229493.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_220344,
                                                                            18,
                                                                            sizeof(mem_230676.mem),
                                                                            &mem_230676.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_220344,
                                                                            19,
                                                                            sizeof(mem_230680.mem),
                                                                            &mem_230680.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_220344,
                                                                            20,
                                                                            sizeof(mem_230684.mem),
                                                                            &mem_230684.mem));
                                    if (1 * ((size_t) num_groups_220336 *
                                             (size_t) segred_group_sizze_220335) !=
                                        0) {
                                        const size_t global_work_sizze_237234[1]
                                                     =
                                                     {(size_t) num_groups_220336 *
                                                     (size_t) segred_group_sizze_220335};
                                        const size_t local_work_sizze_237238[1]
                                                     =
                                                     {(size_t) segred_group_sizze_220335};
                                        int64_t time_start_237235 = 0,
                                                time_end_237236 = 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_220344",
                                                    global_work_sizze_237234[0],
                                                    local_work_sizze_237238[0],
                                                    (int) (0 + (int64_t) 8 *
                                                           segred_group_sizze_220335 +
                                                           (int64_t) 8 *
                                                           segred_group_sizze_220335 +
                                                           (int64_t) 8 *
                                                           segred_group_sizze_220335));
                                            time_start_237235 = get_wall_time();
                                        }
                                        OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                                        ctx->mainzisegred_small_220344,
                                                                                        1,
                                                                                        NULL,
                                                                                        global_work_sizze_237234,
                                                                                        local_work_sizze_237238,
                                                                                        0,
                                                                                        NULL,
                                                                                        ctx->profiling_paused ||
                                                                                        !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                                  &ctx->mainzisegred_small_220344_runs,
                                                                                                                                  &ctx->mainzisegred_small_220344_total_runtime)));
                                        if (ctx->debugging) {
                                            OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                            time_end_237236 = get_wall_time();
                                            
                                            long time_diff_237237 =
                                                 time_end_237236 -
                                                 time_start_237235;
                                            
                                            fprintf(ctx->log,
                                                    "kernel %s runtime: %ldus\n",
                                                    "main.segred_small_220344",
                                                    time_diff_237237);
                                        }
                                    }
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s\n", "");
                                } else {
                                    int64_t groups_per_segment_234810 =
                                            sdiv_up64(num_groups_220336,
                                                      smax64((int64_t) 1,
                                                             partition_sizze_203577 *
                                                             l_n_m_203643));
                                    int64_t elements_per_thread_234811 =
                                            sdiv_up64(q_l_203495,
                                                      segred_group_sizze_220335 *
                                                      groups_per_segment_234810);
                                    int64_t virt_num_groups_234812 =
                                            groups_per_segment_234810 *
                                            (partition_sizze_203577 *
                                             l_n_m_203643);
                                    int64_t num_threads_234813 =
                                            num_groups_220336 *
                                            segred_group_sizze_220335;
                                    int64_t threads_per_segment_234814 =
                                            groups_per_segment_234810 *
                                            segred_group_sizze_220335;
                                    
                                    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_203577 *
                                                             l_n_m_203643),
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "segment_size",
                                                (long long) q_l_203495, '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "virt_num_groups",
                                                (long long) virt_num_groups_234812,
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "num_groups",
                                                (long long) num_groups_220336,
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "group_size",
                                                (long long) segred_group_sizze_220335,
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "elems_per_thread",
                                                (long long) elements_per_thread_234811,
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "groups_per_segment",
                                                (long long) groups_per_segment_234810,
                                                '\n');
                                    
                                    struct memblock_device
                                    segred_tmp_mem_234815;
                                    
                                    segred_tmp_mem_234815.references = NULL;
                                    if (memblock_alloc_device(ctx,
                                                              &segred_tmp_mem_234815,
                                                              (int64_t) 8 *
                                                              virt_num_groups_234812,
                                                              "segred_tmp_mem_234815")) {
                                        err = 1;
                                        goto cleanup;
                                    }
                                    
                                    struct memblock_device
                                    segred_tmp_mem_234817;
                                    
                                    segred_tmp_mem_234817.references = NULL;
                                    if (memblock_alloc_device(ctx,
                                                              &segred_tmp_mem_234817,
                                                              (int64_t) 8 *
                                                              virt_num_groups_234812,
                                                              "segred_tmp_mem_234817")) {
                                        err = 1;
                                        goto cleanup;
                                    }
                                    
                                    struct memblock_device
                                    segred_tmp_mem_234819;
                                    
                                    segred_tmp_mem_234819.references = NULL;
                                    if (memblock_alloc_device(ctx,
                                                              &segred_tmp_mem_234819,
                                                              (int64_t) 8 *
                                                              virt_num_groups_234812,
                                                              "segred_tmp_mem_234819")) {
                                        err = 1;
                                        goto cleanup;
                                    }
                                    
                                    struct memblock_device
                                    mainzicounter_mem_234821 =
                                    ctx->mainzicounter_mem_234821;
                                    
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_220344,
                                                                            1,
                                                                            (size_t) 1,
                                                                            NULL));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_220344,
                                                                            2,
                                                                            (size_t) ((int64_t) 8 *
                                                                                      segred_group_sizze_220335),
                                                                            NULL));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_220344,
                                                                            3,
                                                                            (size_t) ((int64_t) 8 *
                                                                                      segred_group_sizze_220335),
                                                                            NULL));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_220344,
                                                                            4,
                                                                            (size_t) ((int64_t) 8 *
                                                                                      segred_group_sizze_220335),
                                                                            NULL));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_220344,
                                                                            5,
                                                                            sizeof(n_203490),
                                                                            &n_203490));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_220344,
                                                                            6,
                                                                            sizeof(q_l_203495),
                                                                            &q_l_203495));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_220344,
                                                                            7,
                                                                            sizeof(jump_t_203500),
                                                                            &jump_t_203500));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_220344,
                                                                            8,
                                                                            sizeof(partition_sizze_203577),
                                                                            &partition_sizze_203577));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_220344,
                                                                            9,
                                                                            sizeof(l_n_m_203643),
                                                                            &l_n_m_203643));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_220344,
                                                                            10,
                                                                            sizeof(i_203670),
                                                                            &i_203670));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_220344,
                                                                            11,
                                                                            sizeof(num_groups_220336),
                                                                            &num_groups_220336));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_220344,
                                                                            12,
                                                                            sizeof(ctx_param_ext_229488),
                                                                            &ctx_param_ext_229488));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_220344,
                                                                            13,
                                                                            sizeof(ctx_param_ext_229489),
                                                                            &ctx_param_ext_229489));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_220344,
                                                                            14,
                                                                            sizeof(ctx_param_ext_229491),
                                                                            &ctx_param_ext_229491));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_220344,
                                                                            15,
                                                                            sizeof(groups_per_segment_234810),
                                                                            &groups_per_segment_234810));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_220344,
                                                                            16,
                                                                            sizeof(elements_per_thread_234811),
                                                                            &elements_per_thread_234811));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_220344,
                                                                            17,
                                                                            sizeof(virt_num_groups_234812),
                                                                            &virt_num_groups_234812));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_220344,
                                                                            18,
                                                                            sizeof(threads_per_segment_234814),
                                                                            &threads_per_segment_234814));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_220344,
                                                                            19,
                                                                            sizeof(ext_mem_229411.mem),
                                                                            &ext_mem_229411.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_220344,
                                                                            20,
                                                                            sizeof(ext_mem_229412.mem),
                                                                            &ext_mem_229412.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_220344,
                                                                            21,
                                                                            sizeof(mem_param_229493.mem),
                                                                            &mem_param_229493.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_220344,
                                                                            22,
                                                                            sizeof(mem_230676.mem),
                                                                            &mem_230676.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_220344,
                                                                            23,
                                                                            sizeof(mem_230680.mem),
                                                                            &mem_230680.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_220344,
                                                                            24,
                                                                            sizeof(mem_230684.mem),
                                                                            &mem_230684.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_220344,
                                                                            25,
                                                                            sizeof(segred_tmp_mem_234815.mem),
                                                                            &segred_tmp_mem_234815.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_220344,
                                                                            26,
                                                                            sizeof(segred_tmp_mem_234817.mem),
                                                                            &segred_tmp_mem_234817.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_220344,
                                                                            27,
                                                                            sizeof(segred_tmp_mem_234819.mem),
                                                                            &segred_tmp_mem_234819.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_220344,
                                                                            28,
                                                                            sizeof(mainzicounter_mem_234821.mem),
                                                                            &mainzicounter_mem_234821.mem));
                                    if (1 * ((size_t) num_groups_220336 *
                                             (size_t) segred_group_sizze_220335) !=
                                        0) {
                                        const size_t global_work_sizze_237240[1]
                                                     =
                                                     {(size_t) num_groups_220336 *
                                                     (size_t) segred_group_sizze_220335};
                                        const size_t local_work_sizze_237244[1]
                                                     =
                                                     {(size_t) segred_group_sizze_220335};
                                        int64_t time_start_237241 = 0,
                                                time_end_237242 = 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_220344",
                                                    global_work_sizze_237240[0],
                                                    local_work_sizze_237244[0],
                                                    (int) (0 + 1 + (int64_t) 8 *
                                                           segred_group_sizze_220335 +
                                                           (int64_t) 8 *
                                                           segred_group_sizze_220335 +
                                                           (int64_t) 8 *
                                                           segred_group_sizze_220335));
                                            time_start_237241 = get_wall_time();
                                        }
                                        OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                                        ctx->mainzisegred_large_220344,
                                                                                        1,
                                                                                        NULL,
                                                                                        global_work_sizze_237240,
                                                                                        local_work_sizze_237244,
                                                                                        0,
                                                                                        NULL,
                                                                                        ctx->profiling_paused ||
                                                                                        !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                                  &ctx->mainzisegred_large_220344_runs,
                                                                                                                                  &ctx->mainzisegred_large_220344_total_runtime)));
                                        if (ctx->debugging) {
                                            OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                            time_end_237242 = get_wall_time();
                                            
                                            long time_diff_237243 =
                                                 time_end_237242 -
                                                 time_start_237241;
                                            
                                            fprintf(ctx->log,
                                                    "kernel %s runtime: %ldus\n",
                                                    "main.segred_large_220344",
                                                    time_diff_237243);
                                        }
                                    }
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s\n", "");
                                    if (memblock_unref_device(ctx,
                                                              &segred_tmp_mem_234819,
                                                              "segred_tmp_mem_234819") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &segred_tmp_mem_234817,
                                                              "segred_tmp_mem_234817") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &segred_tmp_mem_234815,
                                                              "segred_tmp_mem_234815") !=
                                        0)
                                        return 1;
                                }
                                
                                int64_t segmap_usable_groups_220384 =
                                        sdiv_up64(nest_sizze_209492,
                                                  segmap_group_sizze_220383);
                                struct memblock_device mem_230689;
                                
                                mem_230689.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_230689,
                                                          bytes_229378,
                                                          "mem_230689")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device mem_230693;
                                
                                mem_230693.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_230693,
                                                          bytes_229378,
                                                          "mem_230693")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device mem_230697;
                                
                                mem_230697.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_230697,
                                                          bytes_229378,
                                                          "mem_230697")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s\n", "\n# SegMap");
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_220390,
                                                                        1,
                                                                        sizeof(partition_sizze_203577),
                                                                        &partition_sizze_203577));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_220390,
                                                                        2,
                                                                        sizeof(l_n_m_203643),
                                                                        &l_n_m_203643));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_220390,
                                                                        3,
                                                                        sizeof(mem_230676.mem),
                                                                        &mem_230676.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_220390,
                                                                        4,
                                                                        sizeof(mem_230680.mem),
                                                                        &mem_230680.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_220390,
                                                                        5,
                                                                        sizeof(mem_230684.mem),
                                                                        &mem_230684.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_220390,
                                                                        6,
                                                                        sizeof(mem_230689.mem),
                                                                        &mem_230689.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_220390,
                                                                        7,
                                                                        sizeof(mem_230693.mem),
                                                                        &mem_230693.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_220390,
                                                                        8,
                                                                        sizeof(mem_230697.mem),
                                                                        &mem_230697.mem));
                                if (1 * ((size_t) segmap_usable_groups_220384 *
                                         (size_t) segmap_group_sizze_220383) !=
                                    0) {
                                    const size_t global_work_sizze_237245[1] =
                                                 {(size_t) segmap_usable_groups_220384 *
                                                 (size_t) segmap_group_sizze_220383};
                                    const size_t local_work_sizze_237249[1] =
                                                 {(size_t) segmap_group_sizze_220383};
                                    int64_t time_start_237246 = 0,
                                            time_end_237247 = 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_220390",
                                                global_work_sizze_237245[0],
                                                local_work_sizze_237249[0],
                                                (int) 0);
                                        time_start_237246 = get_wall_time();
                                    }
                                    OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                                    ctx->mainzisegmap_220390,
                                                                                    1,
                                                                                    NULL,
                                                                                    global_work_sizze_237245,
                                                                                    local_work_sizze_237249,
                                                                                    0,
                                                                                    NULL,
                                                                                    ctx->profiling_paused ||
                                                                                    !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                              &ctx->mainzisegmap_220390_runs,
                                                                                                                              &ctx->mainzisegmap_220390_total_runtime)));
                                    if (ctx->debugging) {
                                        OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                        time_end_237247 = get_wall_time();
                                        
                                        long time_diff_237248 =
                                             time_end_237247 -
                                             time_start_237246;
                                        
                                        fprintf(ctx->log,
                                                "kernel %s runtime: %ldus\n",
                                                "main.segmap_220390",
                                                time_diff_237248);
                                    }
                                }
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s\n", "");
                                if (memblock_unref_device(ctx, &mem_230676,
                                                          "mem_230676") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230680,
                                                          "mem_230680") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230684,
                                                          "mem_230684") != 0)
                                    return 1;
                                
                                struct memblock_device mem_230702;
                                
                                mem_230702.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_230702,
                                                          bytes_229378,
                                                          "mem_230702")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device mem_230706;
                                
                                mem_230706.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_230706,
                                                          bytes_229378,
                                                          "mem_230706")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                if (slt64(q_l_203495 * (int64_t) 2,
                                          segred_group_sizze_220405)) {
                                    int64_t segment_sizze_nonzzero_234879 =
                                            smax64((int64_t) 1, q_l_203495);
                                    int64_t num_threads_234880 =
                                            num_groups_220406 *
                                            segred_group_sizze_220405;
                                    
                                    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_203577 *
                                                             l_n_m_203643),
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "segment_size",
                                                (long long) q_l_203495, '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "segments_per_group",
                                                (long long) squot64(segred_group_sizze_220405,
                                                                    segment_sizze_nonzzero_234879),
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "required_groups",
                                                (long long) sext_i64_i32(sdiv_up64(partition_sizze_203577 *
                                                                                   l_n_m_203643,
                                                                                   squot64(segred_group_sizze_220405,
                                                                                           segment_sizze_nonzzero_234879))),
                                                '\n');
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_220413,
                                                                            1,
                                                                            (size_t) ((int64_t) 8 *
                                                                                      segred_group_sizze_220405),
                                                                            NULL));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_220413,
                                                                            2,
                                                                            (size_t) ((int64_t) 8 *
                                                                                      segred_group_sizze_220405),
                                                                            NULL));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_220413,
                                                                            3,
                                                                            sizeof(n_203490),
                                                                            &n_203490));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_220413,
                                                                            4,
                                                                            sizeof(q_l_203495),
                                                                            &q_l_203495));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_220413,
                                                                            5,
                                                                            sizeof(jump_t_203500),
                                                                            &jump_t_203500));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_220413,
                                                                            6,
                                                                            sizeof(partition_sizze_203577),
                                                                            &partition_sizze_203577));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_220413,
                                                                            7,
                                                                            sizeof(l_n_m_203643),
                                                                            &l_n_m_203643));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_220413,
                                                                            8,
                                                                            sizeof(i_203670),
                                                                            &i_203670));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_220413,
                                                                            9,
                                                                            sizeof(num_groups_220406),
                                                                            &num_groups_220406));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_220413,
                                                                            10,
                                                                            sizeof(ctx_param_ext_229488),
                                                                            &ctx_param_ext_229488));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_220413,
                                                                            11,
                                                                            sizeof(ctx_param_ext_229489),
                                                                            &ctx_param_ext_229489));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_220413,
                                                                            12,
                                                                            sizeof(ctx_param_ext_229491),
                                                                            &ctx_param_ext_229491));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_220413,
                                                                            13,
                                                                            sizeof(segment_sizze_nonzzero_234879),
                                                                            &segment_sizze_nonzzero_234879));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_220413,
                                                                            14,
                                                                            sizeof(ext_mem_229411.mem),
                                                                            &ext_mem_229411.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_220413,
                                                                            15,
                                                                            sizeof(ext_mem_229412.mem),
                                                                            &ext_mem_229412.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_220413,
                                                                            16,
                                                                            sizeof(mem_param_229493.mem),
                                                                            &mem_param_229493.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_220413,
                                                                            17,
                                                                            sizeof(mem_230551.mem),
                                                                            &mem_230551.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_220413,
                                                                            18,
                                                                            sizeof(mem_230689.mem),
                                                                            &mem_230689.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_220413,
                                                                            19,
                                                                            sizeof(mem_230693.mem),
                                                                            &mem_230693.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_220413,
                                                                            20,
                                                                            sizeof(mem_230697.mem),
                                                                            &mem_230697.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_220413,
                                                                            21,
                                                                            sizeof(mem_230702.mem),
                                                                            &mem_230702.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_220413,
                                                                            22,
                                                                            sizeof(mem_230706.mem),
                                                                            &mem_230706.mem));
                                    if (1 * ((size_t) num_groups_220406 *
                                             (size_t) segred_group_sizze_220405) !=
                                        0) {
                                        const size_t global_work_sizze_237250[1]
                                                     =
                                                     {(size_t) num_groups_220406 *
                                                     (size_t) segred_group_sizze_220405};
                                        const size_t local_work_sizze_237254[1]
                                                     =
                                                     {(size_t) segred_group_sizze_220405};
                                        int64_t time_start_237251 = 0,
                                                time_end_237252 = 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_220413",
                                                    global_work_sizze_237250[0],
                                                    local_work_sizze_237254[0],
                                                    (int) (0 + (int64_t) 8 *
                                                           segred_group_sizze_220405 +
                                                           (int64_t) 8 *
                                                           segred_group_sizze_220405));
                                            time_start_237251 = get_wall_time();
                                        }
                                        OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                                        ctx->mainzisegred_small_220413,
                                                                                        1,
                                                                                        NULL,
                                                                                        global_work_sizze_237250,
                                                                                        local_work_sizze_237254,
                                                                                        0,
                                                                                        NULL,
                                                                                        ctx->profiling_paused ||
                                                                                        !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                                  &ctx->mainzisegred_small_220413_runs,
                                                                                                                                  &ctx->mainzisegred_small_220413_total_runtime)));
                                        if (ctx->debugging) {
                                            OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                            time_end_237252 = get_wall_time();
                                            
                                            long time_diff_237253 =
                                                 time_end_237252 -
                                                 time_start_237251;
                                            
                                            fprintf(ctx->log,
                                                    "kernel %s runtime: %ldus\n",
                                                    "main.segred_small_220413",
                                                    time_diff_237253);
                                        }
                                    }
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s\n", "");
                                } else {
                                    int64_t groups_per_segment_234914 =
                                            sdiv_up64(num_groups_220406,
                                                      smax64((int64_t) 1,
                                                             partition_sizze_203577 *
                                                             l_n_m_203643));
                                    int64_t elements_per_thread_234915 =
                                            sdiv_up64(q_l_203495,
                                                      segred_group_sizze_220405 *
                                                      groups_per_segment_234914);
                                    int64_t virt_num_groups_234916 =
                                            groups_per_segment_234914 *
                                            (partition_sizze_203577 *
                                             l_n_m_203643);
                                    int64_t num_threads_234917 =
                                            num_groups_220406 *
                                            segred_group_sizze_220405;
                                    int64_t threads_per_segment_234918 =
                                            groups_per_segment_234914 *
                                            segred_group_sizze_220405;
                                    
                                    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_203577 *
                                                             l_n_m_203643),
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "segment_size",
                                                (long long) q_l_203495, '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "virt_num_groups",
                                                (long long) virt_num_groups_234916,
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "num_groups",
                                                (long long) num_groups_220406,
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "group_size",
                                                (long long) segred_group_sizze_220405,
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "elems_per_thread",
                                                (long long) elements_per_thread_234915,
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "groups_per_segment",
                                                (long long) groups_per_segment_234914,
                                                '\n');
                                    
                                    struct memblock_device
                                    segred_tmp_mem_234919;
                                    
                                    segred_tmp_mem_234919.references = NULL;
                                    if (memblock_alloc_device(ctx,
                                                              &segred_tmp_mem_234919,
                                                              (int64_t) 8 *
                                                              virt_num_groups_234916,
                                                              "segred_tmp_mem_234919")) {
                                        err = 1;
                                        goto cleanup;
                                    }
                                    
                                    struct memblock_device
                                    segred_tmp_mem_234921;
                                    
                                    segred_tmp_mem_234921.references = NULL;
                                    if (memblock_alloc_device(ctx,
                                                              &segred_tmp_mem_234921,
                                                              (int64_t) 8 *
                                                              virt_num_groups_234916,
                                                              "segred_tmp_mem_234921")) {
                                        err = 1;
                                        goto cleanup;
                                    }
                                    
                                    struct memblock_device
                                    mainzicounter_mem_234923 =
                                    ctx->mainzicounter_mem_234923;
                                    
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_220413,
                                                                            1,
                                                                            (size_t) 1,
                                                                            NULL));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_220413,
                                                                            2,
                                                                            (size_t) ((int64_t) 8 *
                                                                                      segred_group_sizze_220405),
                                                                            NULL));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_220413,
                                                                            3,
                                                                            (size_t) ((int64_t) 8 *
                                                                                      segred_group_sizze_220405),
                                                                            NULL));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_220413,
                                                                            4,
                                                                            sizeof(n_203490),
                                                                            &n_203490));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_220413,
                                                                            5,
                                                                            sizeof(q_l_203495),
                                                                            &q_l_203495));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_220413,
                                                                            6,
                                                                            sizeof(jump_t_203500),
                                                                            &jump_t_203500));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_220413,
                                                                            7,
                                                                            sizeof(partition_sizze_203577),
                                                                            &partition_sizze_203577));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_220413,
                                                                            8,
                                                                            sizeof(l_n_m_203643),
                                                                            &l_n_m_203643));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_220413,
                                                                            9,
                                                                            sizeof(i_203670),
                                                                            &i_203670));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_220413,
                                                                            10,
                                                                            sizeof(num_groups_220406),
                                                                            &num_groups_220406));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_220413,
                                                                            11,
                                                                            sizeof(ctx_param_ext_229488),
                                                                            &ctx_param_ext_229488));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_220413,
                                                                            12,
                                                                            sizeof(ctx_param_ext_229489),
                                                                            &ctx_param_ext_229489));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_220413,
                                                                            13,
                                                                            sizeof(ctx_param_ext_229491),
                                                                            &ctx_param_ext_229491));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_220413,
                                                                            14,
                                                                            sizeof(groups_per_segment_234914),
                                                                            &groups_per_segment_234914));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_220413,
                                                                            15,
                                                                            sizeof(elements_per_thread_234915),
                                                                            &elements_per_thread_234915));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_220413,
                                                                            16,
                                                                            sizeof(virt_num_groups_234916),
                                                                            &virt_num_groups_234916));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_220413,
                                                                            17,
                                                                            sizeof(threads_per_segment_234918),
                                                                            &threads_per_segment_234918));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_220413,
                                                                            18,
                                                                            sizeof(ext_mem_229411.mem),
                                                                            &ext_mem_229411.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_220413,
                                                                            19,
                                                                            sizeof(ext_mem_229412.mem),
                                                                            &ext_mem_229412.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_220413,
                                                                            20,
                                                                            sizeof(mem_param_229493.mem),
                                                                            &mem_param_229493.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_220413,
                                                                            21,
                                                                            sizeof(mem_230551.mem),
                                                                            &mem_230551.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_220413,
                                                                            22,
                                                                            sizeof(mem_230689.mem),
                                                                            &mem_230689.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_220413,
                                                                            23,
                                                                            sizeof(mem_230693.mem),
                                                                            &mem_230693.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_220413,
                                                                            24,
                                                                            sizeof(mem_230697.mem),
                                                                            &mem_230697.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_220413,
                                                                            25,
                                                                            sizeof(mem_230702.mem),
                                                                            &mem_230702.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_220413,
                                                                            26,
                                                                            sizeof(mem_230706.mem),
                                                                            &mem_230706.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_220413,
                                                                            27,
                                                                            sizeof(segred_tmp_mem_234919.mem),
                                                                            &segred_tmp_mem_234919.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_220413,
                                                                            28,
                                                                            sizeof(segred_tmp_mem_234921.mem),
                                                                            &segred_tmp_mem_234921.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_220413,
                                                                            29,
                                                                            sizeof(mainzicounter_mem_234923.mem),
                                                                            &mainzicounter_mem_234923.mem));
                                    if (1 * ((size_t) num_groups_220406 *
                                             (size_t) segred_group_sizze_220405) !=
                                        0) {
                                        const size_t global_work_sizze_237256[1]
                                                     =
                                                     {(size_t) num_groups_220406 *
                                                     (size_t) segred_group_sizze_220405};
                                        const size_t local_work_sizze_237260[1]
                                                     =
                                                     {(size_t) segred_group_sizze_220405};
                                        int64_t time_start_237257 = 0,
                                                time_end_237258 = 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_220413",
                                                    global_work_sizze_237256[0],
                                                    local_work_sizze_237260[0],
                                                    (int) (0 + 1 + (int64_t) 8 *
                                                           segred_group_sizze_220405 +
                                                           (int64_t) 8 *
                                                           segred_group_sizze_220405));
                                            time_start_237257 = get_wall_time();
                                        }
                                        OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                                        ctx->mainzisegred_large_220413,
                                                                                        1,
                                                                                        NULL,
                                                                                        global_work_sizze_237256,
                                                                                        local_work_sizze_237260,
                                                                                        0,
                                                                                        NULL,
                                                                                        ctx->profiling_paused ||
                                                                                        !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                                  &ctx->mainzisegred_large_220413_runs,
                                                                                                                                  &ctx->mainzisegred_large_220413_total_runtime)));
                                        if (ctx->debugging) {
                                            OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                            time_end_237258 = get_wall_time();
                                            
                                            long time_diff_237259 =
                                                 time_end_237258 -
                                                 time_start_237257;
                                            
                                            fprintf(ctx->log,
                                                    "kernel %s runtime: %ldus\n",
                                                    "main.segred_large_220413",
                                                    time_diff_237259);
                                        }
                                    }
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s\n", "");
                                    if (memblock_unref_device(ctx,
                                                              &segred_tmp_mem_234921,
                                                              "segred_tmp_mem_234921") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &segred_tmp_mem_234919,
                                                              "segred_tmp_mem_234919") !=
                                        0)
                                        return 1;
                                }
                                if (memblock_unref_device(ctx, &mem_230689,
                                                          "mem_230689") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230693,
                                                          "mem_230693") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230697,
                                                          "mem_230697") != 0)
                                    return 1;
                                if (memblock_set_device(ctx, &ext_mem_230708,
                                                        &mem_230702,
                                                        "mem_230702") != 0)
                                    return 1;
                                if (memblock_set_device(ctx, &ext_mem_230707,
                                                        &mem_230706,
                                                        "mem_230706") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230706,
                                                          "mem_230706") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230702,
                                                          "mem_230702") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230697,
                                                          "mem_230697") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230693,
                                                          "mem_230693") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230689,
                                                          "mem_230689") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230684,
                                                          "mem_230684") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230680,
                                                          "mem_230680") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230676,
                                                          "mem_230676") != 0)
                                    return 1;
                            }
                            if (memblock_set_device(ctx, &ext_mem_230720,
                                                    &ext_mem_230708,
                                                    "ext_mem_230708") != 0)
                                return 1;
                            if (memblock_set_device(ctx, &ext_mem_230719,
                                                    &ext_mem_230707,
                                                    "ext_mem_230707") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230707,
                                                      "ext_mem_230707") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230708,
                                                      "ext_mem_230708") != 0)
                                return 1;
                        }
                        if (memblock_set_device(ctx, &ext_mem_230845,
                                                &ext_mem_230720,
                                                "ext_mem_230720") != 0)
                            return 1;
                        if (memblock_set_device(ctx, &ext_mem_230844,
                                                &ext_mem_230719,
                                                "ext_mem_230719") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_230719,
                                                  "ext_mem_230719") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_230720,
                                                  "ext_mem_230720") != 0)
                            return 1;
                    } else {
                        bool suff_outer_par_220469;
                        
                        suff_outer_par_220469 =
                            *ctx->tuning_params.mainzisuff_outer_par_26 <=
                            partition_sizze_203577;
                        if (ctx->logging)
                            fprintf(ctx->log, "Compared %s <= %ld: %s.\n",
                                    "main.suff_outer_par_26",
                                    (long) partition_sizze_203577,
                                    suff_outer_par_220469 ? "true" : "false");
                        
                        int64_t segmap_group_sizze_220603;
                        
                        segmap_group_sizze_220603 =
                            *ctx->tuning_params.mainzisegmap_group_sizze_220473;
                        
                        int64_t num_groups_220604;
                        int32_t max_num_groups_234967;
                        
                        max_num_groups_234967 =
                            *ctx->tuning_params.mainzisegmap_num_groups_220475;
                        num_groups_220604 = sext_i64_i32(smax64((int64_t) 1,
                                                                smin64(sdiv_up64(partition_sizze_203577,
                                                                                 segmap_group_sizze_220603),
                                                                       sext_i32_i64(max_num_groups_234967))));
                        
                        int64_t segmap_group_sizze_221267;
                        
                        segmap_group_sizze_221267 =
                            *ctx->tuning_params.mainzisegmap_group_sizze_220737;
                        
                        bool suff_outer_par_221271;
                        
                        suff_outer_par_221271 =
                            *ctx->tuning_params.mainzisuff_outer_par_27 <=
                            nest_sizze_209492;
                        if (ctx->logging)
                            fprintf(ctx->log, "Compared %s <= %ld: %s.\n",
                                    "main.suff_outer_par_27",
                                    (long) nest_sizze_209492,
                                    suff_outer_par_221271 ? "true" : "false");
                        
                        int64_t nest_sizze_221411 = q_l_203495 *
                                nest_sizze_209492;
                        int64_t segred_group_sizze_221412;
                        
                        segred_group_sizze_221412 =
                            *ctx->tuning_params.mainzisegred_group_sizze_221009;
                        
                        int64_t num_groups_221413;
                        int32_t max_num_groups_234968;
                        
                        max_num_groups_234968 =
                            *ctx->tuning_params.mainzisegred_num_groups_221011;
                        num_groups_221413 = sext_i64_i32(smax64((int64_t) 1,
                                                                smin64(sdiv_up64(nest_sizze_221411,
                                                                                 segred_group_sizze_221412),
                                                                       sext_i32_i64(max_num_groups_234968))));
                        
                        int64_t segmap_group_sizze_221470;
                        
                        segmap_group_sizze_221470 =
                            *ctx->tuning_params.mainzisegmap_group_sizze_220968;
                        
                        int64_t segred_group_sizze_221513;
                        
                        segred_group_sizze_221513 =
                            *ctx->tuning_params.mainzisegred_group_sizze_220883;
                        
                        int64_t num_groups_221514;
                        int32_t max_num_groups_234969;
                        
                        max_num_groups_234969 =
                            *ctx->tuning_params.mainzisegred_num_groups_220885;
                        num_groups_221514 = sext_i64_i32(smax64((int64_t) 1,
                                                                smin64(sdiv_up64(nest_sizze_221411,
                                                                                 segred_group_sizze_221513),
                                                                       sext_i32_i64(max_num_groups_234969))));
                        
                        int64_t num_threads_232170 = segmap_group_sizze_220603 *
                                num_groups_220604;
                        int64_t total_sizze_232171 = bytes_229371 *
                                num_threads_232170;
                        int64_t total_sizze_232172 = bytes_229371 *
                                num_threads_232170;
                        struct memblock_device ext_mem_230843;
                        
                        ext_mem_230843.references = NULL;
                        
                        struct memblock_device ext_mem_230842;
                        
                        ext_mem_230842.references = NULL;
                        
                        int32_t local_memory_capacity_235248;
                        
                        local_memory_capacity_235248 =
                            ctx->opencl.max_local_memory;
                        if ((sle64((int64_t) 0,
                                   sext_i32_i64(local_memory_capacity_235248)) &&
                             sle64((int64_t) 0,
                                   sext_i32_i64(local_memory_capacity_235248))) &&
                            suff_outer_par_220469) {
                            struct memblock_device mem_230723;
                            
                            mem_230723.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_230723,
                                                      binop_y_229377,
                                                      "mem_230723")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (futrts_builtinzhgpu_map_transpose_i64(ctx,
                                                                      mem_230723,
                                                                      (int64_t) 0,
                                                                      ext_mem_229412,
                                                                      (int64_t) 0,
                                                                      (int64_t) 1,
                                                                      l_n_m_203643,
                                                                      partition_sizze_203577) !=
                                0) {
                                if (memblock_unref_device(ctx, &mem_230723,
                                                          "mem_230723") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230842,
                                                          "ext_mem_230842") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230843,
                                                          "ext_mem_230843") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230844,
                                                          "ext_mem_230844") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230845,
                                                          "ext_mem_230845") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230846,
                                                          "ext_mem_230846") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230847,
                                                          "ext_mem_230847") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230907,
                                                          "ext_mem_230907") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230908,
                                                          "ext_mem_230908") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230546,
                                                          "ext_mem_230546") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230529,
                                                          "ext_mem_230529") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230512,
                                                          "ext_mem_230512") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230494,
                                                          "ext_mem_230494") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230486,
                                                          "ext_mem_230486") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230487,
                                                          "ext_mem_230487") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229515,
                                                          "mem_param_229515") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229507,
                                                          "mem_param_229507") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231517,
                                                          "ext_mem_231517") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231518,
                                                          "ext_mem_231518") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229493,
                                                          "mem_param_229493") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229485,
                                                          "mem_param_229485") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229477,
                                                          "mem_param_229477") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231860,
                                                          "ext_mem_231860") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231861,
                                                          "ext_mem_231861") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231862,
                                                          "ext_mem_231862") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230551,
                                                          "mem_230551") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230534,
                                                          "mem_230534") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230517,
                                                          "mem_230517") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230500,
                                                          "mem_230500") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229531,
                                                          "mem_229531") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229526,
                                                          "mem_229526") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229520,
                                                          "mem_229520") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229469,
                                                          "mem_229469") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229465,
                                                          "mem_229465") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229460,
                                                          "ext_mem_229460") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229461,
                                                          "ext_mem_229461") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229411,
                                                          "ext_mem_229411") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229412,
                                                          "ext_mem_229412") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229362,
                                                          "ext_mem_229362") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229363,
                                                          "ext_mem_229363") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229264,
                                                          "ext_mem_229264") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229265,
                                                          "ext_mem_229265") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229206,
                                                          "mem_229206") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229200,
                                                          "mem_229200") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229196,
                                                          "ext_mem_229196") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229197,
                                                          "ext_mem_229197") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229164,
                                                          "mem_229164") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229161,
                                                          "mem_229161") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229157,
                                                          "mem_229157") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229155,
                                                          "mem_229155") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229152,
                                                          "mem_229152") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229148,
                                                          "mem_229148") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232249,
                                                          "mem_out_232249") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232248,
                                                          "mem_out_232248") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232247,
                                                          "mem_out_232247") !=
                                    0)
                                    return 1;
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device mem_230726;
                            
                            mem_230726.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_230726,
                                                      binop_y_229377,
                                                      "mem_230726")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (futrts_builtinzhgpu_map_transpose_f64(ctx,
                                                                      mem_230726,
                                                                      (int64_t) 0,
                                                                      ext_mem_229411,
                                                                      (int64_t) 0,
                                                                      (int64_t) 1,
                                                                      l_n_m_203643,
                                                                      partition_sizze_203577) !=
                                0) {
                                if (memblock_unref_device(ctx, &mem_230726,
                                                          "mem_230726") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230723,
                                                          "mem_230723") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230842,
                                                          "ext_mem_230842") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230843,
                                                          "ext_mem_230843") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230844,
                                                          "ext_mem_230844") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230845,
                                                          "ext_mem_230845") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230846,
                                                          "ext_mem_230846") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230847,
                                                          "ext_mem_230847") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230907,
                                                          "ext_mem_230907") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230908,
                                                          "ext_mem_230908") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230546,
                                                          "ext_mem_230546") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230529,
                                                          "ext_mem_230529") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230512,
                                                          "ext_mem_230512") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230494,
                                                          "ext_mem_230494") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230486,
                                                          "ext_mem_230486") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230487,
                                                          "ext_mem_230487") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229515,
                                                          "mem_param_229515") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229507,
                                                          "mem_param_229507") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231517,
                                                          "ext_mem_231517") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231518,
                                                          "ext_mem_231518") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229493,
                                                          "mem_param_229493") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229485,
                                                          "mem_param_229485") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229477,
                                                          "mem_param_229477") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231860,
                                                          "ext_mem_231860") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231861,
                                                          "ext_mem_231861") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231862,
                                                          "ext_mem_231862") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230551,
                                                          "mem_230551") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230534,
                                                          "mem_230534") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230517,
                                                          "mem_230517") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230500,
                                                          "mem_230500") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229531,
                                                          "mem_229531") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229526,
                                                          "mem_229526") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229520,
                                                          "mem_229520") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229469,
                                                          "mem_229469") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229465,
                                                          "mem_229465") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229460,
                                                          "ext_mem_229460") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229461,
                                                          "ext_mem_229461") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229411,
                                                          "ext_mem_229411") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229412,
                                                          "ext_mem_229412") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229362,
                                                          "ext_mem_229362") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229363,
                                                          "ext_mem_229363") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229264,
                                                          "ext_mem_229264") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229265,
                                                          "ext_mem_229265") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229206,
                                                          "mem_229206") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229200,
                                                          "mem_229200") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229196,
                                                          "ext_mem_229196") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229197,
                                                          "ext_mem_229197") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229164,
                                                          "mem_229164") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229161,
                                                          "mem_229161") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229157,
                                                          "mem_229157") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229155,
                                                          "mem_229155") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229152,
                                                          "mem_229152") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229148,
                                                          "mem_229148") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232249,
                                                          "mem_out_232249") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232248,
                                                          "mem_out_232248") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232247,
                                                          "mem_out_232247") !=
                                    0)
                                    return 1;
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device mem_230729;
                            
                            mem_230729.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_230729,
                                                      binop_y_229176,
                                                      "mem_230729")) {
                                err = 1;
                                goto cleanup;
                            }
                            
                            int64_t group_sizze_234973;
                            
                            group_sizze_234973 =
                                *ctx->tuning_params.mainzigroup_sizze_234973;
                            
                            int64_t num_groups_234974 =
                                    sdiv_up64(partition_sizze_203577 * n_203490,
                                              group_sizze_234973);
                            
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzicopy_234970,
                                                                    0,
                                                                    sizeof(n_203490),
                                                                    &n_203490));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzicopy_234970,
                                                                    1,
                                                                    sizeof(partition_sizze_203577),
                                                                    &partition_sizze_203577));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzicopy_234970,
                                                                    2,
                                                                    sizeof(ctx_param_ext_229488),
                                                                    &ctx_param_ext_229488));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzicopy_234970,
                                                                    3,
                                                                    sizeof(ctx_param_ext_229489),
                                                                    &ctx_param_ext_229489));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzicopy_234970,
                                                                    4,
                                                                    sizeof(ctx_param_ext_229491),
                                                                    &ctx_param_ext_229491));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzicopy_234970,
                                                                    5,
                                                                    sizeof(mem_param_229493.mem),
                                                                    &mem_param_229493.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzicopy_234970,
                                                                    6,
                                                                    sizeof(mem_230729.mem),
                                                                    &mem_230729.mem));
                            if (1 * ((size_t) num_groups_234974 *
                                     (size_t) group_sizze_234973) != 0) {
                                const size_t global_work_sizze_237261[1] =
                                             {(size_t) num_groups_234974 *
                                             (size_t) group_sizze_234973};
                                const size_t local_work_sizze_237265[1] =
                                             {(size_t) group_sizze_234973};
                                int64_t time_start_237262 = 0, time_end_237263 =
                                        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_234970",
                                            global_work_sizze_237261[0],
                                            local_work_sizze_237265[0],
                                            (int) 0);
                                    time_start_237262 = get_wall_time();
                                }
                                OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                                ctx->mainzicopy_234970,
                                                                                1,
                                                                                NULL,
                                                                                global_work_sizze_237261,
                                                                                local_work_sizze_237265,
                                                                                0,
                                                                                NULL,
                                                                                ctx->profiling_paused ||
                                                                                !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                          &ctx->mainzicopy_234970_runs,
                                                                                                                          &ctx->mainzicopy_234970_total_runtime)));
                                if (ctx->debugging) {
                                    OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                    time_end_237263 = get_wall_time();
                                    
                                    long time_diff_237264 = time_end_237263 -
                                         time_start_237262;
                                    
                                    fprintf(ctx->log,
                                            "kernel %s runtime: %ldus\n",
                                            "main.copy_234970",
                                            time_diff_237264);
                                }
                            }
                            
                            struct memblock_device mem_230732;
                            
                            mem_230732.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_230732,
                                                      binop_y_229176,
                                                      "mem_230732")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (futrts_builtinzhgpu_map_transpose_f64(ctx,
                                                                      mem_230732,
                                                                      (int64_t) 0,
                                                                      mem_230551,
                                                                      (int64_t) 0,
                                                                      (int64_t) 1,
                                                                      n_203490,
                                                                      partition_sizze_203577) !=
                                0) {
                                if (memblock_unref_device(ctx, &mem_230732,
                                                          "mem_230732") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230729,
                                                          "mem_230729") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230726,
                                                          "mem_230726") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230723,
                                                          "mem_230723") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230842,
                                                          "ext_mem_230842") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230843,
                                                          "ext_mem_230843") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230844,
                                                          "ext_mem_230844") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230845,
                                                          "ext_mem_230845") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230846,
                                                          "ext_mem_230846") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230847,
                                                          "ext_mem_230847") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230907,
                                                          "ext_mem_230907") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230908,
                                                          "ext_mem_230908") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230546,
                                                          "ext_mem_230546") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230529,
                                                          "ext_mem_230529") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230512,
                                                          "ext_mem_230512") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230494,
                                                          "ext_mem_230494") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230486,
                                                          "ext_mem_230486") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230487,
                                                          "ext_mem_230487") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229515,
                                                          "mem_param_229515") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229507,
                                                          "mem_param_229507") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231517,
                                                          "ext_mem_231517") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231518,
                                                          "ext_mem_231518") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229493,
                                                          "mem_param_229493") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229485,
                                                          "mem_param_229485") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229477,
                                                          "mem_param_229477") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231860,
                                                          "ext_mem_231860") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231861,
                                                          "ext_mem_231861") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231862,
                                                          "ext_mem_231862") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230551,
                                                          "mem_230551") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230534,
                                                          "mem_230534") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230517,
                                                          "mem_230517") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230500,
                                                          "mem_230500") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229531,
                                                          "mem_229531") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229526,
                                                          "mem_229526") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229520,
                                                          "mem_229520") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229469,
                                                          "mem_229469") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229465,
                                                          "mem_229465") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229460,
                                                          "ext_mem_229460") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229461,
                                                          "ext_mem_229461") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229411,
                                                          "ext_mem_229411") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229412,
                                                          "ext_mem_229412") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229362,
                                                          "ext_mem_229362") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229363,
                                                          "ext_mem_229363") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229264,
                                                          "ext_mem_229264") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229265,
                                                          "ext_mem_229265") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229206,
                                                          "mem_229206") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229200,
                                                          "mem_229200") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229196,
                                                          "ext_mem_229196") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229197,
                                                          "ext_mem_229197") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229164,
                                                          "mem_229164") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229161,
                                                          "mem_229161") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229157,
                                                          "mem_229157") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229155,
                                                          "mem_229155") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229152,
                                                          "mem_229152") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229148,
                                                          "mem_229148") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232249,
                                                          "mem_out_232249") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232248,
                                                          "mem_out_232248") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232247,
                                                          "mem_out_232247") !=
                                    0)
                                    return 1;
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device mem_230766;
                            
                            mem_230766.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_230766,
                                                      binop_y_229377,
                                                      "mem_230766")) {
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device mem_230769;
                            
                            mem_230769.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_230769,
                                                      binop_y_229377,
                                                      "mem_230769")) {
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device color_232030;
                            
                            color_232030.references = NULL;
                            if (memblock_alloc_device(ctx, &color_232030,
                                                      total_sizze_232171,
                                                      "color_232030")) {
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device color_232031;
                            
                            color_232031.references = NULL;
                            if (memblock_alloc_device(ctx, &color_232031,
                                                      total_sizze_232172,
                                                      "color_232031")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s\n", "\n# SegMap");
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_220609,
                                                                    1,
                                                                    sizeof(n_203490),
                                                                    &n_203490));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_220609,
                                                                    2,
                                                                    sizeof(q_l_203495),
                                                                    &q_l_203495));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_220609,
                                                                    3,
                                                                    sizeof(jump_t_203500),
                                                                    &jump_t_203500));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_220609,
                                                                    4,
                                                                    sizeof(partition_sizze_203577),
                                                                    &partition_sizze_203577));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_220609,
                                                                    5,
                                                                    sizeof(l_n_m_203643),
                                                                    &l_n_m_203643));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_220609,
                                                                    6,
                                                                    sizeof(i_203670),
                                                                    &i_203670));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_220609,
                                                                    7,
                                                                    sizeof(num_groups_220604),
                                                                    &num_groups_220604));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_220609,
                                                                    8,
                                                                    sizeof(num_threads_232170),
                                                                    &num_threads_232170));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_220609,
                                                                    9,
                                                                    sizeof(mem_230723.mem),
                                                                    &mem_230723.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_220609,
                                                                    10,
                                                                    sizeof(mem_230726.mem),
                                                                    &mem_230726.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_220609,
                                                                    11,
                                                                    sizeof(mem_230729.mem),
                                                                    &mem_230729.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_220609,
                                                                    12,
                                                                    sizeof(mem_230732.mem),
                                                                    &mem_230732.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_220609,
                                                                    13,
                                                                    sizeof(mem_230766.mem),
                                                                    &mem_230766.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_220609,
                                                                    14,
                                                                    sizeof(mem_230769.mem),
                                                                    &mem_230769.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_220609,
                                                                    15,
                                                                    sizeof(color_232030.mem),
                                                                    &color_232030.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_220609,
                                                                    16,
                                                                    sizeof(color_232031.mem),
                                                                    &color_232031.mem));
                            if (1 * ((size_t) num_groups_220604 *
                                     (size_t) segmap_group_sizze_220603) != 0) {
                                const size_t global_work_sizze_237266[1] =
                                             {(size_t) num_groups_220604 *
                                             (size_t) segmap_group_sizze_220603};
                                const size_t local_work_sizze_237270[1] =
                                             {(size_t) segmap_group_sizze_220603};
                                int64_t time_start_237267 = 0, time_end_237268 =
                                        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_220609",
                                            global_work_sizze_237266[0],
                                            local_work_sizze_237270[0],
                                            (int) 0);
                                    time_start_237267 = get_wall_time();
                                }
                                OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                                ctx->mainzisegmap_220609,
                                                                                1,
                                                                                NULL,
                                                                                global_work_sizze_237266,
                                                                                local_work_sizze_237270,
                                                                                0,
                                                                                NULL,
                                                                                ctx->profiling_paused ||
                                                                                !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                          &ctx->mainzisegmap_220609_runs,
                                                                                                                          &ctx->mainzisegmap_220609_total_runtime)));
                                if (ctx->debugging) {
                                    OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                    time_end_237268 = get_wall_time();
                                    
                                    long time_diff_237269 = time_end_237268 -
                                         time_start_237267;
                                    
                                    fprintf(ctx->log,
                                            "kernel %s runtime: %ldus\n",
                                            "main.segmap_220609",
                                            time_diff_237269);
                                }
                            }
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s\n", "");
                            if (memblock_unref_device(ctx, &mem_230723,
                                                      "mem_230723") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230726,
                                                      "mem_230726") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230729,
                                                      "mem_230729") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230732,
                                                      "mem_230732") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &color_232030,
                                                      "color_232030") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &color_232031,
                                                      "color_232031") != 0)
                                return 1;
                            
                            struct memblock_device mem_230835;
                            
                            mem_230835.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_230835,
                                                      bytes_229378,
                                                      "mem_230835")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (futrts_builtinzhgpu_map_transpose_f64(ctx,
                                                                      mem_230835,
                                                                      (int64_t) 0,
                                                                      mem_230766,
                                                                      (int64_t) 0,
                                                                      (int64_t) 1,
                                                                      partition_sizze_203577,
                                                                      l_n_m_203643) !=
                                0) {
                                if (memblock_unref_device(ctx, &mem_230835,
                                                          "mem_230835") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &color_232031,
                                                          "color_232031") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &color_232030,
                                                          "color_232030") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230769,
                                                          "mem_230769") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230766,
                                                          "mem_230766") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230732,
                                                          "mem_230732") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230729,
                                                          "mem_230729") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230726,
                                                          "mem_230726") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230723,
                                                          "mem_230723") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230842,
                                                          "ext_mem_230842") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230843,
                                                          "ext_mem_230843") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230844,
                                                          "ext_mem_230844") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230845,
                                                          "ext_mem_230845") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230846,
                                                          "ext_mem_230846") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230847,
                                                          "ext_mem_230847") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230907,
                                                          "ext_mem_230907") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230908,
                                                          "ext_mem_230908") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230546,
                                                          "ext_mem_230546") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230529,
                                                          "ext_mem_230529") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230512,
                                                          "ext_mem_230512") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230494,
                                                          "ext_mem_230494") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230486,
                                                          "ext_mem_230486") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230487,
                                                          "ext_mem_230487") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229515,
                                                          "mem_param_229515") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229507,
                                                          "mem_param_229507") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231517,
                                                          "ext_mem_231517") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231518,
                                                          "ext_mem_231518") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229493,
                                                          "mem_param_229493") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229485,
                                                          "mem_param_229485") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229477,
                                                          "mem_param_229477") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231860,
                                                          "ext_mem_231860") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231861,
                                                          "ext_mem_231861") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231862,
                                                          "ext_mem_231862") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230551,
                                                          "mem_230551") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230534,
                                                          "mem_230534") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230517,
                                                          "mem_230517") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230500,
                                                          "mem_230500") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229531,
                                                          "mem_229531") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229526,
                                                          "mem_229526") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229520,
                                                          "mem_229520") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229469,
                                                          "mem_229469") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229465,
                                                          "mem_229465") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229460,
                                                          "ext_mem_229460") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229461,
                                                          "ext_mem_229461") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229411,
                                                          "ext_mem_229411") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229412,
                                                          "ext_mem_229412") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229362,
                                                          "ext_mem_229362") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229363,
                                                          "ext_mem_229363") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229264,
                                                          "ext_mem_229264") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229265,
                                                          "ext_mem_229265") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229206,
                                                          "mem_229206") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229200,
                                                          "mem_229200") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229196,
                                                          "ext_mem_229196") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229197,
                                                          "ext_mem_229197") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229164,
                                                          "mem_229164") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229161,
                                                          "mem_229161") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229157,
                                                          "mem_229157") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229155,
                                                          "mem_229155") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229152,
                                                          "mem_229152") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229148,
                                                          "mem_229148") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232249,
                                                          "mem_out_232249") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232248,
                                                          "mem_out_232248") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232247,
                                                          "mem_out_232247") !=
                                    0)
                                    return 1;
                                err = 1;
                                goto cleanup;
                            }
                            if (memblock_unref_device(ctx, &mem_230766,
                                                      "mem_230766") != 0)
                                return 1;
                            
                            struct memblock_device mem_230840;
                            
                            mem_230840.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_230840,
                                                      bytes_229378,
                                                      "mem_230840")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (futrts_builtinzhgpu_map_transpose_f64(ctx,
                                                                      mem_230840,
                                                                      (int64_t) 0,
                                                                      mem_230769,
                                                                      (int64_t) 0,
                                                                      (int64_t) 1,
                                                                      partition_sizze_203577,
                                                                      l_n_m_203643) !=
                                0) {
                                if (memblock_unref_device(ctx, &mem_230840,
                                                          "mem_230840") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230835,
                                                          "mem_230835") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &color_232031,
                                                          "color_232031") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &color_232030,
                                                          "color_232030") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230769,
                                                          "mem_230769") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230766,
                                                          "mem_230766") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230732,
                                                          "mem_230732") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230729,
                                                          "mem_230729") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230726,
                                                          "mem_230726") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230723,
                                                          "mem_230723") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230842,
                                                          "ext_mem_230842") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230843,
                                                          "ext_mem_230843") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230844,
                                                          "ext_mem_230844") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230845,
                                                          "ext_mem_230845") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230846,
                                                          "ext_mem_230846") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230847,
                                                          "ext_mem_230847") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230907,
                                                          "ext_mem_230907") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230908,
                                                          "ext_mem_230908") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230546,
                                                          "ext_mem_230546") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230529,
                                                          "ext_mem_230529") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230512,
                                                          "ext_mem_230512") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230494,
                                                          "ext_mem_230494") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230486,
                                                          "ext_mem_230486") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230487,
                                                          "ext_mem_230487") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229515,
                                                          "mem_param_229515") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229507,
                                                          "mem_param_229507") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231517,
                                                          "ext_mem_231517") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231518,
                                                          "ext_mem_231518") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229493,
                                                          "mem_param_229493") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229485,
                                                          "mem_param_229485") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229477,
                                                          "mem_param_229477") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231860,
                                                          "ext_mem_231860") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231861,
                                                          "ext_mem_231861") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231862,
                                                          "ext_mem_231862") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230551,
                                                          "mem_230551") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230534,
                                                          "mem_230534") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230517,
                                                          "mem_230517") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230500,
                                                          "mem_230500") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229531,
                                                          "mem_229531") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229526,
                                                          "mem_229526") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229520,
                                                          "mem_229520") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229469,
                                                          "mem_229469") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229465,
                                                          "mem_229465") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229460,
                                                          "ext_mem_229460") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229461,
                                                          "ext_mem_229461") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229411,
                                                          "ext_mem_229411") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229412,
                                                          "ext_mem_229412") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229362,
                                                          "ext_mem_229362") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229363,
                                                          "ext_mem_229363") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229264,
                                                          "ext_mem_229264") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229265,
                                                          "ext_mem_229265") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229206,
                                                          "mem_229206") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229200,
                                                          "mem_229200") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229196,
                                                          "ext_mem_229196") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229197,
                                                          "ext_mem_229197") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229164,
                                                          "mem_229164") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229161,
                                                          "mem_229161") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229157,
                                                          "mem_229157") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229155,
                                                          "mem_229155") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229152,
                                                          "mem_229152") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229148,
                                                          "mem_229148") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232249,
                                                          "mem_out_232249") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232248,
                                                          "mem_out_232248") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232247,
                                                          "mem_out_232247") !=
                                    0)
                                    return 1;
                                err = 1;
                                goto cleanup;
                            }
                            if (memblock_unref_device(ctx, &mem_230769,
                                                      "mem_230769") != 0)
                                return 1;
                            if (memblock_set_device(ctx, &ext_mem_230843,
                                                    &mem_230835,
                                                    "mem_230835") != 0)
                                return 1;
                            if (memblock_set_device(ctx, &ext_mem_230842,
                                                    &mem_230840,
                                                    "mem_230840") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230840,
                                                      "mem_230840") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230835,
                                                      "mem_230835") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &color_232031,
                                                      "color_232031") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &color_232030,
                                                      "color_232030") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230769,
                                                      "mem_230769") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230766,
                                                      "mem_230766") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230732,
                                                      "mem_230732") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230729,
                                                      "mem_230729") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230726,
                                                      "mem_230726") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230723,
                                                      "mem_230723") != 0)
                                return 1;
                        } else {
                            int64_t segmap_usable_groups_221268 =
                                    sdiv_up64(nest_sizze_209492,
                                              segmap_group_sizze_221267);
                            struct memblock_device ext_mem_230831;
                            
                            ext_mem_230831.references = NULL;
                            
                            struct memblock_device ext_mem_230830;
                            
                            ext_mem_230830.references = NULL;
                            
                            int32_t local_memory_capacity_235247;
                            
                            local_memory_capacity_235247 =
                                ctx->opencl.max_local_memory;
                            if (sle64((int64_t) 0,
                                      sext_i32_i64(local_memory_capacity_235247)) &&
                                suff_outer_par_221271) {
                                struct memblock_device mem_230774;
                                
                                mem_230774.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_230774,
                                                          bytes_229378,
                                                          "mem_230774")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device mem_230778;
                                
                                mem_230778.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_230778,
                                                          bytes_229378,
                                                          "mem_230778")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s\n", "\n# SegMap");
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_221278,
                                                                        1,
                                                                        sizeof(n_203490),
                                                                        &n_203490));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_221278,
                                                                        2,
                                                                        sizeof(q_l_203495),
                                                                        &q_l_203495));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_221278,
                                                                        3,
                                                                        sizeof(jump_t_203500),
                                                                        &jump_t_203500));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_221278,
                                                                        4,
                                                                        sizeof(partition_sizze_203577),
                                                                        &partition_sizze_203577));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_221278,
                                                                        5,
                                                                        sizeof(l_n_m_203643),
                                                                        &l_n_m_203643));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_221278,
                                                                        6,
                                                                        sizeof(i_203670),
                                                                        &i_203670));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_221278,
                                                                        7,
                                                                        sizeof(ctx_param_ext_229488),
                                                                        &ctx_param_ext_229488));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_221278,
                                                                        8,
                                                                        sizeof(ctx_param_ext_229489),
                                                                        &ctx_param_ext_229489));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_221278,
                                                                        9,
                                                                        sizeof(ctx_param_ext_229491),
                                                                        &ctx_param_ext_229491));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_221278,
                                                                        10,
                                                                        sizeof(ext_mem_229411.mem),
                                                                        &ext_mem_229411.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_221278,
                                                                        11,
                                                                        sizeof(ext_mem_229412.mem),
                                                                        &ext_mem_229412.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_221278,
                                                                        12,
                                                                        sizeof(mem_param_229493.mem),
                                                                        &mem_param_229493.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_221278,
                                                                        13,
                                                                        sizeof(mem_230551.mem),
                                                                        &mem_230551.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_221278,
                                                                        14,
                                                                        sizeof(mem_230774.mem),
                                                                        &mem_230774.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_221278,
                                                                        15,
                                                                        sizeof(mem_230778.mem),
                                                                        &mem_230778.mem));
                                if (1 * ((size_t) segmap_usable_groups_221268 *
                                         (size_t) segmap_group_sizze_221267) !=
                                    0) {
                                    const size_t global_work_sizze_237271[1] =
                                                 {(size_t) segmap_usable_groups_221268 *
                                                 (size_t) segmap_group_sizze_221267};
                                    const size_t local_work_sizze_237275[1] =
                                                 {(size_t) segmap_group_sizze_221267};
                                    int64_t time_start_237272 = 0,
                                            time_end_237273 = 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_221278",
                                                global_work_sizze_237271[0],
                                                local_work_sizze_237275[0],
                                                (int) 0);
                                        time_start_237272 = get_wall_time();
                                    }
                                    OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                                    ctx->mainzisegmap_221278,
                                                                                    1,
                                                                                    NULL,
                                                                                    global_work_sizze_237271,
                                                                                    local_work_sizze_237275,
                                                                                    0,
                                                                                    NULL,
                                                                                    ctx->profiling_paused ||
                                                                                    !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                              &ctx->mainzisegmap_221278_runs,
                                                                                                                              &ctx->mainzisegmap_221278_total_runtime)));
                                    if (ctx->debugging) {
                                        OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                        time_end_237273 = get_wall_time();
                                        
                                        long time_diff_237274 =
                                             time_end_237273 -
                                             time_start_237272;
                                        
                                        fprintf(ctx->log,
                                                "kernel %s runtime: %ldus\n",
                                                "main.segmap_221278",
                                                time_diff_237274);
                                    }
                                }
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s\n", "");
                                if (memblock_set_device(ctx, &ext_mem_230831,
                                                        &mem_230774,
                                                        "mem_230774") != 0)
                                    return 1;
                                if (memblock_set_device(ctx, &ext_mem_230830,
                                                        &mem_230778,
                                                        "mem_230778") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230778,
                                                          "mem_230778") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230774,
                                                          "mem_230774") != 0)
                                    return 1;
                            } else {
                                struct memblock_device mem_230783;
                                
                                mem_230783.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_230783,
                                                          bytes_229378,
                                                          "mem_230783")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device mem_230787;
                                
                                mem_230787.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_230787,
                                                          bytes_229378,
                                                          "mem_230787")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device mem_230791;
                                
                                mem_230791.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_230791,
                                                          bytes_229378,
                                                          "mem_230791")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device mem_230795;
                                
                                mem_230795.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_230795,
                                                          bytes_229378,
                                                          "mem_230795")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device mem_230799;
                                
                                mem_230799.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_230799,
                                                          bytes_229378,
                                                          "mem_230799")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                if (slt64(q_l_203495 * (int64_t) 2,
                                          segred_group_sizze_221412)) {
                                    int64_t segment_sizze_nonzzero_235023 =
                                            smax64((int64_t) 1, q_l_203495);
                                    int64_t num_threads_235024 =
                                            num_groups_221413 *
                                            segred_group_sizze_221412;
                                    
                                    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_203577 *
                                                             l_n_m_203643),
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "segment_size",
                                                (long long) q_l_203495, '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "segments_per_group",
                                                (long long) squot64(segred_group_sizze_221412,
                                                                    segment_sizze_nonzzero_235023),
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "required_groups",
                                                (long long) sext_i64_i32(sdiv_up64(partition_sizze_203577 *
                                                                                   l_n_m_203643,
                                                                                   squot64(segred_group_sizze_221412,
                                                                                           segment_sizze_nonzzero_235023))),
                                                '\n');
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_221423,
                                                                            1,
                                                                            (size_t) ((int64_t) 8 *
                                                                                      segred_group_sizze_221412),
                                                                            NULL));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_221423,
                                                                            2,
                                                                            (size_t) ((int64_t) 8 *
                                                                                      segred_group_sizze_221412),
                                                                            NULL));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_221423,
                                                                            3,
                                                                            (size_t) ((int64_t) 8 *
                                                                                      segred_group_sizze_221412),
                                                                            NULL));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_221423,
                                                                            4,
                                                                            (size_t) ((int64_t) 8 *
                                                                                      segred_group_sizze_221412),
                                                                            NULL));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_221423,
                                                                            5,
                                                                            (size_t) ((int64_t) 8 *
                                                                                      segred_group_sizze_221412),
                                                                            NULL));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_221423,
                                                                            6,
                                                                            sizeof(n_203490),
                                                                            &n_203490));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_221423,
                                                                            7,
                                                                            sizeof(q_l_203495),
                                                                            &q_l_203495));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_221423,
                                                                            8,
                                                                            sizeof(jump_t_203500),
                                                                            &jump_t_203500));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_221423,
                                                                            9,
                                                                            sizeof(partition_sizze_203577),
                                                                            &partition_sizze_203577));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_221423,
                                                                            10,
                                                                            sizeof(l_n_m_203643),
                                                                            &l_n_m_203643));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_221423,
                                                                            11,
                                                                            sizeof(i_203670),
                                                                            &i_203670));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_221423,
                                                                            12,
                                                                            sizeof(num_groups_221413),
                                                                            &num_groups_221413));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_221423,
                                                                            13,
                                                                            sizeof(ctx_param_ext_229488),
                                                                            &ctx_param_ext_229488));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_221423,
                                                                            14,
                                                                            sizeof(ctx_param_ext_229489),
                                                                            &ctx_param_ext_229489));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_221423,
                                                                            15,
                                                                            sizeof(ctx_param_ext_229491),
                                                                            &ctx_param_ext_229491));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_221423,
                                                                            16,
                                                                            sizeof(segment_sizze_nonzzero_235023),
                                                                            &segment_sizze_nonzzero_235023));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_221423,
                                                                            17,
                                                                            sizeof(ext_mem_229411.mem),
                                                                            &ext_mem_229411.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_221423,
                                                                            18,
                                                                            sizeof(ext_mem_229412.mem),
                                                                            &ext_mem_229412.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_221423,
                                                                            19,
                                                                            sizeof(mem_param_229493.mem),
                                                                            &mem_param_229493.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_221423,
                                                                            20,
                                                                            sizeof(mem_230783.mem),
                                                                            &mem_230783.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_221423,
                                                                            21,
                                                                            sizeof(mem_230787.mem),
                                                                            &mem_230787.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_221423,
                                                                            22,
                                                                            sizeof(mem_230791.mem),
                                                                            &mem_230791.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_221423,
                                                                            23,
                                                                            sizeof(mem_230795.mem),
                                                                            &mem_230795.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_221423,
                                                                            24,
                                                                            sizeof(mem_230799.mem),
                                                                            &mem_230799.mem));
                                    if (1 * ((size_t) num_groups_221413 *
                                             (size_t) segred_group_sizze_221412) !=
                                        0) {
                                        const size_t global_work_sizze_237276[1]
                                                     =
                                                     {(size_t) num_groups_221413 *
                                                     (size_t) segred_group_sizze_221412};
                                        const size_t local_work_sizze_237280[1]
                                                     =
                                                     {(size_t) segred_group_sizze_221412};
                                        int64_t time_start_237277 = 0,
                                                time_end_237278 = 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_221423",
                                                    global_work_sizze_237276[0],
                                                    local_work_sizze_237280[0],
                                                    (int) (0 + (int64_t) 8 *
                                                           segred_group_sizze_221412 +
                                                           (int64_t) 8 *
                                                           segred_group_sizze_221412 +
                                                           (int64_t) 8 *
                                                           segred_group_sizze_221412 +
                                                           (int64_t) 8 *
                                                           segred_group_sizze_221412 +
                                                           (int64_t) 8 *
                                                           segred_group_sizze_221412));
                                            time_start_237277 = get_wall_time();
                                        }
                                        OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                                        ctx->mainzisegred_small_221423,
                                                                                        1,
                                                                                        NULL,
                                                                                        global_work_sizze_237276,
                                                                                        local_work_sizze_237280,
                                                                                        0,
                                                                                        NULL,
                                                                                        ctx->profiling_paused ||
                                                                                        !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                                  &ctx->mainzisegred_small_221423_runs,
                                                                                                                                  &ctx->mainzisegred_small_221423_total_runtime)));
                                        if (ctx->debugging) {
                                            OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                            time_end_237278 = get_wall_time();
                                            
                                            long time_diff_237279 =
                                                 time_end_237278 -
                                                 time_start_237277;
                                            
                                            fprintf(ctx->log,
                                                    "kernel %s runtime: %ldus\n",
                                                    "main.segred_small_221423",
                                                    time_diff_237279);
                                        }
                                    }
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s\n", "");
                                } else {
                                    int64_t groups_per_segment_235076 =
                                            sdiv_up64(num_groups_221413,
                                                      smax64((int64_t) 1,
                                                             partition_sizze_203577 *
                                                             l_n_m_203643));
                                    int64_t elements_per_thread_235077 =
                                            sdiv_up64(q_l_203495,
                                                      segred_group_sizze_221412 *
                                                      groups_per_segment_235076);
                                    int64_t virt_num_groups_235078 =
                                            groups_per_segment_235076 *
                                            (partition_sizze_203577 *
                                             l_n_m_203643);
                                    int64_t num_threads_235079 =
                                            num_groups_221413 *
                                            segred_group_sizze_221412;
                                    int64_t threads_per_segment_235080 =
                                            groups_per_segment_235076 *
                                            segred_group_sizze_221412;
                                    
                                    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_203577 *
                                                             l_n_m_203643),
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "segment_size",
                                                (long long) q_l_203495, '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "virt_num_groups",
                                                (long long) virt_num_groups_235078,
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "num_groups",
                                                (long long) num_groups_221413,
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "group_size",
                                                (long long) segred_group_sizze_221412,
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "elems_per_thread",
                                                (long long) elements_per_thread_235077,
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "groups_per_segment",
                                                (long long) groups_per_segment_235076,
                                                '\n');
                                    
                                    struct memblock_device
                                    segred_tmp_mem_235081;
                                    
                                    segred_tmp_mem_235081.references = NULL;
                                    if (memblock_alloc_device(ctx,
                                                              &segred_tmp_mem_235081,
                                                              (int64_t) 8 *
                                                              virt_num_groups_235078,
                                                              "segred_tmp_mem_235081")) {
                                        err = 1;
                                        goto cleanup;
                                    }
                                    
                                    struct memblock_device
                                    segred_tmp_mem_235083;
                                    
                                    segred_tmp_mem_235083.references = NULL;
                                    if (memblock_alloc_device(ctx,
                                                              &segred_tmp_mem_235083,
                                                              (int64_t) 8 *
                                                              virt_num_groups_235078,
                                                              "segred_tmp_mem_235083")) {
                                        err = 1;
                                        goto cleanup;
                                    }
                                    
                                    struct memblock_device
                                    segred_tmp_mem_235085;
                                    
                                    segred_tmp_mem_235085.references = NULL;
                                    if (memblock_alloc_device(ctx,
                                                              &segred_tmp_mem_235085,
                                                              (int64_t) 8 *
                                                              virt_num_groups_235078,
                                                              "segred_tmp_mem_235085")) {
                                        err = 1;
                                        goto cleanup;
                                    }
                                    
                                    struct memblock_device
                                    segred_tmp_mem_235087;
                                    
                                    segred_tmp_mem_235087.references = NULL;
                                    if (memblock_alloc_device(ctx,
                                                              &segred_tmp_mem_235087,
                                                              (int64_t) 8 *
                                                              virt_num_groups_235078,
                                                              "segred_tmp_mem_235087")) {
                                        err = 1;
                                        goto cleanup;
                                    }
                                    
                                    struct memblock_device
                                    segred_tmp_mem_235089;
                                    
                                    segred_tmp_mem_235089.references = NULL;
                                    if (memblock_alloc_device(ctx,
                                                              &segred_tmp_mem_235089,
                                                              (int64_t) 8 *
                                                              virt_num_groups_235078,
                                                              "segred_tmp_mem_235089")) {
                                        err = 1;
                                        goto cleanup;
                                    }
                                    
                                    struct memblock_device
                                    mainzicounter_mem_235091 =
                                    ctx->mainzicounter_mem_235091;
                                    
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_221423,
                                                                            1,
                                                                            (size_t) 1,
                                                                            NULL));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_221423,
                                                                            2,
                                                                            (size_t) ((int64_t) 8 *
                                                                                      segred_group_sizze_221412),
                                                                            NULL));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_221423,
                                                                            3,
                                                                            (size_t) ((int64_t) 8 *
                                                                                      segred_group_sizze_221412),
                                                                            NULL));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_221423,
                                                                            4,
                                                                            (size_t) ((int64_t) 8 *
                                                                                      segred_group_sizze_221412),
                                                                            NULL));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_221423,
                                                                            5,
                                                                            (size_t) ((int64_t) 8 *
                                                                                      segred_group_sizze_221412),
                                                                            NULL));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_221423,
                                                                            6,
                                                                            (size_t) ((int64_t) 8 *
                                                                                      segred_group_sizze_221412),
                                                                            NULL));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_221423,
                                                                            7,
                                                                            sizeof(n_203490),
                                                                            &n_203490));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_221423,
                                                                            8,
                                                                            sizeof(q_l_203495),
                                                                            &q_l_203495));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_221423,
                                                                            9,
                                                                            sizeof(jump_t_203500),
                                                                            &jump_t_203500));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_221423,
                                                                            10,
                                                                            sizeof(partition_sizze_203577),
                                                                            &partition_sizze_203577));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_221423,
                                                                            11,
                                                                            sizeof(l_n_m_203643),
                                                                            &l_n_m_203643));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_221423,
                                                                            12,
                                                                            sizeof(i_203670),
                                                                            &i_203670));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_221423,
                                                                            13,
                                                                            sizeof(num_groups_221413),
                                                                            &num_groups_221413));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_221423,
                                                                            14,
                                                                            sizeof(ctx_param_ext_229488),
                                                                            &ctx_param_ext_229488));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_221423,
                                                                            15,
                                                                            sizeof(ctx_param_ext_229489),
                                                                            &ctx_param_ext_229489));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_221423,
                                                                            16,
                                                                            sizeof(ctx_param_ext_229491),
                                                                            &ctx_param_ext_229491));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_221423,
                                                                            17,
                                                                            sizeof(groups_per_segment_235076),
                                                                            &groups_per_segment_235076));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_221423,
                                                                            18,
                                                                            sizeof(elements_per_thread_235077),
                                                                            &elements_per_thread_235077));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_221423,
                                                                            19,
                                                                            sizeof(virt_num_groups_235078),
                                                                            &virt_num_groups_235078));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_221423,
                                                                            20,
                                                                            sizeof(threads_per_segment_235080),
                                                                            &threads_per_segment_235080));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_221423,
                                                                            21,
                                                                            sizeof(ext_mem_229411.mem),
                                                                            &ext_mem_229411.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_221423,
                                                                            22,
                                                                            sizeof(ext_mem_229412.mem),
                                                                            &ext_mem_229412.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_221423,
                                                                            23,
                                                                            sizeof(mem_param_229493.mem),
                                                                            &mem_param_229493.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_221423,
                                                                            24,
                                                                            sizeof(mem_230783.mem),
                                                                            &mem_230783.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_221423,
                                                                            25,
                                                                            sizeof(mem_230787.mem),
                                                                            &mem_230787.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_221423,
                                                                            26,
                                                                            sizeof(mem_230791.mem),
                                                                            &mem_230791.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_221423,
                                                                            27,
                                                                            sizeof(mem_230795.mem),
                                                                            &mem_230795.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_221423,
                                                                            28,
                                                                            sizeof(mem_230799.mem),
                                                                            &mem_230799.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_221423,
                                                                            29,
                                                                            sizeof(segred_tmp_mem_235081.mem),
                                                                            &segred_tmp_mem_235081.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_221423,
                                                                            30,
                                                                            sizeof(segred_tmp_mem_235083.mem),
                                                                            &segred_tmp_mem_235083.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_221423,
                                                                            31,
                                                                            sizeof(segred_tmp_mem_235085.mem),
                                                                            &segred_tmp_mem_235085.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_221423,
                                                                            32,
                                                                            sizeof(segred_tmp_mem_235087.mem),
                                                                            &segred_tmp_mem_235087.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_221423,
                                                                            33,
                                                                            sizeof(segred_tmp_mem_235089.mem),
                                                                            &segred_tmp_mem_235089.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_221423,
                                                                            34,
                                                                            sizeof(mainzicounter_mem_235091.mem),
                                                                            &mainzicounter_mem_235091.mem));
                                    if (1 * ((size_t) num_groups_221413 *
                                             (size_t) segred_group_sizze_221412) !=
                                        0) {
                                        const size_t global_work_sizze_237282[1]
                                                     =
                                                     {(size_t) num_groups_221413 *
                                                     (size_t) segred_group_sizze_221412};
                                        const size_t local_work_sizze_237286[1]
                                                     =
                                                     {(size_t) segred_group_sizze_221412};
                                        int64_t time_start_237283 = 0,
                                                time_end_237284 = 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_221423",
                                                    global_work_sizze_237282[0],
                                                    local_work_sizze_237286[0],
                                                    (int) (0 + 1 + (int64_t) 8 *
                                                           segred_group_sizze_221412 +
                                                           (int64_t) 8 *
                                                           segred_group_sizze_221412 +
                                                           (int64_t) 8 *
                                                           segred_group_sizze_221412 +
                                                           (int64_t) 8 *
                                                           segred_group_sizze_221412 +
                                                           (int64_t) 8 *
                                                           segred_group_sizze_221412));
                                            time_start_237283 = get_wall_time();
                                        }
                                        OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                                        ctx->mainzisegred_large_221423,
                                                                                        1,
                                                                                        NULL,
                                                                                        global_work_sizze_237282,
                                                                                        local_work_sizze_237286,
                                                                                        0,
                                                                                        NULL,
                                                                                        ctx->profiling_paused ||
                                                                                        !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                                  &ctx->mainzisegred_large_221423_runs,
                                                                                                                                  &ctx->mainzisegred_large_221423_total_runtime)));
                                        if (ctx->debugging) {
                                            OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                            time_end_237284 = get_wall_time();
                                            
                                            long time_diff_237285 =
                                                 time_end_237284 -
                                                 time_start_237283;
                                            
                                            fprintf(ctx->log,
                                                    "kernel %s runtime: %ldus\n",
                                                    "main.segred_large_221423",
                                                    time_diff_237285);
                                        }
                                    }
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s\n", "");
                                    if (memblock_unref_device(ctx,
                                                              &segred_tmp_mem_235089,
                                                              "segred_tmp_mem_235089") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &segred_tmp_mem_235087,
                                                              "segred_tmp_mem_235087") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &segred_tmp_mem_235085,
                                                              "segred_tmp_mem_235085") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &segred_tmp_mem_235083,
                                                              "segred_tmp_mem_235083") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &segred_tmp_mem_235081,
                                                              "segred_tmp_mem_235081") !=
                                        0)
                                        return 1;
                                }
                                
                                int64_t segmap_usable_groups_221471 =
                                        sdiv_up64(nest_sizze_209492,
                                                  segmap_group_sizze_221470);
                                struct memblock_device mem_230804;
                                
                                mem_230804.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_230804,
                                                          bytes_229378,
                                                          "mem_230804")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device mem_230808;
                                
                                mem_230808.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_230808,
                                                          bytes_229378,
                                                          "mem_230808")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device mem_230812;
                                
                                mem_230812.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_230812,
                                                          bytes_229378,
                                                          "mem_230812")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device mem_230816;
                                
                                mem_230816.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_230816,
                                                          bytes_229378,
                                                          "mem_230816")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device mem_230820;
                                
                                mem_230820.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_230820,
                                                          bytes_229378,
                                                          "mem_230820")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s\n", "\n# SegMap");
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_221479,
                                                                        1,
                                                                        sizeof(partition_sizze_203577),
                                                                        &partition_sizze_203577));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_221479,
                                                                        2,
                                                                        sizeof(l_n_m_203643),
                                                                        &l_n_m_203643));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_221479,
                                                                        3,
                                                                        sizeof(mem_230783.mem),
                                                                        &mem_230783.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_221479,
                                                                        4,
                                                                        sizeof(mem_230787.mem),
                                                                        &mem_230787.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_221479,
                                                                        5,
                                                                        sizeof(mem_230791.mem),
                                                                        &mem_230791.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_221479,
                                                                        6,
                                                                        sizeof(mem_230795.mem),
                                                                        &mem_230795.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_221479,
                                                                        7,
                                                                        sizeof(mem_230799.mem),
                                                                        &mem_230799.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_221479,
                                                                        8,
                                                                        sizeof(mem_230804.mem),
                                                                        &mem_230804.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_221479,
                                                                        9,
                                                                        sizeof(mem_230808.mem),
                                                                        &mem_230808.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_221479,
                                                                        10,
                                                                        sizeof(mem_230812.mem),
                                                                        &mem_230812.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_221479,
                                                                        11,
                                                                        sizeof(mem_230816.mem),
                                                                        &mem_230816.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_221479,
                                                                        12,
                                                                        sizeof(mem_230820.mem),
                                                                        &mem_230820.mem));
                                if (1 * ((size_t) segmap_usable_groups_221471 *
                                         (size_t) segmap_group_sizze_221470) !=
                                    0) {
                                    const size_t global_work_sizze_237287[1] =
                                                 {(size_t) segmap_usable_groups_221471 *
                                                 (size_t) segmap_group_sizze_221470};
                                    const size_t local_work_sizze_237291[1] =
                                                 {(size_t) segmap_group_sizze_221470};
                                    int64_t time_start_237288 = 0,
                                            time_end_237289 = 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_221479",
                                                global_work_sizze_237287[0],
                                                local_work_sizze_237291[0],
                                                (int) 0);
                                        time_start_237288 = get_wall_time();
                                    }
                                    OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                                    ctx->mainzisegmap_221479,
                                                                                    1,
                                                                                    NULL,
                                                                                    global_work_sizze_237287,
                                                                                    local_work_sizze_237291,
                                                                                    0,
                                                                                    NULL,
                                                                                    ctx->profiling_paused ||
                                                                                    !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                              &ctx->mainzisegmap_221479_runs,
                                                                                                                              &ctx->mainzisegmap_221479_total_runtime)));
                                    if (ctx->debugging) {
                                        OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                        time_end_237289 = get_wall_time();
                                        
                                        long time_diff_237290 =
                                             time_end_237289 -
                                             time_start_237288;
                                        
                                        fprintf(ctx->log,
                                                "kernel %s runtime: %ldus\n",
                                                "main.segmap_221479",
                                                time_diff_237290);
                                    }
                                }
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s\n", "");
                                if (memblock_unref_device(ctx, &mem_230783,
                                                          "mem_230783") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230787,
                                                          "mem_230787") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230791,
                                                          "mem_230791") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230795,
                                                          "mem_230795") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230799,
                                                          "mem_230799") != 0)
                                    return 1;
                                
                                struct memblock_device mem_230825;
                                
                                mem_230825.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_230825,
                                                          bytes_229378,
                                                          "mem_230825")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device mem_230829;
                                
                                mem_230829.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_230829,
                                                          bytes_229378,
                                                          "mem_230829")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                if (slt64(q_l_203495 * (int64_t) 2,
                                          segred_group_sizze_221513)) {
                                    int64_t segment_sizze_nonzzero_235161 =
                                            smax64((int64_t) 1, q_l_203495);
                                    int64_t num_threads_235162 =
                                            num_groups_221514 *
                                            segred_group_sizze_221513;
                                    
                                    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_203577 *
                                                             l_n_m_203643),
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "segment_size",
                                                (long long) q_l_203495, '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "segments_per_group",
                                                (long long) squot64(segred_group_sizze_221513,
                                                                    segment_sizze_nonzzero_235161),
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "required_groups",
                                                (long long) sext_i64_i32(sdiv_up64(partition_sizze_203577 *
                                                                                   l_n_m_203643,
                                                                                   squot64(segred_group_sizze_221513,
                                                                                           segment_sizze_nonzzero_235161))),
                                                '\n');
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_221521,
                                                                            1,
                                                                            (size_t) ((int64_t) 8 *
                                                                                      segred_group_sizze_221513),
                                                                            NULL));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_221521,
                                                                            2,
                                                                            (size_t) ((int64_t) 8 *
                                                                                      segred_group_sizze_221513),
                                                                            NULL));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_221521,
                                                                            3,
                                                                            sizeof(n_203490),
                                                                            &n_203490));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_221521,
                                                                            4,
                                                                            sizeof(q_l_203495),
                                                                            &q_l_203495));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_221521,
                                                                            5,
                                                                            sizeof(jump_t_203500),
                                                                            &jump_t_203500));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_221521,
                                                                            6,
                                                                            sizeof(partition_sizze_203577),
                                                                            &partition_sizze_203577));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_221521,
                                                                            7,
                                                                            sizeof(l_n_m_203643),
                                                                            &l_n_m_203643));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_221521,
                                                                            8,
                                                                            sizeof(i_203670),
                                                                            &i_203670));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_221521,
                                                                            9,
                                                                            sizeof(num_groups_221514),
                                                                            &num_groups_221514));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_221521,
                                                                            10,
                                                                            sizeof(ctx_param_ext_229488),
                                                                            &ctx_param_ext_229488));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_221521,
                                                                            11,
                                                                            sizeof(ctx_param_ext_229489),
                                                                            &ctx_param_ext_229489));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_221521,
                                                                            12,
                                                                            sizeof(ctx_param_ext_229491),
                                                                            &ctx_param_ext_229491));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_221521,
                                                                            13,
                                                                            sizeof(segment_sizze_nonzzero_235161),
                                                                            &segment_sizze_nonzzero_235161));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_221521,
                                                                            14,
                                                                            sizeof(ext_mem_229411.mem),
                                                                            &ext_mem_229411.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_221521,
                                                                            15,
                                                                            sizeof(ext_mem_229412.mem),
                                                                            &ext_mem_229412.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_221521,
                                                                            16,
                                                                            sizeof(mem_param_229493.mem),
                                                                            &mem_param_229493.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_221521,
                                                                            17,
                                                                            sizeof(mem_230551.mem),
                                                                            &mem_230551.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_221521,
                                                                            18,
                                                                            sizeof(mem_230804.mem),
                                                                            &mem_230804.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_221521,
                                                                            19,
                                                                            sizeof(mem_230808.mem),
                                                                            &mem_230808.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_221521,
                                                                            20,
                                                                            sizeof(mem_230812.mem),
                                                                            &mem_230812.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_221521,
                                                                            21,
                                                                            sizeof(mem_230816.mem),
                                                                            &mem_230816.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_221521,
                                                                            22,
                                                                            sizeof(mem_230820.mem),
                                                                            &mem_230820.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_221521,
                                                                            23,
                                                                            sizeof(mem_230825.mem),
                                                                            &mem_230825.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_221521,
                                                                            24,
                                                                            sizeof(mem_230829.mem),
                                                                            &mem_230829.mem));
                                    if (1 * ((size_t) num_groups_221514 *
                                             (size_t) segred_group_sizze_221513) !=
                                        0) {
                                        const size_t global_work_sizze_237292[1]
                                                     =
                                                     {(size_t) num_groups_221514 *
                                                     (size_t) segred_group_sizze_221513};
                                        const size_t local_work_sizze_237296[1]
                                                     =
                                                     {(size_t) segred_group_sizze_221513};
                                        int64_t time_start_237293 = 0,
                                                time_end_237294 = 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_221521",
                                                    global_work_sizze_237292[0],
                                                    local_work_sizze_237296[0],
                                                    (int) (0 + (int64_t) 8 *
                                                           segred_group_sizze_221513 +
                                                           (int64_t) 8 *
                                                           segred_group_sizze_221513));
                                            time_start_237293 = get_wall_time();
                                        }
                                        OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                                        ctx->mainzisegred_small_221521,
                                                                                        1,
                                                                                        NULL,
                                                                                        global_work_sizze_237292,
                                                                                        local_work_sizze_237296,
                                                                                        0,
                                                                                        NULL,
                                                                                        ctx->profiling_paused ||
                                                                                        !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                                  &ctx->mainzisegred_small_221521_runs,
                                                                                                                                  &ctx->mainzisegred_small_221521_total_runtime)));
                                        if (ctx->debugging) {
                                            OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                            time_end_237294 = get_wall_time();
                                            
                                            long time_diff_237295 =
                                                 time_end_237294 -
                                                 time_start_237293;
                                            
                                            fprintf(ctx->log,
                                                    "kernel %s runtime: %ldus\n",
                                                    "main.segred_small_221521",
                                                    time_diff_237295);
                                        }
                                    }
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s\n", "");
                                } else {
                                    int64_t groups_per_segment_235196 =
                                            sdiv_up64(num_groups_221514,
                                                      smax64((int64_t) 1,
                                                             partition_sizze_203577 *
                                                             l_n_m_203643));
                                    int64_t elements_per_thread_235197 =
                                            sdiv_up64(q_l_203495,
                                                      segred_group_sizze_221513 *
                                                      groups_per_segment_235196);
                                    int64_t virt_num_groups_235198 =
                                            groups_per_segment_235196 *
                                            (partition_sizze_203577 *
                                             l_n_m_203643);
                                    int64_t num_threads_235199 =
                                            num_groups_221514 *
                                            segred_group_sizze_221513;
                                    int64_t threads_per_segment_235200 =
                                            groups_per_segment_235196 *
                                            segred_group_sizze_221513;
                                    
                                    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_203577 *
                                                             l_n_m_203643),
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "segment_size",
                                                (long long) q_l_203495, '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "virt_num_groups",
                                                (long long) virt_num_groups_235198,
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "num_groups",
                                                (long long) num_groups_221514,
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "group_size",
                                                (long long) segred_group_sizze_221513,
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "elems_per_thread",
                                                (long long) elements_per_thread_235197,
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "groups_per_segment",
                                                (long long) groups_per_segment_235196,
                                                '\n');
                                    
                                    struct memblock_device
                                    segred_tmp_mem_235201;
                                    
                                    segred_tmp_mem_235201.references = NULL;
                                    if (memblock_alloc_device(ctx,
                                                              &segred_tmp_mem_235201,
                                                              (int64_t) 8 *
                                                              virt_num_groups_235198,
                                                              "segred_tmp_mem_235201")) {
                                        err = 1;
                                        goto cleanup;
                                    }
                                    
                                    struct memblock_device
                                    segred_tmp_mem_235203;
                                    
                                    segred_tmp_mem_235203.references = NULL;
                                    if (memblock_alloc_device(ctx,
                                                              &segred_tmp_mem_235203,
                                                              (int64_t) 8 *
                                                              virt_num_groups_235198,
                                                              "segred_tmp_mem_235203")) {
                                        err = 1;
                                        goto cleanup;
                                    }
                                    
                                    struct memblock_device
                                    mainzicounter_mem_235205 =
                                    ctx->mainzicounter_mem_235205;
                                    
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_221521,
                                                                            1,
                                                                            (size_t) 1,
                                                                            NULL));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_221521,
                                                                            2,
                                                                            (size_t) ((int64_t) 8 *
                                                                                      segred_group_sizze_221513),
                                                                            NULL));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_221521,
                                                                            3,
                                                                            (size_t) ((int64_t) 8 *
                                                                                      segred_group_sizze_221513),
                                                                            NULL));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_221521,
                                                                            4,
                                                                            sizeof(n_203490),
                                                                            &n_203490));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_221521,
                                                                            5,
                                                                            sizeof(q_l_203495),
                                                                            &q_l_203495));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_221521,
                                                                            6,
                                                                            sizeof(jump_t_203500),
                                                                            &jump_t_203500));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_221521,
                                                                            7,
                                                                            sizeof(partition_sizze_203577),
                                                                            &partition_sizze_203577));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_221521,
                                                                            8,
                                                                            sizeof(l_n_m_203643),
                                                                            &l_n_m_203643));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_221521,
                                                                            9,
                                                                            sizeof(i_203670),
                                                                            &i_203670));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_221521,
                                                                            10,
                                                                            sizeof(num_groups_221514),
                                                                            &num_groups_221514));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_221521,
                                                                            11,
                                                                            sizeof(ctx_param_ext_229488),
                                                                            &ctx_param_ext_229488));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_221521,
                                                                            12,
                                                                            sizeof(ctx_param_ext_229489),
                                                                            &ctx_param_ext_229489));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_221521,
                                                                            13,
                                                                            sizeof(ctx_param_ext_229491),
                                                                            &ctx_param_ext_229491));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_221521,
                                                                            14,
                                                                            sizeof(groups_per_segment_235196),
                                                                            &groups_per_segment_235196));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_221521,
                                                                            15,
                                                                            sizeof(elements_per_thread_235197),
                                                                            &elements_per_thread_235197));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_221521,
                                                                            16,
                                                                            sizeof(virt_num_groups_235198),
                                                                            &virt_num_groups_235198));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_221521,
                                                                            17,
                                                                            sizeof(threads_per_segment_235200),
                                                                            &threads_per_segment_235200));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_221521,
                                                                            18,
                                                                            sizeof(ext_mem_229411.mem),
                                                                            &ext_mem_229411.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_221521,
                                                                            19,
                                                                            sizeof(ext_mem_229412.mem),
                                                                            &ext_mem_229412.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_221521,
                                                                            20,
                                                                            sizeof(mem_param_229493.mem),
                                                                            &mem_param_229493.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_221521,
                                                                            21,
                                                                            sizeof(mem_230551.mem),
                                                                            &mem_230551.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_221521,
                                                                            22,
                                                                            sizeof(mem_230804.mem),
                                                                            &mem_230804.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_221521,
                                                                            23,
                                                                            sizeof(mem_230808.mem),
                                                                            &mem_230808.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_221521,
                                                                            24,
                                                                            sizeof(mem_230812.mem),
                                                                            &mem_230812.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_221521,
                                                                            25,
                                                                            sizeof(mem_230816.mem),
                                                                            &mem_230816.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_221521,
                                                                            26,
                                                                            sizeof(mem_230820.mem),
                                                                            &mem_230820.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_221521,
                                                                            27,
                                                                            sizeof(mem_230825.mem),
                                                                            &mem_230825.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_221521,
                                                                            28,
                                                                            sizeof(mem_230829.mem),
                                                                            &mem_230829.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_221521,
                                                                            29,
                                                                            sizeof(segred_tmp_mem_235201.mem),
                                                                            &segred_tmp_mem_235201.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_221521,
                                                                            30,
                                                                            sizeof(segred_tmp_mem_235203.mem),
                                                                            &segred_tmp_mem_235203.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_221521,
                                                                            31,
                                                                            sizeof(mainzicounter_mem_235205.mem),
                                                                            &mainzicounter_mem_235205.mem));
                                    if (1 * ((size_t) num_groups_221514 *
                                             (size_t) segred_group_sizze_221513) !=
                                        0) {
                                        const size_t global_work_sizze_237298[1]
                                                     =
                                                     {(size_t) num_groups_221514 *
                                                     (size_t) segred_group_sizze_221513};
                                        const size_t local_work_sizze_237302[1]
                                                     =
                                                     {(size_t) segred_group_sizze_221513};
                                        int64_t time_start_237299 = 0,
                                                time_end_237300 = 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_221521",
                                                    global_work_sizze_237298[0],
                                                    local_work_sizze_237302[0],
                                                    (int) (0 + 1 + (int64_t) 8 *
                                                           segred_group_sizze_221513 +
                                                           (int64_t) 8 *
                                                           segred_group_sizze_221513));
                                            time_start_237299 = get_wall_time();
                                        }
                                        OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                                        ctx->mainzisegred_large_221521,
                                                                                        1,
                                                                                        NULL,
                                                                                        global_work_sizze_237298,
                                                                                        local_work_sizze_237302,
                                                                                        0,
                                                                                        NULL,
                                                                                        ctx->profiling_paused ||
                                                                                        !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                                  &ctx->mainzisegred_large_221521_runs,
                                                                                                                                  &ctx->mainzisegred_large_221521_total_runtime)));
                                        if (ctx->debugging) {
                                            OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                            time_end_237300 = get_wall_time();
                                            
                                            long time_diff_237301 =
                                                 time_end_237300 -
                                                 time_start_237299;
                                            
                                            fprintf(ctx->log,
                                                    "kernel %s runtime: %ldus\n",
                                                    "main.segred_large_221521",
                                                    time_diff_237301);
                                        }
                                    }
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s\n", "");
                                    if (memblock_unref_device(ctx,
                                                              &segred_tmp_mem_235203,
                                                              "segred_tmp_mem_235203") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &segred_tmp_mem_235201,
                                                              "segred_tmp_mem_235201") !=
                                        0)
                                        return 1;
                                }
                                if (memblock_unref_device(ctx, &mem_230804,
                                                          "mem_230804") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230808,
                                                          "mem_230808") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230812,
                                                          "mem_230812") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230816,
                                                          "mem_230816") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230820,
                                                          "mem_230820") != 0)
                                    return 1;
                                if (memblock_set_device(ctx, &ext_mem_230831,
                                                        &mem_230825,
                                                        "mem_230825") != 0)
                                    return 1;
                                if (memblock_set_device(ctx, &ext_mem_230830,
                                                        &mem_230829,
                                                        "mem_230829") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230829,
                                                          "mem_230829") != 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, &mem_230816,
                                                          "mem_230816") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230812,
                                                          "mem_230812") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230808,
                                                          "mem_230808") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230804,
                                                          "mem_230804") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230799,
                                                          "mem_230799") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230795,
                                                          "mem_230795") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230791,
                                                          "mem_230791") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230787,
                                                          "mem_230787") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230783,
                                                          "mem_230783") != 0)
                                    return 1;
                            }
                            if (memblock_set_device(ctx, &ext_mem_230843,
                                                    &ext_mem_230831,
                                                    "ext_mem_230831") != 0)
                                return 1;
                            if (memblock_set_device(ctx, &ext_mem_230842,
                                                    &ext_mem_230830,
                                                    "ext_mem_230830") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230830,
                                                      "ext_mem_230830") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230831,
                                                      "ext_mem_230831") != 0)
                                return 1;
                        }
                        if (memblock_set_device(ctx, &ext_mem_230845,
                                                &ext_mem_230843,
                                                "ext_mem_230843") != 0)
                            return 1;
                        if (memblock_set_device(ctx, &ext_mem_230844,
                                                &ext_mem_230842,
                                                "ext_mem_230842") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_230842,
                                                  "ext_mem_230842") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_230843,
                                                  "ext_mem_230843") != 0)
                            return 1;
                    }
                    if (memblock_set_device(ctx, &ext_mem_230847,
                                            &ext_mem_230845,
                                            "ext_mem_230845") != 0)
                        return 1;
                    if (memblock_set_device(ctx, &ext_mem_230846,
                                            &ext_mem_230844,
                                            "ext_mem_230844") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_230844,
                                              "ext_mem_230844") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_230845,
                                              "ext_mem_230845") != 0)
                        return 1;
                }
                if (memblock_set_device(ctx, &ext_mem_230908, &ext_mem_230847,
                                        "ext_mem_230847") != 0)
                    return 1;
                if (memblock_set_device(ctx, &ext_mem_230907, &ext_mem_230846,
                                        "ext_mem_230846") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_230846,
                                          "ext_mem_230846") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_230847,
                                          "ext_mem_230847") != 0)
                    return 1;
            } else {
                bool match_lit_205484 = (int64_t) 0 == d_l_203498;
                int64_t binop_y_230854 = (int64_t) 8 * q_l_203495;
                int64_t bytes_230855 = smax64((int64_t) 0, binop_y_230854);
                struct memblock_device ext_mem_230906;
                
                ext_mem_230906.references = NULL;
                
                struct memblock_device ext_mem_230905;
                
                ext_mem_230905.references = NULL;
                if (match_lit_205484) {
                    struct memblock_device mem_230851;
                    
                    mem_230851.references = NULL;
                    if (memblock_alloc_device(ctx, &mem_230851, bytes_229378,
                                              "mem_230851")) {
                        err = 1;
                        goto cleanup;
                    }
                    if (futrts_builtinzhreplicate_f64(ctx, mem_230851,
                                                      partition_sizze_203577 *
                                                      l_n_m_203643, 0.0) != 0) {
                        if (memblock_unref_device(ctx, &mem_230851,
                                                  "mem_230851") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_230905,
                                                  "ext_mem_230905") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_230906,
                                                  "ext_mem_230906") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_230907,
                                                  "ext_mem_230907") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_230908,
                                                  "ext_mem_230908") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_230546,
                                                  "ext_mem_230546") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_230529,
                                                  "ext_mem_230529") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_230512,
                                                  "ext_mem_230512") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_230494,
                                                  "ext_mem_230494") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_230486,
                                                  "ext_mem_230486") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_230487,
                                                  "ext_mem_230487") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_param_229515,
                                                  "mem_param_229515") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_param_229507,
                                                  "mem_param_229507") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_231517,
                                                  "ext_mem_231517") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_231518,
                                                  "ext_mem_231518") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_param_229493,
                                                  "mem_param_229493") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_param_229485,
                                                  "mem_param_229485") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_param_229477,
                                                  "mem_param_229477") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_231860,
                                                  "ext_mem_231860") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_231861,
                                                  "ext_mem_231861") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_231862,
                                                  "ext_mem_231862") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_230551,
                                                  "mem_230551") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_230534,
                                                  "mem_230534") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_230517,
                                                  "mem_230517") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_230500,
                                                  "mem_230500") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229531,
                                                  "mem_229531") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229526,
                                                  "mem_229526") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229520,
                                                  "mem_229520") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229469,
                                                  "mem_229469") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229465,
                                                  "mem_229465") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_229460,
                                                  "ext_mem_229460") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_229461,
                                                  "ext_mem_229461") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_229411,
                                                  "ext_mem_229411") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_229412,
                                                  "ext_mem_229412") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_229362,
                                                  "ext_mem_229362") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_229363,
                                                  "ext_mem_229363") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_229264,
                                                  "ext_mem_229264") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_229265,
                                                  "ext_mem_229265") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229206,
                                                  "mem_229206") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229200,
                                                  "mem_229200") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_229196,
                                                  "ext_mem_229196") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_229197,
                                                  "ext_mem_229197") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229164,
                                                  "mem_229164") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229161,
                                                  "mem_229161") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229157,
                                                  "mem_229157") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229155,
                                                  "mem_229155") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229152,
                                                  "mem_229152") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229148,
                                                  "mem_229148") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_out_232249,
                                                  "mem_out_232249") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_out_232248,
                                                  "mem_out_232248") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_out_232247,
                                                  "mem_out_232247") != 0)
                            return 1;
                        err = 1;
                        goto cleanup;
                    }
                    
                    struct memblock_device mem_230861;
                    
                    mem_230861.references = NULL;
                    if (memblock_alloc_device(ctx, &mem_230861, bytes_229378,
                                              "mem_230861")) {
                        err = 1;
                        goto cleanup;
                    }
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s\n", "\n# SegMap");
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_221669,
                                                            1,
                                                            (size_t) ((int64_t) 8 *
                                                                      q_l_203495),
                                                            NULL));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_221669,
                                                            2,
                                                            (size_t) ((int64_t) 8 *
                                                                      q_l_203495),
                                                            NULL));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_221669,
                                                            3,
                                                            (size_t) bytes_230855,
                                                            NULL));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_221669,
                                                            4, sizeof(n_203490),
                                                            &n_203490));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_221669,
                                                            5,
                                                            sizeof(q_l_203495),
                                                            &q_l_203495));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_221669,
                                                            6,
                                                            sizeof(jump_t_203500),
                                                            &jump_t_203500));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_221669,
                                                            7,
                                                            sizeof(partition_sizze_203577),
                                                            &partition_sizze_203577));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_221669,
                                                            8,
                                                            sizeof(l_n_m_203643),
                                                            &l_n_m_203643));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_221669,
                                                            9, sizeof(i_203670),
                                                            &i_203670));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_221669,
                                                            10,
                                                            sizeof(ctx_param_ext_229488),
                                                            &ctx_param_ext_229488));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_221669,
                                                            11,
                                                            sizeof(ctx_param_ext_229489),
                                                            &ctx_param_ext_229489));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_221669,
                                                            12,
                                                            sizeof(ctx_param_ext_229491),
                                                            &ctx_param_ext_229491));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_221669,
                                                            13,
                                                            sizeof(ext_mem_229411.mem),
                                                            &ext_mem_229411.mem));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_221669,
                                                            14,
                                                            sizeof(ext_mem_229412.mem),
                                                            &ext_mem_229412.mem));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_221669,
                                                            15,
                                                            sizeof(mem_param_229493.mem),
                                                            &mem_param_229493.mem));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_221669,
                                                            16,
                                                            sizeof(mem_230551.mem),
                                                            &mem_230551.mem));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_221669,
                                                            17,
                                                            sizeof(mem_230861.mem),
                                                            &mem_230861.mem));
                    if (1 * ((size_t) nest_sizze_209492 *
                             (size_t) q_l_203495) != 0) {
                        const size_t global_work_sizze_237303[1] =
                                     {(size_t) nest_sizze_209492 *
                                     (size_t) q_l_203495};
                        const size_t local_work_sizze_237307[1] =
                                     {(size_t) q_l_203495};
                        int64_t time_start_237304 = 0, time_end_237305 = 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_221669",
                                    global_work_sizze_237303[0],
                                    local_work_sizze_237307[0], (int) (0 +
                                                                       (int64_t) 8 *
                                                                       q_l_203495 +
                                                                       (int64_t) 8 *
                                                                       q_l_203495 +
                                                                       bytes_230855));
                            time_start_237304 = get_wall_time();
                        }
                        OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                        ctx->mainzisegmap_intragroup_221669,
                                                                        1, NULL,
                                                                        global_work_sizze_237303,
                                                                        local_work_sizze_237307,
                                                                        0, NULL,
                                                                        ctx->profiling_paused ||
                                                                        !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                  &ctx->mainzisegmap_intragroup_221669_runs,
                                                                                                                  &ctx->mainzisegmap_intragroup_221669_total_runtime)));
                        if (ctx->debugging) {
                            OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                            time_end_237305 = get_wall_time();
                            
                            long time_diff_237306 = time_end_237305 -
                                 time_start_237304;
                            
                            fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                                    "main.segmap_intragroup_221669",
                                    time_diff_237306);
                        }
                    }
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s\n", "");
                    if (memblock_set_device(ctx, &ext_mem_230906, &mem_230861,
                                            "mem_230861") != 0)
                        return 1;
                    if (memblock_set_device(ctx, &ext_mem_230905, &mem_230851,
                                            "mem_230851") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_230861, "mem_230861") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_230851, "mem_230851") !=
                        0)
                        return 1;
                } else {
                    bool match_lit_205539 = (int64_t) 1 == d_l_203498;
                    struct memblock_device ext_mem_230904;
                    
                    ext_mem_230904.references = NULL;
                    
                    struct memblock_device ext_mem_230903;
                    
                    ext_mem_230903.references = NULL;
                    if (match_lit_205539) {
                        struct memblock_device mem_230874;
                        
                        mem_230874.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_230874,
                                                  bytes_229378, "mem_230874")) {
                            err = 1;
                            goto cleanup;
                        }
                        
                        struct memblock_device mem_230878;
                        
                        mem_230878.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_230878,
                                                  bytes_229378, "mem_230878")) {
                            err = 1;
                            goto cleanup;
                        }
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s\n", "\n# SegMap");
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_221836,
                                                                1,
                                                                (size_t) ((int64_t) 8 *
                                                                          q_l_203495),
                                                                NULL));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_221836,
                                                                2,
                                                                (size_t) ((int64_t) 8 *
                                                                          q_l_203495),
                                                                NULL));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_221836,
                                                                3,
                                                                (size_t) ((int64_t) 8 *
                                                                          q_l_203495),
                                                                NULL));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_221836,
                                                                4,
                                                                (size_t) ((int64_t) 8 *
                                                                          q_l_203495),
                                                                NULL));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_221836,
                                                                5,
                                                                (size_t) ((int64_t) 8 *
                                                                          q_l_203495),
                                                                NULL));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_221836,
                                                                6,
                                                                (size_t) bytes_230855,
                                                                NULL));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_221836,
                                                                7,
                                                                (size_t) bytes_230855,
                                                                NULL));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_221836,
                                                                8,
                                                                sizeof(n_203490),
                                                                &n_203490));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_221836,
                                                                9,
                                                                sizeof(q_l_203495),
                                                                &q_l_203495));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_221836,
                                                                10,
                                                                sizeof(jump_t_203500),
                                                                &jump_t_203500));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_221836,
                                                                11,
                                                                sizeof(partition_sizze_203577),
                                                                &partition_sizze_203577));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_221836,
                                                                12,
                                                                sizeof(l_n_m_203643),
                                                                &l_n_m_203643));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_221836,
                                                                13,
                                                                sizeof(i_203670),
                                                                &i_203670));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_221836,
                                                                14,
                                                                sizeof(ctx_param_ext_229488),
                                                                &ctx_param_ext_229488));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_221836,
                                                                15,
                                                                sizeof(ctx_param_ext_229489),
                                                                &ctx_param_ext_229489));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_221836,
                                                                16,
                                                                sizeof(ctx_param_ext_229491),
                                                                &ctx_param_ext_229491));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_221836,
                                                                17,
                                                                sizeof(ext_mem_229411.mem),
                                                                &ext_mem_229411.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_221836,
                                                                18,
                                                                sizeof(ext_mem_229412.mem),
                                                                &ext_mem_229412.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_221836,
                                                                19,
                                                                sizeof(mem_param_229493.mem),
                                                                &mem_param_229493.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_221836,
                                                                20,
                                                                sizeof(mem_230551.mem),
                                                                &mem_230551.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_221836,
                                                                21,
                                                                sizeof(mem_230874.mem),
                                                                &mem_230874.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_221836,
                                                                22,
                                                                sizeof(mem_230878.mem),
                                                                &mem_230878.mem));
                        if (1 * ((size_t) nest_sizze_209492 *
                                 (size_t) q_l_203495) != 0) {
                            const size_t global_work_sizze_237308[1] =
                                         {(size_t) nest_sizze_209492 *
                                         (size_t) q_l_203495};
                            const size_t local_work_sizze_237312[1] =
                                         {(size_t) q_l_203495};
                            int64_t time_start_237309 = 0, time_end_237310 = 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_221836",
                                        global_work_sizze_237308[0],
                                        local_work_sizze_237312[0], (int) (0 +
                                                                           (int64_t) 8 *
                                                                           q_l_203495 +
                                                                           (int64_t) 8 *
                                                                           q_l_203495 +
                                                                           (int64_t) 8 *
                                                                           q_l_203495 +
                                                                           (int64_t) 8 *
                                                                           q_l_203495 +
                                                                           (int64_t) 8 *
                                                                           q_l_203495 +
                                                                           bytes_230855 +
                                                                           bytes_230855));
                                time_start_237309 = get_wall_time();
                            }
                            OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                            ctx->mainzisegmap_intragroup_221836,
                                                                            1,
                                                                            NULL,
                                                                            global_work_sizze_237308,
                                                                            local_work_sizze_237312,
                                                                            0,
                                                                            NULL,
                                                                            ctx->profiling_paused ||
                                                                            !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                      &ctx->mainzisegmap_intragroup_221836_runs,
                                                                                                                      &ctx->mainzisegmap_intragroup_221836_total_runtime)));
                            if (ctx->debugging) {
                                OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                time_end_237310 = get_wall_time();
                                
                                long time_diff_237311 = time_end_237310 -
                                     time_start_237309;
                                
                                fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                                        "main.segmap_intragroup_221836",
                                        time_diff_237311);
                            }
                        }
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s\n", "");
                        if (memblock_set_device(ctx, &ext_mem_230904,
                                                &mem_230874, "mem_230874") != 0)
                            return 1;
                        if (memblock_set_device(ctx, &ext_mem_230903,
                                                &mem_230878, "mem_230878") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_230878,
                                                  "mem_230878") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_230874,
                                                  "mem_230874") != 0)
                            return 1;
                    } else {
                        struct memblock_device mem_230898;
                        
                        mem_230898.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_230898,
                                                  bytes_229378, "mem_230898")) {
                            err = 1;
                            goto cleanup;
                        }
                        
                        struct memblock_device mem_230902;
                        
                        mem_230902.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_230902,
                                                  bytes_229378, "mem_230902")) {
                            err = 1;
                            goto cleanup;
                        }
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s\n", "\n# SegMap");
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_222093,
                                                                1,
                                                                (size_t) ((int64_t) 8 *
                                                                          q_l_203495),
                                                                NULL));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_222093,
                                                                2,
                                                                (size_t) ((int64_t) 8 *
                                                                          q_l_203495),
                                                                NULL));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_222093,
                                                                3,
                                                                (size_t) ((int64_t) 8 *
                                                                          q_l_203495),
                                                                NULL));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_222093,
                                                                4,
                                                                (size_t) ((int64_t) 8 *
                                                                          q_l_203495),
                                                                NULL));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_222093,
                                                                5,
                                                                (size_t) ((int64_t) 8 *
                                                                          q_l_203495),
                                                                NULL));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_222093,
                                                                6,
                                                                (size_t) ((int64_t) 8 *
                                                                          q_l_203495),
                                                                NULL));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_222093,
                                                                7,
                                                                (size_t) ((int64_t) 8 *
                                                                          q_l_203495),
                                                                NULL));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_222093,
                                                                8,
                                                                (size_t) bytes_230855,
                                                                NULL));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_222093,
                                                                9,
                                                                (size_t) bytes_230855,
                                                                NULL));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_222093,
                                                                10,
                                                                (size_t) bytes_230855,
                                                                NULL));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_222093,
                                                                11,
                                                                (size_t) bytes_230855,
                                                                NULL));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_222093,
                                                                12,
                                                                sizeof(n_203490),
                                                                &n_203490));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_222093,
                                                                13,
                                                                sizeof(q_l_203495),
                                                                &q_l_203495));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_222093,
                                                                14,
                                                                sizeof(jump_t_203500),
                                                                &jump_t_203500));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_222093,
                                                                15,
                                                                sizeof(partition_sizze_203577),
                                                                &partition_sizze_203577));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_222093,
                                                                16,
                                                                sizeof(l_n_m_203643),
                                                                &l_n_m_203643));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_222093,
                                                                17,
                                                                sizeof(i_203670),
                                                                &i_203670));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_222093,
                                                                18,
                                                                sizeof(ctx_param_ext_229488),
                                                                &ctx_param_ext_229488));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_222093,
                                                                19,
                                                                sizeof(ctx_param_ext_229489),
                                                                &ctx_param_ext_229489));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_222093,
                                                                20,
                                                                sizeof(ctx_param_ext_229491),
                                                                &ctx_param_ext_229491));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_222093,
                                                                21,
                                                                sizeof(ext_mem_229411.mem),
                                                                &ext_mem_229411.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_222093,
                                                                22,
                                                                sizeof(ext_mem_229412.mem),
                                                                &ext_mem_229412.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_222093,
                                                                23,
                                                                sizeof(mem_param_229493.mem),
                                                                &mem_param_229493.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_222093,
                                                                24,
                                                                sizeof(mem_230551.mem),
                                                                &mem_230551.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_222093,
                                                                25,
                                                                sizeof(mem_230898.mem),
                                                                &mem_230898.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_222093,
                                                                26,
                                                                sizeof(mem_230902.mem),
                                                                &mem_230902.mem));
                        if (1 * ((size_t) nest_sizze_209492 *
                                 (size_t) q_l_203495) != 0) {
                            const size_t global_work_sizze_237313[1] =
                                         {(size_t) nest_sizze_209492 *
                                         (size_t) q_l_203495};
                            const size_t local_work_sizze_237317[1] =
                                         {(size_t) q_l_203495};
                            int64_t time_start_237314 = 0, time_end_237315 = 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_222093",
                                        global_work_sizze_237313[0],
                                        local_work_sizze_237317[0], (int) (0 +
                                                                           (int64_t) 8 *
                                                                           q_l_203495 +
                                                                           (int64_t) 8 *
                                                                           q_l_203495 +
                                                                           (int64_t) 8 *
                                                                           q_l_203495 +
                                                                           (int64_t) 8 *
                                                                           q_l_203495 +
                                                                           (int64_t) 8 *
                                                                           q_l_203495 +
                                                                           (int64_t) 8 *
                                                                           q_l_203495 +
                                                                           (int64_t) 8 *
                                                                           q_l_203495 +
                                                                           bytes_230855 +
                                                                           bytes_230855 +
                                                                           bytes_230855 +
                                                                           bytes_230855));
                                time_start_237314 = get_wall_time();
                            }
                            OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                            ctx->mainzisegmap_intragroup_222093,
                                                                            1,
                                                                            NULL,
                                                                            global_work_sizze_237313,
                                                                            local_work_sizze_237317,
                                                                            0,
                                                                            NULL,
                                                                            ctx->profiling_paused ||
                                                                            !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                      &ctx->mainzisegmap_intragroup_222093_runs,
                                                                                                                      &ctx->mainzisegmap_intragroup_222093_total_runtime)));
                            if (ctx->debugging) {
                                OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                time_end_237315 = get_wall_time();
                                
                                long time_diff_237316 = time_end_237315 -
                                     time_start_237314;
                                
                                fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                                        "main.segmap_intragroup_222093",
                                        time_diff_237316);
                            }
                        }
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s\n", "");
                        if (memblock_set_device(ctx, &ext_mem_230904,
                                                &mem_230898, "mem_230898") != 0)
                            return 1;
                        if (memblock_set_device(ctx, &ext_mem_230903,
                                                &mem_230902, "mem_230902") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_230902,
                                                  "mem_230902") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_230898,
                                                  "mem_230898") != 0)
                            return 1;
                    }
                    if (memblock_set_device(ctx, &ext_mem_230906,
                                            &ext_mem_230904,
                                            "ext_mem_230904") != 0)
                        return 1;
                    if (memblock_set_device(ctx, &ext_mem_230905,
                                            &ext_mem_230903,
                                            "ext_mem_230903") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_230903,
                                              "ext_mem_230903") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_230904,
                                              "ext_mem_230904") != 0)
                        return 1;
                }
                if (memblock_set_device(ctx, &ext_mem_230908, &ext_mem_230906,
                                        "ext_mem_230906") != 0)
                    return 1;
                if (memblock_set_device(ctx, &ext_mem_230907, &ext_mem_230905,
                                        "ext_mem_230905") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_230905,
                                          "ext_mem_230905") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_230906,
                                          "ext_mem_230906") != 0)
                    return 1;
            }
            
            struct memblock_device ext_mem_230914;
            
            ext_mem_230914.references = NULL;
            if (cond_204107) {
                bool zzero_205783 = jump_l_203501 == (int64_t) 0;
                bool nonzzero_205784 = !zzero_205783;
                bool nonzzero_cert_205785;
                
                if (!nonzzero_205784) {
                    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_230914,
                                              "ext_mem_230914") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_230907,
                                              "ext_mem_230907") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_230908,
                                              "ext_mem_230908") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_230546,
                                              "ext_mem_230546") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_230529,
                                              "ext_mem_230529") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_230512,
                                              "ext_mem_230512") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_230494,
                                              "ext_mem_230494") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_230486,
                                              "ext_mem_230486") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_230487,
                                              "ext_mem_230487") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_229515,
                                              "mem_param_229515") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_229507,
                                              "mem_param_229507") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231517,
                                              "ext_mem_231517") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231518,
                                              "ext_mem_231518") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_229493,
                                              "mem_param_229493") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_229485,
                                              "mem_param_229485") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_229477,
                                              "mem_param_229477") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231860,
                                              "ext_mem_231860") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231861,
                                              "ext_mem_231861") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231862,
                                              "ext_mem_231862") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_230551, "mem_230551") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_230534, "mem_230534") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_230517, "mem_230517") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_230500, "mem_230500") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229531, "mem_229531") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229526, "mem_229526") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229520, "mem_229520") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229469, "mem_229469") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229465, "mem_229465") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229460,
                                              "ext_mem_229460") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229461,
                                              "ext_mem_229461") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229411,
                                              "ext_mem_229411") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229412,
                                              "ext_mem_229412") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229362,
                                              "ext_mem_229362") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229363,
                                              "ext_mem_229363") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229264,
                                              "ext_mem_229264") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229265,
                                              "ext_mem_229265") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229206, "mem_229206") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229200, "mem_229200") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229196,
                                              "ext_mem_229196") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229197,
                                              "ext_mem_229197") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229164, "mem_229164") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229161, "mem_229161") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229157, "mem_229157") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229155, "mem_229155") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229152, "mem_229152") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229148, "mem_229148") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_out_232249,
                                              "mem_out_232249") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_out_232248,
                                              "mem_out_232248") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_out_232247,
                                              "mem_out_232247") != 0)
                        return 1;
                    err = 1;
                    goto cleanup;
                }
                
                int64_t y_205786 = sub64(l_n_m_203643, (int64_t) 1);
                int64_t segmap_group_sizze_222344;
                
                segmap_group_sizze_222344 =
                    *ctx->tuning_params.mainzisegmap_group_sizze_222226;
                
                int64_t segmap_usable_groups_222345 =
                        sdiv_up64(nest_sizze_207000, segmap_group_sizze_222344);
                struct memblock_device mem_230913;
                
                mem_230913.references = NULL;
                if (memblock_alloc_device(ctx, &mem_230913, bytes_229177,
                                          "mem_230913")) {
                    err = 1;
                    goto cleanup;
                }
                if (ctx->debugging)
                    fprintf(ctx->log, "%s\n", "\n# SegMap");
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_222349,
                                                        1,
                                                        sizeof(ctx->failure_is_an_option),
                                                        &ctx->failure_is_an_option));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_222349,
                                                        3, sizeof(n_203490),
                                                        &n_203490));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_222349,
                                                        4,
                                                        sizeof(jump_l_203501),
                                                        &jump_l_203501));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_222349,
                                                        5,
                                                        sizeof(partition_sizze_203577),
                                                        &partition_sizze_203577));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_222349,
                                                        6, sizeof(l_n_m_203643),
                                                        &l_n_m_203643));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_222349,
                                                        7, sizeof(i_203670),
                                                        &i_203670));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_222349,
                                                        8, sizeof(y_205786),
                                                        &y_205786));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_222349,
                                                        9,
                                                        sizeof(ext_mem_230907.mem),
                                                        &ext_mem_230907.mem));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_222349,
                                                        10,
                                                        sizeof(ext_mem_230908.mem),
                                                        &ext_mem_230908.mem));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_222349,
                                                        11,
                                                        sizeof(mem_230913.mem),
                                                        &mem_230913.mem));
                if (1 * ((size_t) segmap_usable_groups_222345 *
                         (size_t) segmap_group_sizze_222344) != 0) {
                    const size_t global_work_sizze_237318[1] =
                                 {(size_t) segmap_usable_groups_222345 *
                                 (size_t) segmap_group_sizze_222344};
                    const size_t local_work_sizze_237322[1] =
                                 {(size_t) segmap_group_sizze_222344};
                    int64_t time_start_237319 = 0, time_end_237320 = 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_222349",
                                global_work_sizze_237318[0],
                                local_work_sizze_237322[0], (int) 0);
                        time_start_237319 = get_wall_time();
                    }
                    OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                    ctx->mainzisegmap_222349,
                                                                    1, NULL,
                                                                    global_work_sizze_237318,
                                                                    local_work_sizze_237322,
                                                                    0, NULL,
                                                                    ctx->profiling_paused ||
                                                                    !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                              &ctx->mainzisegmap_222349_runs,
                                                                                                              &ctx->mainzisegmap_222349_total_runtime)));
                    if (ctx->debugging) {
                        OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                        time_end_237320 = get_wall_time();
                        
                        long time_diff_237321 = time_end_237320 -
                             time_start_237319;
                        
                        fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                                "main.segmap_222349", time_diff_237321);
                    }
                }
                ctx->failure_is_an_option = 1;
                if (ctx->debugging)
                    fprintf(ctx->log, "%s\n", "");
                if (memblock_set_device(ctx, &ext_mem_230914, &mem_230913,
                                        "mem_230913") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_230913, "mem_230913") != 0)
                    return 1;
            } else {
                bool dim_match_205838 = n_203490 == l_n_m_203643;
                bool empty_or_match_cert_205839;
                
                if (!dim_match_205838) {
                    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_203577, ", ",
                                  (long long) l_n_m_203643,
                                  ") cannot match shape of type `[",
                                  (long long) partition_sizze_203577, "][",
                                  (long long) n_203490, "]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_230914,
                                              "ext_mem_230914") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_230907,
                                              "ext_mem_230907") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_230908,
                                              "ext_mem_230908") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_230546,
                                              "ext_mem_230546") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_230529,
                                              "ext_mem_230529") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_230512,
                                              "ext_mem_230512") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_230494,
                                              "ext_mem_230494") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_230486,
                                              "ext_mem_230486") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_230487,
                                              "ext_mem_230487") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_229515,
                                              "mem_param_229515") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_229507,
                                              "mem_param_229507") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231517,
                                              "ext_mem_231517") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231518,
                                              "ext_mem_231518") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_229493,
                                              "mem_param_229493") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_229485,
                                              "mem_param_229485") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_229477,
                                              "mem_param_229477") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231860,
                                              "ext_mem_231860") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231861,
                                              "ext_mem_231861") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231862,
                                              "ext_mem_231862") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_230551, "mem_230551") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_230534, "mem_230534") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_230517, "mem_230517") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_230500, "mem_230500") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229531, "mem_229531") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229526, "mem_229526") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229520, "mem_229520") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229469, "mem_229469") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229465, "mem_229465") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229460,
                                              "ext_mem_229460") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229461,
                                              "ext_mem_229461") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229411,
                                              "ext_mem_229411") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229412,
                                              "ext_mem_229412") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229362,
                                              "ext_mem_229362") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229363,
                                              "ext_mem_229363") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229264,
                                              "ext_mem_229264") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229265,
                                              "ext_mem_229265") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229206, "mem_229206") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229200, "mem_229200") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229196,
                                              "ext_mem_229196") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229197,
                                              "ext_mem_229197") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229164, "mem_229164") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229161, "mem_229161") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229157, "mem_229157") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229155, "mem_229155") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229152, "mem_229152") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229148, "mem_229148") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_out_232249,
                                              "mem_out_232249") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_out_232248,
                                              "mem_out_232248") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_out_232247,
                                              "mem_out_232247") != 0)
                        return 1;
                    err = 1;
                    goto cleanup;
                }
                if (memblock_set_device(ctx, &ext_mem_230914, &ext_mem_230908,
                                        "ext_mem_230908") != 0)
                    return 1;
            }
            if (memblock_unref_device(ctx, &ext_mem_230907, "ext_mem_230907") !=
                0)
                return 1;
            if (memblock_unref_device(ctx, &ext_mem_230908, "ext_mem_230908") !=
                0)
                return 1;
            
            struct memblock_device mem_230920;
            
            mem_230920.references = NULL;
            if (memblock_alloc_device(ctx, &mem_230920, bytes_229177,
                                      "mem_230920")) {
                err = 1;
                goto cleanup;
            }
            if (ctx->debugging)
                fprintf(ctx->log, "%s\n", "\n# SegMap");
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_222444, 1,
                                                    sizeof(n_203490),
                                                    &n_203490));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_222444, 2,
                                                    sizeof(n_p_203492),
                                                    &n_p_203492));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_222444, 3,
                                                    sizeof(partition_sizze_203577),
                                                    &partition_sizze_203577));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_222444, 4,
                                                    sizeof(C_len_203634),
                                                    &C_len_203634));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_222444, 5,
                                                    sizeof(ext_230915),
                                                    &ext_230915));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_222444, 6,
                                                    sizeof(mem_230500.mem),
                                                    &mem_230500.mem));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_222444, 7,
                                                    sizeof(ext_mem_230914.mem),
                                                    &ext_mem_230914.mem));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_222444, 8,
                                                    sizeof(mem_230920.mem),
                                                    &mem_230920.mem));
            if (1 * ((size_t) segmap_usable_groups_222440 *
                     (size_t) segmap_group_sizze_222439) != 0) {
                const size_t global_work_sizze_237323[1] =
                             {(size_t) segmap_usable_groups_222440 *
                             (size_t) segmap_group_sizze_222439};
                const size_t local_work_sizze_237327[1] =
                             {(size_t) segmap_group_sizze_222439};
                int64_t time_start_237324 = 0, time_end_237325 = 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_222444", global_work_sizze_237323[0],
                            local_work_sizze_237327[0], (int) 0);
                    time_start_237324 = get_wall_time();
                }
                OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                ctx->mainzisegmap_222444,
                                                                1, NULL,
                                                                global_work_sizze_237323,
                                                                local_work_sizze_237327,
                                                                0, NULL,
                                                                ctx->profiling_paused ||
                                                                !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                          &ctx->mainzisegmap_222444_runs,
                                                                                                          &ctx->mainzisegmap_222444_total_runtime)));
                if (ctx->debugging) {
                    OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                    time_end_237325 = get_wall_time();
                    
                    long time_diff_237326 = time_end_237325 - time_start_237324;
                    
                    fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                            "main.segmap_222444", time_diff_237326);
                }
            }
            if (ctx->debugging)
                fprintf(ctx->log, "%s\n", "");
            if (memblock_unref_device(ctx, &ext_mem_230914, "ext_mem_230914") !=
                0)
                return 1;
            
            struct memblock_device ext_mem_231505;
            
            ext_mem_231505.references = NULL;
            
            struct memblock_device ext_mem_231504;
            
            ext_mem_231504.references = NULL;
            if (cond_204165) {
                bool match_lit_205851 = (int64_t) 0 == d_t_203497;
                struct memblock_device ext_mem_231402;
                
                ext_mem_231402.references = NULL;
                
                struct memblock_device ext_mem_231401;
                
                ext_mem_231401.references = NULL;
                if (match_lit_205851) {
                    struct memblock_device mem_230924;
                    
                    mem_230924.references = NULL;
                    if (memblock_alloc_device(ctx, &mem_230924, bytes_229427,
                                              "mem_230924")) {
                        err = 1;
                        goto cleanup;
                    }
                    if (futrts_builtinzhreplicate_f64(ctx, mem_230924,
                                                      partition_sizze_203577 *
                                                      t_n_m_203650, 0.0) != 0) {
                        if (memblock_unref_device(ctx, &mem_230924,
                                                  "mem_230924") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_231401,
                                                  "ext_mem_231401") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_231402,
                                                  "ext_mem_231402") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_231504,
                                                  "ext_mem_231504") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_231505,
                                                  "ext_mem_231505") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_230920,
                                                  "mem_230920") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_230914,
                                                  "ext_mem_230914") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_230907,
                                                  "ext_mem_230907") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_230908,
                                                  "ext_mem_230908") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_230546,
                                                  "ext_mem_230546") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_230529,
                                                  "ext_mem_230529") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_230512,
                                                  "ext_mem_230512") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_230494,
                                                  "ext_mem_230494") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_230486,
                                                  "ext_mem_230486") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_230487,
                                                  "ext_mem_230487") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_param_229515,
                                                  "mem_param_229515") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_param_229507,
                                                  "mem_param_229507") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_231517,
                                                  "ext_mem_231517") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_231518,
                                                  "ext_mem_231518") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_param_229493,
                                                  "mem_param_229493") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_param_229485,
                                                  "mem_param_229485") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_param_229477,
                                                  "mem_param_229477") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_231860,
                                                  "ext_mem_231860") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_231861,
                                                  "ext_mem_231861") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_231862,
                                                  "ext_mem_231862") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_230551,
                                                  "mem_230551") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_230534,
                                                  "mem_230534") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_230517,
                                                  "mem_230517") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_230500,
                                                  "mem_230500") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229531,
                                                  "mem_229531") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229526,
                                                  "mem_229526") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229520,
                                                  "mem_229520") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229469,
                                                  "mem_229469") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229465,
                                                  "mem_229465") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_229460,
                                                  "ext_mem_229460") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_229461,
                                                  "ext_mem_229461") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_229411,
                                                  "ext_mem_229411") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_229412,
                                                  "ext_mem_229412") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_229362,
                                                  "ext_mem_229362") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_229363,
                                                  "ext_mem_229363") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_229264,
                                                  "ext_mem_229264") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_229265,
                                                  "ext_mem_229265") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229206,
                                                  "mem_229206") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229200,
                                                  "mem_229200") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_229196,
                                                  "ext_mem_229196") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_229197,
                                                  "ext_mem_229197") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229164,
                                                  "mem_229164") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229161,
                                                  "mem_229161") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229157,
                                                  "mem_229157") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229155,
                                                  "mem_229155") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229152,
                                                  "mem_229152") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229148,
                                                  "mem_229148") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_out_232249,
                                                  "mem_out_232249") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_out_232248,
                                                  "mem_out_232248") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_out_232247,
                                                  "mem_out_232247") != 0)
                            return 1;
                        err = 1;
                        goto cleanup;
                    }
                    
                    bool suff_outer_par_222450;
                    
                    suff_outer_par_222450 =
                        *ctx->tuning_params.mainzisuff_outer_par_28 <=
                        partition_sizze_203577;
                    if (ctx->logging)
                        fprintf(ctx->log, "Compared %s <= %ld: %s.\n",
                                "main.suff_outer_par_28",
                                (long) partition_sizze_203577,
                                suff_outer_par_222450 ? "true" : "false");
                    
                    int64_t segmap_group_sizze_222546;
                    
                    segmap_group_sizze_222546 =
                        *ctx->tuning_params.mainzisegmap_group_sizze_222454;
                    
                    int64_t num_groups_222547;
                    int32_t max_num_groups_235345;
                    
                    max_num_groups_235345 =
                        *ctx->tuning_params.mainzisegmap_num_groups_222456;
                    num_groups_222547 = sext_i64_i32(smax64((int64_t) 1,
                                                            smin64(sdiv_up64(partition_sizze_203577,
                                                                             segmap_group_sizze_222546),
                                                                   sext_i32_i64(max_num_groups_235345))));
                    
                    int64_t segmap_group_sizze_223062;
                    
                    segmap_group_sizze_223062 =
                        *ctx->tuning_params.mainzisegmap_group_sizze_223036;
                    
                    int64_t segmap_group_sizze_223078;
                    
                    segmap_group_sizze_223078 =
                        *ctx->tuning_params.mainzisegmap_group_sizze_222980;
                    
                    int64_t segmap_group_sizze_223103;
                    
                    segmap_group_sizze_223103 =
                        *ctx->tuning_params.mainzisegmap_group_sizze_222643;
                    
                    bool suff_outer_par_223107;
                    
                    suff_outer_par_223107 =
                        *ctx->tuning_params.mainzisuff_outer_par_29 <=
                        nest_sizze_210118;
                    if (ctx->logging)
                        fprintf(ctx->log, "Compared %s <= %ld: %s.\n",
                                "main.suff_outer_par_29",
                                (long) nest_sizze_210118,
                                suff_outer_par_223107 ? "true" : "false");
                    
                    int64_t nest_sizze_223189 = q_t_203494 * nest_sizze_210118;
                    int64_t segred_group_sizze_223190;
                    
                    segred_group_sizze_223190 =
                        *ctx->tuning_params.mainzisegred_group_sizze_222794;
                    
                    int64_t num_groups_223191;
                    int32_t max_num_groups_235346;
                    
                    max_num_groups_235346 =
                        *ctx->tuning_params.mainzisegred_num_groups_222796;
                    num_groups_223191 = sext_i64_i32(smax64((int64_t) 1,
                                                            smin64(sdiv_up64(nest_sizze_223189,
                                                                             segred_group_sizze_223190),
                                                                   sext_i32_i64(max_num_groups_235346))));
                    
                    int64_t segmap_group_sizze_223231;
                    
                    segmap_group_sizze_223231 =
                        *ctx->tuning_params.mainzisegmap_group_sizze_222781;
                    
                    int64_t segred_group_sizze_223242;
                    
                    segred_group_sizze_223242 =
                        *ctx->tuning_params.mainzisegred_group_sizze_222724;
                    
                    int64_t num_groups_223243;
                    int32_t max_num_groups_235347;
                    
                    max_num_groups_235347 =
                        *ctx->tuning_params.mainzisegred_num_groups_222726;
                    num_groups_223243 = sext_i64_i32(smax64((int64_t) 1,
                                                            smin64(sdiv_up64(nest_sizze_223189,
                                                                             segred_group_sizze_223242),
                                                                   sext_i32_i64(max_num_groups_235347))));
                    
                    int64_t maxSubHelper_232039 = umax64(bytes_229169,
                                                         bytes_229420);
                    int64_t num_threads_232182 = segmap_group_sizze_222546 *
                            num_groups_222547;
                    int64_t total_sizze_232183 = maxSubHelper_232039 *
                            num_threads_232182;
                    int64_t total_sizze_232184 = bytes_229169 *
                            num_threads_232182;
                    int64_t total_sizze_232185 = bytes_229169 *
                            num_threads_232182;
                    struct memblock_device ext_mem_231044;
                    
                    ext_mem_231044.references = NULL;
                    
                    int32_t local_memory_capacity_235566;
                    
                    local_memory_capacity_235566 = ctx->opencl.max_local_memory;
                    if ((sle64((int64_t) 0,
                               sext_i32_i64(local_memory_capacity_235566)) &&
                         sle64((int64_t) 0,
                               sext_i32_i64(local_memory_capacity_235566))) &&
                        suff_outer_par_222450) {
                        struct memblock_device mem_230927;
                        
                        mem_230927.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_230927,
                                                  binop_y_229176,
                                                  "mem_230927")) {
                            err = 1;
                            goto cleanup;
                        }
                        if (futrts_builtinzhgpu_map_transpose_f64(ctx,
                                                                  mem_230927,
                                                                  (int64_t) 0,
                                                                  mem_230920,
                                                                  (int64_t) 0,
                                                                  (int64_t) 1,
                                                                  n_203490,
                                                                  partition_sizze_203577) !=
                            0) {
                            if (memblock_unref_device(ctx, &mem_230927,
                                                      "mem_230927") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231044,
                                                      "ext_mem_231044") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230924,
                                                      "mem_230924") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231401,
                                                      "ext_mem_231401") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231402,
                                                      "ext_mem_231402") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231504,
                                                      "ext_mem_231504") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231505,
                                                      "ext_mem_231505") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230920,
                                                      "mem_230920") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230914,
                                                      "ext_mem_230914") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230907,
                                                      "ext_mem_230907") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230908,
                                                      "ext_mem_230908") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230546,
                                                      "ext_mem_230546") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230529,
                                                      "ext_mem_230529") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230512,
                                                      "ext_mem_230512") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230494,
                                                      "ext_mem_230494") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230486,
                                                      "ext_mem_230486") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230487,
                                                      "ext_mem_230487") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229515,
                                                      "mem_param_229515") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229507,
                                                      "mem_param_229507") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231517,
                                                      "ext_mem_231517") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231518,
                                                      "ext_mem_231518") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229493,
                                                      "mem_param_229493") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229485,
                                                      "mem_param_229485") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229477,
                                                      "mem_param_229477") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231860,
                                                      "ext_mem_231860") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231861,
                                                      "ext_mem_231861") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231862,
                                                      "ext_mem_231862") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230551,
                                                      "mem_230551") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230534,
                                                      "mem_230534") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230517,
                                                      "mem_230517") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230500,
                                                      "mem_230500") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229531,
                                                      "mem_229531") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229526,
                                                      "mem_229526") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229520,
                                                      "mem_229520") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229469,
                                                      "mem_229469") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229465,
                                                      "mem_229465") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229460,
                                                      "ext_mem_229460") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229461,
                                                      "ext_mem_229461") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229411,
                                                      "ext_mem_229411") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229412,
                                                      "ext_mem_229412") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229362,
                                                      "ext_mem_229362") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229363,
                                                      "ext_mem_229363") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229264,
                                                      "ext_mem_229264") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229265,
                                                      "ext_mem_229265") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229206,
                                                      "mem_229206") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229200,
                                                      "mem_229200") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229196,
                                                      "ext_mem_229196") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229197,
                                                      "ext_mem_229197") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229164,
                                                      "mem_229164") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229161,
                                                      "mem_229161") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229157,
                                                      "mem_229157") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229155,
                                                      "mem_229155") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229152,
                                                      "mem_229152") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229148,
                                                      "mem_229148") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_out_232249,
                                                      "mem_out_232249") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_out_232248,
                                                      "mem_out_232248") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_out_232247,
                                                      "mem_out_232247") != 0)
                                return 1;
                            err = 1;
                            goto cleanup;
                        }
                        
                        struct memblock_device mem_230930;
                        
                        mem_230930.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_230930,
                                                  binop_y_229176,
                                                  "mem_230930")) {
                            err = 1;
                            goto cleanup;
                        }
                        if (futrts_builtinzhgpu_map_transpose_i64(ctx,
                                                                  mem_230930,
                                                                  (int64_t) 0,
                                                                  ext_mem_229197,
                                                                  (int64_t) 0,
                                                                  (int64_t) 1,
                                                                  n_203490,
                                                                  partition_sizze_203577) !=
                            0) {
                            if (memblock_unref_device(ctx, &mem_230930,
                                                      "mem_230930") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230927,
                                                      "mem_230927") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231044,
                                                      "ext_mem_231044") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230924,
                                                      "mem_230924") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231401,
                                                      "ext_mem_231401") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231402,
                                                      "ext_mem_231402") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231504,
                                                      "ext_mem_231504") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231505,
                                                      "ext_mem_231505") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230920,
                                                      "mem_230920") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230914,
                                                      "ext_mem_230914") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230907,
                                                      "ext_mem_230907") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230908,
                                                      "ext_mem_230908") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230546,
                                                      "ext_mem_230546") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230529,
                                                      "ext_mem_230529") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230512,
                                                      "ext_mem_230512") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230494,
                                                      "ext_mem_230494") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230486,
                                                      "ext_mem_230486") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230487,
                                                      "ext_mem_230487") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229515,
                                                      "mem_param_229515") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229507,
                                                      "mem_param_229507") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231517,
                                                      "ext_mem_231517") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231518,
                                                      "ext_mem_231518") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229493,
                                                      "mem_param_229493") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229485,
                                                      "mem_param_229485") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229477,
                                                      "mem_param_229477") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231860,
                                                      "ext_mem_231860") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231861,
                                                      "ext_mem_231861") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231862,
                                                      "ext_mem_231862") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230551,
                                                      "mem_230551") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230534,
                                                      "mem_230534") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230517,
                                                      "mem_230517") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230500,
                                                      "mem_230500") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229531,
                                                      "mem_229531") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229526,
                                                      "mem_229526") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229520,
                                                      "mem_229520") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229469,
                                                      "mem_229469") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229465,
                                                      "mem_229465") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229460,
                                                      "ext_mem_229460") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229461,
                                                      "ext_mem_229461") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229411,
                                                      "ext_mem_229411") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229412,
                                                      "ext_mem_229412") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229362,
                                                      "ext_mem_229362") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229363,
                                                      "ext_mem_229363") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229264,
                                                      "ext_mem_229264") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229265,
                                                      "ext_mem_229265") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229206,
                                                      "mem_229206") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229200,
                                                      "mem_229200") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229196,
                                                      "ext_mem_229196") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229197,
                                                      "ext_mem_229197") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229164,
                                                      "mem_229164") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229161,
                                                      "mem_229161") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229157,
                                                      "mem_229157") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229155,
                                                      "mem_229155") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229152,
                                                      "mem_229152") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229148,
                                                      "mem_229148") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_out_232249,
                                                      "mem_out_232249") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_out_232248,
                                                      "mem_out_232248") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_out_232247,
                                                      "mem_out_232247") != 0)
                                return 1;
                            err = 1;
                            goto cleanup;
                        }
                        
                        struct memblock_device mem_230933;
                        
                        mem_230933.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_230933,
                                                  binop_y_229426,
                                                  "mem_230933")) {
                            err = 1;
                            goto cleanup;
                        }
                        if (futrts_builtinzhgpu_map_transpose_i64(ctx,
                                                                  mem_230933,
                                                                  (int64_t) 0,
                                                                  ext_mem_229461,
                                                                  (int64_t) 0,
                                                                  (int64_t) 1,
                                                                  t_n_m_203650,
                                                                  partition_sizze_203577) !=
                            0) {
                            if (memblock_unref_device(ctx, &mem_230933,
                                                      "mem_230933") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230930,
                                                      "mem_230930") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230927,
                                                      "mem_230927") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231044,
                                                      "ext_mem_231044") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230924,
                                                      "mem_230924") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231401,
                                                      "ext_mem_231401") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231402,
                                                      "ext_mem_231402") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231504,
                                                      "ext_mem_231504") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231505,
                                                      "ext_mem_231505") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230920,
                                                      "mem_230920") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230914,
                                                      "ext_mem_230914") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230907,
                                                      "ext_mem_230907") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230908,
                                                      "ext_mem_230908") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230546,
                                                      "ext_mem_230546") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230529,
                                                      "ext_mem_230529") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230512,
                                                      "ext_mem_230512") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230494,
                                                      "ext_mem_230494") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230486,
                                                      "ext_mem_230486") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230487,
                                                      "ext_mem_230487") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229515,
                                                      "mem_param_229515") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229507,
                                                      "mem_param_229507") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231517,
                                                      "ext_mem_231517") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231518,
                                                      "ext_mem_231518") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229493,
                                                      "mem_param_229493") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229485,
                                                      "mem_param_229485") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229477,
                                                      "mem_param_229477") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231860,
                                                      "ext_mem_231860") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231861,
                                                      "ext_mem_231861") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231862,
                                                      "ext_mem_231862") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230551,
                                                      "mem_230551") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230534,
                                                      "mem_230534") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230517,
                                                      "mem_230517") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230500,
                                                      "mem_230500") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229531,
                                                      "mem_229531") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229526,
                                                      "mem_229526") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229520,
                                                      "mem_229520") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229469,
                                                      "mem_229469") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229465,
                                                      "mem_229465") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229460,
                                                      "ext_mem_229460") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229461,
                                                      "ext_mem_229461") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229411,
                                                      "ext_mem_229411") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229412,
                                                      "ext_mem_229412") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229362,
                                                      "ext_mem_229362") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229363,
                                                      "ext_mem_229363") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229264,
                                                      "ext_mem_229264") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229265,
                                                      "ext_mem_229265") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229206,
                                                      "mem_229206") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229200,
                                                      "mem_229200") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229196,
                                                      "ext_mem_229196") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229197,
                                                      "ext_mem_229197") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229164,
                                                      "mem_229164") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229161,
                                                      "mem_229161") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229157,
                                                      "mem_229157") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229155,
                                                      "mem_229155") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229152,
                                                      "mem_229152") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229148,
                                                      "mem_229148") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_out_232249,
                                                      "mem_out_232249") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_out_232248,
                                                      "mem_out_232248") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_out_232247,
                                                      "mem_out_232247") != 0)
                                return 1;
                            err = 1;
                            goto cleanup;
                        }
                        
                        struct memblock_device mem_230936;
                        
                        mem_230936.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_230936,
                                                  binop_y_229426,
                                                  "mem_230936")) {
                            err = 1;
                            goto cleanup;
                        }
                        if (futrts_builtinzhgpu_map_transpose_f64(ctx,
                                                                  mem_230936,
                                                                  (int64_t) 0,
                                                                  ext_mem_229460,
                                                                  (int64_t) 0,
                                                                  (int64_t) 1,
                                                                  t_n_m_203650,
                                                                  partition_sizze_203577) !=
                            0) {
                            if (memblock_unref_device(ctx, &mem_230936,
                                                      "mem_230936") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230933,
                                                      "mem_230933") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230930,
                                                      "mem_230930") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230927,
                                                      "mem_230927") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231044,
                                                      "ext_mem_231044") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230924,
                                                      "mem_230924") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231401,
                                                      "ext_mem_231401") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231402,
                                                      "ext_mem_231402") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231504,
                                                      "ext_mem_231504") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231505,
                                                      "ext_mem_231505") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230920,
                                                      "mem_230920") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230914,
                                                      "ext_mem_230914") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230907,
                                                      "ext_mem_230907") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230908,
                                                      "ext_mem_230908") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230546,
                                                      "ext_mem_230546") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230529,
                                                      "ext_mem_230529") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230512,
                                                      "ext_mem_230512") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230494,
                                                      "ext_mem_230494") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230486,
                                                      "ext_mem_230486") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230487,
                                                      "ext_mem_230487") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229515,
                                                      "mem_param_229515") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229507,
                                                      "mem_param_229507") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231517,
                                                      "ext_mem_231517") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231518,
                                                      "ext_mem_231518") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229493,
                                                      "mem_param_229493") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229485,
                                                      "mem_param_229485") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229477,
                                                      "mem_param_229477") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231860,
                                                      "ext_mem_231860") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231861,
                                                      "ext_mem_231861") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231862,
                                                      "ext_mem_231862") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230551,
                                                      "mem_230551") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230534,
                                                      "mem_230534") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230517,
                                                      "mem_230517") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230500,
                                                      "mem_230500") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229531,
                                                      "mem_229531") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229526,
                                                      "mem_229526") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229520,
                                                      "mem_229520") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229469,
                                                      "mem_229469") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229465,
                                                      "mem_229465") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229460,
                                                      "ext_mem_229460") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229461,
                                                      "ext_mem_229461") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229411,
                                                      "ext_mem_229411") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229412,
                                                      "ext_mem_229412") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229362,
                                                      "ext_mem_229362") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229363,
                                                      "ext_mem_229363") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229264,
                                                      "ext_mem_229264") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229265,
                                                      "ext_mem_229265") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229206,
                                                      "mem_229206") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229200,
                                                      "mem_229200") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229196,
                                                      "ext_mem_229196") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229197,
                                                      "ext_mem_229197") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229164,
                                                      "mem_229164") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229161,
                                                      "mem_229161") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229157,
                                                      "mem_229157") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229155,
                                                      "mem_229155") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229152,
                                                      "mem_229152") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229148,
                                                      "mem_229148") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_out_232249,
                                                      "mem_out_232249") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_out_232248,
                                                      "mem_out_232248") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_out_232247,
                                                      "mem_out_232247") != 0)
                                return 1;
                            err = 1;
                            goto cleanup;
                        }
                        
                        struct memblock_device mem_230939;
                        
                        mem_230939.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_230939,
                                                  binop_y_229176,
                                                  "mem_230939")) {
                            err = 1;
                            goto cleanup;
                        }
                        
                        int64_t group_sizze_235351;
                        
                        group_sizze_235351 =
                            *ctx->tuning_params.mainzigroup_sizze_235351;
                        
                        int64_t num_groups_235352 =
                                sdiv_up64(partition_sizze_203577 * n_203490,
                                          group_sizze_235351);
                        
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzicopy_235348,
                                                                0,
                                                                sizeof(n_203490),
                                                                &n_203490));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzicopy_235348,
                                                                1,
                                                                sizeof(partition_sizze_203577),
                                                                &partition_sizze_203577));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzicopy_235348,
                                                                2,
                                                                sizeof(ctx_param_ext_229488),
                                                                &ctx_param_ext_229488));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzicopy_235348,
                                                                3,
                                                                sizeof(ctx_param_ext_229489),
                                                                &ctx_param_ext_229489));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzicopy_235348,
                                                                4,
                                                                sizeof(ctx_param_ext_229491),
                                                                &ctx_param_ext_229491));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzicopy_235348,
                                                                5,
                                                                sizeof(mem_param_229493.mem),
                                                                &mem_param_229493.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzicopy_235348,
                                                                6,
                                                                sizeof(mem_230939.mem),
                                                                &mem_230939.mem));
                        if (1 * ((size_t) num_groups_235352 *
                                 (size_t) group_sizze_235351) != 0) {
                            const size_t global_work_sizze_237328[1] =
                                         {(size_t) num_groups_235352 *
                                         (size_t) group_sizze_235351};
                            const size_t local_work_sizze_237332[1] =
                                         {(size_t) group_sizze_235351};
                            int64_t time_start_237329 = 0, time_end_237330 = 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_235348",
                                        global_work_sizze_237328[0],
                                        local_work_sizze_237332[0], (int) 0);
                                time_start_237329 = get_wall_time();
                            }
                            OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                            ctx->mainzicopy_235348,
                                                                            1,
                                                                            NULL,
                                                                            global_work_sizze_237328,
                                                                            local_work_sizze_237332,
                                                                            0,
                                                                            NULL,
                                                                            ctx->profiling_paused ||
                                                                            !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                      &ctx->mainzicopy_235348_runs,
                                                                                                                      &ctx->mainzicopy_235348_total_runtime)));
                            if (ctx->debugging) {
                                OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                time_end_237330 = get_wall_time();
                                
                                long time_diff_237331 = time_end_237330 -
                                     time_start_237329;
                                
                                fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                                        "main.copy_235348", time_diff_237331);
                            }
                        }
                        
                        struct memblock_device mem_231003;
                        
                        mem_231003.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_231003,
                                                  binop_y_229426,
                                                  "mem_231003")) {
                            err = 1;
                            goto cleanup;
                        }
                        
                        struct memblock_device color_232040;
                        
                        color_232040.references = NULL;
                        if (memblock_alloc_device(ctx, &color_232040,
                                                  total_sizze_232183,
                                                  "color_232040")) {
                            err = 1;
                            goto cleanup;
                        }
                        
                        struct memblock_device color_232041;
                        
                        color_232041.references = NULL;
                        if (memblock_alloc_device(ctx, &color_232041,
                                                  total_sizze_232184,
                                                  "color_232041")) {
                            err = 1;
                            goto cleanup;
                        }
                        
                        struct memblock_device color_232042;
                        
                        color_232042.references = NULL;
                        if (memblock_alloc_device(ctx, &color_232042,
                                                  total_sizze_232185,
                                                  "color_232042")) {
                            err = 1;
                            goto cleanup;
                        }
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s\n", "\n# SegMap");
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_222551,
                                                                1,
                                                                sizeof(ctx->failure_is_an_option),
                                                                &ctx->failure_is_an_option));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_222551,
                                                                3,
                                                                sizeof(n_203490),
                                                                &n_203490));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_222551,
                                                                4,
                                                                sizeof(q_t_203494),
                                                                &q_t_203494));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_222551,
                                                                5,
                                                                sizeof(jump_t_203500),
                                                                &jump_t_203500));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_222551,
                                                                6,
                                                                sizeof(partition_sizze_203577),
                                                                &partition_sizze_203577));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_222551,
                                                                7,
                                                                sizeof(t_n_m_203650),
                                                                &t_n_m_203650));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_222551,
                                                                8,
                                                                sizeof(i_203670),
                                                                &i_203670));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_222551,
                                                                9,
                                                                sizeof(num_groups_222547),
                                                                &num_groups_222547));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_222551,
                                                                10,
                                                                sizeof(num_threads_232182),
                                                                &num_threads_232182));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_222551,
                                                                11,
                                                                sizeof(mem_229161.mem),
                                                                &mem_229161.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_222551,
                                                                12,
                                                                sizeof(ext_mem_229196.mem),
                                                                &ext_mem_229196.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_222551,
                                                                13,
                                                                sizeof(mem_230927.mem),
                                                                &mem_230927.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_222551,
                                                                14,
                                                                sizeof(mem_230930.mem),
                                                                &mem_230930.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_222551,
                                                                15,
                                                                sizeof(mem_230933.mem),
                                                                &mem_230933.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_222551,
                                                                16,
                                                                sizeof(mem_230936.mem),
                                                                &mem_230936.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_222551,
                                                                17,
                                                                sizeof(mem_230939.mem),
                                                                &mem_230939.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_222551,
                                                                18,
                                                                sizeof(mem_231003.mem),
                                                                &mem_231003.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_222551,
                                                                19,
                                                                sizeof(color_232040.mem),
                                                                &color_232040.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_222551,
                                                                20,
                                                                sizeof(color_232041.mem),
                                                                &color_232041.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_222551,
                                                                21,
                                                                sizeof(color_232042.mem),
                                                                &color_232042.mem));
                        if (1 * ((size_t) num_groups_222547 *
                                 (size_t) segmap_group_sizze_222546) != 0) {
                            const size_t global_work_sizze_237333[1] =
                                         {(size_t) num_groups_222547 *
                                         (size_t) segmap_group_sizze_222546};
                            const size_t local_work_sizze_237337[1] =
                                         {(size_t) segmap_group_sizze_222546};
                            int64_t time_start_237334 = 0, time_end_237335 = 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_222551",
                                        global_work_sizze_237333[0],
                                        local_work_sizze_237337[0], (int) 0);
                                time_start_237334 = get_wall_time();
                            }
                            OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                            ctx->mainzisegmap_222551,
                                                                            1,
                                                                            NULL,
                                                                            global_work_sizze_237333,
                                                                            local_work_sizze_237337,
                                                                            0,
                                                                            NULL,
                                                                            ctx->profiling_paused ||
                                                                            !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                      &ctx->mainzisegmap_222551_runs,
                                                                                                                      &ctx->mainzisegmap_222551_total_runtime)));
                            if (ctx->debugging) {
                                OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                time_end_237335 = get_wall_time();
                                
                                long time_diff_237336 = time_end_237335 -
                                     time_start_237334;
                                
                                fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                                        "main.segmap_222551", time_diff_237336);
                            }
                        }
                        ctx->failure_is_an_option = 1;
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s\n", "");
                        if (memblock_unref_device(ctx, &mem_230927,
                                                  "mem_230927") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_230930,
                                                  "mem_230930") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_230933,
                                                  "mem_230933") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_230936,
                                                  "mem_230936") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_230939,
                                                  "mem_230939") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &color_232040,
                                                  "color_232040") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &color_232041,
                                                  "color_232041") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &color_232042,
                                                  "color_232042") != 0)
                            return 1;
                        
                        struct memblock_device mem_231042;
                        
                        mem_231042.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_231042,
                                                  bytes_229427, "mem_231042")) {
                            err = 1;
                            goto cleanup;
                        }
                        if (futrts_builtinzhgpu_map_transpose_f64(ctx,
                                                                  mem_231042,
                                                                  (int64_t) 0,
                                                                  mem_231003,
                                                                  (int64_t) 0,
                                                                  (int64_t) 1,
                                                                  partition_sizze_203577,
                                                                  t_n_m_203650) !=
                            0) {
                            if (memblock_unref_device(ctx, &mem_231042,
                                                      "mem_231042") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &color_232042,
                                                      "color_232042") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &color_232041,
                                                      "color_232041") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &color_232040,
                                                      "color_232040") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_231003,
                                                      "mem_231003") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230939,
                                                      "mem_230939") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230936,
                                                      "mem_230936") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230933,
                                                      "mem_230933") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230930,
                                                      "mem_230930") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230927,
                                                      "mem_230927") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231044,
                                                      "ext_mem_231044") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230924,
                                                      "mem_230924") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231401,
                                                      "ext_mem_231401") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231402,
                                                      "ext_mem_231402") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231504,
                                                      "ext_mem_231504") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231505,
                                                      "ext_mem_231505") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230920,
                                                      "mem_230920") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230914,
                                                      "ext_mem_230914") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230907,
                                                      "ext_mem_230907") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230908,
                                                      "ext_mem_230908") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230546,
                                                      "ext_mem_230546") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230529,
                                                      "ext_mem_230529") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230512,
                                                      "ext_mem_230512") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230494,
                                                      "ext_mem_230494") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230486,
                                                      "ext_mem_230486") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_230487,
                                                      "ext_mem_230487") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229515,
                                                      "mem_param_229515") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229507,
                                                      "mem_param_229507") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231517,
                                                      "ext_mem_231517") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231518,
                                                      "ext_mem_231518") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229493,
                                                      "mem_param_229493") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229485,
                                                      "mem_param_229485") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_param_229477,
                                                      "mem_param_229477") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231860,
                                                      "ext_mem_231860") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231861,
                                                      "ext_mem_231861") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231862,
                                                      "ext_mem_231862") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230551,
                                                      "mem_230551") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230534,
                                                      "mem_230534") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230517,
                                                      "mem_230517") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_230500,
                                                      "mem_230500") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229531,
                                                      "mem_229531") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229526,
                                                      "mem_229526") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229520,
                                                      "mem_229520") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229469,
                                                      "mem_229469") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229465,
                                                      "mem_229465") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229460,
                                                      "ext_mem_229460") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229461,
                                                      "ext_mem_229461") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229411,
                                                      "ext_mem_229411") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229412,
                                                      "ext_mem_229412") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229362,
                                                      "ext_mem_229362") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229363,
                                                      "ext_mem_229363") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229264,
                                                      "ext_mem_229264") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229265,
                                                      "ext_mem_229265") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229206,
                                                      "mem_229206") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229200,
                                                      "mem_229200") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229196,
                                                      "ext_mem_229196") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_229197,
                                                      "ext_mem_229197") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229164,
                                                      "mem_229164") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229161,
                                                      "mem_229161") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229157,
                                                      "mem_229157") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229155,
                                                      "mem_229155") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229152,
                                                      "mem_229152") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_229148,
                                                      "mem_229148") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_out_232249,
                                                      "mem_out_232249") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_out_232248,
                                                      "mem_out_232248") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_out_232247,
                                                      "mem_out_232247") != 0)
                                return 1;
                            err = 1;
                            goto cleanup;
                        }
                        if (memblock_unref_device(ctx, &mem_231003,
                                                  "mem_231003") != 0)
                            return 1;
                        if (memblock_set_device(ctx, &ext_mem_231044,
                                                &mem_231042, "mem_231042") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_231042,
                                                  "mem_231042") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &color_232042,
                                                  "color_232042") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &color_232041,
                                                  "color_232041") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &color_232040,
                                                  "color_232040") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_231003,
                                                  "mem_231003") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_230939,
                                                  "mem_230939") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_230936,
                                                  "mem_230936") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_230933,
                                                  "mem_230933") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_230930,
                                                  "mem_230930") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_230927,
                                                  "mem_230927") != 0)
                            return 1;
                    } else {
                        int64_t segmap_usable_groups_223063 =
                                sdiv_up64(nest_sizze_207000,
                                          segmap_group_sizze_223062);
                        struct memblock_device mem_231008;
                        
                        mem_231008.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_231008,
                                                  bytes_229177, "mem_231008")) {
                            err = 1;
                            goto cleanup;
                        }
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s\n", "\n# SegMap");
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_223067,
                                                                1,
                                                                sizeof(n_203490),
                                                                &n_203490));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_223067,
                                                                2,
                                                                sizeof(partition_sizze_203577),
                                                                &partition_sizze_203577));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_223067,
                                                                3,
                                                                sizeof(mem_229161.mem),
                                                                &mem_229161.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_223067,
                                                                4,
                                                                sizeof(mem_230920.mem),
                                                                &mem_230920.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_223067,
                                                                5,
                                                                sizeof(mem_231008.mem),
                                                                &mem_231008.mem));
                        if (1 * ((size_t) segmap_usable_groups_223063 *
                                 (size_t) segmap_group_sizze_223062) != 0) {
                            const size_t global_work_sizze_237338[1] =
                                         {(size_t) segmap_usable_groups_223063 *
                                         (size_t) segmap_group_sizze_223062};
                            const size_t local_work_sizze_237342[1] =
                                         {(size_t) segmap_group_sizze_223062};
                            int64_t time_start_237339 = 0, time_end_237340 = 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_223067",
                                        global_work_sizze_237338[0],
                                        local_work_sizze_237342[0], (int) 0);
                                time_start_237339 = get_wall_time();
                            }
                            OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                            ctx->mainzisegmap_223067,
                                                                            1,
                                                                            NULL,
                                                                            global_work_sizze_237338,
                                                                            local_work_sizze_237342,
                                                                            0,
                                                                            NULL,
                                                                            ctx->profiling_paused ||
                                                                            !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                      &ctx->mainzisegmap_223067_runs,
                                                                                                                      &ctx->mainzisegmap_223067_total_runtime)));
                            if (ctx->debugging) {
                                OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                time_end_237340 = get_wall_time();
                                
                                long time_diff_237341 = time_end_237340 -
                                     time_start_237339;
                                
                                fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                                        "main.segmap_223067", time_diff_237341);
                            }
                        }
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s\n", "");
                        
                        int64_t segmap_usable_groups_223079 =
                                sdiv_up64(nest_sizze_207000,
                                          segmap_group_sizze_223078);
                        struct memblock_device mem_231013;
                        
                        mem_231013.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_231013,
                                                  bytes_229177, "mem_231013")) {
                            err = 1;
                            goto cleanup;
                        }
                        
                        struct memblock_device mem_231017;
                        
                        mem_231017.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_231017,
                                                  bytes_229177, "mem_231017")) {
                            err = 1;
                            goto cleanup;
                        }
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s\n", "\n# SegMap");
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_223084,
                                                                1,
                                                                sizeof(ctx->failure_is_an_option),
                                                                &ctx->failure_is_an_option));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_223084,
                                                                3,
                                                                sizeof(n_203490),
                                                                &n_203490));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_223084,
                                                                4,
                                                                sizeof(partition_sizze_203577),
                                                                &partition_sizze_203577));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_223084,
                                                                5,
                                                                sizeof(ctx_param_ext_229488),
                                                                &ctx_param_ext_229488));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_223084,
                                                                6,
                                                                sizeof(ctx_param_ext_229489),
                                                                &ctx_param_ext_229489));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_223084,
                                                                7,
                                                                sizeof(ctx_param_ext_229491),
                                                                &ctx_param_ext_229491));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_223084,
                                                                8,
                                                                sizeof(ext_mem_229197.mem),
                                                                &ext_mem_229197.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_223084,
                                                                9,
                                                                sizeof(mem_param_229493.mem),
                                                                &mem_param_229493.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_223084,
                                                                10,
                                                                sizeof(mem_231008.mem),
                                                                &mem_231008.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_223084,
                                                                11,
                                                                sizeof(mem_231013.mem),
                                                                &mem_231013.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_223084,
                                                                12,
                                                                sizeof(mem_231017.mem),
                                                                &mem_231017.mem));
                        if (1 * ((size_t) segmap_usable_groups_223079 *
                                 (size_t) segmap_group_sizze_223078) != 0) {
                            const size_t global_work_sizze_237343[1] =
                                         {(size_t) segmap_usable_groups_223079 *
                                         (size_t) segmap_group_sizze_223078};
                            const size_t local_work_sizze_237347[1] =
                                         {(size_t) segmap_group_sizze_223078};
                            int64_t time_start_237344 = 0, time_end_237345 = 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_223084",
                                        global_work_sizze_237343[0],
                                        local_work_sizze_237347[0], (int) 0);
                                time_start_237344 = get_wall_time();
                            }
                            OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                            ctx->mainzisegmap_223084,
                                                                            1,
                                                                            NULL,
                                                                            global_work_sizze_237343,
                                                                            local_work_sizze_237347,
                                                                            0,
                                                                            NULL,
                                                                            ctx->profiling_paused ||
                                                                            !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                      &ctx->mainzisegmap_223084_runs,
                                                                                                                      &ctx->mainzisegmap_223084_total_runtime)));
                            if (ctx->debugging) {
                                OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                time_end_237345 = get_wall_time();
                                
                                long time_diff_237346 = time_end_237345 -
                                     time_start_237344;
                                
                                fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                                        "main.segmap_223084", time_diff_237346);
                            }
                        }
                        ctx->failure_is_an_option = 1;
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s\n", "");
                        if (memblock_unref_device(ctx, &mem_231008,
                                                  "mem_231008") != 0)
                            return 1;
                        
                        int64_t segmap_usable_groups_223104 =
                                sdiv_up64(nest_sizze_210118,
                                          segmap_group_sizze_223103);
                        struct memblock_device ext_mem_231038;
                        
                        ext_mem_231038.references = NULL;
                        
                        int32_t local_memory_capacity_235565;
                        
                        local_memory_capacity_235565 =
                            ctx->opencl.max_local_memory;
                        if (sle64((int64_t) 0,
                                  sext_i32_i64(local_memory_capacity_235565)) &&
                            suff_outer_par_223107) {
                            struct memblock_device mem_231022;
                            
                            mem_231022.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_231022,
                                                      bytes_229427,
                                                      "mem_231022")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s\n", "\n# SegMap");
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_223112,
                                                                    1,
                                                                    sizeof(n_203490),
                                                                    &n_203490));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_223112,
                                                                    2,
                                                                    sizeof(q_t_203494),
                                                                    &q_t_203494));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_223112,
                                                                    3,
                                                                    sizeof(jump_t_203500),
                                                                    &jump_t_203500));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_223112,
                                                                    4,
                                                                    sizeof(partition_sizze_203577),
                                                                    &partition_sizze_203577));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_223112,
                                                                    5,
                                                                    sizeof(t_n_m_203650),
                                                                    &t_n_m_203650));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_223112,
                                                                    6,
                                                                    sizeof(i_203670),
                                                                    &i_203670));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_223112,
                                                                    7,
                                                                    sizeof(ext_mem_229196.mem),
                                                                    &ext_mem_229196.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_223112,
                                                                    8,
                                                                    sizeof(ext_mem_229197.mem),
                                                                    &ext_mem_229197.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_223112,
                                                                    9,
                                                                    sizeof(ext_mem_229460.mem),
                                                                    &ext_mem_229460.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_223112,
                                                                    10,
                                                                    sizeof(ext_mem_229461.mem),
                                                                    &ext_mem_229461.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_223112,
                                                                    11,
                                                                    sizeof(mem_231013.mem),
                                                                    &mem_231013.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_223112,
                                                                    12,
                                                                    sizeof(mem_231017.mem),
                                                                    &mem_231017.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_223112,
                                                                    13,
                                                                    sizeof(mem_231022.mem),
                                                                    &mem_231022.mem));
                            if (1 * ((size_t) segmap_usable_groups_223104 *
                                     (size_t) segmap_group_sizze_223103) != 0) {
                                const size_t global_work_sizze_237348[1] =
                                             {(size_t) segmap_usable_groups_223104 *
                                             (size_t) segmap_group_sizze_223103};
                                const size_t local_work_sizze_237352[1] =
                                             {(size_t) segmap_group_sizze_223103};
                                int64_t time_start_237349 = 0, time_end_237350 =
                                        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_223112",
                                            global_work_sizze_237348[0],
                                            local_work_sizze_237352[0],
                                            (int) 0);
                                    time_start_237349 = get_wall_time();
                                }
                                OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                                ctx->mainzisegmap_223112,
                                                                                1,
                                                                                NULL,
                                                                                global_work_sizze_237348,
                                                                                local_work_sizze_237352,
                                                                                0,
                                                                                NULL,
                                                                                ctx->profiling_paused ||
                                                                                !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                          &ctx->mainzisegmap_223112_runs,
                                                                                                                          &ctx->mainzisegmap_223112_total_runtime)));
                                if (ctx->debugging) {
                                    OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                    time_end_237350 = get_wall_time();
                                    
                                    long time_diff_237351 = time_end_237350 -
                                         time_start_237349;
                                    
                                    fprintf(ctx->log,
                                            "kernel %s runtime: %ldus\n",
                                            "main.segmap_223112",
                                            time_diff_237351);
                                }
                            }
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s\n", "");
                            if (memblock_set_device(ctx, &ext_mem_231038,
                                                    &mem_231022,
                                                    "mem_231022") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_231022,
                                                      "mem_231022") != 0)
                                return 1;
                        } else {
                            struct memblock_device mem_231027;
                            
                            mem_231027.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_231027,
                                                      bytes_229427,
                                                      "mem_231027")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (slt64(q_t_203494 * (int64_t) 2,
                                      segred_group_sizze_223190)) {
                                int64_t segment_sizze_nonzzero_235411 =
                                        smax64((int64_t) 1, q_t_203494);
                                int64_t num_threads_235412 = num_groups_223191 *
                                        segred_group_sizze_223190;
                                
                                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_203577 *
                                                         t_n_m_203650), '\n');
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s: %llu%c",
                                            "segment_size",
                                            (long long) q_t_203494, '\n');
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s: %llu%c",
                                            "segments_per_group",
                                            (long long) squot64(segred_group_sizze_223190,
                                                                segment_sizze_nonzzero_235411),
                                            '\n');
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s: %llu%c",
                                            "required_groups",
                                            (long long) sext_i64_i32(sdiv_up64(partition_sizze_203577 *
                                                                               t_n_m_203650,
                                                                               squot64(segred_group_sizze_223190,
                                                                                       segment_sizze_nonzzero_235411))),
                                            '\n');
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_223197,
                                                                        1,
                                                                        (size_t) ((int64_t) 8 *
                                                                                  segred_group_sizze_223190),
                                                                        NULL));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_223197,
                                                                        2,
                                                                        sizeof(n_203490),
                                                                        &n_203490));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_223197,
                                                                        3,
                                                                        sizeof(q_t_203494),
                                                                        &q_t_203494));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_223197,
                                                                        4,
                                                                        sizeof(jump_t_203500),
                                                                        &jump_t_203500));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_223197,
                                                                        5,
                                                                        sizeof(partition_sizze_203577),
                                                                        &partition_sizze_203577));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_223197,
                                                                        6,
                                                                        sizeof(t_n_m_203650),
                                                                        &t_n_m_203650));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_223197,
                                                                        7,
                                                                        sizeof(i_203670),
                                                                        &i_203670));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_223197,
                                                                        8,
                                                                        sizeof(num_groups_223191),
                                                                        &num_groups_223191));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_223197,
                                                                        9,
                                                                        sizeof(segment_sizze_nonzzero_235411),
                                                                        &segment_sizze_nonzzero_235411));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_223197,
                                                                        10,
                                                                        sizeof(ext_mem_229196.mem),
                                                                        &ext_mem_229196.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_223197,
                                                                        11,
                                                                        sizeof(ext_mem_229197.mem),
                                                                        &ext_mem_229197.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_223197,
                                                                        12,
                                                                        sizeof(ext_mem_229460.mem),
                                                                        &ext_mem_229460.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_223197,
                                                                        13,
                                                                        sizeof(ext_mem_229461.mem),
                                                                        &ext_mem_229461.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_223197,
                                                                        14,
                                                                        sizeof(mem_231013.mem),
                                                                        &mem_231013.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_223197,
                                                                        15,
                                                                        sizeof(mem_231027.mem),
                                                                        &mem_231027.mem));
                                if (1 * ((size_t) num_groups_223191 *
                                         (size_t) segred_group_sizze_223190) !=
                                    0) {
                                    const size_t global_work_sizze_237353[1] =
                                                 {(size_t) num_groups_223191 *
                                                 (size_t) segred_group_sizze_223190};
                                    const size_t local_work_sizze_237357[1] =
                                                 {(size_t) segred_group_sizze_223190};
                                    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_small_223197",
                                                global_work_sizze_237353[0],
                                                local_work_sizze_237357[0],
                                                (int) (0 + (int64_t) 8 *
                                                       segred_group_sizze_223190));
                                        time_start_237354 = get_wall_time();
                                    }
                                    OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                                    ctx->mainzisegred_small_223197,
                                                                                    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_small_223197_runs,
                                                                                                                              &ctx->mainzisegred_small_223197_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_small_223197",
                                                time_diff_237356);
                                    }
                                }
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s\n", "");
                            } else {
                                int64_t groups_per_segment_235440 =
                                        sdiv_up64(num_groups_223191,
                                                  smax64((int64_t) 1,
                                                         partition_sizze_203577 *
                                                         t_n_m_203650));
                                int64_t elements_per_thread_235441 =
                                        sdiv_up64(q_t_203494,
                                                  segred_group_sizze_223190 *
                                                  groups_per_segment_235440);
                                int64_t virt_num_groups_235442 =
                                        groups_per_segment_235440 *
                                        (partition_sizze_203577 * t_n_m_203650);
                                int64_t num_threads_235443 = num_groups_223191 *
                                        segred_group_sizze_223190;
                                int64_t threads_per_segment_235444 =
                                        groups_per_segment_235440 *
                                        segred_group_sizze_223190;
                                
                                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_203577 *
                                                         t_n_m_203650), '\n');
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s: %llu%c",
                                            "segment_size",
                                            (long long) q_t_203494, '\n');
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s: %llu%c",
                                            "virt_num_groups",
                                            (long long) virt_num_groups_235442,
                                            '\n');
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s: %llu%c",
                                            "num_groups",
                                            (long long) num_groups_223191,
                                            '\n');
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s: %llu%c",
                                            "group_size",
                                            (long long) segred_group_sizze_223190,
                                            '\n');
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s: %llu%c",
                                            "elems_per_thread",
                                            (long long) elements_per_thread_235441,
                                            '\n');
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s: %llu%c",
                                            "groups_per_segment",
                                            (long long) groups_per_segment_235440,
                                            '\n');
                                
                                struct memblock_device segred_tmp_mem_235445;
                                
                                segred_tmp_mem_235445.references = NULL;
                                if (memblock_alloc_device(ctx,
                                                          &segred_tmp_mem_235445,
                                                          (int64_t) 8 *
                                                          virt_num_groups_235442,
                                                          "segred_tmp_mem_235445")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device mainzicounter_mem_235447
                                                       =
                                                       ctx->mainzicounter_mem_235447;
                                
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_223197,
                                                                        1,
                                                                        (size_t) 1,
                                                                        NULL));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_223197,
                                                                        2,
                                                                        (size_t) ((int64_t) 8 *
                                                                                  segred_group_sizze_223190),
                                                                        NULL));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_223197,
                                                                        3,
                                                                        sizeof(n_203490),
                                                                        &n_203490));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_223197,
                                                                        4,
                                                                        sizeof(q_t_203494),
                                                                        &q_t_203494));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_223197,
                                                                        5,
                                                                        sizeof(jump_t_203500),
                                                                        &jump_t_203500));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_223197,
                                                                        6,
                                                                        sizeof(partition_sizze_203577),
                                                                        &partition_sizze_203577));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_223197,
                                                                        7,
                                                                        sizeof(t_n_m_203650),
                                                                        &t_n_m_203650));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_223197,
                                                                        8,
                                                                        sizeof(i_203670),
                                                                        &i_203670));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_223197,
                                                                        9,
                                                                        sizeof(num_groups_223191),
                                                                        &num_groups_223191));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_223197,
                                                                        10,
                                                                        sizeof(groups_per_segment_235440),
                                                                        &groups_per_segment_235440));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_223197,
                                                                        11,
                                                                        sizeof(elements_per_thread_235441),
                                                                        &elements_per_thread_235441));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_223197,
                                                                        12,
                                                                        sizeof(virt_num_groups_235442),
                                                                        &virt_num_groups_235442));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_223197,
                                                                        13,
                                                                        sizeof(threads_per_segment_235444),
                                                                        &threads_per_segment_235444));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_223197,
                                                                        14,
                                                                        sizeof(ext_mem_229196.mem),
                                                                        &ext_mem_229196.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_223197,
                                                                        15,
                                                                        sizeof(ext_mem_229197.mem),
                                                                        &ext_mem_229197.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_223197,
                                                                        16,
                                                                        sizeof(ext_mem_229460.mem),
                                                                        &ext_mem_229460.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_223197,
                                                                        17,
                                                                        sizeof(ext_mem_229461.mem),
                                                                        &ext_mem_229461.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_223197,
                                                                        18,
                                                                        sizeof(mem_231013.mem),
                                                                        &mem_231013.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_223197,
                                                                        19,
                                                                        sizeof(mem_231027.mem),
                                                                        &mem_231027.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_223197,
                                                                        20,
                                                                        sizeof(segred_tmp_mem_235445.mem),
                                                                        &segred_tmp_mem_235445.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_223197,
                                                                        21,
                                                                        sizeof(mainzicounter_mem_235447.mem),
                                                                        &mainzicounter_mem_235447.mem));
                                if (1 * ((size_t) num_groups_223191 *
                                         (size_t) segred_group_sizze_223190) !=
                                    0) {
                                    const size_t global_work_sizze_237359[1] =
                                                 {(size_t) num_groups_223191 *
                                                 (size_t) segred_group_sizze_223190};
                                    const size_t local_work_sizze_237363[1] =
                                                 {(size_t) segred_group_sizze_223190};
                                    int64_t time_start_237360 = 0,
                                            time_end_237361 = 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_223197",
                                                global_work_sizze_237359[0],
                                                local_work_sizze_237363[0],
                                                (int) (0 + 1 + (int64_t) 8 *
                                                       segred_group_sizze_223190));
                                        time_start_237360 = get_wall_time();
                                    }
                                    OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                                    ctx->mainzisegred_large_223197,
                                                                                    1,
                                                                                    NULL,
                                                                                    global_work_sizze_237359,
                                                                                    local_work_sizze_237363,
                                                                                    0,
                                                                                    NULL,
                                                                                    ctx->profiling_paused ||
                                                                                    !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                              &ctx->mainzisegred_large_223197_runs,
                                                                                                                              &ctx->mainzisegred_large_223197_total_runtime)));
                                    if (ctx->debugging) {
                                        OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                        time_end_237361 = get_wall_time();
                                        
                                        long time_diff_237362 =
                                             time_end_237361 -
                                             time_start_237360;
                                        
                                        fprintf(ctx->log,
                                                "kernel %s runtime: %ldus\n",
                                                "main.segred_large_223197",
                                                time_diff_237362);
                                    }
                                }
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s\n", "");
                                if (memblock_unref_device(ctx,
                                                          &segred_tmp_mem_235445,
                                                          "segred_tmp_mem_235445") !=
                                    0)
                                    return 1;
                            }
                            
                            int64_t segmap_usable_groups_223232 =
                                    sdiv_up64(nest_sizze_210118,
                                              segmap_group_sizze_223231);
                            struct memblock_device mem_231032;
                            
                            mem_231032.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_231032,
                                                      bytes_229427,
                                                      "mem_231032")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s\n", "\n# SegMap");
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_223236,
                                                                    1,
                                                                    sizeof(partition_sizze_203577),
                                                                    &partition_sizze_203577));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_223236,
                                                                    2,
                                                                    sizeof(t_n_m_203650),
                                                                    &t_n_m_203650));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_223236,
                                                                    3,
                                                                    sizeof(mem_231027.mem),
                                                                    &mem_231027.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_223236,
                                                                    4,
                                                                    sizeof(mem_231032.mem),
                                                                    &mem_231032.mem));
                            if (1 * ((size_t) segmap_usable_groups_223232 *
                                     (size_t) segmap_group_sizze_223231) != 0) {
                                const size_t global_work_sizze_237364[1] =
                                             {(size_t) segmap_usable_groups_223232 *
                                             (size_t) segmap_group_sizze_223231};
                                const size_t local_work_sizze_237368[1] =
                                             {(size_t) segmap_group_sizze_223231};
                                int64_t time_start_237365 = 0, time_end_237366 =
                                        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_223236",
                                            global_work_sizze_237364[0],
                                            local_work_sizze_237368[0],
                                            (int) 0);
                                    time_start_237365 = get_wall_time();
                                }
                                OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                                ctx->mainzisegmap_223236,
                                                                                1,
                                                                                NULL,
                                                                                global_work_sizze_237364,
                                                                                local_work_sizze_237368,
                                                                                0,
                                                                                NULL,
                                                                                ctx->profiling_paused ||
                                                                                !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                          &ctx->mainzisegmap_223236_runs,
                                                                                                                          &ctx->mainzisegmap_223236_total_runtime)));
                                if (ctx->debugging) {
                                    OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                    time_end_237366 = get_wall_time();
                                    
                                    long time_diff_237367 = time_end_237366 -
                                         time_start_237365;
                                    
                                    fprintf(ctx->log,
                                            "kernel %s runtime: %ldus\n",
                                            "main.segmap_223236",
                                            time_diff_237367);
                                }
                            }
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s\n", "");
                            if (memblock_unref_device(ctx, &mem_231027,
                                                      "mem_231027") != 0)
                                return 1;
                            
                            struct memblock_device mem_231037;
                            
                            mem_231037.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_231037,
                                                      bytes_229427,
                                                      "mem_231037")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (slt64(q_t_203494 * (int64_t) 2,
                                      segred_group_sizze_223242)) {
                                int64_t segment_sizze_nonzzero_235493 =
                                        smax64((int64_t) 1, q_t_203494);
                                int64_t num_threads_235494 = num_groups_223243 *
                                        segred_group_sizze_223242;
                                
                                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_203577 *
                                                         t_n_m_203650), '\n');
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s: %llu%c",
                                            "segment_size",
                                            (long long) q_t_203494, '\n');
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s: %llu%c",
                                            "segments_per_group",
                                            (long long) squot64(segred_group_sizze_223242,
                                                                segment_sizze_nonzzero_235493),
                                            '\n');
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s: %llu%c",
                                            "required_groups",
                                            (long long) sext_i64_i32(sdiv_up64(partition_sizze_203577 *
                                                                               t_n_m_203650,
                                                                               squot64(segred_group_sizze_223242,
                                                                                       segment_sizze_nonzzero_235493))),
                                            '\n');
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_223249,
                                                                        1,
                                                                        (size_t) ((int64_t) 8 *
                                                                                  segred_group_sizze_223242),
                                                                        NULL));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_223249,
                                                                        2,
                                                                        sizeof(n_203490),
                                                                        &n_203490));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_223249,
                                                                        3,
                                                                        sizeof(q_t_203494),
                                                                        &q_t_203494));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_223249,
                                                                        4,
                                                                        sizeof(jump_t_203500),
                                                                        &jump_t_203500));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_223249,
                                                                        5,
                                                                        sizeof(partition_sizze_203577),
                                                                        &partition_sizze_203577));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_223249,
                                                                        6,
                                                                        sizeof(t_n_m_203650),
                                                                        &t_n_m_203650));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_223249,
                                                                        7,
                                                                        sizeof(i_203670),
                                                                        &i_203670));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_223249,
                                                                        8,
                                                                        sizeof(num_groups_223243),
                                                                        &num_groups_223243));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_223249,
                                                                        9,
                                                                        sizeof(segment_sizze_nonzzero_235493),
                                                                        &segment_sizze_nonzzero_235493));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_223249,
                                                                        10,
                                                                        sizeof(ext_mem_229196.mem),
                                                                        &ext_mem_229196.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_223249,
                                                                        11,
                                                                        sizeof(ext_mem_229197.mem),
                                                                        &ext_mem_229197.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_223249,
                                                                        12,
                                                                        sizeof(ext_mem_229460.mem),
                                                                        &ext_mem_229460.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_223249,
                                                                        13,
                                                                        sizeof(ext_mem_229461.mem),
                                                                        &ext_mem_229461.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_223249,
                                                                        14,
                                                                        sizeof(mem_231013.mem),
                                                                        &mem_231013.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_223249,
                                                                        15,
                                                                        sizeof(mem_231017.mem),
                                                                        &mem_231017.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_223249,
                                                                        16,
                                                                        sizeof(mem_231032.mem),
                                                                        &mem_231032.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_223249,
                                                                        17,
                                                                        sizeof(mem_231037.mem),
                                                                        &mem_231037.mem));
                                if (1 * ((size_t) num_groups_223243 *
                                         (size_t) segred_group_sizze_223242) !=
                                    0) {
                                    const size_t global_work_sizze_237369[1] =
                                                 {(size_t) num_groups_223243 *
                                                 (size_t) segred_group_sizze_223242};
                                    const size_t local_work_sizze_237373[1] =
                                                 {(size_t) segred_group_sizze_223242};
                                    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_small_223249",
                                                global_work_sizze_237369[0],
                                                local_work_sizze_237373[0],
                                                (int) (0 + (int64_t) 8 *
                                                       segred_group_sizze_223242));
                                        time_start_237370 = get_wall_time();
                                    }
                                    OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                                    ctx->mainzisegred_small_223249,
                                                                                    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_small_223249_runs,
                                                                                                                              &ctx->mainzisegred_small_223249_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_small_223249",
                                                time_diff_237372);
                                    }
                                }
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s\n", "");
                            } else {
                                int64_t groups_per_segment_235522 =
                                        sdiv_up64(num_groups_223243,
                                                  smax64((int64_t) 1,
                                                         partition_sizze_203577 *
                                                         t_n_m_203650));
                                int64_t elements_per_thread_235523 =
                                        sdiv_up64(q_t_203494,
                                                  segred_group_sizze_223242 *
                                                  groups_per_segment_235522);
                                int64_t virt_num_groups_235524 =
                                        groups_per_segment_235522 *
                                        (partition_sizze_203577 * t_n_m_203650);
                                int64_t num_threads_235525 = num_groups_223243 *
                                        segred_group_sizze_223242;
                                int64_t threads_per_segment_235526 =
                                        groups_per_segment_235522 *
                                        segred_group_sizze_223242;
                                
                                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_203577 *
                                                         t_n_m_203650), '\n');
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s: %llu%c",
                                            "segment_size",
                                            (long long) q_t_203494, '\n');
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s: %llu%c",
                                            "virt_num_groups",
                                            (long long) virt_num_groups_235524,
                                            '\n');
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s: %llu%c",
                                            "num_groups",
                                            (long long) num_groups_223243,
                                            '\n');
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s: %llu%c",
                                            "group_size",
                                            (long long) segred_group_sizze_223242,
                                            '\n');
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s: %llu%c",
                                            "elems_per_thread",
                                            (long long) elements_per_thread_235523,
                                            '\n');
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s: %llu%c",
                                            "groups_per_segment",
                                            (long long) groups_per_segment_235522,
                                            '\n');
                                
                                struct memblock_device segred_tmp_mem_235527;
                                
                                segred_tmp_mem_235527.references = NULL;
                                if (memblock_alloc_device(ctx,
                                                          &segred_tmp_mem_235527,
                                                          (int64_t) 8 *
                                                          virt_num_groups_235524,
                                                          "segred_tmp_mem_235527")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device mainzicounter_mem_235529
                                                       =
                                                       ctx->mainzicounter_mem_235529;
                                
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_223249,
                                                                        1,
                                                                        (size_t) 1,
                                                                        NULL));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_223249,
                                                                        2,
                                                                        (size_t) ((int64_t) 8 *
                                                                                  segred_group_sizze_223242),
                                                                        NULL));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_223249,
                                                                        3,
                                                                        sizeof(n_203490),
                                                                        &n_203490));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_223249,
                                                                        4,
                                                                        sizeof(q_t_203494),
                                                                        &q_t_203494));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_223249,
                                                                        5,
                                                                        sizeof(jump_t_203500),
                                                                        &jump_t_203500));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_223249,
                                                                        6,
                                                                        sizeof(partition_sizze_203577),
                                                                        &partition_sizze_203577));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_223249,
                                                                        7,
                                                                        sizeof(t_n_m_203650),
                                                                        &t_n_m_203650));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_223249,
                                                                        8,
                                                                        sizeof(i_203670),
                                                                        &i_203670));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_223249,
                                                                        9,
                                                                        sizeof(num_groups_223243),
                                                                        &num_groups_223243));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_223249,
                                                                        10,
                                                                        sizeof(groups_per_segment_235522),
                                                                        &groups_per_segment_235522));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_223249,
                                                                        11,
                                                                        sizeof(elements_per_thread_235523),
                                                                        &elements_per_thread_235523));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_223249,
                                                                        12,
                                                                        sizeof(virt_num_groups_235524),
                                                                        &virt_num_groups_235524));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_223249,
                                                                        13,
                                                                        sizeof(threads_per_segment_235526),
                                                                        &threads_per_segment_235526));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_223249,
                                                                        14,
                                                                        sizeof(ext_mem_229196.mem),
                                                                        &ext_mem_229196.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_223249,
                                                                        15,
                                                                        sizeof(ext_mem_229197.mem),
                                                                        &ext_mem_229197.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_223249,
                                                                        16,
                                                                        sizeof(ext_mem_229460.mem),
                                                                        &ext_mem_229460.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_223249,
                                                                        17,
                                                                        sizeof(ext_mem_229461.mem),
                                                                        &ext_mem_229461.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_223249,
                                                                        18,
                                                                        sizeof(mem_231013.mem),
                                                                        &mem_231013.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_223249,
                                                                        19,
                                                                        sizeof(mem_231017.mem),
                                                                        &mem_231017.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_223249,
                                                                        20,
                                                                        sizeof(mem_231032.mem),
                                                                        &mem_231032.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_223249,
                                                                        21,
                                                                        sizeof(mem_231037.mem),
                                                                        &mem_231037.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_223249,
                                                                        22,
                                                                        sizeof(segred_tmp_mem_235527.mem),
                                                                        &segred_tmp_mem_235527.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_223249,
                                                                        23,
                                                                        sizeof(mainzicounter_mem_235529.mem),
                                                                        &mainzicounter_mem_235529.mem));
                                if (1 * ((size_t) num_groups_223243 *
                                         (size_t) segred_group_sizze_223242) !=
                                    0) {
                                    const size_t global_work_sizze_237375[1] =
                                                 {(size_t) num_groups_223243 *
                                                 (size_t) segred_group_sizze_223242};
                                    const size_t local_work_sizze_237379[1] =
                                                 {(size_t) segred_group_sizze_223242};
                                    int64_t time_start_237376 = 0,
                                            time_end_237377 = 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_223249",
                                                global_work_sizze_237375[0],
                                                local_work_sizze_237379[0],
                                                (int) (0 + 1 + (int64_t) 8 *
                                                       segred_group_sizze_223242));
                                        time_start_237376 = get_wall_time();
                                    }
                                    OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                                    ctx->mainzisegred_large_223249,
                                                                                    1,
                                                                                    NULL,
                                                                                    global_work_sizze_237375,
                                                                                    local_work_sizze_237379,
                                                                                    0,
                                                                                    NULL,
                                                                                    ctx->profiling_paused ||
                                                                                    !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                              &ctx->mainzisegred_large_223249_runs,
                                                                                                                              &ctx->mainzisegred_large_223249_total_runtime)));
                                    if (ctx->debugging) {
                                        OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                        time_end_237377 = get_wall_time();
                                        
                                        long time_diff_237378 =
                                             time_end_237377 -
                                             time_start_237376;
                                        
                                        fprintf(ctx->log,
                                                "kernel %s runtime: %ldus\n",
                                                "main.segred_large_223249",
                                                time_diff_237378);
                                    }
                                }
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s\n", "");
                                if (memblock_unref_device(ctx,
                                                          &segred_tmp_mem_235527,
                                                          "segred_tmp_mem_235527") !=
                                    0)
                                    return 1;
                            }
                            if (memblock_unref_device(ctx, &mem_231032,
                                                      "mem_231032") != 0)
                                return 1;
                            if (memblock_set_device(ctx, &ext_mem_231038,
                                                    &mem_231037,
                                                    "mem_231037") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_231037,
                                                      "mem_231037") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_231032,
                                                      "mem_231032") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_231027,
                                                      "mem_231027") != 0)
                                return 1;
                        }
                        if (memblock_unref_device(ctx, &mem_231013,
                                                  "mem_231013") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_231017,
                                                  "mem_231017") != 0)
                            return 1;
                        if (memblock_set_device(ctx, &ext_mem_231044,
                                                &ext_mem_231038,
                                                "ext_mem_231038") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_231038,
                                                  "ext_mem_231038") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_231017,
                                                  "mem_231017") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_231013,
                                                  "mem_231013") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_231008,
                                                  "mem_231008") != 0)
                            return 1;
                    }
                    if (memblock_set_device(ctx, &ext_mem_231402,
                                            &ext_mem_231044,
                                            "ext_mem_231044") != 0)
                        return 1;
                    if (memblock_set_device(ctx, &ext_mem_231401, &mem_230924,
                                            "mem_230924") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231044,
                                              "ext_mem_231044") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_230924, "mem_230924") !=
                        0)
                        return 1;
                } else {
                    bool match_lit_205943 = (int64_t) 1 == d_t_203497;
                    struct memblock_device ext_mem_231400;
                    
                    ext_mem_231400.references = NULL;
                    
                    struct memblock_device ext_mem_231399;
                    
                    ext_mem_231399.references = NULL;
                    if (match_lit_205943) {
                        bool suff_outer_par_223292;
                        
                        suff_outer_par_223292 =
                            *ctx->tuning_params.mainzisuff_outer_par_30 <=
                            partition_sizze_203577;
                        if (ctx->logging)
                            fprintf(ctx->log, "Compared %s <= %ld: %s.\n",
                                    "main.suff_outer_par_30",
                                    (long) partition_sizze_203577,
                                    suff_outer_par_223292 ? "true" : "false");
                        
                        int64_t segmap_group_sizze_223417;
                        
                        segmap_group_sizze_223417 =
                            *ctx->tuning_params.mainzisegmap_group_sizze_223296;
                        
                        int64_t num_groups_223418;
                        int32_t max_num_groups_235567;
                        
                        max_num_groups_235567 =
                            *ctx->tuning_params.mainzisegmap_num_groups_223298;
                        num_groups_223418 = sext_i64_i32(smax64((int64_t) 1,
                                                                smin64(sdiv_up64(partition_sizze_203577,
                                                                                 segmap_group_sizze_223417),
                                                                       sext_i32_i64(max_num_groups_235567))));
                        
                        int64_t segmap_group_sizze_224068;
                        
                        segmap_group_sizze_224068 =
                            *ctx->tuning_params.mainzisegmap_group_sizze_224042;
                        
                        int64_t segmap_group_sizze_224084;
                        
                        segmap_group_sizze_224084 =
                            *ctx->tuning_params.mainzisegmap_group_sizze_223986;
                        
                        int64_t segmap_group_sizze_224109;
                        
                        segmap_group_sizze_224109 =
                            *ctx->tuning_params.mainzisegmap_group_sizze_223544;
                        
                        bool suff_outer_par_224113;
                        
                        suff_outer_par_224113 =
                            *ctx->tuning_params.mainzisuff_outer_par_31 <=
                            nest_sizze_210118;
                        if (ctx->logging)
                            fprintf(ctx->log, "Compared %s <= %ld: %s.\n",
                                    "main.suff_outer_par_31",
                                    (long) nest_sizze_210118,
                                    suff_outer_par_224113 ? "true" : "false");
                        
                        int64_t nest_sizze_224225 = q_t_203494 *
                                nest_sizze_210118;
                        int64_t segred_group_sizze_224226;
                        
                        segred_group_sizze_224226 =
                            *ctx->tuning_params.mainzisegred_group_sizze_223755;
                        
                        int64_t num_groups_224227;
                        int32_t max_num_groups_235568;
                        
                        max_num_groups_235568 =
                            *ctx->tuning_params.mainzisegred_num_groups_223757;
                        num_groups_224227 = sext_i64_i32(smax64((int64_t) 1,
                                                                smin64(sdiv_up64(nest_sizze_224225,
                                                                                 segred_group_sizze_224226),
                                                                       sext_i32_i64(max_num_groups_235568))));
                        
                        int64_t segmap_group_sizze_224277;
                        
                        segmap_group_sizze_224277 =
                            *ctx->tuning_params.mainzisegmap_group_sizze_223733;
                        
                        int64_t segred_group_sizze_224299;
                        
                        segred_group_sizze_224299 =
                            *ctx->tuning_params.mainzisegred_group_sizze_223658;
                        
                        int64_t num_groups_224300;
                        int32_t max_num_groups_235569;
                        
                        max_num_groups_235569 =
                            *ctx->tuning_params.mainzisegred_num_groups_223660;
                        num_groups_224300 = sext_i64_i32(smax64((int64_t) 1,
                                                                smin64(sdiv_up64(nest_sizze_224225,
                                                                                 segred_group_sizze_224299),
                                                                       sext_i32_i64(max_num_groups_235569))));
                        
                        int64_t maxSubHelper_232043 = umax64(bytes_229169,
                                                             bytes_229420);
                        int64_t num_threads_232192 = segmap_group_sizze_223417 *
                                num_groups_223418;
                        int64_t total_sizze_232193 = maxSubHelper_232043 *
                                num_threads_232192;
                        int64_t total_sizze_232194 = bytes_229420 *
                                num_threads_232192;
                        int64_t total_sizze_232195 = bytes_229169 *
                                num_threads_232192;
                        int64_t total_sizze_232196 = bytes_229169 *
                                num_threads_232192;
                        struct memblock_device ext_mem_231213;
                        
                        ext_mem_231213.references = NULL;
                        
                        struct memblock_device ext_mem_231212;
                        
                        ext_mem_231212.references = NULL;
                        
                        int32_t local_memory_capacity_235839;
                        
                        local_memory_capacity_235839 =
                            ctx->opencl.max_local_memory;
                        if ((sle64((int64_t) 0,
                                   sext_i32_i64(local_memory_capacity_235839)) &&
                             sle64((int64_t) 0,
                                   sext_i32_i64(local_memory_capacity_235839))) &&
                            suff_outer_par_223292) {
                            struct memblock_device mem_231047;
                            
                            mem_231047.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_231047,
                                                      binop_y_229176,
                                                      "mem_231047")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (futrts_builtinzhgpu_map_transpose_f64(ctx,
                                                                      mem_231047,
                                                                      (int64_t) 0,
                                                                      mem_230920,
                                                                      (int64_t) 0,
                                                                      (int64_t) 1,
                                                                      n_203490,
                                                                      partition_sizze_203577) !=
                                0) {
                                if (memblock_unref_device(ctx, &mem_231047,
                                                          "mem_231047") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231212,
                                                          "ext_mem_231212") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231213,
                                                          "ext_mem_231213") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231399,
                                                          "ext_mem_231399") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231400,
                                                          "ext_mem_231400") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231401,
                                                          "ext_mem_231401") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231402,
                                                          "ext_mem_231402") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231504,
                                                          "ext_mem_231504") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231505,
                                                          "ext_mem_231505") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230920,
                                                          "mem_230920") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230914,
                                                          "ext_mem_230914") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230907,
                                                          "ext_mem_230907") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230908,
                                                          "ext_mem_230908") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230546,
                                                          "ext_mem_230546") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230529,
                                                          "ext_mem_230529") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230512,
                                                          "ext_mem_230512") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230494,
                                                          "ext_mem_230494") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230486,
                                                          "ext_mem_230486") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230487,
                                                          "ext_mem_230487") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229515,
                                                          "mem_param_229515") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229507,
                                                          "mem_param_229507") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231517,
                                                          "ext_mem_231517") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231518,
                                                          "ext_mem_231518") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229493,
                                                          "mem_param_229493") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229485,
                                                          "mem_param_229485") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229477,
                                                          "mem_param_229477") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231860,
                                                          "ext_mem_231860") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231861,
                                                          "ext_mem_231861") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231862,
                                                          "ext_mem_231862") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230551,
                                                          "mem_230551") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230534,
                                                          "mem_230534") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230517,
                                                          "mem_230517") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230500,
                                                          "mem_230500") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229531,
                                                          "mem_229531") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229526,
                                                          "mem_229526") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229520,
                                                          "mem_229520") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229469,
                                                          "mem_229469") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229465,
                                                          "mem_229465") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229460,
                                                          "ext_mem_229460") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229461,
                                                          "ext_mem_229461") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229411,
                                                          "ext_mem_229411") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229412,
                                                          "ext_mem_229412") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229362,
                                                          "ext_mem_229362") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229363,
                                                          "ext_mem_229363") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229264,
                                                          "ext_mem_229264") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229265,
                                                          "ext_mem_229265") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229206,
                                                          "mem_229206") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229200,
                                                          "mem_229200") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229196,
                                                          "ext_mem_229196") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229197,
                                                          "ext_mem_229197") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229164,
                                                          "mem_229164") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229161,
                                                          "mem_229161") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229157,
                                                          "mem_229157") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229155,
                                                          "mem_229155") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229152,
                                                          "mem_229152") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229148,
                                                          "mem_229148") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232249,
                                                          "mem_out_232249") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232248,
                                                          "mem_out_232248") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232247,
                                                          "mem_out_232247") !=
                                    0)
                                    return 1;
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device mem_231050;
                            
                            mem_231050.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_231050,
                                                      binop_y_229176,
                                                      "mem_231050")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (futrts_builtinzhgpu_map_transpose_i64(ctx,
                                                                      mem_231050,
                                                                      (int64_t) 0,
                                                                      ext_mem_229197,
                                                                      (int64_t) 0,
                                                                      (int64_t) 1,
                                                                      n_203490,
                                                                      partition_sizze_203577) !=
                                0) {
                                if (memblock_unref_device(ctx, &mem_231050,
                                                          "mem_231050") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231047,
                                                          "mem_231047") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231212,
                                                          "ext_mem_231212") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231213,
                                                          "ext_mem_231213") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231399,
                                                          "ext_mem_231399") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231400,
                                                          "ext_mem_231400") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231401,
                                                          "ext_mem_231401") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231402,
                                                          "ext_mem_231402") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231504,
                                                          "ext_mem_231504") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231505,
                                                          "ext_mem_231505") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230920,
                                                          "mem_230920") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230914,
                                                          "ext_mem_230914") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230907,
                                                          "ext_mem_230907") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230908,
                                                          "ext_mem_230908") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230546,
                                                          "ext_mem_230546") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230529,
                                                          "ext_mem_230529") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230512,
                                                          "ext_mem_230512") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230494,
                                                          "ext_mem_230494") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230486,
                                                          "ext_mem_230486") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230487,
                                                          "ext_mem_230487") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229515,
                                                          "mem_param_229515") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229507,
                                                          "mem_param_229507") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231517,
                                                          "ext_mem_231517") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231518,
                                                          "ext_mem_231518") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229493,
                                                          "mem_param_229493") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229485,
                                                          "mem_param_229485") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229477,
                                                          "mem_param_229477") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231860,
                                                          "ext_mem_231860") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231861,
                                                          "ext_mem_231861") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231862,
                                                          "ext_mem_231862") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230551,
                                                          "mem_230551") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230534,
                                                          "mem_230534") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230517,
                                                          "mem_230517") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230500,
                                                          "mem_230500") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229531,
                                                          "mem_229531") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229526,
                                                          "mem_229526") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229520,
                                                          "mem_229520") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229469,
                                                          "mem_229469") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229465,
                                                          "mem_229465") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229460,
                                                          "ext_mem_229460") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229461,
                                                          "ext_mem_229461") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229411,
                                                          "ext_mem_229411") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229412,
                                                          "ext_mem_229412") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229362,
                                                          "ext_mem_229362") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229363,
                                                          "ext_mem_229363") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229264,
                                                          "ext_mem_229264") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229265,
                                                          "ext_mem_229265") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229206,
                                                          "mem_229206") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229200,
                                                          "mem_229200") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229196,
                                                          "ext_mem_229196") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229197,
                                                          "ext_mem_229197") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229164,
                                                          "mem_229164") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229161,
                                                          "mem_229161") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229157,
                                                          "mem_229157") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229155,
                                                          "mem_229155") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229152,
                                                          "mem_229152") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229148,
                                                          "mem_229148") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232249,
                                                          "mem_out_232249") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232248,
                                                          "mem_out_232248") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232247,
                                                          "mem_out_232247") !=
                                    0)
                                    return 1;
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device mem_231053;
                            
                            mem_231053.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_231053,
                                                      binop_y_229426,
                                                      "mem_231053")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (futrts_builtinzhgpu_map_transpose_i64(ctx,
                                                                      mem_231053,
                                                                      (int64_t) 0,
                                                                      ext_mem_229461,
                                                                      (int64_t) 0,
                                                                      (int64_t) 1,
                                                                      t_n_m_203650,
                                                                      partition_sizze_203577) !=
                                0) {
                                if (memblock_unref_device(ctx, &mem_231053,
                                                          "mem_231053") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231050,
                                                          "mem_231050") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231047,
                                                          "mem_231047") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231212,
                                                          "ext_mem_231212") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231213,
                                                          "ext_mem_231213") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231399,
                                                          "ext_mem_231399") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231400,
                                                          "ext_mem_231400") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231401,
                                                          "ext_mem_231401") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231402,
                                                          "ext_mem_231402") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231504,
                                                          "ext_mem_231504") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231505,
                                                          "ext_mem_231505") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230920,
                                                          "mem_230920") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230914,
                                                          "ext_mem_230914") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230907,
                                                          "ext_mem_230907") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230908,
                                                          "ext_mem_230908") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230546,
                                                          "ext_mem_230546") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230529,
                                                          "ext_mem_230529") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230512,
                                                          "ext_mem_230512") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230494,
                                                          "ext_mem_230494") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230486,
                                                          "ext_mem_230486") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230487,
                                                          "ext_mem_230487") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229515,
                                                          "mem_param_229515") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229507,
                                                          "mem_param_229507") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231517,
                                                          "ext_mem_231517") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231518,
                                                          "ext_mem_231518") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229493,
                                                          "mem_param_229493") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229485,
                                                          "mem_param_229485") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229477,
                                                          "mem_param_229477") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231860,
                                                          "ext_mem_231860") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231861,
                                                          "ext_mem_231861") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231862,
                                                          "ext_mem_231862") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230551,
                                                          "mem_230551") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230534,
                                                          "mem_230534") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230517,
                                                          "mem_230517") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230500,
                                                          "mem_230500") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229531,
                                                          "mem_229531") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229526,
                                                          "mem_229526") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229520,
                                                          "mem_229520") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229469,
                                                          "mem_229469") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229465,
                                                          "mem_229465") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229460,
                                                          "ext_mem_229460") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229461,
                                                          "ext_mem_229461") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229411,
                                                          "ext_mem_229411") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229412,
                                                          "ext_mem_229412") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229362,
                                                          "ext_mem_229362") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229363,
                                                          "ext_mem_229363") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229264,
                                                          "ext_mem_229264") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229265,
                                                          "ext_mem_229265") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229206,
                                                          "mem_229206") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229200,
                                                          "mem_229200") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229196,
                                                          "ext_mem_229196") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229197,
                                                          "ext_mem_229197") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229164,
                                                          "mem_229164") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229161,
                                                          "mem_229161") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229157,
                                                          "mem_229157") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229155,
                                                          "mem_229155") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229152,
                                                          "mem_229152") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229148,
                                                          "mem_229148") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232249,
                                                          "mem_out_232249") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232248,
                                                          "mem_out_232248") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232247,
                                                          "mem_out_232247") !=
                                    0)
                                    return 1;
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device mem_231056;
                            
                            mem_231056.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_231056,
                                                      binop_y_229426,
                                                      "mem_231056")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (futrts_builtinzhgpu_map_transpose_f64(ctx,
                                                                      mem_231056,
                                                                      (int64_t) 0,
                                                                      ext_mem_229460,
                                                                      (int64_t) 0,
                                                                      (int64_t) 1,
                                                                      t_n_m_203650,
                                                                      partition_sizze_203577) !=
                                0) {
                                if (memblock_unref_device(ctx, &mem_231056,
                                                          "mem_231056") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231053,
                                                          "mem_231053") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231050,
                                                          "mem_231050") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231047,
                                                          "mem_231047") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231212,
                                                          "ext_mem_231212") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231213,
                                                          "ext_mem_231213") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231399,
                                                          "ext_mem_231399") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231400,
                                                          "ext_mem_231400") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231401,
                                                          "ext_mem_231401") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231402,
                                                          "ext_mem_231402") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231504,
                                                          "ext_mem_231504") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231505,
                                                          "ext_mem_231505") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230920,
                                                          "mem_230920") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230914,
                                                          "ext_mem_230914") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230907,
                                                          "ext_mem_230907") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230908,
                                                          "ext_mem_230908") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230546,
                                                          "ext_mem_230546") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230529,
                                                          "ext_mem_230529") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230512,
                                                          "ext_mem_230512") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230494,
                                                          "ext_mem_230494") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230486,
                                                          "ext_mem_230486") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230487,
                                                          "ext_mem_230487") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229515,
                                                          "mem_param_229515") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229507,
                                                          "mem_param_229507") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231517,
                                                          "ext_mem_231517") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231518,
                                                          "ext_mem_231518") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229493,
                                                          "mem_param_229493") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229485,
                                                          "mem_param_229485") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229477,
                                                          "mem_param_229477") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231860,
                                                          "ext_mem_231860") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231861,
                                                          "ext_mem_231861") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231862,
                                                          "ext_mem_231862") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230551,
                                                          "mem_230551") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230534,
                                                          "mem_230534") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230517,
                                                          "mem_230517") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230500,
                                                          "mem_230500") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229531,
                                                          "mem_229531") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229526,
                                                          "mem_229526") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229520,
                                                          "mem_229520") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229469,
                                                          "mem_229469") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229465,
                                                          "mem_229465") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229460,
                                                          "ext_mem_229460") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229461,
                                                          "ext_mem_229461") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229411,
                                                          "ext_mem_229411") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229412,
                                                          "ext_mem_229412") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229362,
                                                          "ext_mem_229362") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229363,
                                                          "ext_mem_229363") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229264,
                                                          "ext_mem_229264") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229265,
                                                          "ext_mem_229265") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229206,
                                                          "mem_229206") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229200,
                                                          "mem_229200") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229196,
                                                          "ext_mem_229196") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229197,
                                                          "ext_mem_229197") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229164,
                                                          "mem_229164") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229161,
                                                          "mem_229161") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229157,
                                                          "mem_229157") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229155,
                                                          "mem_229155") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229152,
                                                          "mem_229152") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229148,
                                                          "mem_229148") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232249,
                                                          "mem_out_232249") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232248,
                                                          "mem_out_232248") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232247,
                                                          "mem_out_232247") !=
                                    0)
                                    return 1;
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device mem_231059;
                            
                            mem_231059.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_231059,
                                                      binop_y_229176,
                                                      "mem_231059")) {
                                err = 1;
                                goto cleanup;
                            }
                            
                            int64_t group_sizze_235573;
                            
                            group_sizze_235573 =
                                *ctx->tuning_params.mainzigroup_sizze_235573;
                            
                            int64_t num_groups_235574 =
                                    sdiv_up64(partition_sizze_203577 * n_203490,
                                              group_sizze_235573);
                            
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzicopy_235570,
                                                                    0,
                                                                    sizeof(n_203490),
                                                                    &n_203490));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzicopy_235570,
                                                                    1,
                                                                    sizeof(partition_sizze_203577),
                                                                    &partition_sizze_203577));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzicopy_235570,
                                                                    2,
                                                                    sizeof(ctx_param_ext_229488),
                                                                    &ctx_param_ext_229488));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzicopy_235570,
                                                                    3,
                                                                    sizeof(ctx_param_ext_229489),
                                                                    &ctx_param_ext_229489));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzicopy_235570,
                                                                    4,
                                                                    sizeof(ctx_param_ext_229491),
                                                                    &ctx_param_ext_229491));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzicopy_235570,
                                                                    5,
                                                                    sizeof(mem_param_229493.mem),
                                                                    &mem_param_229493.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzicopy_235570,
                                                                    6,
                                                                    sizeof(mem_231059.mem),
                                                                    &mem_231059.mem));
                            if (1 * ((size_t) num_groups_235574 *
                                     (size_t) group_sizze_235573) != 0) {
                                const size_t global_work_sizze_237380[1] =
                                             {(size_t) num_groups_235574 *
                                             (size_t) group_sizze_235573};
                                const size_t local_work_sizze_237384[1] =
                                             {(size_t) group_sizze_235573};
                                int64_t time_start_237381 = 0, time_end_237382 =
                                        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_235570",
                                            global_work_sizze_237380[0],
                                            local_work_sizze_237384[0],
                                            (int) 0);
                                    time_start_237381 = get_wall_time();
                                }
                                OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                                ctx->mainzicopy_235570,
                                                                                1,
                                                                                NULL,
                                                                                global_work_sizze_237380,
                                                                                local_work_sizze_237384,
                                                                                0,
                                                                                NULL,
                                                                                ctx->profiling_paused ||
                                                                                !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                          &ctx->mainzicopy_235570_runs,
                                                                                                                          &ctx->mainzicopy_235570_total_runtime)));
                                if (ctx->debugging) {
                                    OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                    time_end_237382 = get_wall_time();
                                    
                                    long time_diff_237383 = time_end_237382 -
                                         time_start_237381;
                                    
                                    fprintf(ctx->log,
                                            "kernel %s runtime: %ldus\n",
                                            "main.copy_235570",
                                            time_diff_237383);
                                }
                            }
                            
                            struct memblock_device mem_231138;
                            
                            mem_231138.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_231138,
                                                      binop_y_229426,
                                                      "mem_231138")) {
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device mem_231141;
                            
                            mem_231141.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_231141,
                                                      binop_y_229426,
                                                      "mem_231141")) {
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device color_232044;
                            
                            color_232044.references = NULL;
                            if (memblock_alloc_device(ctx, &color_232044,
                                                      total_sizze_232193,
                                                      "color_232044")) {
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device color_232045;
                            
                            color_232045.references = NULL;
                            if (memblock_alloc_device(ctx, &color_232045,
                                                      total_sizze_232194,
                                                      "color_232045")) {
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device color_232046;
                            
                            color_232046.references = NULL;
                            if (memblock_alloc_device(ctx, &color_232046,
                                                      total_sizze_232195,
                                                      "color_232046")) {
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device color_232047;
                            
                            color_232047.references = NULL;
                            if (memblock_alloc_device(ctx, &color_232047,
                                                      total_sizze_232196,
                                                      "color_232047")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s\n", "\n# SegMap");
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_223423,
                                                                    1,
                                                                    sizeof(ctx->failure_is_an_option),
                                                                    &ctx->failure_is_an_option));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_223423,
                                                                    3,
                                                                    sizeof(n_203490),
                                                                    &n_203490));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_223423,
                                                                    4,
                                                                    sizeof(q_t_203494),
                                                                    &q_t_203494));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_223423,
                                                                    5,
                                                                    sizeof(jump_t_203500),
                                                                    &jump_t_203500));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_223423,
                                                                    6,
                                                                    sizeof(partition_sizze_203577),
                                                                    &partition_sizze_203577));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_223423,
                                                                    7,
                                                                    sizeof(t_n_m_203650),
                                                                    &t_n_m_203650));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_223423,
                                                                    8,
                                                                    sizeof(i_203670),
                                                                    &i_203670));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_223423,
                                                                    9,
                                                                    sizeof(num_groups_223418),
                                                                    &num_groups_223418));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_223423,
                                                                    10,
                                                                    sizeof(num_threads_232192),
                                                                    &num_threads_232192));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_223423,
                                                                    11,
                                                                    sizeof(mem_229161.mem),
                                                                    &mem_229161.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_223423,
                                                                    12,
                                                                    sizeof(ext_mem_229196.mem),
                                                                    &ext_mem_229196.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_223423,
                                                                    13,
                                                                    sizeof(mem_231047.mem),
                                                                    &mem_231047.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_223423,
                                                                    14,
                                                                    sizeof(mem_231050.mem),
                                                                    &mem_231050.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_223423,
                                                                    15,
                                                                    sizeof(mem_231053.mem),
                                                                    &mem_231053.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_223423,
                                                                    16,
                                                                    sizeof(mem_231056.mem),
                                                                    &mem_231056.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_223423,
                                                                    17,
                                                                    sizeof(mem_231059.mem),
                                                                    &mem_231059.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_223423,
                                                                    18,
                                                                    sizeof(mem_231138.mem),
                                                                    &mem_231138.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_223423,
                                                                    19,
                                                                    sizeof(mem_231141.mem),
                                                                    &mem_231141.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_223423,
                                                                    20,
                                                                    sizeof(color_232044.mem),
                                                                    &color_232044.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_223423,
                                                                    21,
                                                                    sizeof(color_232045.mem),
                                                                    &color_232045.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_223423,
                                                                    22,
                                                                    sizeof(color_232046.mem),
                                                                    &color_232046.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_223423,
                                                                    23,
                                                                    sizeof(color_232047.mem),
                                                                    &color_232047.mem));
                            if (1 * ((size_t) num_groups_223418 *
                                     (size_t) segmap_group_sizze_223417) != 0) {
                                const size_t global_work_sizze_237385[1] =
                                             {(size_t) num_groups_223418 *
                                             (size_t) segmap_group_sizze_223417};
                                const size_t local_work_sizze_237389[1] =
                                             {(size_t) segmap_group_sizze_223417};
                                int64_t time_start_237386 = 0, time_end_237387 =
                                        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_223423",
                                            global_work_sizze_237385[0],
                                            local_work_sizze_237389[0],
                                            (int) 0);
                                    time_start_237386 = get_wall_time();
                                }
                                OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                                ctx->mainzisegmap_223423,
                                                                                1,
                                                                                NULL,
                                                                                global_work_sizze_237385,
                                                                                local_work_sizze_237389,
                                                                                0,
                                                                                NULL,
                                                                                ctx->profiling_paused ||
                                                                                !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                          &ctx->mainzisegmap_223423_runs,
                                                                                                                          &ctx->mainzisegmap_223423_total_runtime)));
                                if (ctx->debugging) {
                                    OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                    time_end_237387 = get_wall_time();
                                    
                                    long time_diff_237388 = time_end_237387 -
                                         time_start_237386;
                                    
                                    fprintf(ctx->log,
                                            "kernel %s runtime: %ldus\n",
                                            "main.segmap_223423",
                                            time_diff_237388);
                                }
                            }
                            ctx->failure_is_an_option = 1;
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s\n", "");
                            if (memblock_unref_device(ctx, &mem_231047,
                                                      "mem_231047") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_231050,
                                                      "mem_231050") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_231053,
                                                      "mem_231053") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_231056,
                                                      "mem_231056") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_231059,
                                                      "mem_231059") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &color_232044,
                                                      "color_232044") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &color_232045,
                                                      "color_232045") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &color_232046,
                                                      "color_232046") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &color_232047,
                                                      "color_232047") != 0)
                                return 1;
                            
                            struct memblock_device mem_231205;
                            
                            mem_231205.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_231205,
                                                      bytes_229427,
                                                      "mem_231205")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (futrts_builtinzhgpu_map_transpose_f64(ctx,
                                                                      mem_231205,
                                                                      (int64_t) 0,
                                                                      mem_231138,
                                                                      (int64_t) 0,
                                                                      (int64_t) 1,
                                                                      partition_sizze_203577,
                                                                      t_n_m_203650) !=
                                0) {
                                if (memblock_unref_device(ctx, &mem_231205,
                                                          "mem_231205") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &color_232047,
                                                          "color_232047") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &color_232046,
                                                          "color_232046") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &color_232045,
                                                          "color_232045") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &color_232044,
                                                          "color_232044") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231141,
                                                          "mem_231141") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231138,
                                                          "mem_231138") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231059,
                                                          "mem_231059") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231056,
                                                          "mem_231056") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231053,
                                                          "mem_231053") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231050,
                                                          "mem_231050") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231047,
                                                          "mem_231047") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231212,
                                                          "ext_mem_231212") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231213,
                                                          "ext_mem_231213") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231399,
                                                          "ext_mem_231399") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231400,
                                                          "ext_mem_231400") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231401,
                                                          "ext_mem_231401") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231402,
                                                          "ext_mem_231402") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231504,
                                                          "ext_mem_231504") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231505,
                                                          "ext_mem_231505") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230920,
                                                          "mem_230920") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230914,
                                                          "ext_mem_230914") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230907,
                                                          "ext_mem_230907") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230908,
                                                          "ext_mem_230908") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230546,
                                                          "ext_mem_230546") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230529,
                                                          "ext_mem_230529") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230512,
                                                          "ext_mem_230512") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230494,
                                                          "ext_mem_230494") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230486,
                                                          "ext_mem_230486") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230487,
                                                          "ext_mem_230487") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229515,
                                                          "mem_param_229515") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229507,
                                                          "mem_param_229507") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231517,
                                                          "ext_mem_231517") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231518,
                                                          "ext_mem_231518") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229493,
                                                          "mem_param_229493") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229485,
                                                          "mem_param_229485") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229477,
                                                          "mem_param_229477") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231860,
                                                          "ext_mem_231860") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231861,
                                                          "ext_mem_231861") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231862,
                                                          "ext_mem_231862") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230551,
                                                          "mem_230551") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230534,
                                                          "mem_230534") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230517,
                                                          "mem_230517") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230500,
                                                          "mem_230500") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229531,
                                                          "mem_229531") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229526,
                                                          "mem_229526") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229520,
                                                          "mem_229520") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229469,
                                                          "mem_229469") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229465,
                                                          "mem_229465") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229460,
                                                          "ext_mem_229460") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229461,
                                                          "ext_mem_229461") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229411,
                                                          "ext_mem_229411") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229412,
                                                          "ext_mem_229412") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229362,
                                                          "ext_mem_229362") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229363,
                                                          "ext_mem_229363") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229264,
                                                          "ext_mem_229264") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229265,
                                                          "ext_mem_229265") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229206,
                                                          "mem_229206") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229200,
                                                          "mem_229200") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229196,
                                                          "ext_mem_229196") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229197,
                                                          "ext_mem_229197") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229164,
                                                          "mem_229164") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229161,
                                                          "mem_229161") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229157,
                                                          "mem_229157") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229155,
                                                          "mem_229155") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229152,
                                                          "mem_229152") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229148,
                                                          "mem_229148") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232249,
                                                          "mem_out_232249") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232248,
                                                          "mem_out_232248") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232247,
                                                          "mem_out_232247") !=
                                    0)
                                    return 1;
                                err = 1;
                                goto cleanup;
                            }
                            if (memblock_unref_device(ctx, &mem_231138,
                                                      "mem_231138") != 0)
                                return 1;
                            
                            struct memblock_device mem_231210;
                            
                            mem_231210.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_231210,
                                                      bytes_229427,
                                                      "mem_231210")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (futrts_builtinzhgpu_map_transpose_f64(ctx,
                                                                      mem_231210,
                                                                      (int64_t) 0,
                                                                      mem_231141,
                                                                      (int64_t) 0,
                                                                      (int64_t) 1,
                                                                      partition_sizze_203577,
                                                                      t_n_m_203650) !=
                                0) {
                                if (memblock_unref_device(ctx, &mem_231210,
                                                          "mem_231210") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231205,
                                                          "mem_231205") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &color_232047,
                                                          "color_232047") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &color_232046,
                                                          "color_232046") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &color_232045,
                                                          "color_232045") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &color_232044,
                                                          "color_232044") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231141,
                                                          "mem_231141") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231138,
                                                          "mem_231138") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231059,
                                                          "mem_231059") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231056,
                                                          "mem_231056") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231053,
                                                          "mem_231053") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231050,
                                                          "mem_231050") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231047,
                                                          "mem_231047") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231212,
                                                          "ext_mem_231212") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231213,
                                                          "ext_mem_231213") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231399,
                                                          "ext_mem_231399") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231400,
                                                          "ext_mem_231400") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231401,
                                                          "ext_mem_231401") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231402,
                                                          "ext_mem_231402") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231504,
                                                          "ext_mem_231504") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231505,
                                                          "ext_mem_231505") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230920,
                                                          "mem_230920") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230914,
                                                          "ext_mem_230914") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230907,
                                                          "ext_mem_230907") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230908,
                                                          "ext_mem_230908") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230546,
                                                          "ext_mem_230546") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230529,
                                                          "ext_mem_230529") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230512,
                                                          "ext_mem_230512") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230494,
                                                          "ext_mem_230494") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230486,
                                                          "ext_mem_230486") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230487,
                                                          "ext_mem_230487") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229515,
                                                          "mem_param_229515") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229507,
                                                          "mem_param_229507") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231517,
                                                          "ext_mem_231517") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231518,
                                                          "ext_mem_231518") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229493,
                                                          "mem_param_229493") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229485,
                                                          "mem_param_229485") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229477,
                                                          "mem_param_229477") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231860,
                                                          "ext_mem_231860") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231861,
                                                          "ext_mem_231861") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231862,
                                                          "ext_mem_231862") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230551,
                                                          "mem_230551") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230534,
                                                          "mem_230534") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230517,
                                                          "mem_230517") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230500,
                                                          "mem_230500") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229531,
                                                          "mem_229531") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229526,
                                                          "mem_229526") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229520,
                                                          "mem_229520") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229469,
                                                          "mem_229469") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229465,
                                                          "mem_229465") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229460,
                                                          "ext_mem_229460") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229461,
                                                          "ext_mem_229461") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229411,
                                                          "ext_mem_229411") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229412,
                                                          "ext_mem_229412") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229362,
                                                          "ext_mem_229362") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229363,
                                                          "ext_mem_229363") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229264,
                                                          "ext_mem_229264") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229265,
                                                          "ext_mem_229265") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229206,
                                                          "mem_229206") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229200,
                                                          "mem_229200") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229196,
                                                          "ext_mem_229196") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229197,
                                                          "ext_mem_229197") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229164,
                                                          "mem_229164") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229161,
                                                          "mem_229161") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229157,
                                                          "mem_229157") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229155,
                                                          "mem_229155") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229152,
                                                          "mem_229152") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229148,
                                                          "mem_229148") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232249,
                                                          "mem_out_232249") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232248,
                                                          "mem_out_232248") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232247,
                                                          "mem_out_232247") !=
                                    0)
                                    return 1;
                                err = 1;
                                goto cleanup;
                            }
                            if (memblock_unref_device(ctx, &mem_231141,
                                                      "mem_231141") != 0)
                                return 1;
                            if (memblock_set_device(ctx, &ext_mem_231213,
                                                    &mem_231205,
                                                    "mem_231205") != 0)
                                return 1;
                            if (memblock_set_device(ctx, &ext_mem_231212,
                                                    &mem_231210,
                                                    "mem_231210") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_231210,
                                                      "mem_231210") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_231205,
                                                      "mem_231205") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &color_232047,
                                                      "color_232047") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &color_232046,
                                                      "color_232046") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &color_232045,
                                                      "color_232045") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &color_232044,
                                                      "color_232044") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_231141,
                                                      "mem_231141") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_231138,
                                                      "mem_231138") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_231059,
                                                      "mem_231059") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_231056,
                                                      "mem_231056") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_231053,
                                                      "mem_231053") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_231050,
                                                      "mem_231050") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_231047,
                                                      "mem_231047") != 0)
                                return 1;
                        } else {
                            int64_t segmap_usable_groups_224069 =
                                    sdiv_up64(nest_sizze_207000,
                                              segmap_group_sizze_224068);
                            struct memblock_device mem_231146;
                            
                            mem_231146.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_231146,
                                                      bytes_229177,
                                                      "mem_231146")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s\n", "\n# SegMap");
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_224073,
                                                                    1,
                                                                    sizeof(n_203490),
                                                                    &n_203490));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_224073,
                                                                    2,
                                                                    sizeof(partition_sizze_203577),
                                                                    &partition_sizze_203577));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_224073,
                                                                    3,
                                                                    sizeof(mem_229161.mem),
                                                                    &mem_229161.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_224073,
                                                                    4,
                                                                    sizeof(mem_230920.mem),
                                                                    &mem_230920.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_224073,
                                                                    5,
                                                                    sizeof(mem_231146.mem),
                                                                    &mem_231146.mem));
                            if (1 * ((size_t) segmap_usable_groups_224069 *
                                     (size_t) segmap_group_sizze_224068) != 0) {
                                const size_t global_work_sizze_237390[1] =
                                             {(size_t) segmap_usable_groups_224069 *
                                             (size_t) segmap_group_sizze_224068};
                                const size_t local_work_sizze_237394[1] =
                                             {(size_t) segmap_group_sizze_224068};
                                int64_t time_start_237391 = 0, time_end_237392 =
                                        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_224073",
                                            global_work_sizze_237390[0],
                                            local_work_sizze_237394[0],
                                            (int) 0);
                                    time_start_237391 = get_wall_time();
                                }
                                OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                                ctx->mainzisegmap_224073,
                                                                                1,
                                                                                NULL,
                                                                                global_work_sizze_237390,
                                                                                local_work_sizze_237394,
                                                                                0,
                                                                                NULL,
                                                                                ctx->profiling_paused ||
                                                                                !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                          &ctx->mainzisegmap_224073_runs,
                                                                                                                          &ctx->mainzisegmap_224073_total_runtime)));
                                if (ctx->debugging) {
                                    OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                    time_end_237392 = get_wall_time();
                                    
                                    long time_diff_237393 = time_end_237392 -
                                         time_start_237391;
                                    
                                    fprintf(ctx->log,
                                            "kernel %s runtime: %ldus\n",
                                            "main.segmap_224073",
                                            time_diff_237393);
                                }
                            }
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s\n", "");
                            
                            int64_t segmap_usable_groups_224085 =
                                    sdiv_up64(nest_sizze_207000,
                                              segmap_group_sizze_224084);
                            struct memblock_device mem_231151;
                            
                            mem_231151.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_231151,
                                                      bytes_229177,
                                                      "mem_231151")) {
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device mem_231155;
                            
                            mem_231155.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_231155,
                                                      bytes_229177,
                                                      "mem_231155")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s\n", "\n# SegMap");
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_224090,
                                                                    1,
                                                                    sizeof(ctx->failure_is_an_option),
                                                                    &ctx->failure_is_an_option));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_224090,
                                                                    3,
                                                                    sizeof(n_203490),
                                                                    &n_203490));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_224090,
                                                                    4,
                                                                    sizeof(partition_sizze_203577),
                                                                    &partition_sizze_203577));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_224090,
                                                                    5,
                                                                    sizeof(ctx_param_ext_229488),
                                                                    &ctx_param_ext_229488));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_224090,
                                                                    6,
                                                                    sizeof(ctx_param_ext_229489),
                                                                    &ctx_param_ext_229489));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_224090,
                                                                    7,
                                                                    sizeof(ctx_param_ext_229491),
                                                                    &ctx_param_ext_229491));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_224090,
                                                                    8,
                                                                    sizeof(ext_mem_229197.mem),
                                                                    &ext_mem_229197.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_224090,
                                                                    9,
                                                                    sizeof(mem_param_229493.mem),
                                                                    &mem_param_229493.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_224090,
                                                                    10,
                                                                    sizeof(mem_231146.mem),
                                                                    &mem_231146.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_224090,
                                                                    11,
                                                                    sizeof(mem_231151.mem),
                                                                    &mem_231151.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_224090,
                                                                    12,
                                                                    sizeof(mem_231155.mem),
                                                                    &mem_231155.mem));
                            if (1 * ((size_t) segmap_usable_groups_224085 *
                                     (size_t) segmap_group_sizze_224084) != 0) {
                                const size_t global_work_sizze_237395[1] =
                                             {(size_t) segmap_usable_groups_224085 *
                                             (size_t) segmap_group_sizze_224084};
                                const size_t local_work_sizze_237399[1] =
                                             {(size_t) segmap_group_sizze_224084};
                                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.segmap_224090",
                                            global_work_sizze_237395[0],
                                            local_work_sizze_237399[0],
                                            (int) 0);
                                    time_start_237396 = get_wall_time();
                                }
                                OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                                ctx->mainzisegmap_224090,
                                                                                1,
                                                                                NULL,
                                                                                global_work_sizze_237395,
                                                                                local_work_sizze_237399,
                                                                                0,
                                                                                NULL,
                                                                                ctx->profiling_paused ||
                                                                                !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                          &ctx->mainzisegmap_224090_runs,
                                                                                                                          &ctx->mainzisegmap_224090_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.segmap_224090",
                                            time_diff_237398);
                                }
                            }
                            ctx->failure_is_an_option = 1;
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s\n", "");
                            if (memblock_unref_device(ctx, &mem_231146,
                                                      "mem_231146") != 0)
                                return 1;
                            
                            int64_t segmap_usable_groups_224110 =
                                    sdiv_up64(nest_sizze_210118,
                                              segmap_group_sizze_224109);
                            struct memblock_device ext_mem_231201;
                            
                            ext_mem_231201.references = NULL;
                            
                            struct memblock_device ext_mem_231200;
                            
                            ext_mem_231200.references = NULL;
                            
                            int32_t local_memory_capacity_235838;
                            
                            local_memory_capacity_235838 =
                                ctx->opencl.max_local_memory;
                            if (sle64((int64_t) 0,
                                      sext_i32_i64(local_memory_capacity_235838)) &&
                                suff_outer_par_224113) {
                                struct memblock_device mem_231160;
                                
                                mem_231160.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_231160,
                                                          bytes_229427,
                                                          "mem_231160")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device mem_231164;
                                
                                mem_231164.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_231164,
                                                          bytes_229427,
                                                          "mem_231164")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s\n", "\n# SegMap");
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_224120,
                                                                        1,
                                                                        sizeof(n_203490),
                                                                        &n_203490));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_224120,
                                                                        2,
                                                                        sizeof(q_t_203494),
                                                                        &q_t_203494));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_224120,
                                                                        3,
                                                                        sizeof(jump_t_203500),
                                                                        &jump_t_203500));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_224120,
                                                                        4,
                                                                        sizeof(partition_sizze_203577),
                                                                        &partition_sizze_203577));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_224120,
                                                                        5,
                                                                        sizeof(t_n_m_203650),
                                                                        &t_n_m_203650));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_224120,
                                                                        6,
                                                                        sizeof(i_203670),
                                                                        &i_203670));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_224120,
                                                                        7,
                                                                        sizeof(ext_mem_229196.mem),
                                                                        &ext_mem_229196.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_224120,
                                                                        8,
                                                                        sizeof(ext_mem_229197.mem),
                                                                        &ext_mem_229197.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_224120,
                                                                        9,
                                                                        sizeof(ext_mem_229460.mem),
                                                                        &ext_mem_229460.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_224120,
                                                                        10,
                                                                        sizeof(ext_mem_229461.mem),
                                                                        &ext_mem_229461.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_224120,
                                                                        11,
                                                                        sizeof(mem_231151.mem),
                                                                        &mem_231151.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_224120,
                                                                        12,
                                                                        sizeof(mem_231155.mem),
                                                                        &mem_231155.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_224120,
                                                                        13,
                                                                        sizeof(mem_231160.mem),
                                                                        &mem_231160.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_224120,
                                                                        14,
                                                                        sizeof(mem_231164.mem),
                                                                        &mem_231164.mem));
                                if (1 * ((size_t) segmap_usable_groups_224110 *
                                         (size_t) segmap_group_sizze_224109) !=
                                    0) {
                                    const size_t global_work_sizze_237400[1] =
                                                 {(size_t) segmap_usable_groups_224110 *
                                                 (size_t) segmap_group_sizze_224109};
                                    const size_t local_work_sizze_237404[1] =
                                                 {(size_t) segmap_group_sizze_224109};
                                    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_224120",
                                                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_224120,
                                                                                    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_224120_runs,
                                                                                                                              &ctx->mainzisegmap_224120_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_224120",
                                                time_diff_237403);
                                    }
                                }
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s\n", "");
                                if (memblock_set_device(ctx, &ext_mem_231201,
                                                        &mem_231160,
                                                        "mem_231160") != 0)
                                    return 1;
                                if (memblock_set_device(ctx, &ext_mem_231200,
                                                        &mem_231164,
                                                        "mem_231164") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231164,
                                                          "mem_231164") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231160,
                                                          "mem_231160") != 0)
                                    return 1;
                            } else {
                                struct memblock_device mem_231169;
                                
                                mem_231169.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_231169,
                                                          bytes_229427,
                                                          "mem_231169")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device mem_231173;
                                
                                mem_231173.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_231173,
                                                          bytes_229427,
                                                          "mem_231173")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device mem_231177;
                                
                                mem_231177.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_231177,
                                                          bytes_229427,
                                                          "mem_231177")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                if (slt64(q_t_203494 * (int64_t) 2,
                                          segred_group_sizze_224226)) {
                                    int64_t segment_sizze_nonzzero_235642 =
                                            smax64((int64_t) 1, q_t_203494);
                                    int64_t num_threads_235643 =
                                            num_groups_224227 *
                                            segred_group_sizze_224226;
                                    
                                    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_203577 *
                                                             t_n_m_203650),
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "segment_size",
                                                (long long) q_t_203494, '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "segments_per_group",
                                                (long long) squot64(segred_group_sizze_224226,
                                                                    segment_sizze_nonzzero_235642),
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "required_groups",
                                                (long long) sext_i64_i32(sdiv_up64(partition_sizze_203577 *
                                                                                   t_n_m_203650,
                                                                                   squot64(segred_group_sizze_224226,
                                                                                           segment_sizze_nonzzero_235642))),
                                                '\n');
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_224235,
                                                                            1,
                                                                            (size_t) ((int64_t) 8 *
                                                                                      segred_group_sizze_224226),
                                                                            NULL));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_224235,
                                                                            2,
                                                                            (size_t) ((int64_t) 8 *
                                                                                      segred_group_sizze_224226),
                                                                            NULL));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_224235,
                                                                            3,
                                                                            (size_t) ((int64_t) 8 *
                                                                                      segred_group_sizze_224226),
                                                                            NULL));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_224235,
                                                                            4,
                                                                            sizeof(n_203490),
                                                                            &n_203490));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_224235,
                                                                            5,
                                                                            sizeof(q_t_203494),
                                                                            &q_t_203494));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_224235,
                                                                            6,
                                                                            sizeof(jump_t_203500),
                                                                            &jump_t_203500));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_224235,
                                                                            7,
                                                                            sizeof(partition_sizze_203577),
                                                                            &partition_sizze_203577));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_224235,
                                                                            8,
                                                                            sizeof(t_n_m_203650),
                                                                            &t_n_m_203650));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_224235,
                                                                            9,
                                                                            sizeof(i_203670),
                                                                            &i_203670));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_224235,
                                                                            10,
                                                                            sizeof(num_groups_224227),
                                                                            &num_groups_224227));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_224235,
                                                                            11,
                                                                            sizeof(segment_sizze_nonzzero_235642),
                                                                            &segment_sizze_nonzzero_235642));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_224235,
                                                                            12,
                                                                            sizeof(ext_mem_229196.mem),
                                                                            &ext_mem_229196.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_224235,
                                                                            13,
                                                                            sizeof(ext_mem_229197.mem),
                                                                            &ext_mem_229197.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_224235,
                                                                            14,
                                                                            sizeof(ext_mem_229460.mem),
                                                                            &ext_mem_229460.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_224235,
                                                                            15,
                                                                            sizeof(ext_mem_229461.mem),
                                                                            &ext_mem_229461.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_224235,
                                                                            16,
                                                                            sizeof(mem_231151.mem),
                                                                            &mem_231151.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_224235,
                                                                            17,
                                                                            sizeof(mem_231169.mem),
                                                                            &mem_231169.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_224235,
                                                                            18,
                                                                            sizeof(mem_231173.mem),
                                                                            &mem_231173.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_224235,
                                                                            19,
                                                                            sizeof(mem_231177.mem),
                                                                            &mem_231177.mem));
                                    if (1 * ((size_t) num_groups_224227 *
                                             (size_t) segred_group_sizze_224226) !=
                                        0) {
                                        const size_t global_work_sizze_237405[1]
                                                     =
                                                     {(size_t) num_groups_224227 *
                                                     (size_t) segred_group_sizze_224226};
                                        const size_t local_work_sizze_237409[1]
                                                     =
                                                     {(size_t) segred_group_sizze_224226};
                                        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_224235",
                                                    global_work_sizze_237405[0],
                                                    local_work_sizze_237409[0],
                                                    (int) (0 + (int64_t) 8 *
                                                           segred_group_sizze_224226 +
                                                           (int64_t) 8 *
                                                           segred_group_sizze_224226 +
                                                           (int64_t) 8 *
                                                           segred_group_sizze_224226));
                                            time_start_237406 = get_wall_time();
                                        }
                                        OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                                        ctx->mainzisegred_small_224235,
                                                                                        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_224235_runs,
                                                                                                                                  &ctx->mainzisegred_small_224235_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_224235",
                                                    time_diff_237408);
                                        }
                                    }
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s\n", "");
                                } else {
                                    int64_t groups_per_segment_235683 =
                                            sdiv_up64(num_groups_224227,
                                                      smax64((int64_t) 1,
                                                             partition_sizze_203577 *
                                                             t_n_m_203650));
                                    int64_t elements_per_thread_235684 =
                                            sdiv_up64(q_t_203494,
                                                      segred_group_sizze_224226 *
                                                      groups_per_segment_235683);
                                    int64_t virt_num_groups_235685 =
                                            groups_per_segment_235683 *
                                            (partition_sizze_203577 *
                                             t_n_m_203650);
                                    int64_t num_threads_235686 =
                                            num_groups_224227 *
                                            segred_group_sizze_224226;
                                    int64_t threads_per_segment_235687 =
                                            groups_per_segment_235683 *
                                            segred_group_sizze_224226;
                                    
                                    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_203577 *
                                                             t_n_m_203650),
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "segment_size",
                                                (long long) q_t_203494, '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "virt_num_groups",
                                                (long long) virt_num_groups_235685,
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "num_groups",
                                                (long long) num_groups_224227,
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "group_size",
                                                (long long) segred_group_sizze_224226,
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "elems_per_thread",
                                                (long long) elements_per_thread_235684,
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "groups_per_segment",
                                                (long long) groups_per_segment_235683,
                                                '\n');
                                    
                                    struct memblock_device
                                    segred_tmp_mem_235688;
                                    
                                    segred_tmp_mem_235688.references = NULL;
                                    if (memblock_alloc_device(ctx,
                                                              &segred_tmp_mem_235688,
                                                              (int64_t) 8 *
                                                              virt_num_groups_235685,
                                                              "segred_tmp_mem_235688")) {
                                        err = 1;
                                        goto cleanup;
                                    }
                                    
                                    struct memblock_device
                                    segred_tmp_mem_235690;
                                    
                                    segred_tmp_mem_235690.references = NULL;
                                    if (memblock_alloc_device(ctx,
                                                              &segred_tmp_mem_235690,
                                                              (int64_t) 8 *
                                                              virt_num_groups_235685,
                                                              "segred_tmp_mem_235690")) {
                                        err = 1;
                                        goto cleanup;
                                    }
                                    
                                    struct memblock_device
                                    segred_tmp_mem_235692;
                                    
                                    segred_tmp_mem_235692.references = NULL;
                                    if (memblock_alloc_device(ctx,
                                                              &segred_tmp_mem_235692,
                                                              (int64_t) 8 *
                                                              virt_num_groups_235685,
                                                              "segred_tmp_mem_235692")) {
                                        err = 1;
                                        goto cleanup;
                                    }
                                    
                                    struct memblock_device
                                    mainzicounter_mem_235694 =
                                    ctx->mainzicounter_mem_235694;
                                    
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_224235,
                                                                            1,
                                                                            (size_t) 1,
                                                                            NULL));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_224235,
                                                                            2,
                                                                            (size_t) ((int64_t) 8 *
                                                                                      segred_group_sizze_224226),
                                                                            NULL));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_224235,
                                                                            3,
                                                                            (size_t) ((int64_t) 8 *
                                                                                      segred_group_sizze_224226),
                                                                            NULL));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_224235,
                                                                            4,
                                                                            (size_t) ((int64_t) 8 *
                                                                                      segred_group_sizze_224226),
                                                                            NULL));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_224235,
                                                                            5,
                                                                            sizeof(n_203490),
                                                                            &n_203490));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_224235,
                                                                            6,
                                                                            sizeof(q_t_203494),
                                                                            &q_t_203494));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_224235,
                                                                            7,
                                                                            sizeof(jump_t_203500),
                                                                            &jump_t_203500));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_224235,
                                                                            8,
                                                                            sizeof(partition_sizze_203577),
                                                                            &partition_sizze_203577));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_224235,
                                                                            9,
                                                                            sizeof(t_n_m_203650),
                                                                            &t_n_m_203650));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_224235,
                                                                            10,
                                                                            sizeof(i_203670),
                                                                            &i_203670));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_224235,
                                                                            11,
                                                                            sizeof(num_groups_224227),
                                                                            &num_groups_224227));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_224235,
                                                                            12,
                                                                            sizeof(groups_per_segment_235683),
                                                                            &groups_per_segment_235683));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_224235,
                                                                            13,
                                                                            sizeof(elements_per_thread_235684),
                                                                            &elements_per_thread_235684));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_224235,
                                                                            14,
                                                                            sizeof(virt_num_groups_235685),
                                                                            &virt_num_groups_235685));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_224235,
                                                                            15,
                                                                            sizeof(threads_per_segment_235687),
                                                                            &threads_per_segment_235687));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_224235,
                                                                            16,
                                                                            sizeof(ext_mem_229196.mem),
                                                                            &ext_mem_229196.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_224235,
                                                                            17,
                                                                            sizeof(ext_mem_229197.mem),
                                                                            &ext_mem_229197.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_224235,
                                                                            18,
                                                                            sizeof(ext_mem_229460.mem),
                                                                            &ext_mem_229460.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_224235,
                                                                            19,
                                                                            sizeof(ext_mem_229461.mem),
                                                                            &ext_mem_229461.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_224235,
                                                                            20,
                                                                            sizeof(mem_231151.mem),
                                                                            &mem_231151.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_224235,
                                                                            21,
                                                                            sizeof(mem_231169.mem),
                                                                            &mem_231169.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_224235,
                                                                            22,
                                                                            sizeof(mem_231173.mem),
                                                                            &mem_231173.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_224235,
                                                                            23,
                                                                            sizeof(mem_231177.mem),
                                                                            &mem_231177.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_224235,
                                                                            24,
                                                                            sizeof(segred_tmp_mem_235688.mem),
                                                                            &segred_tmp_mem_235688.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_224235,
                                                                            25,
                                                                            sizeof(segred_tmp_mem_235690.mem),
                                                                            &segred_tmp_mem_235690.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_224235,
                                                                            26,
                                                                            sizeof(segred_tmp_mem_235692.mem),
                                                                            &segred_tmp_mem_235692.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_224235,
                                                                            27,
                                                                            sizeof(mainzicounter_mem_235694.mem),
                                                                            &mainzicounter_mem_235694.mem));
                                    if (1 * ((size_t) num_groups_224227 *
                                             (size_t) segred_group_sizze_224226) !=
                                        0) {
                                        const size_t global_work_sizze_237411[1]
                                                     =
                                                     {(size_t) num_groups_224227 *
                                                     (size_t) segred_group_sizze_224226};
                                        const size_t local_work_sizze_237415[1]
                                                     =
                                                     {(size_t) segred_group_sizze_224226};
                                        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_224235",
                                                    global_work_sizze_237411[0],
                                                    local_work_sizze_237415[0],
                                                    (int) (0 + 1 + (int64_t) 8 *
                                                           segred_group_sizze_224226 +
                                                           (int64_t) 8 *
                                                           segred_group_sizze_224226 +
                                                           (int64_t) 8 *
                                                           segred_group_sizze_224226));
                                            time_start_237412 = get_wall_time();
                                        }
                                        OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                                        ctx->mainzisegred_large_224235,
                                                                                        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_224235_runs,
                                                                                                                                  &ctx->mainzisegred_large_224235_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_224235",
                                                    time_diff_237414);
                                        }
                                    }
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s\n", "");
                                    if (memblock_unref_device(ctx,
                                                              &segred_tmp_mem_235692,
                                                              "segred_tmp_mem_235692") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &segred_tmp_mem_235690,
                                                              "segred_tmp_mem_235690") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &segred_tmp_mem_235688,
                                                              "segred_tmp_mem_235688") !=
                                        0)
                                        return 1;
                                }
                                
                                int64_t segmap_usable_groups_224278 =
                                        sdiv_up64(nest_sizze_210118,
                                                  segmap_group_sizze_224277);
                                struct memblock_device mem_231182;
                                
                                mem_231182.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_231182,
                                                          bytes_229427,
                                                          "mem_231182")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device mem_231186;
                                
                                mem_231186.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_231186,
                                                          bytes_229427,
                                                          "mem_231186")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device mem_231190;
                                
                                mem_231190.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_231190,
                                                          bytes_229427,
                                                          "mem_231190")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s\n", "\n# SegMap");
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_224284,
                                                                        1,
                                                                        sizeof(partition_sizze_203577),
                                                                        &partition_sizze_203577));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_224284,
                                                                        2,
                                                                        sizeof(t_n_m_203650),
                                                                        &t_n_m_203650));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_224284,
                                                                        3,
                                                                        sizeof(mem_231169.mem),
                                                                        &mem_231169.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_224284,
                                                                        4,
                                                                        sizeof(mem_231173.mem),
                                                                        &mem_231173.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_224284,
                                                                        5,
                                                                        sizeof(mem_231177.mem),
                                                                        &mem_231177.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_224284,
                                                                        6,
                                                                        sizeof(mem_231182.mem),
                                                                        &mem_231182.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_224284,
                                                                        7,
                                                                        sizeof(mem_231186.mem),
                                                                        &mem_231186.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_224284,
                                                                        8,
                                                                        sizeof(mem_231190.mem),
                                                                        &mem_231190.mem));
                                if (1 * ((size_t) segmap_usable_groups_224278 *
                                         (size_t) segmap_group_sizze_224277) !=
                                    0) {
                                    const size_t global_work_sizze_237416[1] =
                                                 {(size_t) segmap_usable_groups_224278 *
                                                 (size_t) segmap_group_sizze_224277};
                                    const size_t local_work_sizze_237420[1] =
                                                 {(size_t) segmap_group_sizze_224277};
                                    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_224284",
                                                global_work_sizze_237416[0],
                                                local_work_sizze_237420[0],
                                                (int) 0);
                                        time_start_237417 = get_wall_time();
                                    }
                                    OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                                    ctx->mainzisegmap_224284,
                                                                                    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_224284_runs,
                                                                                                                              &ctx->mainzisegmap_224284_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_224284",
                                                time_diff_237419);
                                    }
                                }
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s\n", "");
                                if (memblock_unref_device(ctx, &mem_231169,
                                                          "mem_231169") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231173,
                                                          "mem_231173") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231177,
                                                          "mem_231177") != 0)
                                    return 1;
                                
                                struct memblock_device mem_231195;
                                
                                mem_231195.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_231195,
                                                          bytes_229427,
                                                          "mem_231195")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device mem_231199;
                                
                                mem_231199.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_231199,
                                                          bytes_229427,
                                                          "mem_231199")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                if (slt64(q_t_203494 * (int64_t) 2,
                                          segred_group_sizze_224299)) {
                                    int64_t segment_sizze_nonzzero_235752 =
                                            smax64((int64_t) 1, q_t_203494);
                                    int64_t num_threads_235753 =
                                            num_groups_224300 *
                                            segred_group_sizze_224299;
                                    
                                    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_203577 *
                                                             t_n_m_203650),
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "segment_size",
                                                (long long) q_t_203494, '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "segments_per_group",
                                                (long long) squot64(segred_group_sizze_224299,
                                                                    segment_sizze_nonzzero_235752),
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "required_groups",
                                                (long long) sext_i64_i32(sdiv_up64(partition_sizze_203577 *
                                                                                   t_n_m_203650,
                                                                                   squot64(segred_group_sizze_224299,
                                                                                           segment_sizze_nonzzero_235752))),
                                                '\n');
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_224307,
                                                                            1,
                                                                            (size_t) ((int64_t) 8 *
                                                                                      segred_group_sizze_224299),
                                                                            NULL));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_224307,
                                                                            2,
                                                                            (size_t) ((int64_t) 8 *
                                                                                      segred_group_sizze_224299),
                                                                            NULL));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_224307,
                                                                            3,
                                                                            sizeof(n_203490),
                                                                            &n_203490));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_224307,
                                                                            4,
                                                                            sizeof(q_t_203494),
                                                                            &q_t_203494));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_224307,
                                                                            5,
                                                                            sizeof(jump_t_203500),
                                                                            &jump_t_203500));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_224307,
                                                                            6,
                                                                            sizeof(partition_sizze_203577),
                                                                            &partition_sizze_203577));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_224307,
                                                                            7,
                                                                            sizeof(t_n_m_203650),
                                                                            &t_n_m_203650));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_224307,
                                                                            8,
                                                                            sizeof(i_203670),
                                                                            &i_203670));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_224307,
                                                                            9,
                                                                            sizeof(num_groups_224300),
                                                                            &num_groups_224300));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_224307,
                                                                            10,
                                                                            sizeof(segment_sizze_nonzzero_235752),
                                                                            &segment_sizze_nonzzero_235752));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_224307,
                                                                            11,
                                                                            sizeof(ext_mem_229196.mem),
                                                                            &ext_mem_229196.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_224307,
                                                                            12,
                                                                            sizeof(ext_mem_229197.mem),
                                                                            &ext_mem_229197.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_224307,
                                                                            13,
                                                                            sizeof(ext_mem_229460.mem),
                                                                            &ext_mem_229460.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_224307,
                                                                            14,
                                                                            sizeof(ext_mem_229461.mem),
                                                                            &ext_mem_229461.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_224307,
                                                                            15,
                                                                            sizeof(mem_231151.mem),
                                                                            &mem_231151.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_224307,
                                                                            16,
                                                                            sizeof(mem_231155.mem),
                                                                            &mem_231155.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_224307,
                                                                            17,
                                                                            sizeof(mem_231182.mem),
                                                                            &mem_231182.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_224307,
                                                                            18,
                                                                            sizeof(mem_231186.mem),
                                                                            &mem_231186.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_224307,
                                                                            19,
                                                                            sizeof(mem_231190.mem),
                                                                            &mem_231190.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_224307,
                                                                            20,
                                                                            sizeof(mem_231195.mem),
                                                                            &mem_231195.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_224307,
                                                                            21,
                                                                            sizeof(mem_231199.mem),
                                                                            &mem_231199.mem));
                                    if (1 * ((size_t) num_groups_224300 *
                                             (size_t) segred_group_sizze_224299) !=
                                        0) {
                                        const size_t global_work_sizze_237421[1]
                                                     =
                                                     {(size_t) num_groups_224300 *
                                                     (size_t) segred_group_sizze_224299};
                                        const size_t local_work_sizze_237425[1]
                                                     =
                                                     {(size_t) segred_group_sizze_224299};
                                        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.segred_small_224307",
                                                    global_work_sizze_237421[0],
                                                    local_work_sizze_237425[0],
                                                    (int) (0 + (int64_t) 8 *
                                                           segred_group_sizze_224299 +
                                                           (int64_t) 8 *
                                                           segred_group_sizze_224299));
                                            time_start_237422 = get_wall_time();
                                        }
                                        OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                                        ctx->mainzisegred_small_224307,
                                                                                        1,
                                                                                        NULL,
                                                                                        global_work_sizze_237421,
                                                                                        local_work_sizze_237425,
                                                                                        0,
                                                                                        NULL,
                                                                                        ctx->profiling_paused ||
                                                                                        !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                                  &ctx->mainzisegred_small_224307_runs,
                                                                                                                                  &ctx->mainzisegred_small_224307_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.segred_small_224307",
                                                    time_diff_237424);
                                        }
                                    }
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s\n", "");
                                } else {
                                    int64_t groups_per_segment_235787 =
                                            sdiv_up64(num_groups_224300,
                                                      smax64((int64_t) 1,
                                                             partition_sizze_203577 *
                                                             t_n_m_203650));
                                    int64_t elements_per_thread_235788 =
                                            sdiv_up64(q_t_203494,
                                                      segred_group_sizze_224299 *
                                                      groups_per_segment_235787);
                                    int64_t virt_num_groups_235789 =
                                            groups_per_segment_235787 *
                                            (partition_sizze_203577 *
                                             t_n_m_203650);
                                    int64_t num_threads_235790 =
                                            num_groups_224300 *
                                            segred_group_sizze_224299;
                                    int64_t threads_per_segment_235791 =
                                            groups_per_segment_235787 *
                                            segred_group_sizze_224299;
                                    
                                    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_203577 *
                                                             t_n_m_203650),
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "segment_size",
                                                (long long) q_t_203494, '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "virt_num_groups",
                                                (long long) virt_num_groups_235789,
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "num_groups",
                                                (long long) num_groups_224300,
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "group_size",
                                                (long long) segred_group_sizze_224299,
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "elems_per_thread",
                                                (long long) elements_per_thread_235788,
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "groups_per_segment",
                                                (long long) groups_per_segment_235787,
                                                '\n');
                                    
                                    struct memblock_device
                                    segred_tmp_mem_235792;
                                    
                                    segred_tmp_mem_235792.references = NULL;
                                    if (memblock_alloc_device(ctx,
                                                              &segred_tmp_mem_235792,
                                                              (int64_t) 8 *
                                                              virt_num_groups_235789,
                                                              "segred_tmp_mem_235792")) {
                                        err = 1;
                                        goto cleanup;
                                    }
                                    
                                    struct memblock_device
                                    segred_tmp_mem_235794;
                                    
                                    segred_tmp_mem_235794.references = NULL;
                                    if (memblock_alloc_device(ctx,
                                                              &segred_tmp_mem_235794,
                                                              (int64_t) 8 *
                                                              virt_num_groups_235789,
                                                              "segred_tmp_mem_235794")) {
                                        err = 1;
                                        goto cleanup;
                                    }
                                    
                                    struct memblock_device
                                    mainzicounter_mem_235796 =
                                    ctx->mainzicounter_mem_235796;
                                    
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_224307,
                                                                            1,
                                                                            (size_t) 1,
                                                                            NULL));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_224307,
                                                                            2,
                                                                            (size_t) ((int64_t) 8 *
                                                                                      segred_group_sizze_224299),
                                                                            NULL));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_224307,
                                                                            3,
                                                                            (size_t) ((int64_t) 8 *
                                                                                      segred_group_sizze_224299),
                                                                            NULL));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_224307,
                                                                            4,
                                                                            sizeof(n_203490),
                                                                            &n_203490));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_224307,
                                                                            5,
                                                                            sizeof(q_t_203494),
                                                                            &q_t_203494));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_224307,
                                                                            6,
                                                                            sizeof(jump_t_203500),
                                                                            &jump_t_203500));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_224307,
                                                                            7,
                                                                            sizeof(partition_sizze_203577),
                                                                            &partition_sizze_203577));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_224307,
                                                                            8,
                                                                            sizeof(t_n_m_203650),
                                                                            &t_n_m_203650));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_224307,
                                                                            9,
                                                                            sizeof(i_203670),
                                                                            &i_203670));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_224307,
                                                                            10,
                                                                            sizeof(num_groups_224300),
                                                                            &num_groups_224300));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_224307,
                                                                            11,
                                                                            sizeof(groups_per_segment_235787),
                                                                            &groups_per_segment_235787));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_224307,
                                                                            12,
                                                                            sizeof(elements_per_thread_235788),
                                                                            &elements_per_thread_235788));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_224307,
                                                                            13,
                                                                            sizeof(virt_num_groups_235789),
                                                                            &virt_num_groups_235789));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_224307,
                                                                            14,
                                                                            sizeof(threads_per_segment_235791),
                                                                            &threads_per_segment_235791));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_224307,
                                                                            15,
                                                                            sizeof(ext_mem_229196.mem),
                                                                            &ext_mem_229196.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_224307,
                                                                            16,
                                                                            sizeof(ext_mem_229197.mem),
                                                                            &ext_mem_229197.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_224307,
                                                                            17,
                                                                            sizeof(ext_mem_229460.mem),
                                                                            &ext_mem_229460.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_224307,
                                                                            18,
                                                                            sizeof(ext_mem_229461.mem),
                                                                            &ext_mem_229461.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_224307,
                                                                            19,
                                                                            sizeof(mem_231151.mem),
                                                                            &mem_231151.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_224307,
                                                                            20,
                                                                            sizeof(mem_231155.mem),
                                                                            &mem_231155.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_224307,
                                                                            21,
                                                                            sizeof(mem_231182.mem),
                                                                            &mem_231182.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_224307,
                                                                            22,
                                                                            sizeof(mem_231186.mem),
                                                                            &mem_231186.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_224307,
                                                                            23,
                                                                            sizeof(mem_231190.mem),
                                                                            &mem_231190.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_224307,
                                                                            24,
                                                                            sizeof(mem_231195.mem),
                                                                            &mem_231195.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_224307,
                                                                            25,
                                                                            sizeof(mem_231199.mem),
                                                                            &mem_231199.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_224307,
                                                                            26,
                                                                            sizeof(segred_tmp_mem_235792.mem),
                                                                            &segred_tmp_mem_235792.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_224307,
                                                                            27,
                                                                            sizeof(segred_tmp_mem_235794.mem),
                                                                            &segred_tmp_mem_235794.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_224307,
                                                                            28,
                                                                            sizeof(mainzicounter_mem_235796.mem),
                                                                            &mainzicounter_mem_235796.mem));
                                    if (1 * ((size_t) num_groups_224300 *
                                             (size_t) segred_group_sizze_224299) !=
                                        0) {
                                        const size_t global_work_sizze_237427[1]
                                                     =
                                                     {(size_t) num_groups_224300 *
                                                     (size_t) segred_group_sizze_224299};
                                        const size_t local_work_sizze_237431[1]
                                                     =
                                                     {(size_t) segred_group_sizze_224299};
                                        int64_t time_start_237428 = 0,
                                                time_end_237429 = 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_224307",
                                                    global_work_sizze_237427[0],
                                                    local_work_sizze_237431[0],
                                                    (int) (0 + 1 + (int64_t) 8 *
                                                           segred_group_sizze_224299 +
                                                           (int64_t) 8 *
                                                           segred_group_sizze_224299));
                                            time_start_237428 = get_wall_time();
                                        }
                                        OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                                        ctx->mainzisegred_large_224307,
                                                                                        1,
                                                                                        NULL,
                                                                                        global_work_sizze_237427,
                                                                                        local_work_sizze_237431,
                                                                                        0,
                                                                                        NULL,
                                                                                        ctx->profiling_paused ||
                                                                                        !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                                  &ctx->mainzisegred_large_224307_runs,
                                                                                                                                  &ctx->mainzisegred_large_224307_total_runtime)));
                                        if (ctx->debugging) {
                                            OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                            time_end_237429 = get_wall_time();
                                            
                                            long time_diff_237430 =
                                                 time_end_237429 -
                                                 time_start_237428;
                                            
                                            fprintf(ctx->log,
                                                    "kernel %s runtime: %ldus\n",
                                                    "main.segred_large_224307",
                                                    time_diff_237430);
                                        }
                                    }
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s\n", "");
                                    if (memblock_unref_device(ctx,
                                                              &segred_tmp_mem_235794,
                                                              "segred_tmp_mem_235794") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &segred_tmp_mem_235792,
                                                              "segred_tmp_mem_235792") !=
                                        0)
                                        return 1;
                                }
                                if (memblock_unref_device(ctx, &mem_231182,
                                                          "mem_231182") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231186,
                                                          "mem_231186") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231190,
                                                          "mem_231190") != 0)
                                    return 1;
                                if (memblock_set_device(ctx, &ext_mem_231201,
                                                        &mem_231195,
                                                        "mem_231195") != 0)
                                    return 1;
                                if (memblock_set_device(ctx, &ext_mem_231200,
                                                        &mem_231199,
                                                        "mem_231199") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231199,
                                                          "mem_231199") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231195,
                                                          "mem_231195") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231190,
                                                          "mem_231190") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231186,
                                                          "mem_231186") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231182,
                                                          "mem_231182") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231177,
                                                          "mem_231177") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231173,
                                                          "mem_231173") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231169,
                                                          "mem_231169") != 0)
                                    return 1;
                            }
                            if (memblock_unref_device(ctx, &mem_231151,
                                                      "mem_231151") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_231155,
                                                      "mem_231155") != 0)
                                return 1;
                            if (memblock_set_device(ctx, &ext_mem_231213,
                                                    &ext_mem_231201,
                                                    "ext_mem_231201") != 0)
                                return 1;
                            if (memblock_set_device(ctx, &ext_mem_231212,
                                                    &ext_mem_231200,
                                                    "ext_mem_231200") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231200,
                                                      "ext_mem_231200") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231201,
                                                      "ext_mem_231201") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_231155,
                                                      "mem_231155") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_231151,
                                                      "mem_231151") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_231146,
                                                      "mem_231146") != 0)
                                return 1;
                        }
                        if (memblock_set_device(ctx, &ext_mem_231400,
                                                &ext_mem_231213,
                                                "ext_mem_231213") != 0)
                            return 1;
                        if (memblock_set_device(ctx, &ext_mem_231399,
                                                &ext_mem_231212,
                                                "ext_mem_231212") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_231212,
                                                  "ext_mem_231212") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_231213,
                                                  "ext_mem_231213") != 0)
                            return 1;
                    } else {
                        bool suff_outer_par_224366;
                        
                        suff_outer_par_224366 =
                            *ctx->tuning_params.mainzisuff_outer_par_32 <=
                            partition_sizze_203577;
                        if (ctx->logging)
                            fprintf(ctx->log, "Compared %s <= %ld: %s.\n",
                                    "main.suff_outer_par_32",
                                    (long) partition_sizze_203577,
                                    suff_outer_par_224366 ? "true" : "false");
                        
                        int64_t segmap_group_sizze_224523;
                        
                        segmap_group_sizze_224523 =
                            *ctx->tuning_params.mainzisegmap_group_sizze_224370;
                        
                        int64_t num_groups_224524;
                        int32_t max_num_groups_235840;
                        
                        max_num_groups_235840 =
                            *ctx->tuning_params.mainzisegmap_num_groups_224372;
                        num_groups_224524 = sext_i64_i32(smax64((int64_t) 1,
                                                                smin64(sdiv_up64(partition_sizze_203577,
                                                                                 segmap_group_sizze_224523),
                                                                       sext_i32_i64(max_num_groups_235840))));
                        
                        int64_t segmap_group_sizze_225322;
                        
                        segmap_group_sizze_225322 =
                            *ctx->tuning_params.mainzisegmap_group_sizze_225296;
                        
                        int64_t segmap_group_sizze_225338;
                        
                        segmap_group_sizze_225338 =
                            *ctx->tuning_params.mainzisegmap_group_sizze_225240;
                        
                        int64_t segmap_group_sizze_225363;
                        
                        segmap_group_sizze_225363 =
                            *ctx->tuning_params.mainzisegmap_group_sizze_224682;
                        
                        bool suff_outer_par_225367;
                        
                        suff_outer_par_225367 =
                            *ctx->tuning_params.mainzisuff_outer_par_33 <=
                            nest_sizze_210118;
                        if (ctx->logging)
                            fprintf(ctx->log, "Compared %s <= %ld: %s.\n",
                                    "main.suff_outer_par_33",
                                    (long) nest_sizze_210118,
                                    suff_outer_par_225367 ? "true" : "false");
                        
                        int64_t nest_sizze_225511 = q_t_203494 *
                                nest_sizze_210118;
                        int64_t segred_group_sizze_225512;
                        
                        segred_group_sizze_225512 =
                            *ctx->tuning_params.mainzisegred_group_sizze_224961;
                        
                        int64_t num_groups_225513;
                        int32_t max_num_groups_235841;
                        
                        max_num_groups_235841 =
                            *ctx->tuning_params.mainzisegred_num_groups_224963;
                        num_groups_225513 = sext_i64_i32(smax64((int64_t) 1,
                                                                smin64(sdiv_up64(nest_sizze_225511,
                                                                                 segred_group_sizze_225512),
                                                                       sext_i32_i64(max_num_groups_235841))));
                        
                        int64_t segmap_group_sizze_225573;
                        
                        segmap_group_sizze_225573 =
                            *ctx->tuning_params.mainzisegmap_group_sizze_224920;
                        
                        int64_t segred_group_sizze_225616;
                        
                        segred_group_sizze_225616 =
                            *ctx->tuning_params.mainzisegred_group_sizze_224832;
                        
                        int64_t num_groups_225617;
                        int32_t max_num_groups_235842;
                        
                        max_num_groups_235842 =
                            *ctx->tuning_params.mainzisegred_num_groups_224834;
                        num_groups_225617 = sext_i64_i32(smax64((int64_t) 1,
                                                                smin64(sdiv_up64(nest_sizze_225511,
                                                                                 segred_group_sizze_225616),
                                                                       sext_i32_i64(max_num_groups_235842))));
                        
                        int64_t maxSubHelper_232048 = umax64(bytes_229169,
                                                             bytes_229420);
                        int64_t num_threads_232203 = segmap_group_sizze_224523 *
                                num_groups_224524;
                        int64_t total_sizze_232204 = maxSubHelper_232048 *
                                num_threads_232203;
                        int64_t total_sizze_232205 = bytes_229420 *
                                num_threads_232203;
                        int64_t total_sizze_232206 = bytes_229169 *
                                num_threads_232203;
                        int64_t total_sizze_232207 = bytes_229169 *
                                num_threads_232203;
                        struct memblock_device ext_mem_231398;
                        
                        ext_mem_231398.references = NULL;
                        
                        struct memblock_device ext_mem_231397;
                        
                        ext_mem_231397.references = NULL;
                        
                        int32_t local_memory_capacity_236144;
                        
                        local_memory_capacity_236144 =
                            ctx->opencl.max_local_memory;
                        if ((sle64((int64_t) 0,
                                   sext_i32_i64(local_memory_capacity_236144)) &&
                             sle64((int64_t) 0,
                                   sext_i32_i64(local_memory_capacity_236144))) &&
                            suff_outer_par_224366) {
                            struct memblock_device mem_231216;
                            
                            mem_231216.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_231216,
                                                      binop_y_229176,
                                                      "mem_231216")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (futrts_builtinzhgpu_map_transpose_f64(ctx,
                                                                      mem_231216,
                                                                      (int64_t) 0,
                                                                      mem_230920,
                                                                      (int64_t) 0,
                                                                      (int64_t) 1,
                                                                      n_203490,
                                                                      partition_sizze_203577) !=
                                0) {
                                if (memblock_unref_device(ctx, &mem_231216,
                                                          "mem_231216") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231397,
                                                          "ext_mem_231397") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231398,
                                                          "ext_mem_231398") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231399,
                                                          "ext_mem_231399") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231400,
                                                          "ext_mem_231400") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231401,
                                                          "ext_mem_231401") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231402,
                                                          "ext_mem_231402") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231504,
                                                          "ext_mem_231504") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231505,
                                                          "ext_mem_231505") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230920,
                                                          "mem_230920") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230914,
                                                          "ext_mem_230914") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230907,
                                                          "ext_mem_230907") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230908,
                                                          "ext_mem_230908") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230546,
                                                          "ext_mem_230546") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230529,
                                                          "ext_mem_230529") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230512,
                                                          "ext_mem_230512") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230494,
                                                          "ext_mem_230494") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230486,
                                                          "ext_mem_230486") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230487,
                                                          "ext_mem_230487") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229515,
                                                          "mem_param_229515") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229507,
                                                          "mem_param_229507") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231517,
                                                          "ext_mem_231517") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231518,
                                                          "ext_mem_231518") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229493,
                                                          "mem_param_229493") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229485,
                                                          "mem_param_229485") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229477,
                                                          "mem_param_229477") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231860,
                                                          "ext_mem_231860") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231861,
                                                          "ext_mem_231861") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231862,
                                                          "ext_mem_231862") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230551,
                                                          "mem_230551") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230534,
                                                          "mem_230534") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230517,
                                                          "mem_230517") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230500,
                                                          "mem_230500") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229531,
                                                          "mem_229531") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229526,
                                                          "mem_229526") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229520,
                                                          "mem_229520") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229469,
                                                          "mem_229469") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229465,
                                                          "mem_229465") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229460,
                                                          "ext_mem_229460") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229461,
                                                          "ext_mem_229461") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229411,
                                                          "ext_mem_229411") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229412,
                                                          "ext_mem_229412") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229362,
                                                          "ext_mem_229362") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229363,
                                                          "ext_mem_229363") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229264,
                                                          "ext_mem_229264") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229265,
                                                          "ext_mem_229265") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229206,
                                                          "mem_229206") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229200,
                                                          "mem_229200") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229196,
                                                          "ext_mem_229196") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229197,
                                                          "ext_mem_229197") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229164,
                                                          "mem_229164") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229161,
                                                          "mem_229161") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229157,
                                                          "mem_229157") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229155,
                                                          "mem_229155") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229152,
                                                          "mem_229152") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229148,
                                                          "mem_229148") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232249,
                                                          "mem_out_232249") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232248,
                                                          "mem_out_232248") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232247,
                                                          "mem_out_232247") !=
                                    0)
                                    return 1;
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device mem_231219;
                            
                            mem_231219.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_231219,
                                                      binop_y_229176,
                                                      "mem_231219")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (futrts_builtinzhgpu_map_transpose_i64(ctx,
                                                                      mem_231219,
                                                                      (int64_t) 0,
                                                                      ext_mem_229197,
                                                                      (int64_t) 0,
                                                                      (int64_t) 1,
                                                                      n_203490,
                                                                      partition_sizze_203577) !=
                                0) {
                                if (memblock_unref_device(ctx, &mem_231219,
                                                          "mem_231219") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231216,
                                                          "mem_231216") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231397,
                                                          "ext_mem_231397") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231398,
                                                          "ext_mem_231398") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231399,
                                                          "ext_mem_231399") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231400,
                                                          "ext_mem_231400") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231401,
                                                          "ext_mem_231401") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231402,
                                                          "ext_mem_231402") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231504,
                                                          "ext_mem_231504") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231505,
                                                          "ext_mem_231505") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230920,
                                                          "mem_230920") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230914,
                                                          "ext_mem_230914") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230907,
                                                          "ext_mem_230907") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230908,
                                                          "ext_mem_230908") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230546,
                                                          "ext_mem_230546") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230529,
                                                          "ext_mem_230529") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230512,
                                                          "ext_mem_230512") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230494,
                                                          "ext_mem_230494") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230486,
                                                          "ext_mem_230486") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230487,
                                                          "ext_mem_230487") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229515,
                                                          "mem_param_229515") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229507,
                                                          "mem_param_229507") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231517,
                                                          "ext_mem_231517") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231518,
                                                          "ext_mem_231518") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229493,
                                                          "mem_param_229493") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229485,
                                                          "mem_param_229485") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229477,
                                                          "mem_param_229477") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231860,
                                                          "ext_mem_231860") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231861,
                                                          "ext_mem_231861") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231862,
                                                          "ext_mem_231862") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230551,
                                                          "mem_230551") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230534,
                                                          "mem_230534") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230517,
                                                          "mem_230517") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230500,
                                                          "mem_230500") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229531,
                                                          "mem_229531") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229526,
                                                          "mem_229526") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229520,
                                                          "mem_229520") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229469,
                                                          "mem_229469") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229465,
                                                          "mem_229465") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229460,
                                                          "ext_mem_229460") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229461,
                                                          "ext_mem_229461") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229411,
                                                          "ext_mem_229411") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229412,
                                                          "ext_mem_229412") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229362,
                                                          "ext_mem_229362") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229363,
                                                          "ext_mem_229363") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229264,
                                                          "ext_mem_229264") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229265,
                                                          "ext_mem_229265") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229206,
                                                          "mem_229206") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229200,
                                                          "mem_229200") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229196,
                                                          "ext_mem_229196") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229197,
                                                          "ext_mem_229197") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229164,
                                                          "mem_229164") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229161,
                                                          "mem_229161") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229157,
                                                          "mem_229157") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229155,
                                                          "mem_229155") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229152,
                                                          "mem_229152") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229148,
                                                          "mem_229148") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232249,
                                                          "mem_out_232249") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232248,
                                                          "mem_out_232248") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232247,
                                                          "mem_out_232247") !=
                                    0)
                                    return 1;
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device mem_231222;
                            
                            mem_231222.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_231222,
                                                      binop_y_229426,
                                                      "mem_231222")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (futrts_builtinzhgpu_map_transpose_i64(ctx,
                                                                      mem_231222,
                                                                      (int64_t) 0,
                                                                      ext_mem_229461,
                                                                      (int64_t) 0,
                                                                      (int64_t) 1,
                                                                      t_n_m_203650,
                                                                      partition_sizze_203577) !=
                                0) {
                                if (memblock_unref_device(ctx, &mem_231222,
                                                          "mem_231222") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231219,
                                                          "mem_231219") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231216,
                                                          "mem_231216") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231397,
                                                          "ext_mem_231397") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231398,
                                                          "ext_mem_231398") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231399,
                                                          "ext_mem_231399") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231400,
                                                          "ext_mem_231400") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231401,
                                                          "ext_mem_231401") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231402,
                                                          "ext_mem_231402") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231504,
                                                          "ext_mem_231504") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231505,
                                                          "ext_mem_231505") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230920,
                                                          "mem_230920") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230914,
                                                          "ext_mem_230914") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230907,
                                                          "ext_mem_230907") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230908,
                                                          "ext_mem_230908") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230546,
                                                          "ext_mem_230546") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230529,
                                                          "ext_mem_230529") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230512,
                                                          "ext_mem_230512") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230494,
                                                          "ext_mem_230494") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230486,
                                                          "ext_mem_230486") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230487,
                                                          "ext_mem_230487") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229515,
                                                          "mem_param_229515") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229507,
                                                          "mem_param_229507") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231517,
                                                          "ext_mem_231517") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231518,
                                                          "ext_mem_231518") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229493,
                                                          "mem_param_229493") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229485,
                                                          "mem_param_229485") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229477,
                                                          "mem_param_229477") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231860,
                                                          "ext_mem_231860") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231861,
                                                          "ext_mem_231861") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231862,
                                                          "ext_mem_231862") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230551,
                                                          "mem_230551") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230534,
                                                          "mem_230534") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230517,
                                                          "mem_230517") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230500,
                                                          "mem_230500") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229531,
                                                          "mem_229531") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229526,
                                                          "mem_229526") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229520,
                                                          "mem_229520") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229469,
                                                          "mem_229469") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229465,
                                                          "mem_229465") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229460,
                                                          "ext_mem_229460") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229461,
                                                          "ext_mem_229461") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229411,
                                                          "ext_mem_229411") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229412,
                                                          "ext_mem_229412") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229362,
                                                          "ext_mem_229362") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229363,
                                                          "ext_mem_229363") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229264,
                                                          "ext_mem_229264") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229265,
                                                          "ext_mem_229265") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229206,
                                                          "mem_229206") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229200,
                                                          "mem_229200") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229196,
                                                          "ext_mem_229196") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229197,
                                                          "ext_mem_229197") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229164,
                                                          "mem_229164") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229161,
                                                          "mem_229161") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229157,
                                                          "mem_229157") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229155,
                                                          "mem_229155") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229152,
                                                          "mem_229152") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229148,
                                                          "mem_229148") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232249,
                                                          "mem_out_232249") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232248,
                                                          "mem_out_232248") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232247,
                                                          "mem_out_232247") !=
                                    0)
                                    return 1;
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device mem_231225;
                            
                            mem_231225.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_231225,
                                                      binop_y_229426,
                                                      "mem_231225")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (futrts_builtinzhgpu_map_transpose_f64(ctx,
                                                                      mem_231225,
                                                                      (int64_t) 0,
                                                                      ext_mem_229460,
                                                                      (int64_t) 0,
                                                                      (int64_t) 1,
                                                                      t_n_m_203650,
                                                                      partition_sizze_203577) !=
                                0) {
                                if (memblock_unref_device(ctx, &mem_231225,
                                                          "mem_231225") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231222,
                                                          "mem_231222") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231219,
                                                          "mem_231219") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231216,
                                                          "mem_231216") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231397,
                                                          "ext_mem_231397") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231398,
                                                          "ext_mem_231398") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231399,
                                                          "ext_mem_231399") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231400,
                                                          "ext_mem_231400") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231401,
                                                          "ext_mem_231401") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231402,
                                                          "ext_mem_231402") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231504,
                                                          "ext_mem_231504") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231505,
                                                          "ext_mem_231505") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230920,
                                                          "mem_230920") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230914,
                                                          "ext_mem_230914") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230907,
                                                          "ext_mem_230907") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230908,
                                                          "ext_mem_230908") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230546,
                                                          "ext_mem_230546") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230529,
                                                          "ext_mem_230529") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230512,
                                                          "ext_mem_230512") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230494,
                                                          "ext_mem_230494") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230486,
                                                          "ext_mem_230486") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230487,
                                                          "ext_mem_230487") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229515,
                                                          "mem_param_229515") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229507,
                                                          "mem_param_229507") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231517,
                                                          "ext_mem_231517") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231518,
                                                          "ext_mem_231518") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229493,
                                                          "mem_param_229493") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229485,
                                                          "mem_param_229485") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229477,
                                                          "mem_param_229477") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231860,
                                                          "ext_mem_231860") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231861,
                                                          "ext_mem_231861") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231862,
                                                          "ext_mem_231862") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230551,
                                                          "mem_230551") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230534,
                                                          "mem_230534") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230517,
                                                          "mem_230517") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230500,
                                                          "mem_230500") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229531,
                                                          "mem_229531") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229526,
                                                          "mem_229526") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229520,
                                                          "mem_229520") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229469,
                                                          "mem_229469") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229465,
                                                          "mem_229465") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229460,
                                                          "ext_mem_229460") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229461,
                                                          "ext_mem_229461") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229411,
                                                          "ext_mem_229411") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229412,
                                                          "ext_mem_229412") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229362,
                                                          "ext_mem_229362") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229363,
                                                          "ext_mem_229363") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229264,
                                                          "ext_mem_229264") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229265,
                                                          "ext_mem_229265") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229206,
                                                          "mem_229206") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229200,
                                                          "mem_229200") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229196,
                                                          "ext_mem_229196") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229197,
                                                          "ext_mem_229197") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229164,
                                                          "mem_229164") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229161,
                                                          "mem_229161") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229157,
                                                          "mem_229157") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229155,
                                                          "mem_229155") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229152,
                                                          "mem_229152") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229148,
                                                          "mem_229148") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232249,
                                                          "mem_out_232249") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232248,
                                                          "mem_out_232248") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232247,
                                                          "mem_out_232247") !=
                                    0)
                                    return 1;
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device mem_231228;
                            
                            mem_231228.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_231228,
                                                      binop_y_229176,
                                                      "mem_231228")) {
                                err = 1;
                                goto cleanup;
                            }
                            
                            int64_t group_sizze_235846;
                            
                            group_sizze_235846 =
                                *ctx->tuning_params.mainzigroup_sizze_235846;
                            
                            int64_t num_groups_235847 =
                                    sdiv_up64(partition_sizze_203577 * n_203490,
                                              group_sizze_235846);
                            
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzicopy_235843,
                                                                    0,
                                                                    sizeof(n_203490),
                                                                    &n_203490));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzicopy_235843,
                                                                    1,
                                                                    sizeof(partition_sizze_203577),
                                                                    &partition_sizze_203577));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzicopy_235843,
                                                                    2,
                                                                    sizeof(ctx_param_ext_229488),
                                                                    &ctx_param_ext_229488));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzicopy_235843,
                                                                    3,
                                                                    sizeof(ctx_param_ext_229489),
                                                                    &ctx_param_ext_229489));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzicopy_235843,
                                                                    4,
                                                                    sizeof(ctx_param_ext_229491),
                                                                    &ctx_param_ext_229491));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzicopy_235843,
                                                                    5,
                                                                    sizeof(mem_param_229493.mem),
                                                                    &mem_param_229493.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzicopy_235843,
                                                                    6,
                                                                    sizeof(mem_231228.mem),
                                                                    &mem_231228.mem));
                            if (1 * ((size_t) num_groups_235847 *
                                     (size_t) group_sizze_235846) != 0) {
                                const size_t global_work_sizze_237432[1] =
                                             {(size_t) num_groups_235847 *
                                             (size_t) group_sizze_235846};
                                const size_t local_work_sizze_237436[1] =
                                             {(size_t) group_sizze_235846};
                                int64_t time_start_237433 = 0, time_end_237434 =
                                        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_235843",
                                            global_work_sizze_237432[0],
                                            local_work_sizze_237436[0],
                                            (int) 0);
                                    time_start_237433 = get_wall_time();
                                }
                                OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                                ctx->mainzicopy_235843,
                                                                                1,
                                                                                NULL,
                                                                                global_work_sizze_237432,
                                                                                local_work_sizze_237436,
                                                                                0,
                                                                                NULL,
                                                                                ctx->profiling_paused ||
                                                                                !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                          &ctx->mainzicopy_235843_runs,
                                                                                                                          &ctx->mainzicopy_235843_total_runtime)));
                                if (ctx->debugging) {
                                    OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                    time_end_237434 = get_wall_time();
                                    
                                    long time_diff_237435 = time_end_237434 -
                                         time_start_237433;
                                    
                                    fprintf(ctx->log,
                                            "kernel %s runtime: %ldus\n",
                                            "main.copy_235843",
                                            time_diff_237435);
                                }
                            }
                            
                            struct memblock_device mem_231307;
                            
                            mem_231307.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_231307,
                                                      binop_y_229426,
                                                      "mem_231307")) {
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device mem_231310;
                            
                            mem_231310.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_231310,
                                                      binop_y_229426,
                                                      "mem_231310")) {
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device color_232049;
                            
                            color_232049.references = NULL;
                            if (memblock_alloc_device(ctx, &color_232049,
                                                      total_sizze_232204,
                                                      "color_232049")) {
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device color_232050;
                            
                            color_232050.references = NULL;
                            if (memblock_alloc_device(ctx, &color_232050,
                                                      total_sizze_232205,
                                                      "color_232050")) {
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device color_232051;
                            
                            color_232051.references = NULL;
                            if (memblock_alloc_device(ctx, &color_232051,
                                                      total_sizze_232206,
                                                      "color_232051")) {
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device color_232052;
                            
                            color_232052.references = NULL;
                            if (memblock_alloc_device(ctx, &color_232052,
                                                      total_sizze_232207,
                                                      "color_232052")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s\n", "\n# SegMap");
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_224529,
                                                                    1,
                                                                    sizeof(ctx->failure_is_an_option),
                                                                    &ctx->failure_is_an_option));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_224529,
                                                                    3,
                                                                    sizeof(n_203490),
                                                                    &n_203490));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_224529,
                                                                    4,
                                                                    sizeof(q_t_203494),
                                                                    &q_t_203494));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_224529,
                                                                    5,
                                                                    sizeof(jump_t_203500),
                                                                    &jump_t_203500));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_224529,
                                                                    6,
                                                                    sizeof(partition_sizze_203577),
                                                                    &partition_sizze_203577));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_224529,
                                                                    7,
                                                                    sizeof(t_n_m_203650),
                                                                    &t_n_m_203650));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_224529,
                                                                    8,
                                                                    sizeof(i_203670),
                                                                    &i_203670));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_224529,
                                                                    9,
                                                                    sizeof(num_groups_224524),
                                                                    &num_groups_224524));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_224529,
                                                                    10,
                                                                    sizeof(num_threads_232203),
                                                                    &num_threads_232203));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_224529,
                                                                    11,
                                                                    sizeof(mem_229161.mem),
                                                                    &mem_229161.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_224529,
                                                                    12,
                                                                    sizeof(ext_mem_229196.mem),
                                                                    &ext_mem_229196.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_224529,
                                                                    13,
                                                                    sizeof(mem_231216.mem),
                                                                    &mem_231216.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_224529,
                                                                    14,
                                                                    sizeof(mem_231219.mem),
                                                                    &mem_231219.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_224529,
                                                                    15,
                                                                    sizeof(mem_231222.mem),
                                                                    &mem_231222.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_224529,
                                                                    16,
                                                                    sizeof(mem_231225.mem),
                                                                    &mem_231225.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_224529,
                                                                    17,
                                                                    sizeof(mem_231228.mem),
                                                                    &mem_231228.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_224529,
                                                                    18,
                                                                    sizeof(mem_231307.mem),
                                                                    &mem_231307.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_224529,
                                                                    19,
                                                                    sizeof(mem_231310.mem),
                                                                    &mem_231310.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_224529,
                                                                    20,
                                                                    sizeof(color_232049.mem),
                                                                    &color_232049.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_224529,
                                                                    21,
                                                                    sizeof(color_232050.mem),
                                                                    &color_232050.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_224529,
                                                                    22,
                                                                    sizeof(color_232051.mem),
                                                                    &color_232051.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_224529,
                                                                    23,
                                                                    sizeof(color_232052.mem),
                                                                    &color_232052.mem));
                            if (1 * ((size_t) num_groups_224524 *
                                     (size_t) segmap_group_sizze_224523) != 0) {
                                const size_t global_work_sizze_237437[1] =
                                             {(size_t) num_groups_224524 *
                                             (size_t) segmap_group_sizze_224523};
                                const size_t local_work_sizze_237441[1] =
                                             {(size_t) segmap_group_sizze_224523};
                                int64_t time_start_237438 = 0, time_end_237439 =
                                        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_224529",
                                            global_work_sizze_237437[0],
                                            local_work_sizze_237441[0],
                                            (int) 0);
                                    time_start_237438 = get_wall_time();
                                }
                                OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                                ctx->mainzisegmap_224529,
                                                                                1,
                                                                                NULL,
                                                                                global_work_sizze_237437,
                                                                                local_work_sizze_237441,
                                                                                0,
                                                                                NULL,
                                                                                ctx->profiling_paused ||
                                                                                !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                          &ctx->mainzisegmap_224529_runs,
                                                                                                                          &ctx->mainzisegmap_224529_total_runtime)));
                                if (ctx->debugging) {
                                    OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                    time_end_237439 = get_wall_time();
                                    
                                    long time_diff_237440 = time_end_237439 -
                                         time_start_237438;
                                    
                                    fprintf(ctx->log,
                                            "kernel %s runtime: %ldus\n",
                                            "main.segmap_224529",
                                            time_diff_237440);
                                }
                            }
                            ctx->failure_is_an_option = 1;
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s\n", "");
                            if (memblock_unref_device(ctx, &mem_231216,
                                                      "mem_231216") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_231219,
                                                      "mem_231219") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_231222,
                                                      "mem_231222") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_231225,
                                                      "mem_231225") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_231228,
                                                      "mem_231228") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &color_232049,
                                                      "color_232049") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &color_232050,
                                                      "color_232050") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &color_232051,
                                                      "color_232051") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &color_232052,
                                                      "color_232052") != 0)
                                return 1;
                            
                            struct memblock_device mem_231390;
                            
                            mem_231390.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_231390,
                                                      bytes_229427,
                                                      "mem_231390")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (futrts_builtinzhgpu_map_transpose_f64(ctx,
                                                                      mem_231390,
                                                                      (int64_t) 0,
                                                                      mem_231307,
                                                                      (int64_t) 0,
                                                                      (int64_t) 1,
                                                                      partition_sizze_203577,
                                                                      t_n_m_203650) !=
                                0) {
                                if (memblock_unref_device(ctx, &mem_231390,
                                                          "mem_231390") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &color_232052,
                                                          "color_232052") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &color_232051,
                                                          "color_232051") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &color_232050,
                                                          "color_232050") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &color_232049,
                                                          "color_232049") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231310,
                                                          "mem_231310") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231307,
                                                          "mem_231307") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231228,
                                                          "mem_231228") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231225,
                                                          "mem_231225") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231222,
                                                          "mem_231222") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231219,
                                                          "mem_231219") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231216,
                                                          "mem_231216") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231397,
                                                          "ext_mem_231397") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231398,
                                                          "ext_mem_231398") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231399,
                                                          "ext_mem_231399") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231400,
                                                          "ext_mem_231400") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231401,
                                                          "ext_mem_231401") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231402,
                                                          "ext_mem_231402") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231504,
                                                          "ext_mem_231504") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231505,
                                                          "ext_mem_231505") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230920,
                                                          "mem_230920") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230914,
                                                          "ext_mem_230914") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230907,
                                                          "ext_mem_230907") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230908,
                                                          "ext_mem_230908") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230546,
                                                          "ext_mem_230546") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230529,
                                                          "ext_mem_230529") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230512,
                                                          "ext_mem_230512") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230494,
                                                          "ext_mem_230494") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230486,
                                                          "ext_mem_230486") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230487,
                                                          "ext_mem_230487") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229515,
                                                          "mem_param_229515") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229507,
                                                          "mem_param_229507") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231517,
                                                          "ext_mem_231517") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231518,
                                                          "ext_mem_231518") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229493,
                                                          "mem_param_229493") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229485,
                                                          "mem_param_229485") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229477,
                                                          "mem_param_229477") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231860,
                                                          "ext_mem_231860") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231861,
                                                          "ext_mem_231861") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231862,
                                                          "ext_mem_231862") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230551,
                                                          "mem_230551") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230534,
                                                          "mem_230534") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230517,
                                                          "mem_230517") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230500,
                                                          "mem_230500") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229531,
                                                          "mem_229531") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229526,
                                                          "mem_229526") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229520,
                                                          "mem_229520") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229469,
                                                          "mem_229469") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229465,
                                                          "mem_229465") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229460,
                                                          "ext_mem_229460") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229461,
                                                          "ext_mem_229461") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229411,
                                                          "ext_mem_229411") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229412,
                                                          "ext_mem_229412") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229362,
                                                          "ext_mem_229362") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229363,
                                                          "ext_mem_229363") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229264,
                                                          "ext_mem_229264") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229265,
                                                          "ext_mem_229265") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229206,
                                                          "mem_229206") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229200,
                                                          "mem_229200") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229196,
                                                          "ext_mem_229196") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229197,
                                                          "ext_mem_229197") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229164,
                                                          "mem_229164") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229161,
                                                          "mem_229161") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229157,
                                                          "mem_229157") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229155,
                                                          "mem_229155") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229152,
                                                          "mem_229152") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229148,
                                                          "mem_229148") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232249,
                                                          "mem_out_232249") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232248,
                                                          "mem_out_232248") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232247,
                                                          "mem_out_232247") !=
                                    0)
                                    return 1;
                                err = 1;
                                goto cleanup;
                            }
                            if (memblock_unref_device(ctx, &mem_231307,
                                                      "mem_231307") != 0)
                                return 1;
                            
                            struct memblock_device mem_231395;
                            
                            mem_231395.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_231395,
                                                      bytes_229427,
                                                      "mem_231395")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (futrts_builtinzhgpu_map_transpose_f64(ctx,
                                                                      mem_231395,
                                                                      (int64_t) 0,
                                                                      mem_231310,
                                                                      (int64_t) 0,
                                                                      (int64_t) 1,
                                                                      partition_sizze_203577,
                                                                      t_n_m_203650) !=
                                0) {
                                if (memblock_unref_device(ctx, &mem_231395,
                                                          "mem_231395") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231390,
                                                          "mem_231390") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &color_232052,
                                                          "color_232052") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &color_232051,
                                                          "color_232051") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &color_232050,
                                                          "color_232050") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &color_232049,
                                                          "color_232049") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231310,
                                                          "mem_231310") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231307,
                                                          "mem_231307") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231228,
                                                          "mem_231228") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231225,
                                                          "mem_231225") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231222,
                                                          "mem_231222") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231219,
                                                          "mem_231219") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231216,
                                                          "mem_231216") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231397,
                                                          "ext_mem_231397") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231398,
                                                          "ext_mem_231398") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231399,
                                                          "ext_mem_231399") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231400,
                                                          "ext_mem_231400") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231401,
                                                          "ext_mem_231401") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231402,
                                                          "ext_mem_231402") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231504,
                                                          "ext_mem_231504") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231505,
                                                          "ext_mem_231505") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230920,
                                                          "mem_230920") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230914,
                                                          "ext_mem_230914") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230907,
                                                          "ext_mem_230907") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230908,
                                                          "ext_mem_230908") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230546,
                                                          "ext_mem_230546") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230529,
                                                          "ext_mem_230529") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230512,
                                                          "ext_mem_230512") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230494,
                                                          "ext_mem_230494") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230486,
                                                          "ext_mem_230486") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_230487,
                                                          "ext_mem_230487") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229515,
                                                          "mem_param_229515") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229507,
                                                          "mem_param_229507") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231517,
                                                          "ext_mem_231517") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231518,
                                                          "ext_mem_231518") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229493,
                                                          "mem_param_229493") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229485,
                                                          "mem_param_229485") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx,
                                                          &mem_param_229477,
                                                          "mem_param_229477") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231860,
                                                          "ext_mem_231860") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231861,
                                                          "ext_mem_231861") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_231862,
                                                          "ext_mem_231862") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230551,
                                                          "mem_230551") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230534,
                                                          "mem_230534") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230517,
                                                          "mem_230517") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_230500,
                                                          "mem_230500") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229531,
                                                          "mem_229531") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229526,
                                                          "mem_229526") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229520,
                                                          "mem_229520") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229469,
                                                          "mem_229469") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229465,
                                                          "mem_229465") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229460,
                                                          "ext_mem_229460") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229461,
                                                          "ext_mem_229461") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229411,
                                                          "ext_mem_229411") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229412,
                                                          "ext_mem_229412") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229362,
                                                          "ext_mem_229362") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229363,
                                                          "ext_mem_229363") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229264,
                                                          "ext_mem_229264") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229265,
                                                          "ext_mem_229265") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229206,
                                                          "mem_229206") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229200,
                                                          "mem_229200") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229196,
                                                          "ext_mem_229196") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &ext_mem_229197,
                                                          "ext_mem_229197") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229164,
                                                          "mem_229164") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229161,
                                                          "mem_229161") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229157,
                                                          "mem_229157") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229155,
                                                          "mem_229155") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229152,
                                                          "mem_229152") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_229148,
                                                          "mem_229148") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232249,
                                                          "mem_out_232249") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232248,
                                                          "mem_out_232248") !=
                                    0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_out_232247,
                                                          "mem_out_232247") !=
                                    0)
                                    return 1;
                                err = 1;
                                goto cleanup;
                            }
                            if (memblock_unref_device(ctx, &mem_231310,
                                                      "mem_231310") != 0)
                                return 1;
                            if (memblock_set_device(ctx, &ext_mem_231398,
                                                    &mem_231390,
                                                    "mem_231390") != 0)
                                return 1;
                            if (memblock_set_device(ctx, &ext_mem_231397,
                                                    &mem_231395,
                                                    "mem_231395") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_231395,
                                                      "mem_231395") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_231390,
                                                      "mem_231390") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &color_232052,
                                                      "color_232052") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &color_232051,
                                                      "color_232051") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &color_232050,
                                                      "color_232050") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &color_232049,
                                                      "color_232049") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_231310,
                                                      "mem_231310") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_231307,
                                                      "mem_231307") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_231228,
                                                      "mem_231228") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_231225,
                                                      "mem_231225") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_231222,
                                                      "mem_231222") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_231219,
                                                      "mem_231219") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_231216,
                                                      "mem_231216") != 0)
                                return 1;
                        } else {
                            int64_t segmap_usable_groups_225323 =
                                    sdiv_up64(nest_sizze_207000,
                                              segmap_group_sizze_225322);
                            struct memblock_device mem_231315;
                            
                            mem_231315.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_231315,
                                                      bytes_229177,
                                                      "mem_231315")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s\n", "\n# SegMap");
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_225327,
                                                                    1,
                                                                    sizeof(n_203490),
                                                                    &n_203490));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_225327,
                                                                    2,
                                                                    sizeof(partition_sizze_203577),
                                                                    &partition_sizze_203577));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_225327,
                                                                    3,
                                                                    sizeof(mem_229161.mem),
                                                                    &mem_229161.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_225327,
                                                                    4,
                                                                    sizeof(mem_230920.mem),
                                                                    &mem_230920.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_225327,
                                                                    5,
                                                                    sizeof(mem_231315.mem),
                                                                    &mem_231315.mem));
                            if (1 * ((size_t) segmap_usable_groups_225323 *
                                     (size_t) segmap_group_sizze_225322) != 0) {
                                const size_t global_work_sizze_237442[1] =
                                             {(size_t) segmap_usable_groups_225323 *
                                             (size_t) segmap_group_sizze_225322};
                                const size_t local_work_sizze_237446[1] =
                                             {(size_t) segmap_group_sizze_225322};
                                int64_t time_start_237443 = 0, time_end_237444 =
                                        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_225327",
                                            global_work_sizze_237442[0],
                                            local_work_sizze_237446[0],
                                            (int) 0);
                                    time_start_237443 = get_wall_time();
                                }
                                OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                                ctx->mainzisegmap_225327,
                                                                                1,
                                                                                NULL,
                                                                                global_work_sizze_237442,
                                                                                local_work_sizze_237446,
                                                                                0,
                                                                                NULL,
                                                                                ctx->profiling_paused ||
                                                                                !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                          &ctx->mainzisegmap_225327_runs,
                                                                                                                          &ctx->mainzisegmap_225327_total_runtime)));
                                if (ctx->debugging) {
                                    OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                    time_end_237444 = get_wall_time();
                                    
                                    long time_diff_237445 = time_end_237444 -
                                         time_start_237443;
                                    
                                    fprintf(ctx->log,
                                            "kernel %s runtime: %ldus\n",
                                            "main.segmap_225327",
                                            time_diff_237445);
                                }
                            }
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s\n", "");
                            
                            int64_t segmap_usable_groups_225339 =
                                    sdiv_up64(nest_sizze_207000,
                                              segmap_group_sizze_225338);
                            struct memblock_device mem_231320;
                            
                            mem_231320.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_231320,
                                                      bytes_229177,
                                                      "mem_231320")) {
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device mem_231324;
                            
                            mem_231324.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_231324,
                                                      bytes_229177,
                                                      "mem_231324")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s\n", "\n# SegMap");
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_225344,
                                                                    1,
                                                                    sizeof(ctx->failure_is_an_option),
                                                                    &ctx->failure_is_an_option));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_225344,
                                                                    3,
                                                                    sizeof(n_203490),
                                                                    &n_203490));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_225344,
                                                                    4,
                                                                    sizeof(partition_sizze_203577),
                                                                    &partition_sizze_203577));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_225344,
                                                                    5,
                                                                    sizeof(ctx_param_ext_229488),
                                                                    &ctx_param_ext_229488));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_225344,
                                                                    6,
                                                                    sizeof(ctx_param_ext_229489),
                                                                    &ctx_param_ext_229489));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_225344,
                                                                    7,
                                                                    sizeof(ctx_param_ext_229491),
                                                                    &ctx_param_ext_229491));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_225344,
                                                                    8,
                                                                    sizeof(ext_mem_229197.mem),
                                                                    &ext_mem_229197.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_225344,
                                                                    9,
                                                                    sizeof(mem_param_229493.mem),
                                                                    &mem_param_229493.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_225344,
                                                                    10,
                                                                    sizeof(mem_231315.mem),
                                                                    &mem_231315.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_225344,
                                                                    11,
                                                                    sizeof(mem_231320.mem),
                                                                    &mem_231320.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_225344,
                                                                    12,
                                                                    sizeof(mem_231324.mem),
                                                                    &mem_231324.mem));
                            if (1 * ((size_t) segmap_usable_groups_225339 *
                                     (size_t) segmap_group_sizze_225338) != 0) {
                                const size_t global_work_sizze_237447[1] =
                                             {(size_t) segmap_usable_groups_225339 *
                                             (size_t) segmap_group_sizze_225338};
                                const size_t local_work_sizze_237451[1] =
                                             {(size_t) segmap_group_sizze_225338};
                                int64_t time_start_237448 = 0, time_end_237449 =
                                        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_225344",
                                            global_work_sizze_237447[0],
                                            local_work_sizze_237451[0],
                                            (int) 0);
                                    time_start_237448 = get_wall_time();
                                }
                                OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                                ctx->mainzisegmap_225344,
                                                                                1,
                                                                                NULL,
                                                                                global_work_sizze_237447,
                                                                                local_work_sizze_237451,
                                                                                0,
                                                                                NULL,
                                                                                ctx->profiling_paused ||
                                                                                !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                          &ctx->mainzisegmap_225344_runs,
                                                                                                                          &ctx->mainzisegmap_225344_total_runtime)));
                                if (ctx->debugging) {
                                    OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                    time_end_237449 = get_wall_time();
                                    
                                    long time_diff_237450 = time_end_237449 -
                                         time_start_237448;
                                    
                                    fprintf(ctx->log,
                                            "kernel %s runtime: %ldus\n",
                                            "main.segmap_225344",
                                            time_diff_237450);
                                }
                            }
                            ctx->failure_is_an_option = 1;
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s\n", "");
                            if (memblock_unref_device(ctx, &mem_231315,
                                                      "mem_231315") != 0)
                                return 1;
                            
                            int64_t segmap_usable_groups_225364 =
                                    sdiv_up64(nest_sizze_210118,
                                              segmap_group_sizze_225363);
                            struct memblock_device ext_mem_231386;
                            
                            ext_mem_231386.references = NULL;
                            
                            struct memblock_device ext_mem_231385;
                            
                            ext_mem_231385.references = NULL;
                            
                            int32_t local_memory_capacity_236143;
                            
                            local_memory_capacity_236143 =
                                ctx->opencl.max_local_memory;
                            if (sle64((int64_t) 0,
                                      sext_i32_i64(local_memory_capacity_236143)) &&
                                suff_outer_par_225367) {
                                struct memblock_device mem_231329;
                                
                                mem_231329.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_231329,
                                                          bytes_229427,
                                                          "mem_231329")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device mem_231333;
                                
                                mem_231333.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_231333,
                                                          bytes_229427,
                                                          "mem_231333")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s\n", "\n# SegMap");
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_225374,
                                                                        1,
                                                                        sizeof(n_203490),
                                                                        &n_203490));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_225374,
                                                                        2,
                                                                        sizeof(q_t_203494),
                                                                        &q_t_203494));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_225374,
                                                                        3,
                                                                        sizeof(jump_t_203500),
                                                                        &jump_t_203500));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_225374,
                                                                        4,
                                                                        sizeof(partition_sizze_203577),
                                                                        &partition_sizze_203577));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_225374,
                                                                        5,
                                                                        sizeof(t_n_m_203650),
                                                                        &t_n_m_203650));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_225374,
                                                                        6,
                                                                        sizeof(i_203670),
                                                                        &i_203670));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_225374,
                                                                        7,
                                                                        sizeof(ext_mem_229196.mem),
                                                                        &ext_mem_229196.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_225374,
                                                                        8,
                                                                        sizeof(ext_mem_229197.mem),
                                                                        &ext_mem_229197.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_225374,
                                                                        9,
                                                                        sizeof(ext_mem_229460.mem),
                                                                        &ext_mem_229460.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_225374,
                                                                        10,
                                                                        sizeof(ext_mem_229461.mem),
                                                                        &ext_mem_229461.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_225374,
                                                                        11,
                                                                        sizeof(mem_231320.mem),
                                                                        &mem_231320.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_225374,
                                                                        12,
                                                                        sizeof(mem_231324.mem),
                                                                        &mem_231324.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_225374,
                                                                        13,
                                                                        sizeof(mem_231329.mem),
                                                                        &mem_231329.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_225374,
                                                                        14,
                                                                        sizeof(mem_231333.mem),
                                                                        &mem_231333.mem));
                                if (1 * ((size_t) segmap_usable_groups_225364 *
                                         (size_t) segmap_group_sizze_225363) !=
                                    0) {
                                    const size_t global_work_sizze_237452[1] =
                                                 {(size_t) segmap_usable_groups_225364 *
                                                 (size_t) segmap_group_sizze_225363};
                                    const size_t local_work_sizze_237456[1] =
                                                 {(size_t) segmap_group_sizze_225363};
                                    int64_t time_start_237453 = 0,
                                            time_end_237454 = 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_225374",
                                                global_work_sizze_237452[0],
                                                local_work_sizze_237456[0],
                                                (int) 0);
                                        time_start_237453 = get_wall_time();
                                    }
                                    OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                                    ctx->mainzisegmap_225374,
                                                                                    1,
                                                                                    NULL,
                                                                                    global_work_sizze_237452,
                                                                                    local_work_sizze_237456,
                                                                                    0,
                                                                                    NULL,
                                                                                    ctx->profiling_paused ||
                                                                                    !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                              &ctx->mainzisegmap_225374_runs,
                                                                                                                              &ctx->mainzisegmap_225374_total_runtime)));
                                    if (ctx->debugging) {
                                        OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                        time_end_237454 = get_wall_time();
                                        
                                        long time_diff_237455 =
                                             time_end_237454 -
                                             time_start_237453;
                                        
                                        fprintf(ctx->log,
                                                "kernel %s runtime: %ldus\n",
                                                "main.segmap_225374",
                                                time_diff_237455);
                                    }
                                }
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s\n", "");
                                if (memblock_set_device(ctx, &ext_mem_231386,
                                                        &mem_231329,
                                                        "mem_231329") != 0)
                                    return 1;
                                if (memblock_set_device(ctx, &ext_mem_231385,
                                                        &mem_231333,
                                                        "mem_231333") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231333,
                                                          "mem_231333") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231329,
                                                          "mem_231329") != 0)
                                    return 1;
                            } else {
                                struct memblock_device mem_231338;
                                
                                mem_231338.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_231338,
                                                          bytes_229427,
                                                          "mem_231338")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device mem_231342;
                                
                                mem_231342.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_231342,
                                                          bytes_229427,
                                                          "mem_231342")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device mem_231346;
                                
                                mem_231346.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_231346,
                                                          bytes_229427,
                                                          "mem_231346")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device mem_231350;
                                
                                mem_231350.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_231350,
                                                          bytes_229427,
                                                          "mem_231350")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device mem_231354;
                                
                                mem_231354.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_231354,
                                                          bytes_229427,
                                                          "mem_231354")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                if (slt64(q_t_203494 * (int64_t) 2,
                                          segred_group_sizze_225512)) {
                                    int64_t segment_sizze_nonzzero_235919 =
                                            smax64((int64_t) 1, q_t_203494);
                                    int64_t num_threads_235920 =
                                            num_groups_225513 *
                                            segred_group_sizze_225512;
                                    
                                    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_203577 *
                                                             t_n_m_203650),
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "segment_size",
                                                (long long) q_t_203494, '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "segments_per_group",
                                                (long long) squot64(segred_group_sizze_225512,
                                                                    segment_sizze_nonzzero_235919),
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "required_groups",
                                                (long long) sext_i64_i32(sdiv_up64(partition_sizze_203577 *
                                                                                   t_n_m_203650,
                                                                                   squot64(segred_group_sizze_225512,
                                                                                           segment_sizze_nonzzero_235919))),
                                                '\n');
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_225523,
                                                                            1,
                                                                            (size_t) ((int64_t) 8 *
                                                                                      segred_group_sizze_225512),
                                                                            NULL));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_225523,
                                                                            2,
                                                                            (size_t) ((int64_t) 8 *
                                                                                      segred_group_sizze_225512),
                                                                            NULL));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_225523,
                                                                            3,
                                                                            (size_t) ((int64_t) 8 *
                                                                                      segred_group_sizze_225512),
                                                                            NULL));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_225523,
                                                                            4,
                                                                            (size_t) ((int64_t) 8 *
                                                                                      segred_group_sizze_225512),
                                                                            NULL));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_225523,
                                                                            5,
                                                                            (size_t) ((int64_t) 8 *
                                                                                      segred_group_sizze_225512),
                                                                            NULL));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_225523,
                                                                            6,
                                                                            sizeof(n_203490),
                                                                            &n_203490));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_225523,
                                                                            7,
                                                                            sizeof(q_t_203494),
                                                                            &q_t_203494));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_225523,
                                                                            8,
                                                                            sizeof(jump_t_203500),
                                                                            &jump_t_203500));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_225523,
                                                                            9,
                                                                            sizeof(partition_sizze_203577),
                                                                            &partition_sizze_203577));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_225523,
                                                                            10,
                                                                            sizeof(t_n_m_203650),
                                                                            &t_n_m_203650));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_225523,
                                                                            11,
                                                                            sizeof(i_203670),
                                                                            &i_203670));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_225523,
                                                                            12,
                                                                            sizeof(num_groups_225513),
                                                                            &num_groups_225513));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_225523,
                                                                            13,
                                                                            sizeof(segment_sizze_nonzzero_235919),
                                                                            &segment_sizze_nonzzero_235919));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_225523,
                                                                            14,
                                                                            sizeof(ext_mem_229196.mem),
                                                                            &ext_mem_229196.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_225523,
                                                                            15,
                                                                            sizeof(ext_mem_229197.mem),
                                                                            &ext_mem_229197.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_225523,
                                                                            16,
                                                                            sizeof(ext_mem_229460.mem),
                                                                            &ext_mem_229460.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_225523,
                                                                            17,
                                                                            sizeof(ext_mem_229461.mem),
                                                                            &ext_mem_229461.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_225523,
                                                                            18,
                                                                            sizeof(mem_231320.mem),
                                                                            &mem_231320.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_225523,
                                                                            19,
                                                                            sizeof(mem_231338.mem),
                                                                            &mem_231338.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_225523,
                                                                            20,
                                                                            sizeof(mem_231342.mem),
                                                                            &mem_231342.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_225523,
                                                                            21,
                                                                            sizeof(mem_231346.mem),
                                                                            &mem_231346.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_225523,
                                                                            22,
                                                                            sizeof(mem_231350.mem),
                                                                            &mem_231350.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_225523,
                                                                            23,
                                                                            sizeof(mem_231354.mem),
                                                                            &mem_231354.mem));
                                    if (1 * ((size_t) num_groups_225513 *
                                             (size_t) segred_group_sizze_225512) !=
                                        0) {
                                        const size_t global_work_sizze_237457[1]
                                                     =
                                                     {(size_t) num_groups_225513 *
                                                     (size_t) segred_group_sizze_225512};
                                        const size_t local_work_sizze_237461[1]
                                                     =
                                                     {(size_t) segred_group_sizze_225512};
                                        int64_t time_start_237458 = 0,
                                                time_end_237459 = 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_225523",
                                                    global_work_sizze_237457[0],
                                                    local_work_sizze_237461[0],
                                                    (int) (0 + (int64_t) 8 *
                                                           segred_group_sizze_225512 +
                                                           (int64_t) 8 *
                                                           segred_group_sizze_225512 +
                                                           (int64_t) 8 *
                                                           segred_group_sizze_225512 +
                                                           (int64_t) 8 *
                                                           segred_group_sizze_225512 +
                                                           (int64_t) 8 *
                                                           segred_group_sizze_225512));
                                            time_start_237458 = get_wall_time();
                                        }
                                        OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                                        ctx->mainzisegred_small_225523,
                                                                                        1,
                                                                                        NULL,
                                                                                        global_work_sizze_237457,
                                                                                        local_work_sizze_237461,
                                                                                        0,
                                                                                        NULL,
                                                                                        ctx->profiling_paused ||
                                                                                        !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                                  &ctx->mainzisegred_small_225523_runs,
                                                                                                                                  &ctx->mainzisegred_small_225523_total_runtime)));
                                        if (ctx->debugging) {
                                            OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                            time_end_237459 = get_wall_time();
                                            
                                            long time_diff_237460 =
                                                 time_end_237459 -
                                                 time_start_237458;
                                            
                                            fprintf(ctx->log,
                                                    "kernel %s runtime: %ldus\n",
                                                    "main.segred_small_225523",
                                                    time_diff_237460);
                                        }
                                    }
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s\n", "");
                                } else {
                                    int64_t groups_per_segment_235972 =
                                            sdiv_up64(num_groups_225513,
                                                      smax64((int64_t) 1,
                                                             partition_sizze_203577 *
                                                             t_n_m_203650));
                                    int64_t elements_per_thread_235973 =
                                            sdiv_up64(q_t_203494,
                                                      segred_group_sizze_225512 *
                                                      groups_per_segment_235972);
                                    int64_t virt_num_groups_235974 =
                                            groups_per_segment_235972 *
                                            (partition_sizze_203577 *
                                             t_n_m_203650);
                                    int64_t num_threads_235975 =
                                            num_groups_225513 *
                                            segred_group_sizze_225512;
                                    int64_t threads_per_segment_235976 =
                                            groups_per_segment_235972 *
                                            segred_group_sizze_225512;
                                    
                                    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_203577 *
                                                             t_n_m_203650),
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "segment_size",
                                                (long long) q_t_203494, '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "virt_num_groups",
                                                (long long) virt_num_groups_235974,
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "num_groups",
                                                (long long) num_groups_225513,
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "group_size",
                                                (long long) segred_group_sizze_225512,
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "elems_per_thread",
                                                (long long) elements_per_thread_235973,
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "groups_per_segment",
                                                (long long) groups_per_segment_235972,
                                                '\n');
                                    
                                    struct memblock_device
                                    segred_tmp_mem_235977;
                                    
                                    segred_tmp_mem_235977.references = NULL;
                                    if (memblock_alloc_device(ctx,
                                                              &segred_tmp_mem_235977,
                                                              (int64_t) 8 *
                                                              virt_num_groups_235974,
                                                              "segred_tmp_mem_235977")) {
                                        err = 1;
                                        goto cleanup;
                                    }
                                    
                                    struct memblock_device
                                    segred_tmp_mem_235979;
                                    
                                    segred_tmp_mem_235979.references = NULL;
                                    if (memblock_alloc_device(ctx,
                                                              &segred_tmp_mem_235979,
                                                              (int64_t) 8 *
                                                              virt_num_groups_235974,
                                                              "segred_tmp_mem_235979")) {
                                        err = 1;
                                        goto cleanup;
                                    }
                                    
                                    struct memblock_device
                                    segred_tmp_mem_235981;
                                    
                                    segred_tmp_mem_235981.references = NULL;
                                    if (memblock_alloc_device(ctx,
                                                              &segred_tmp_mem_235981,
                                                              (int64_t) 8 *
                                                              virt_num_groups_235974,
                                                              "segred_tmp_mem_235981")) {
                                        err = 1;
                                        goto cleanup;
                                    }
                                    
                                    struct memblock_device
                                    segred_tmp_mem_235983;
                                    
                                    segred_tmp_mem_235983.references = NULL;
                                    if (memblock_alloc_device(ctx,
                                                              &segred_tmp_mem_235983,
                                                              (int64_t) 8 *
                                                              virt_num_groups_235974,
                                                              "segred_tmp_mem_235983")) {
                                        err = 1;
                                        goto cleanup;
                                    }
                                    
                                    struct memblock_device
                                    segred_tmp_mem_235985;
                                    
                                    segred_tmp_mem_235985.references = NULL;
                                    if (memblock_alloc_device(ctx,
                                                              &segred_tmp_mem_235985,
                                                              (int64_t) 8 *
                                                              virt_num_groups_235974,
                                                              "segred_tmp_mem_235985")) {
                                        err = 1;
                                        goto cleanup;
                                    }
                                    
                                    struct memblock_device
                                    mainzicounter_mem_235987 =
                                    ctx->mainzicounter_mem_235987;
                                    
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_225523,
                                                                            1,
                                                                            (size_t) 1,
                                                                            NULL));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_225523,
                                                                            2,
                                                                            (size_t) ((int64_t) 8 *
                                                                                      segred_group_sizze_225512),
                                                                            NULL));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_225523,
                                                                            3,
                                                                            (size_t) ((int64_t) 8 *
                                                                                      segred_group_sizze_225512),
                                                                            NULL));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_225523,
                                                                            4,
                                                                            (size_t) ((int64_t) 8 *
                                                                                      segred_group_sizze_225512),
                                                                            NULL));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_225523,
                                                                            5,
                                                                            (size_t) ((int64_t) 8 *
                                                                                      segred_group_sizze_225512),
                                                                            NULL));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_225523,
                                                                            6,
                                                                            (size_t) ((int64_t) 8 *
                                                                                      segred_group_sizze_225512),
                                                                            NULL));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_225523,
                                                                            7,
                                                                            sizeof(n_203490),
                                                                            &n_203490));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_225523,
                                                                            8,
                                                                            sizeof(q_t_203494),
                                                                            &q_t_203494));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_225523,
                                                                            9,
                                                                            sizeof(jump_t_203500),
                                                                            &jump_t_203500));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_225523,
                                                                            10,
                                                                            sizeof(partition_sizze_203577),
                                                                            &partition_sizze_203577));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_225523,
                                                                            11,
                                                                            sizeof(t_n_m_203650),
                                                                            &t_n_m_203650));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_225523,
                                                                            12,
                                                                            sizeof(i_203670),
                                                                            &i_203670));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_225523,
                                                                            13,
                                                                            sizeof(num_groups_225513),
                                                                            &num_groups_225513));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_225523,
                                                                            14,
                                                                            sizeof(groups_per_segment_235972),
                                                                            &groups_per_segment_235972));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_225523,
                                                                            15,
                                                                            sizeof(elements_per_thread_235973),
                                                                            &elements_per_thread_235973));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_225523,
                                                                            16,
                                                                            sizeof(virt_num_groups_235974),
                                                                            &virt_num_groups_235974));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_225523,
                                                                            17,
                                                                            sizeof(threads_per_segment_235976),
                                                                            &threads_per_segment_235976));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_225523,
                                                                            18,
                                                                            sizeof(ext_mem_229196.mem),
                                                                            &ext_mem_229196.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_225523,
                                                                            19,
                                                                            sizeof(ext_mem_229197.mem),
                                                                            &ext_mem_229197.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_225523,
                                                                            20,
                                                                            sizeof(ext_mem_229460.mem),
                                                                            &ext_mem_229460.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_225523,
                                                                            21,
                                                                            sizeof(ext_mem_229461.mem),
                                                                            &ext_mem_229461.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_225523,
                                                                            22,
                                                                            sizeof(mem_231320.mem),
                                                                            &mem_231320.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_225523,
                                                                            23,
                                                                            sizeof(mem_231338.mem),
                                                                            &mem_231338.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_225523,
                                                                            24,
                                                                            sizeof(mem_231342.mem),
                                                                            &mem_231342.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_225523,
                                                                            25,
                                                                            sizeof(mem_231346.mem),
                                                                            &mem_231346.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_225523,
                                                                            26,
                                                                            sizeof(mem_231350.mem),
                                                                            &mem_231350.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_225523,
                                                                            27,
                                                                            sizeof(mem_231354.mem),
                                                                            &mem_231354.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_225523,
                                                                            28,
                                                                            sizeof(segred_tmp_mem_235977.mem),
                                                                            &segred_tmp_mem_235977.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_225523,
                                                                            29,
                                                                            sizeof(segred_tmp_mem_235979.mem),
                                                                            &segred_tmp_mem_235979.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_225523,
                                                                            30,
                                                                            sizeof(segred_tmp_mem_235981.mem),
                                                                            &segred_tmp_mem_235981.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_225523,
                                                                            31,
                                                                            sizeof(segred_tmp_mem_235983.mem),
                                                                            &segred_tmp_mem_235983.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_225523,
                                                                            32,
                                                                            sizeof(segred_tmp_mem_235985.mem),
                                                                            &segred_tmp_mem_235985.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_225523,
                                                                            33,
                                                                            sizeof(mainzicounter_mem_235987.mem),
                                                                            &mainzicounter_mem_235987.mem));
                                    if (1 * ((size_t) num_groups_225513 *
                                             (size_t) segred_group_sizze_225512) !=
                                        0) {
                                        const size_t global_work_sizze_237463[1]
                                                     =
                                                     {(size_t) num_groups_225513 *
                                                     (size_t) segred_group_sizze_225512};
                                        const size_t local_work_sizze_237467[1]
                                                     =
                                                     {(size_t) segred_group_sizze_225512};
                                        int64_t time_start_237464 = 0,
                                                time_end_237465 = 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_225523",
                                                    global_work_sizze_237463[0],
                                                    local_work_sizze_237467[0],
                                                    (int) (0 + 1 + (int64_t) 8 *
                                                           segred_group_sizze_225512 +
                                                           (int64_t) 8 *
                                                           segred_group_sizze_225512 +
                                                           (int64_t) 8 *
                                                           segred_group_sizze_225512 +
                                                           (int64_t) 8 *
                                                           segred_group_sizze_225512 +
                                                           (int64_t) 8 *
                                                           segred_group_sizze_225512));
                                            time_start_237464 = get_wall_time();
                                        }
                                        OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                                        ctx->mainzisegred_large_225523,
                                                                                        1,
                                                                                        NULL,
                                                                                        global_work_sizze_237463,
                                                                                        local_work_sizze_237467,
                                                                                        0,
                                                                                        NULL,
                                                                                        ctx->profiling_paused ||
                                                                                        !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                                  &ctx->mainzisegred_large_225523_runs,
                                                                                                                                  &ctx->mainzisegred_large_225523_total_runtime)));
                                        if (ctx->debugging) {
                                            OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                            time_end_237465 = get_wall_time();
                                            
                                            long time_diff_237466 =
                                                 time_end_237465 -
                                                 time_start_237464;
                                            
                                            fprintf(ctx->log,
                                                    "kernel %s runtime: %ldus\n",
                                                    "main.segred_large_225523",
                                                    time_diff_237466);
                                        }
                                    }
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s\n", "");
                                    if (memblock_unref_device(ctx,
                                                              &segred_tmp_mem_235985,
                                                              "segred_tmp_mem_235985") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &segred_tmp_mem_235983,
                                                              "segred_tmp_mem_235983") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &segred_tmp_mem_235981,
                                                              "segred_tmp_mem_235981") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &segred_tmp_mem_235979,
                                                              "segred_tmp_mem_235979") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &segred_tmp_mem_235977,
                                                              "segred_tmp_mem_235977") !=
                                        0)
                                        return 1;
                                }
                                
                                int64_t segmap_usable_groups_225574 =
                                        sdiv_up64(nest_sizze_210118,
                                                  segmap_group_sizze_225573);
                                struct memblock_device mem_231359;
                                
                                mem_231359.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_231359,
                                                          bytes_229427,
                                                          "mem_231359")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device mem_231363;
                                
                                mem_231363.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_231363,
                                                          bytes_229427,
                                                          "mem_231363")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device mem_231367;
                                
                                mem_231367.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_231367,
                                                          bytes_229427,
                                                          "mem_231367")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device mem_231371;
                                
                                mem_231371.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_231371,
                                                          bytes_229427,
                                                          "mem_231371")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device mem_231375;
                                
                                mem_231375.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_231375,
                                                          bytes_229427,
                                                          "mem_231375")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s\n", "\n# SegMap");
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_225582,
                                                                        1,
                                                                        sizeof(partition_sizze_203577),
                                                                        &partition_sizze_203577));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_225582,
                                                                        2,
                                                                        sizeof(t_n_m_203650),
                                                                        &t_n_m_203650));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_225582,
                                                                        3,
                                                                        sizeof(mem_231338.mem),
                                                                        &mem_231338.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_225582,
                                                                        4,
                                                                        sizeof(mem_231342.mem),
                                                                        &mem_231342.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_225582,
                                                                        5,
                                                                        sizeof(mem_231346.mem),
                                                                        &mem_231346.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_225582,
                                                                        6,
                                                                        sizeof(mem_231350.mem),
                                                                        &mem_231350.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_225582,
                                                                        7,
                                                                        sizeof(mem_231354.mem),
                                                                        &mem_231354.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_225582,
                                                                        8,
                                                                        sizeof(mem_231359.mem),
                                                                        &mem_231359.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_225582,
                                                                        9,
                                                                        sizeof(mem_231363.mem),
                                                                        &mem_231363.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_225582,
                                                                        10,
                                                                        sizeof(mem_231367.mem),
                                                                        &mem_231367.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_225582,
                                                                        11,
                                                                        sizeof(mem_231371.mem),
                                                                        &mem_231371.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_225582,
                                                                        12,
                                                                        sizeof(mem_231375.mem),
                                                                        &mem_231375.mem));
                                if (1 * ((size_t) segmap_usable_groups_225574 *
                                         (size_t) segmap_group_sizze_225573) !=
                                    0) {
                                    const size_t global_work_sizze_237468[1] =
                                                 {(size_t) segmap_usable_groups_225574 *
                                                 (size_t) segmap_group_sizze_225573};
                                    const size_t local_work_sizze_237472[1] =
                                                 {(size_t) segmap_group_sizze_225573};
                                    int64_t time_start_237469 = 0,
                                            time_end_237470 = 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_225582",
                                                global_work_sizze_237468[0],
                                                local_work_sizze_237472[0],
                                                (int) 0);
                                        time_start_237469 = get_wall_time();
                                    }
                                    OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                                    ctx->mainzisegmap_225582,
                                                                                    1,
                                                                                    NULL,
                                                                                    global_work_sizze_237468,
                                                                                    local_work_sizze_237472,
                                                                                    0,
                                                                                    NULL,
                                                                                    ctx->profiling_paused ||
                                                                                    !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                              &ctx->mainzisegmap_225582_runs,
                                                                                                                              &ctx->mainzisegmap_225582_total_runtime)));
                                    if (ctx->debugging) {
                                        OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                        time_end_237470 = get_wall_time();
                                        
                                        long time_diff_237471 =
                                             time_end_237470 -
                                             time_start_237469;
                                        
                                        fprintf(ctx->log,
                                                "kernel %s runtime: %ldus\n",
                                                "main.segmap_225582",
                                                time_diff_237471);
                                    }
                                }
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s\n", "");
                                if (memblock_unref_device(ctx, &mem_231338,
                                                          "mem_231338") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231342,
                                                          "mem_231342") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231346,
                                                          "mem_231346") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231350,
                                                          "mem_231350") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231354,
                                                          "mem_231354") != 0)
                                    return 1;
                                
                                struct memblock_device mem_231380;
                                
                                mem_231380.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_231380,
                                                          bytes_229427,
                                                          "mem_231380")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device mem_231384;
                                
                                mem_231384.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_231384,
                                                          bytes_229427,
                                                          "mem_231384")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                if (slt64(q_t_203494 * (int64_t) 2,
                                          segred_group_sizze_225616)) {
                                    int64_t segment_sizze_nonzzero_236057 =
                                            smax64((int64_t) 1, q_t_203494);
                                    int64_t num_threads_236058 =
                                            num_groups_225617 *
                                            segred_group_sizze_225616;
                                    
                                    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_203577 *
                                                             t_n_m_203650),
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "segment_size",
                                                (long long) q_t_203494, '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "segments_per_group",
                                                (long long) squot64(segred_group_sizze_225616,
                                                                    segment_sizze_nonzzero_236057),
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "required_groups",
                                                (long long) sext_i64_i32(sdiv_up64(partition_sizze_203577 *
                                                                                   t_n_m_203650,
                                                                                   squot64(segred_group_sizze_225616,
                                                                                           segment_sizze_nonzzero_236057))),
                                                '\n');
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_225624,
                                                                            1,
                                                                            (size_t) ((int64_t) 8 *
                                                                                      segred_group_sizze_225616),
                                                                            NULL));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_225624,
                                                                            2,
                                                                            (size_t) ((int64_t) 8 *
                                                                                      segred_group_sizze_225616),
                                                                            NULL));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_225624,
                                                                            3,
                                                                            sizeof(n_203490),
                                                                            &n_203490));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_225624,
                                                                            4,
                                                                            sizeof(q_t_203494),
                                                                            &q_t_203494));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_225624,
                                                                            5,
                                                                            sizeof(jump_t_203500),
                                                                            &jump_t_203500));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_225624,
                                                                            6,
                                                                            sizeof(partition_sizze_203577),
                                                                            &partition_sizze_203577));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_225624,
                                                                            7,
                                                                            sizeof(t_n_m_203650),
                                                                            &t_n_m_203650));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_225624,
                                                                            8,
                                                                            sizeof(i_203670),
                                                                            &i_203670));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_225624,
                                                                            9,
                                                                            sizeof(num_groups_225617),
                                                                            &num_groups_225617));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_225624,
                                                                            10,
                                                                            sizeof(segment_sizze_nonzzero_236057),
                                                                            &segment_sizze_nonzzero_236057));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_225624,
                                                                            11,
                                                                            sizeof(ext_mem_229196.mem),
                                                                            &ext_mem_229196.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_225624,
                                                                            12,
                                                                            sizeof(ext_mem_229197.mem),
                                                                            &ext_mem_229197.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_225624,
                                                                            13,
                                                                            sizeof(ext_mem_229460.mem),
                                                                            &ext_mem_229460.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_225624,
                                                                            14,
                                                                            sizeof(ext_mem_229461.mem),
                                                                            &ext_mem_229461.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_225624,
                                                                            15,
                                                                            sizeof(mem_231320.mem),
                                                                            &mem_231320.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_225624,
                                                                            16,
                                                                            sizeof(mem_231324.mem),
                                                                            &mem_231324.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_225624,
                                                                            17,
                                                                            sizeof(mem_231359.mem),
                                                                            &mem_231359.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_225624,
                                                                            18,
                                                                            sizeof(mem_231363.mem),
                                                                            &mem_231363.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_225624,
                                                                            19,
                                                                            sizeof(mem_231367.mem),
                                                                            &mem_231367.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_225624,
                                                                            20,
                                                                            sizeof(mem_231371.mem),
                                                                            &mem_231371.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_225624,
                                                                            21,
                                                                            sizeof(mem_231375.mem),
                                                                            &mem_231375.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_225624,
                                                                            22,
                                                                            sizeof(mem_231380.mem),
                                                                            &mem_231380.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_225624,
                                                                            23,
                                                                            sizeof(mem_231384.mem),
                                                                            &mem_231384.mem));
                                    if (1 * ((size_t) num_groups_225617 *
                                             (size_t) segred_group_sizze_225616) !=
                                        0) {
                                        const size_t global_work_sizze_237473[1]
                                                     =
                                                     {(size_t) num_groups_225617 *
                                                     (size_t) segred_group_sizze_225616};
                                        const size_t local_work_sizze_237477[1]
                                                     =
                                                     {(size_t) segred_group_sizze_225616};
                                        int64_t time_start_237474 = 0,
                                                time_end_237475 = 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_225624",
                                                    global_work_sizze_237473[0],
                                                    local_work_sizze_237477[0],
                                                    (int) (0 + (int64_t) 8 *
                                                           segred_group_sizze_225616 +
                                                           (int64_t) 8 *
                                                           segred_group_sizze_225616));
                                            time_start_237474 = get_wall_time();
                                        }
                                        OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                                        ctx->mainzisegred_small_225624,
                                                                                        1,
                                                                                        NULL,
                                                                                        global_work_sizze_237473,
                                                                                        local_work_sizze_237477,
                                                                                        0,
                                                                                        NULL,
                                                                                        ctx->profiling_paused ||
                                                                                        !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                                  &ctx->mainzisegred_small_225624_runs,
                                                                                                                                  &ctx->mainzisegred_small_225624_total_runtime)));
                                        if (ctx->debugging) {
                                            OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                            time_end_237475 = get_wall_time();
                                            
                                            long time_diff_237476 =
                                                 time_end_237475 -
                                                 time_start_237474;
                                            
                                            fprintf(ctx->log,
                                                    "kernel %s runtime: %ldus\n",
                                                    "main.segred_small_225624",
                                                    time_diff_237476);
                                        }
                                    }
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s\n", "");
                                } else {
                                    int64_t groups_per_segment_236092 =
                                            sdiv_up64(num_groups_225617,
                                                      smax64((int64_t) 1,
                                                             partition_sizze_203577 *
                                                             t_n_m_203650));
                                    int64_t elements_per_thread_236093 =
                                            sdiv_up64(q_t_203494,
                                                      segred_group_sizze_225616 *
                                                      groups_per_segment_236092);
                                    int64_t virt_num_groups_236094 =
                                            groups_per_segment_236092 *
                                            (partition_sizze_203577 *
                                             t_n_m_203650);
                                    int64_t num_threads_236095 =
                                            num_groups_225617 *
                                            segred_group_sizze_225616;
                                    int64_t threads_per_segment_236096 =
                                            groups_per_segment_236092 *
                                            segred_group_sizze_225616;
                                    
                                    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_203577 *
                                                             t_n_m_203650),
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "segment_size",
                                                (long long) q_t_203494, '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "virt_num_groups",
                                                (long long) virt_num_groups_236094,
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "num_groups",
                                                (long long) num_groups_225617,
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "group_size",
                                                (long long) segred_group_sizze_225616,
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "elems_per_thread",
                                                (long long) elements_per_thread_236093,
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "groups_per_segment",
                                                (long long) groups_per_segment_236092,
                                                '\n');
                                    
                                    struct memblock_device
                                    segred_tmp_mem_236097;
                                    
                                    segred_tmp_mem_236097.references = NULL;
                                    if (memblock_alloc_device(ctx,
                                                              &segred_tmp_mem_236097,
                                                              (int64_t) 8 *
                                                              virt_num_groups_236094,
                                                              "segred_tmp_mem_236097")) {
                                        err = 1;
                                        goto cleanup;
                                    }
                                    
                                    struct memblock_device
                                    segred_tmp_mem_236099;
                                    
                                    segred_tmp_mem_236099.references = NULL;
                                    if (memblock_alloc_device(ctx,
                                                              &segred_tmp_mem_236099,
                                                              (int64_t) 8 *
                                                              virt_num_groups_236094,
                                                              "segred_tmp_mem_236099")) {
                                        err = 1;
                                        goto cleanup;
                                    }
                                    
                                    struct memblock_device
                                    mainzicounter_mem_236101 =
                                    ctx->mainzicounter_mem_236101;
                                    
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_225624,
                                                                            1,
                                                                            (size_t) 1,
                                                                            NULL));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_225624,
                                                                            2,
                                                                            (size_t) ((int64_t) 8 *
                                                                                      segred_group_sizze_225616),
                                                                            NULL));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_225624,
                                                                            3,
                                                                            (size_t) ((int64_t) 8 *
                                                                                      segred_group_sizze_225616),
                                                                            NULL));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_225624,
                                                                            4,
                                                                            sizeof(n_203490),
                                                                            &n_203490));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_225624,
                                                                            5,
                                                                            sizeof(q_t_203494),
                                                                            &q_t_203494));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_225624,
                                                                            6,
                                                                            sizeof(jump_t_203500),
                                                                            &jump_t_203500));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_225624,
                                                                            7,
                                                                            sizeof(partition_sizze_203577),
                                                                            &partition_sizze_203577));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_225624,
                                                                            8,
                                                                            sizeof(t_n_m_203650),
                                                                            &t_n_m_203650));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_225624,
                                                                            9,
                                                                            sizeof(i_203670),
                                                                            &i_203670));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_225624,
                                                                            10,
                                                                            sizeof(num_groups_225617),
                                                                            &num_groups_225617));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_225624,
                                                                            11,
                                                                            sizeof(groups_per_segment_236092),
                                                                            &groups_per_segment_236092));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_225624,
                                                                            12,
                                                                            sizeof(elements_per_thread_236093),
                                                                            &elements_per_thread_236093));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_225624,
                                                                            13,
                                                                            sizeof(virt_num_groups_236094),
                                                                            &virt_num_groups_236094));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_225624,
                                                                            14,
                                                                            sizeof(threads_per_segment_236096),
                                                                            &threads_per_segment_236096));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_225624,
                                                                            15,
                                                                            sizeof(ext_mem_229196.mem),
                                                                            &ext_mem_229196.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_225624,
                                                                            16,
                                                                            sizeof(ext_mem_229197.mem),
                                                                            &ext_mem_229197.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_225624,
                                                                            17,
                                                                            sizeof(ext_mem_229460.mem),
                                                                            &ext_mem_229460.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_225624,
                                                                            18,
                                                                            sizeof(ext_mem_229461.mem),
                                                                            &ext_mem_229461.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_225624,
                                                                            19,
                                                                            sizeof(mem_231320.mem),
                                                                            &mem_231320.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_225624,
                                                                            20,
                                                                            sizeof(mem_231324.mem),
                                                                            &mem_231324.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_225624,
                                                                            21,
                                                                            sizeof(mem_231359.mem),
                                                                            &mem_231359.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_225624,
                                                                            22,
                                                                            sizeof(mem_231363.mem),
                                                                            &mem_231363.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_225624,
                                                                            23,
                                                                            sizeof(mem_231367.mem),
                                                                            &mem_231367.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_225624,
                                                                            24,
                                                                            sizeof(mem_231371.mem),
                                                                            &mem_231371.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_225624,
                                                                            25,
                                                                            sizeof(mem_231375.mem),
                                                                            &mem_231375.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_225624,
                                                                            26,
                                                                            sizeof(mem_231380.mem),
                                                                            &mem_231380.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_225624,
                                                                            27,
                                                                            sizeof(mem_231384.mem),
                                                                            &mem_231384.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_225624,
                                                                            28,
                                                                            sizeof(segred_tmp_mem_236097.mem),
                                                                            &segred_tmp_mem_236097.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_225624,
                                                                            29,
                                                                            sizeof(segred_tmp_mem_236099.mem),
                                                                            &segred_tmp_mem_236099.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_225624,
                                                                            30,
                                                                            sizeof(mainzicounter_mem_236101.mem),
                                                                            &mainzicounter_mem_236101.mem));
                                    if (1 * ((size_t) num_groups_225617 *
                                             (size_t) segred_group_sizze_225616) !=
                                        0) {
                                        const size_t global_work_sizze_237479[1]
                                                     =
                                                     {(size_t) num_groups_225617 *
                                                     (size_t) segred_group_sizze_225616};
                                        const size_t local_work_sizze_237483[1]
                                                     =
                                                     {(size_t) segred_group_sizze_225616};
                                        int64_t time_start_237480 = 0,
                                                time_end_237481 = 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_225624",
                                                    global_work_sizze_237479[0],
                                                    local_work_sizze_237483[0],
                                                    (int) (0 + 1 + (int64_t) 8 *
                                                           segred_group_sizze_225616 +
                                                           (int64_t) 8 *
                                                           segred_group_sizze_225616));
                                            time_start_237480 = get_wall_time();
                                        }
                                        OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                                        ctx->mainzisegred_large_225624,
                                                                                        1,
                                                                                        NULL,
                                                                                        global_work_sizze_237479,
                                                                                        local_work_sizze_237483,
                                                                                        0,
                                                                                        NULL,
                                                                                        ctx->profiling_paused ||
                                                                                        !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                                  &ctx->mainzisegred_large_225624_runs,
                                                                                                                                  &ctx->mainzisegred_large_225624_total_runtime)));
                                        if (ctx->debugging) {
                                            OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                            time_end_237481 = get_wall_time();
                                            
                                            long time_diff_237482 =
                                                 time_end_237481 -
                                                 time_start_237480;
                                            
                                            fprintf(ctx->log,
                                                    "kernel %s runtime: %ldus\n",
                                                    "main.segred_large_225624",
                                                    time_diff_237482);
                                        }
                                    }
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s\n", "");
                                    if (memblock_unref_device(ctx,
                                                              &segred_tmp_mem_236099,
                                                              "segred_tmp_mem_236099") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &segred_tmp_mem_236097,
                                                              "segred_tmp_mem_236097") !=
                                        0)
                                        return 1;
                                }
                                if (memblock_unref_device(ctx, &mem_231359,
                                                          "mem_231359") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231363,
                                                          "mem_231363") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231367,
                                                          "mem_231367") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231371,
                                                          "mem_231371") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231375,
                                                          "mem_231375") != 0)
                                    return 1;
                                if (memblock_set_device(ctx, &ext_mem_231386,
                                                        &mem_231380,
                                                        "mem_231380") != 0)
                                    return 1;
                                if (memblock_set_device(ctx, &ext_mem_231385,
                                                        &mem_231384,
                                                        "mem_231384") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231384,
                                                          "mem_231384") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231380,
                                                          "mem_231380") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231375,
                                                          "mem_231375") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231371,
                                                          "mem_231371") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231367,
                                                          "mem_231367") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231363,
                                                          "mem_231363") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231359,
                                                          "mem_231359") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231354,
                                                          "mem_231354") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231350,
                                                          "mem_231350") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231346,
                                                          "mem_231346") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231342,
                                                          "mem_231342") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_231338,
                                                          "mem_231338") != 0)
                                    return 1;
                            }
                            if (memblock_unref_device(ctx, &mem_231320,
                                                      "mem_231320") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_231324,
                                                      "mem_231324") != 0)
                                return 1;
                            if (memblock_set_device(ctx, &ext_mem_231398,
                                                    &ext_mem_231386,
                                                    "ext_mem_231386") != 0)
                                return 1;
                            if (memblock_set_device(ctx, &ext_mem_231397,
                                                    &ext_mem_231385,
                                                    "ext_mem_231385") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231385,
                                                      "ext_mem_231385") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &ext_mem_231386,
                                                      "ext_mem_231386") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_231324,
                                                      "mem_231324") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_231320,
                                                      "mem_231320") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_231315,
                                                      "mem_231315") != 0)
                                return 1;
                        }
                        if (memblock_set_device(ctx, &ext_mem_231400,
                                                &ext_mem_231398,
                                                "ext_mem_231398") != 0)
                            return 1;
                        if (memblock_set_device(ctx, &ext_mem_231399,
                                                &ext_mem_231397,
                                                "ext_mem_231397") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_231397,
                                                  "ext_mem_231397") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_231398,
                                                  "ext_mem_231398") != 0)
                            return 1;
                    }
                    if (memblock_set_device(ctx, &ext_mem_231402,
                                            &ext_mem_231400,
                                            "ext_mem_231400") != 0)
                        return 1;
                    if (memblock_set_device(ctx, &ext_mem_231401,
                                            &ext_mem_231399,
                                            "ext_mem_231399") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231399,
                                              "ext_mem_231399") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231400,
                                              "ext_mem_231400") != 0)
                        return 1;
                }
                if (memblock_set_device(ctx, &ext_mem_231505, &ext_mem_231402,
                                        "ext_mem_231402") != 0)
                    return 1;
                if (memblock_set_device(ctx, &ext_mem_231504, &ext_mem_231401,
                                        "ext_mem_231401") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_231401,
                                          "ext_mem_231401") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_231402,
                                          "ext_mem_231402") != 0)
                    return 1;
            } else {
                bool match_lit_206214 = (int64_t) 0 == d_t_203497;
                int64_t binop_y_231423 = (int64_t) 8 * q_t_203494;
                int64_t bytes_231424 = smax64((int64_t) 0, binop_y_231423);
                struct memblock_device ext_mem_231503;
                
                ext_mem_231503.references = NULL;
                
                struct memblock_device ext_mem_231502;
                
                ext_mem_231502.references = NULL;
                if (match_lit_206214) {
                    struct memblock_device mem_231406;
                    
                    mem_231406.references = NULL;
                    if (memblock_alloc_device(ctx, &mem_231406, bytes_229427,
                                              "mem_231406")) {
                        err = 1;
                        goto cleanup;
                    }
                    if (futrts_builtinzhreplicate_f64(ctx, mem_231406,
                                                      partition_sizze_203577 *
                                                      t_n_m_203650, 0.0) != 0) {
                        if (memblock_unref_device(ctx, &mem_231406,
                                                  "mem_231406") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_231502,
                                                  "ext_mem_231502") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_231503,
                                                  "ext_mem_231503") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_231504,
                                                  "ext_mem_231504") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_231505,
                                                  "ext_mem_231505") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_230920,
                                                  "mem_230920") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_230914,
                                                  "ext_mem_230914") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_230907,
                                                  "ext_mem_230907") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_230908,
                                                  "ext_mem_230908") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_230546,
                                                  "ext_mem_230546") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_230529,
                                                  "ext_mem_230529") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_230512,
                                                  "ext_mem_230512") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_230494,
                                                  "ext_mem_230494") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_230486,
                                                  "ext_mem_230486") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_230487,
                                                  "ext_mem_230487") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_param_229515,
                                                  "mem_param_229515") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_param_229507,
                                                  "mem_param_229507") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_231517,
                                                  "ext_mem_231517") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_231518,
                                                  "ext_mem_231518") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_param_229493,
                                                  "mem_param_229493") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_param_229485,
                                                  "mem_param_229485") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_param_229477,
                                                  "mem_param_229477") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_231860,
                                                  "ext_mem_231860") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_231861,
                                                  "ext_mem_231861") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_231862,
                                                  "ext_mem_231862") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_230551,
                                                  "mem_230551") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_230534,
                                                  "mem_230534") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_230517,
                                                  "mem_230517") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_230500,
                                                  "mem_230500") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229531,
                                                  "mem_229531") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229526,
                                                  "mem_229526") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229520,
                                                  "mem_229520") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229469,
                                                  "mem_229469") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229465,
                                                  "mem_229465") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_229460,
                                                  "ext_mem_229460") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_229461,
                                                  "ext_mem_229461") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_229411,
                                                  "ext_mem_229411") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_229412,
                                                  "ext_mem_229412") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_229362,
                                                  "ext_mem_229362") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_229363,
                                                  "ext_mem_229363") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_229264,
                                                  "ext_mem_229264") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_229265,
                                                  "ext_mem_229265") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229206,
                                                  "mem_229206") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229200,
                                                  "mem_229200") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_229196,
                                                  "ext_mem_229196") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_229197,
                                                  "ext_mem_229197") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229164,
                                                  "mem_229164") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229161,
                                                  "mem_229161") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229157,
                                                  "mem_229157") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229155,
                                                  "mem_229155") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229152,
                                                  "mem_229152") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_229148,
                                                  "mem_229148") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_out_232249,
                                                  "mem_out_232249") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_out_232248,
                                                  "mem_out_232248") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_out_232247,
                                                  "mem_out_232247") != 0)
                            return 1;
                        err = 1;
                        goto cleanup;
                    }
                    
                    int64_t segmap_group_sizze_225868;
                    
                    segmap_group_sizze_225868 =
                        *ctx->tuning_params.mainzisegmap_group_sizze_225842;
                    
                    int64_t segmap_usable_groups_225869 =
                            sdiv_up64(nest_sizze_207000,
                                      segmap_group_sizze_225868);
                    struct memblock_device mem_231411;
                    
                    mem_231411.references = NULL;
                    if (memblock_alloc_device(ctx, &mem_231411, bytes_229177,
                                              "mem_231411")) {
                        err = 1;
                        goto cleanup;
                    }
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s\n", "\n# SegMap");
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_225873,
                                                            1, sizeof(n_203490),
                                                            &n_203490));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_225873,
                                                            2,
                                                            sizeof(partition_sizze_203577),
                                                            &partition_sizze_203577));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_225873,
                                                            3,
                                                            sizeof(mem_229161.mem),
                                                            &mem_229161.mem));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_225873,
                                                            4,
                                                            sizeof(mem_230920.mem),
                                                            &mem_230920.mem));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_225873,
                                                            5,
                                                            sizeof(mem_231411.mem),
                                                            &mem_231411.mem));
                    if (1 * ((size_t) segmap_usable_groups_225869 *
                             (size_t) segmap_group_sizze_225868) != 0) {
                        const size_t global_work_sizze_237484[1] =
                                     {(size_t) segmap_usable_groups_225869 *
                                     (size_t) segmap_group_sizze_225868};
                        const size_t local_work_sizze_237488[1] =
                                     {(size_t) segmap_group_sizze_225868};
                        int64_t time_start_237485 = 0, time_end_237486 = 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_225873",
                                    global_work_sizze_237484[0],
                                    local_work_sizze_237488[0], (int) 0);
                            time_start_237485 = get_wall_time();
                        }
                        OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                        ctx->mainzisegmap_225873,
                                                                        1, NULL,
                                                                        global_work_sizze_237484,
                                                                        local_work_sizze_237488,
                                                                        0, NULL,
                                                                        ctx->profiling_paused ||
                                                                        !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                  &ctx->mainzisegmap_225873_runs,
                                                                                                                  &ctx->mainzisegmap_225873_total_runtime)));
                        if (ctx->debugging) {
                            OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                            time_end_237486 = get_wall_time();
                            
                            long time_diff_237487 = time_end_237486 -
                                 time_start_237485;
                            
                            fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                                    "main.segmap_225873", time_diff_237487);
                        }
                    }
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s\n", "");
                    
                    int64_t segmap_group_sizze_225884;
                    
                    segmap_group_sizze_225884 =
                        *ctx->tuning_params.mainzisegmap_group_sizze_225786;
                    
                    int64_t segmap_usable_groups_225885 =
                            sdiv_up64(nest_sizze_207000,
                                      segmap_group_sizze_225884);
                    struct memblock_device mem_231416;
                    
                    mem_231416.references = NULL;
                    if (memblock_alloc_device(ctx, &mem_231416, bytes_229177,
                                              "mem_231416")) {
                        err = 1;
                        goto cleanup;
                    }
                    
                    struct memblock_device mem_231420;
                    
                    mem_231420.references = NULL;
                    if (memblock_alloc_device(ctx, &mem_231420, bytes_229177,
                                              "mem_231420")) {
                        err = 1;
                        goto cleanup;
                    }
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s\n", "\n# SegMap");
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_225890,
                                                            1,
                                                            sizeof(ctx->failure_is_an_option),
                                                            &ctx->failure_is_an_option));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_225890,
                                                            3, sizeof(n_203490),
                                                            &n_203490));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_225890,
                                                            4,
                                                            sizeof(partition_sizze_203577),
                                                            &partition_sizze_203577));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_225890,
                                                            5,
                                                            sizeof(ctx_param_ext_229488),
                                                            &ctx_param_ext_229488));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_225890,
                                                            6,
                                                            sizeof(ctx_param_ext_229489),
                                                            &ctx_param_ext_229489));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_225890,
                                                            7,
                                                            sizeof(ctx_param_ext_229491),
                                                            &ctx_param_ext_229491));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_225890,
                                                            8,
                                                            sizeof(ext_mem_229197.mem),
                                                            &ext_mem_229197.mem));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_225890,
                                                            9,
                                                            sizeof(mem_param_229493.mem),
                                                            &mem_param_229493.mem));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_225890,
                                                            10,
                                                            sizeof(mem_231411.mem),
                                                            &mem_231411.mem));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_225890,
                                                            11,
                                                            sizeof(mem_231416.mem),
                                                            &mem_231416.mem));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_225890,
                                                            12,
                                                            sizeof(mem_231420.mem),
                                                            &mem_231420.mem));
                    if (1 * ((size_t) segmap_usable_groups_225885 *
                             (size_t) segmap_group_sizze_225884) != 0) {
                        const size_t global_work_sizze_237489[1] =
                                     {(size_t) segmap_usable_groups_225885 *
                                     (size_t) segmap_group_sizze_225884};
                        const size_t local_work_sizze_237493[1] =
                                     {(size_t) segmap_group_sizze_225884};
                        int64_t time_start_237490 = 0, time_end_237491 = 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_225890",
                                    global_work_sizze_237489[0],
                                    local_work_sizze_237493[0], (int) 0);
                            time_start_237490 = get_wall_time();
                        }
                        OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                        ctx->mainzisegmap_225890,
                                                                        1, NULL,
                                                                        global_work_sizze_237489,
                                                                        local_work_sizze_237493,
                                                                        0, NULL,
                                                                        ctx->profiling_paused ||
                                                                        !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                  &ctx->mainzisegmap_225890_runs,
                                                                                                                  &ctx->mainzisegmap_225890_total_runtime)));
                        if (ctx->debugging) {
                            OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                            time_end_237491 = get_wall_time();
                            
                            long time_diff_237492 = time_end_237491 -
                                 time_start_237490;
                            
                            fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                                    "main.segmap_225890", time_diff_237492);
                        }
                    }
                    ctx->failure_is_an_option = 1;
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s\n", "");
                    if (memblock_unref_device(ctx, &mem_231411, "mem_231411") !=
                        0)
                        return 1;
                    
                    struct memblock_device mem_231430;
                    
                    mem_231430.references = NULL;
                    if (memblock_alloc_device(ctx, &mem_231430, bytes_229427,
                                              "mem_231430")) {
                        err = 1;
                        goto cleanup;
                    }
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s\n", "\n# SegMap");
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_225917,
                                                            1,
                                                            (size_t) ((int64_t) 8 *
                                                                      q_t_203494),
                                                            NULL));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_225917,
                                                            2,
                                                            (size_t) ((int64_t) 8 *
                                                                      q_t_203494),
                                                            NULL));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_225917,
                                                            3,
                                                            (size_t) bytes_231424,
                                                            NULL));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_225917,
                                                            4, sizeof(n_203490),
                                                            &n_203490));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_225917,
                                                            5,
                                                            sizeof(q_t_203494),
                                                            &q_t_203494));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_225917,
                                                            6,
                                                            sizeof(jump_t_203500),
                                                            &jump_t_203500));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_225917,
                                                            7,
                                                            sizeof(partition_sizze_203577),
                                                            &partition_sizze_203577));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_225917,
                                                            8,
                                                            sizeof(t_n_m_203650),
                                                            &t_n_m_203650));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_225917,
                                                            9, sizeof(i_203670),
                                                            &i_203670));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_225917,
                                                            10,
                                                            sizeof(ext_mem_229196.mem),
                                                            &ext_mem_229196.mem));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_225917,
                                                            11,
                                                            sizeof(ext_mem_229197.mem),
                                                            &ext_mem_229197.mem));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_225917,
                                                            12,
                                                            sizeof(ext_mem_229460.mem),
                                                            &ext_mem_229460.mem));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_225917,
                                                            13,
                                                            sizeof(ext_mem_229461.mem),
                                                            &ext_mem_229461.mem));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_225917,
                                                            14,
                                                            sizeof(mem_231416.mem),
                                                            &mem_231416.mem));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_225917,
                                                            15,
                                                            sizeof(mem_231420.mem),
                                                            &mem_231420.mem));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_225917,
                                                            16,
                                                            sizeof(mem_231430.mem),
                                                            &mem_231430.mem));
                    if (1 * ((size_t) nest_sizze_210118 *
                             (size_t) q_t_203494) != 0) {
                        const size_t global_work_sizze_237494[1] =
                                     {(size_t) nest_sizze_210118 *
                                     (size_t) q_t_203494};
                        const size_t local_work_sizze_237498[1] =
                                     {(size_t) q_t_203494};
                        int64_t time_start_237495 = 0, time_end_237496 = 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_225917",
                                    global_work_sizze_237494[0],
                                    local_work_sizze_237498[0], (int) (0 +
                                                                       (int64_t) 8 *
                                                                       q_t_203494 +
                                                                       (int64_t) 8 *
                                                                       q_t_203494 +
                                                                       bytes_231424));
                            time_start_237495 = get_wall_time();
                        }
                        OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                        ctx->mainzisegmap_intragroup_225917,
                                                                        1, NULL,
                                                                        global_work_sizze_237494,
                                                                        local_work_sizze_237498,
                                                                        0, NULL,
                                                                        ctx->profiling_paused ||
                                                                        !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                  &ctx->mainzisegmap_intragroup_225917_runs,
                                                                                                                  &ctx->mainzisegmap_intragroup_225917_total_runtime)));
                        if (ctx->debugging) {
                            OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                            time_end_237496 = get_wall_time();
                            
                            long time_diff_237497 = time_end_237496 -
                                 time_start_237495;
                            
                            fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                                    "main.segmap_intragroup_225917",
                                    time_diff_237497);
                        }
                    }
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s\n", "");
                    if (memblock_unref_device(ctx, &mem_231416, "mem_231416") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_231420, "mem_231420") !=
                        0)
                        return 1;
                    if (memblock_set_device(ctx, &ext_mem_231503, &mem_231430,
                                            "mem_231430") != 0)
                        return 1;
                    if (memblock_set_device(ctx, &ext_mem_231502, &mem_231406,
                                            "mem_231406") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_231430, "mem_231430") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_231420, "mem_231420") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_231416, "mem_231416") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_231411, "mem_231411") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_231406, "mem_231406") !=
                        0)
                        return 1;
                } else {
                    bool match_lit_206291 = (int64_t) 1 == d_t_203497;
                    struct memblock_device ext_mem_231501;
                    
                    ext_mem_231501.references = NULL;
                    
                    struct memblock_device ext_mem_231500;
                    
                    ext_mem_231500.references = NULL;
                    if (match_lit_206291) {
                        int64_t segmap_group_sizze_226180;
                        
                        segmap_group_sizze_226180 =
                            *ctx->tuning_params.mainzisegmap_group_sizze_226154;
                        
                        int64_t segmap_usable_groups_226181 =
                                sdiv_up64(nest_sizze_207000,
                                          segmap_group_sizze_226180);
                        struct memblock_device mem_231435;
                        
                        mem_231435.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_231435,
                                                  bytes_229177, "mem_231435")) {
                            err = 1;
                            goto cleanup;
                        }
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s\n", "\n# SegMap");
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_226185,
                                                                1,
                                                                sizeof(n_203490),
                                                                &n_203490));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_226185,
                                                                2,
                                                                sizeof(partition_sizze_203577),
                                                                &partition_sizze_203577));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_226185,
                                                                3,
                                                                sizeof(mem_229161.mem),
                                                                &mem_229161.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_226185,
                                                                4,
                                                                sizeof(mem_230920.mem),
                                                                &mem_230920.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_226185,
                                                                5,
                                                                sizeof(mem_231435.mem),
                                                                &mem_231435.mem));
                        if (1 * ((size_t) segmap_usable_groups_226181 *
                                 (size_t) segmap_group_sizze_226180) != 0) {
                            const size_t global_work_sizze_237499[1] =
                                         {(size_t) segmap_usable_groups_226181 *
                                         (size_t) segmap_group_sizze_226180};
                            const size_t local_work_sizze_237503[1] =
                                         {(size_t) segmap_group_sizze_226180};
                            int64_t time_start_237500 = 0, time_end_237501 = 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_226185",
                                        global_work_sizze_237499[0],
                                        local_work_sizze_237503[0], (int) 0);
                                time_start_237500 = get_wall_time();
                            }
                            OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                            ctx->mainzisegmap_226185,
                                                                            1,
                                                                            NULL,
                                                                            global_work_sizze_237499,
                                                                            local_work_sizze_237503,
                                                                            0,
                                                                            NULL,
                                                                            ctx->profiling_paused ||
                                                                            !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                      &ctx->mainzisegmap_226185_runs,
                                                                                                                      &ctx->mainzisegmap_226185_total_runtime)));
                            if (ctx->debugging) {
                                OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                time_end_237501 = get_wall_time();
                                
                                long time_diff_237502 = time_end_237501 -
                                     time_start_237500;
                                
                                fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                                        "main.segmap_226185", time_diff_237502);
                            }
                        }
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s\n", "");
                        
                        int64_t segmap_group_sizze_226196;
                        
                        segmap_group_sizze_226196 =
                            *ctx->tuning_params.mainzisegmap_group_sizze_226098;
                        
                        int64_t segmap_usable_groups_226197 =
                                sdiv_up64(nest_sizze_207000,
                                          segmap_group_sizze_226196);
                        struct memblock_device mem_231440;
                        
                        mem_231440.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_231440,
                                                  bytes_229177, "mem_231440")) {
                            err = 1;
                            goto cleanup;
                        }
                        
                        struct memblock_device mem_231444;
                        
                        mem_231444.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_231444,
                                                  bytes_229177, "mem_231444")) {
                            err = 1;
                            goto cleanup;
                        }
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s\n", "\n# SegMap");
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_226202,
                                                                1,
                                                                sizeof(ctx->failure_is_an_option),
                                                                &ctx->failure_is_an_option));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_226202,
                                                                3,
                                                                sizeof(n_203490),
                                                                &n_203490));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_226202,
                                                                4,
                                                                sizeof(partition_sizze_203577),
                                                                &partition_sizze_203577));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_226202,
                                                                5,
                                                                sizeof(ctx_param_ext_229488),
                                                                &ctx_param_ext_229488));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_226202,
                                                                6,
                                                                sizeof(ctx_param_ext_229489),
                                                                &ctx_param_ext_229489));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_226202,
                                                                7,
                                                                sizeof(ctx_param_ext_229491),
                                                                &ctx_param_ext_229491));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_226202,
                                                                8,
                                                                sizeof(ext_mem_229197.mem),
                                                                &ext_mem_229197.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_226202,
                                                                9,
                                                                sizeof(mem_param_229493.mem),
                                                                &mem_param_229493.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_226202,
                                                                10,
                                                                sizeof(mem_231435.mem),
                                                                &mem_231435.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_226202,
                                                                11,
                                                                sizeof(mem_231440.mem),
                                                                &mem_231440.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_226202,
                                                                12,
                                                                sizeof(mem_231444.mem),
                                                                &mem_231444.mem));
                        if (1 * ((size_t) segmap_usable_groups_226197 *
                                 (size_t) segmap_group_sizze_226196) != 0) {
                            const size_t global_work_sizze_237504[1] =
                                         {(size_t) segmap_usable_groups_226197 *
                                         (size_t) segmap_group_sizze_226196};
                            const size_t local_work_sizze_237508[1] =
                                         {(size_t) segmap_group_sizze_226196};
                            int64_t time_start_237505 = 0, time_end_237506 = 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_226202",
                                        global_work_sizze_237504[0],
                                        local_work_sizze_237508[0], (int) 0);
                                time_start_237505 = get_wall_time();
                            }
                            OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                            ctx->mainzisegmap_226202,
                                                                            1,
                                                                            NULL,
                                                                            global_work_sizze_237504,
                                                                            local_work_sizze_237508,
                                                                            0,
                                                                            NULL,
                                                                            ctx->profiling_paused ||
                                                                            !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                      &ctx->mainzisegmap_226202_runs,
                                                                                                                      &ctx->mainzisegmap_226202_total_runtime)));
                            if (ctx->debugging) {
                                OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                time_end_237506 = get_wall_time();
                                
                                long time_diff_237507 = time_end_237506 -
                                     time_start_237505;
                                
                                fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                                        "main.segmap_226202", time_diff_237507);
                            }
                        }
                        ctx->failure_is_an_option = 1;
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s\n", "");
                        if (memblock_unref_device(ctx, &mem_231435,
                                                  "mem_231435") != 0)
                            return 1;
                        
                        struct memblock_device mem_231457;
                        
                        mem_231457.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_231457,
                                                  bytes_229427, "mem_231457")) {
                            err = 1;
                            goto cleanup;
                        }
                        
                        struct memblock_device mem_231461;
                        
                        mem_231461.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_231461,
                                                  bytes_229427, "mem_231461")) {
                            err = 1;
                            goto cleanup;
                        }
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s\n", "\n# SegMap");
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_226230,
                                                                1,
                                                                (size_t) ((int64_t) 8 *
                                                                          q_t_203494),
                                                                NULL));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_226230,
                                                                2,
                                                                (size_t) ((int64_t) 8 *
                                                                          q_t_203494),
                                                                NULL));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_226230,
                                                                3,
                                                                (size_t) ((int64_t) 8 *
                                                                          q_t_203494),
                                                                NULL));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_226230,
                                                                4,
                                                                (size_t) ((int64_t) 8 *
                                                                          q_t_203494),
                                                                NULL));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_226230,
                                                                5,
                                                                (size_t) ((int64_t) 8 *
                                                                          q_t_203494),
                                                                NULL));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_226230,
                                                                6,
                                                                (size_t) bytes_231424,
                                                                NULL));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_226230,
                                                                7,
                                                                (size_t) bytes_231424,
                                                                NULL));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_226230,
                                                                8,
                                                                sizeof(n_203490),
                                                                &n_203490));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_226230,
                                                                9,
                                                                sizeof(q_t_203494),
                                                                &q_t_203494));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_226230,
                                                                10,
                                                                sizeof(jump_t_203500),
                                                                &jump_t_203500));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_226230,
                                                                11,
                                                                sizeof(partition_sizze_203577),
                                                                &partition_sizze_203577));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_226230,
                                                                12,
                                                                sizeof(t_n_m_203650),
                                                                &t_n_m_203650));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_226230,
                                                                13,
                                                                sizeof(i_203670),
                                                                &i_203670));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_226230,
                                                                14,
                                                                sizeof(ext_mem_229196.mem),
                                                                &ext_mem_229196.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_226230,
                                                                15,
                                                                sizeof(ext_mem_229197.mem),
                                                                &ext_mem_229197.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_226230,
                                                                16,
                                                                sizeof(ext_mem_229460.mem),
                                                                &ext_mem_229460.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_226230,
                                                                17,
                                                                sizeof(ext_mem_229461.mem),
                                                                &ext_mem_229461.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_226230,
                                                                18,
                                                                sizeof(mem_231440.mem),
                                                                &mem_231440.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_226230,
                                                                19,
                                                                sizeof(mem_231444.mem),
                                                                &mem_231444.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_226230,
                                                                20,
                                                                sizeof(mem_231457.mem),
                                                                &mem_231457.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_226230,
                                                                21,
                                                                sizeof(mem_231461.mem),
                                                                &mem_231461.mem));
                        if (1 * ((size_t) nest_sizze_210118 *
                                 (size_t) q_t_203494) != 0) {
                            const size_t global_work_sizze_237509[1] =
                                         {(size_t) nest_sizze_210118 *
                                         (size_t) q_t_203494};
                            const size_t local_work_sizze_237513[1] =
                                         {(size_t) q_t_203494};
                            int64_t time_start_237510 = 0, time_end_237511 = 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_226230",
                                        global_work_sizze_237509[0],
                                        local_work_sizze_237513[0], (int) (0 +
                                                                           (int64_t) 8 *
                                                                           q_t_203494 +
                                                                           (int64_t) 8 *
                                                                           q_t_203494 +
                                                                           (int64_t) 8 *
                                                                           q_t_203494 +
                                                                           (int64_t) 8 *
                                                                           q_t_203494 +
                                                                           (int64_t) 8 *
                                                                           q_t_203494 +
                                                                           bytes_231424 +
                                                                           bytes_231424));
                                time_start_237510 = get_wall_time();
                            }
                            OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                            ctx->mainzisegmap_intragroup_226230,
                                                                            1,
                                                                            NULL,
                                                                            global_work_sizze_237509,
                                                                            local_work_sizze_237513,
                                                                            0,
                                                                            NULL,
                                                                            ctx->profiling_paused ||
                                                                            !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                      &ctx->mainzisegmap_intragroup_226230_runs,
                                                                                                                      &ctx->mainzisegmap_intragroup_226230_total_runtime)));
                            if (ctx->debugging) {
                                OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                time_end_237511 = get_wall_time();
                                
                                long time_diff_237512 = time_end_237511 -
                                     time_start_237510;
                                
                                fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                                        "main.segmap_intragroup_226230",
                                        time_diff_237512);
                            }
                        }
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s\n", "");
                        if (memblock_unref_device(ctx, &mem_231440,
                                                  "mem_231440") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_231444,
                                                  "mem_231444") != 0)
                            return 1;
                        if (memblock_set_device(ctx, &ext_mem_231501,
                                                &mem_231457, "mem_231457") != 0)
                            return 1;
                        if (memblock_set_device(ctx, &ext_mem_231500,
                                                &mem_231461, "mem_231461") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_231461,
                                                  "mem_231461") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_231457,
                                                  "mem_231457") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_231444,
                                                  "mem_231444") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_231440,
                                                  "mem_231440") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_231435,
                                                  "mem_231435") != 0)
                            return 1;
                    } else {
                        int64_t segmap_group_sizze_226584;
                        
                        segmap_group_sizze_226584 =
                            *ctx->tuning_params.mainzisegmap_group_sizze_226558;
                        
                        int64_t segmap_usable_groups_226585 =
                                sdiv_up64(nest_sizze_207000,
                                          segmap_group_sizze_226584);
                        struct memblock_device mem_231466;
                        
                        mem_231466.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_231466,
                                                  bytes_229177, "mem_231466")) {
                            err = 1;
                            goto cleanup;
                        }
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s\n", "\n# SegMap");
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_226589,
                                                                1,
                                                                sizeof(n_203490),
                                                                &n_203490));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_226589,
                                                                2,
                                                                sizeof(partition_sizze_203577),
                                                                &partition_sizze_203577));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_226589,
                                                                3,
                                                                sizeof(mem_229161.mem),
                                                                &mem_229161.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_226589,
                                                                4,
                                                                sizeof(mem_230920.mem),
                                                                &mem_230920.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_226589,
                                                                5,
                                                                sizeof(mem_231466.mem),
                                                                &mem_231466.mem));
                        if (1 * ((size_t) segmap_usable_groups_226585 *
                                 (size_t) segmap_group_sizze_226584) != 0) {
                            const size_t global_work_sizze_237514[1] =
                                         {(size_t) segmap_usable_groups_226585 *
                                         (size_t) segmap_group_sizze_226584};
                            const size_t local_work_sizze_237518[1] =
                                         {(size_t) segmap_group_sizze_226584};
                            int64_t time_start_237515 = 0, time_end_237516 = 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_226589",
                                        global_work_sizze_237514[0],
                                        local_work_sizze_237518[0], (int) 0);
                                time_start_237515 = get_wall_time();
                            }
                            OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                            ctx->mainzisegmap_226589,
                                                                            1,
                                                                            NULL,
                                                                            global_work_sizze_237514,
                                                                            local_work_sizze_237518,
                                                                            0,
                                                                            NULL,
                                                                            ctx->profiling_paused ||
                                                                            !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                      &ctx->mainzisegmap_226589_runs,
                                                                                                                      &ctx->mainzisegmap_226589_total_runtime)));
                            if (ctx->debugging) {
                                OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                time_end_237516 = get_wall_time();
                                
                                long time_diff_237517 = time_end_237516 -
                                     time_start_237515;
                                
                                fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                                        "main.segmap_226589", time_diff_237517);
                            }
                        }
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s\n", "");
                        
                        int64_t segmap_group_sizze_226600;
                        
                        segmap_group_sizze_226600 =
                            *ctx->tuning_params.mainzisegmap_group_sizze_226502;
                        
                        int64_t segmap_usable_groups_226601 =
                                sdiv_up64(nest_sizze_207000,
                                          segmap_group_sizze_226600);
                        struct memblock_device mem_231471;
                        
                        mem_231471.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_231471,
                                                  bytes_229177, "mem_231471")) {
                            err = 1;
                            goto cleanup;
                        }
                        
                        struct memblock_device mem_231475;
                        
                        mem_231475.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_231475,
                                                  bytes_229177, "mem_231475")) {
                            err = 1;
                            goto cleanup;
                        }
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s\n", "\n# SegMap");
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_226606,
                                                                1,
                                                                sizeof(ctx->failure_is_an_option),
                                                                &ctx->failure_is_an_option));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_226606,
                                                                3,
                                                                sizeof(n_203490),
                                                                &n_203490));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_226606,
                                                                4,
                                                                sizeof(partition_sizze_203577),
                                                                &partition_sizze_203577));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_226606,
                                                                5,
                                                                sizeof(ctx_param_ext_229488),
                                                                &ctx_param_ext_229488));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_226606,
                                                                6,
                                                                sizeof(ctx_param_ext_229489),
                                                                &ctx_param_ext_229489));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_226606,
                                                                7,
                                                                sizeof(ctx_param_ext_229491),
                                                                &ctx_param_ext_229491));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_226606,
                                                                8,
                                                                sizeof(ext_mem_229197.mem),
                                                                &ext_mem_229197.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_226606,
                                                                9,
                                                                sizeof(mem_param_229493.mem),
                                                                &mem_param_229493.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_226606,
                                                                10,
                                                                sizeof(mem_231466.mem),
                                                                &mem_231466.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_226606,
                                                                11,
                                                                sizeof(mem_231471.mem),
                                                                &mem_231471.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_226606,
                                                                12,
                                                                sizeof(mem_231475.mem),
                                                                &mem_231475.mem));
                        if (1 * ((size_t) segmap_usable_groups_226601 *
                                 (size_t) segmap_group_sizze_226600) != 0) {
                            const size_t global_work_sizze_237519[1] =
                                         {(size_t) segmap_usable_groups_226601 *
                                         (size_t) segmap_group_sizze_226600};
                            const size_t local_work_sizze_237523[1] =
                                         {(size_t) segmap_group_sizze_226600};
                            int64_t time_start_237520 = 0, time_end_237521 = 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_226606",
                                        global_work_sizze_237519[0],
                                        local_work_sizze_237523[0], (int) 0);
                                time_start_237520 = get_wall_time();
                            }
                            OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                            ctx->mainzisegmap_226606,
                                                                            1,
                                                                            NULL,
                                                                            global_work_sizze_237519,
                                                                            local_work_sizze_237523,
                                                                            0,
                                                                            NULL,
                                                                            ctx->profiling_paused ||
                                                                            !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                      &ctx->mainzisegmap_226606_runs,
                                                                                                                      &ctx->mainzisegmap_226606_total_runtime)));
                            if (ctx->debugging) {
                                OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                time_end_237521 = get_wall_time();
                                
                                long time_diff_237522 = time_end_237521 -
                                     time_start_237520;
                                
                                fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                                        "main.segmap_226606", time_diff_237522);
                            }
                        }
                        ctx->failure_is_an_option = 1;
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s\n", "");
                        if (memblock_unref_device(ctx, &mem_231466,
                                                  "mem_231466") != 0)
                            return 1;
                        
                        struct memblock_device mem_231495;
                        
                        mem_231495.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_231495,
                                                  bytes_229427, "mem_231495")) {
                            err = 1;
                            goto cleanup;
                        }
                        
                        struct memblock_device mem_231499;
                        
                        mem_231499.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_231499,
                                                  bytes_229427, "mem_231499")) {
                            err = 1;
                            goto cleanup;
                        }
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s\n", "\n# SegMap");
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_226634,
                                                                1,
                                                                (size_t) ((int64_t) 8 *
                                                                          q_t_203494),
                                                                NULL));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_226634,
                                                                2,
                                                                (size_t) ((int64_t) 8 *
                                                                          q_t_203494),
                                                                NULL));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_226634,
                                                                3,
                                                                (size_t) ((int64_t) 8 *
                                                                          q_t_203494),
                                                                NULL));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_226634,
                                                                4,
                                                                (size_t) ((int64_t) 8 *
                                                                          q_t_203494),
                                                                NULL));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_226634,
                                                                5,
                                                                (size_t) ((int64_t) 8 *
                                                                          q_t_203494),
                                                                NULL));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_226634,
                                                                6,
                                                                (size_t) ((int64_t) 8 *
                                                                          q_t_203494),
                                                                NULL));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_226634,
                                                                7,
                                                                (size_t) ((int64_t) 8 *
                                                                          q_t_203494),
                                                                NULL));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_226634,
                                                                8,
                                                                (size_t) bytes_231424,
                                                                NULL));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_226634,
                                                                9,
                                                                (size_t) bytes_231424,
                                                                NULL));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_226634,
                                                                10,
                                                                (size_t) bytes_231424,
                                                                NULL));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_226634,
                                                                11,
                                                                (size_t) bytes_231424,
                                                                NULL));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_226634,
                                                                12,
                                                                sizeof(n_203490),
                                                                &n_203490));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_226634,
                                                                13,
                                                                sizeof(q_t_203494),
                                                                &q_t_203494));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_226634,
                                                                14,
                                                                sizeof(jump_t_203500),
                                                                &jump_t_203500));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_226634,
                                                                15,
                                                                sizeof(partition_sizze_203577),
                                                                &partition_sizze_203577));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_226634,
                                                                16,
                                                                sizeof(t_n_m_203650),
                                                                &t_n_m_203650));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_226634,
                                                                17,
                                                                sizeof(i_203670),
                                                                &i_203670));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_226634,
                                                                18,
                                                                sizeof(ext_mem_229196.mem),
                                                                &ext_mem_229196.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_226634,
                                                                19,
                                                                sizeof(ext_mem_229197.mem),
                                                                &ext_mem_229197.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_226634,
                                                                20,
                                                                sizeof(ext_mem_229460.mem),
                                                                &ext_mem_229460.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_226634,
                                                                21,
                                                                sizeof(ext_mem_229461.mem),
                                                                &ext_mem_229461.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_226634,
                                                                22,
                                                                sizeof(mem_231471.mem),
                                                                &mem_231471.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_226634,
                                                                23,
                                                                sizeof(mem_231475.mem),
                                                                &mem_231475.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_226634,
                                                                24,
                                                                sizeof(mem_231495.mem),
                                                                &mem_231495.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_226634,
                                                                25,
                                                                sizeof(mem_231499.mem),
                                                                &mem_231499.mem));
                        if (1 * ((size_t) nest_sizze_210118 *
                                 (size_t) q_t_203494) != 0) {
                            const size_t global_work_sizze_237524[1] =
                                         {(size_t) nest_sizze_210118 *
                                         (size_t) q_t_203494};
                            const size_t local_work_sizze_237528[1] =
                                         {(size_t) q_t_203494};
                            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.segmap_intragroup_226634",
                                        global_work_sizze_237524[0],
                                        local_work_sizze_237528[0], (int) (0 +
                                                                           (int64_t) 8 *
                                                                           q_t_203494 +
                                                                           (int64_t) 8 *
                                                                           q_t_203494 +
                                                                           (int64_t) 8 *
                                                                           q_t_203494 +
                                                                           (int64_t) 8 *
                                                                           q_t_203494 +
                                                                           (int64_t) 8 *
                                                                           q_t_203494 +
                                                                           (int64_t) 8 *
                                                                           q_t_203494 +
                                                                           (int64_t) 8 *
                                                                           q_t_203494 +
                                                                           bytes_231424 +
                                                                           bytes_231424 +
                                                                           bytes_231424 +
                                                                           bytes_231424));
                                time_start_237525 = get_wall_time();
                            }
                            OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                            ctx->mainzisegmap_intragroup_226634,
                                                                            1,
                                                                            NULL,
                                                                            global_work_sizze_237524,
                                                                            local_work_sizze_237528,
                                                                            0,
                                                                            NULL,
                                                                            ctx->profiling_paused ||
                                                                            !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                      &ctx->mainzisegmap_intragroup_226634_runs,
                                                                                                                      &ctx->mainzisegmap_intragroup_226634_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.segmap_intragroup_226634",
                                        time_diff_237527);
                            }
                        }
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s\n", "");
                        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_set_device(ctx, &ext_mem_231501,
                                                &mem_231495, "mem_231495") != 0)
                            return 1;
                        if (memblock_set_device(ctx, &ext_mem_231500,
                                                &mem_231499, "mem_231499") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_231499,
                                                  "mem_231499") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_231495,
                                                  "mem_231495") != 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_231466,
                                                  "mem_231466") != 0)
                            return 1;
                    }
                    if (memblock_set_device(ctx, &ext_mem_231503,
                                            &ext_mem_231501,
                                            "ext_mem_231501") != 0)
                        return 1;
                    if (memblock_set_device(ctx, &ext_mem_231502,
                                            &ext_mem_231500,
                                            "ext_mem_231500") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231500,
                                              "ext_mem_231500") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231501,
                                              "ext_mem_231501") != 0)
                        return 1;
                }
                if (memblock_set_device(ctx, &ext_mem_231505, &ext_mem_231503,
                                        "ext_mem_231503") != 0)
                    return 1;
                if (memblock_set_device(ctx, &ext_mem_231504, &ext_mem_231502,
                                        "ext_mem_231502") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_231502,
                                          "ext_mem_231502") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_231503,
                                          "ext_mem_231503") != 0)
                    return 1;
            }
            
            struct memblock_device ext_mem_231511;
            
            ext_mem_231511.references = NULL;
            if (cond_204108) {
                bool zzero_206580 = jump_t_203500 == (int64_t) 0;
                bool nonzzero_206581 = !zzero_206580;
                bool nonzzero_cert_206582;
                
                if (!nonzzero_206581) {
                    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_231511,
                                              "ext_mem_231511") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231504,
                                              "ext_mem_231504") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231505,
                                              "ext_mem_231505") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_230920, "mem_230920") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_230914,
                                              "ext_mem_230914") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_230907,
                                              "ext_mem_230907") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_230908,
                                              "ext_mem_230908") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_230546,
                                              "ext_mem_230546") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_230529,
                                              "ext_mem_230529") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_230512,
                                              "ext_mem_230512") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_230494,
                                              "ext_mem_230494") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_230486,
                                              "ext_mem_230486") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_230487,
                                              "ext_mem_230487") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_229515,
                                              "mem_param_229515") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_229507,
                                              "mem_param_229507") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231517,
                                              "ext_mem_231517") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231518,
                                              "ext_mem_231518") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_229493,
                                              "mem_param_229493") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_229485,
                                              "mem_param_229485") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_229477,
                                              "mem_param_229477") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231860,
                                              "ext_mem_231860") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231861,
                                              "ext_mem_231861") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231862,
                                              "ext_mem_231862") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_230551, "mem_230551") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_230534, "mem_230534") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_230517, "mem_230517") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_230500, "mem_230500") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229531, "mem_229531") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229526, "mem_229526") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229520, "mem_229520") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229469, "mem_229469") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229465, "mem_229465") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229460,
                                              "ext_mem_229460") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229461,
                                              "ext_mem_229461") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229411,
                                              "ext_mem_229411") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229412,
                                              "ext_mem_229412") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229362,
                                              "ext_mem_229362") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229363,
                                              "ext_mem_229363") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229264,
                                              "ext_mem_229264") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229265,
                                              "ext_mem_229265") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229206, "mem_229206") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229200, "mem_229200") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229196,
                                              "ext_mem_229196") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229197,
                                              "ext_mem_229197") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229164, "mem_229164") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229161, "mem_229161") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229157, "mem_229157") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229155, "mem_229155") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229152, "mem_229152") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229148, "mem_229148") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_out_232249,
                                              "mem_out_232249") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_out_232248,
                                              "mem_out_232248") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_out_232247,
                                              "mem_out_232247") != 0)
                        return 1;
                    err = 1;
                    goto cleanup;
                }
                
                int64_t y_206583 = sub64(t_n_m_203650, (int64_t) 1);
                int64_t segmap_group_sizze_226889;
                
                segmap_group_sizze_226889 =
                    *ctx->tuning_params.mainzisegmap_group_sizze_226771;
                
                int64_t segmap_usable_groups_226890 =
                        sdiv_up64(nest_sizze_207000, segmap_group_sizze_226889);
                struct memblock_device mem_231510;
                
                mem_231510.references = NULL;
                if (memblock_alloc_device(ctx, &mem_231510, bytes_229177,
                                          "mem_231510")) {
                    err = 1;
                    goto cleanup;
                }
                if (ctx->debugging)
                    fprintf(ctx->log, "%s\n", "\n# SegMap");
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_226894,
                                                        1,
                                                        sizeof(ctx->failure_is_an_option),
                                                        &ctx->failure_is_an_option));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_226894,
                                                        3, sizeof(n_203490),
                                                        &n_203490));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_226894,
                                                        4,
                                                        sizeof(jump_t_203500),
                                                        &jump_t_203500));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_226894,
                                                        5,
                                                        sizeof(partition_sizze_203577),
                                                        &partition_sizze_203577));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_226894,
                                                        6, sizeof(t_n_m_203650),
                                                        &t_n_m_203650));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_226894,
                                                        7, sizeof(i_203670),
                                                        &i_203670));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_226894,
                                                        8, sizeof(y_206583),
                                                        &y_206583));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_226894,
                                                        9,
                                                        sizeof(ext_mem_231504.mem),
                                                        &ext_mem_231504.mem));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_226894,
                                                        10,
                                                        sizeof(ext_mem_231505.mem),
                                                        &ext_mem_231505.mem));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_226894,
                                                        11,
                                                        sizeof(mem_231510.mem),
                                                        &mem_231510.mem));
                if (1 * ((size_t) segmap_usable_groups_226890 *
                         (size_t) segmap_group_sizze_226889) != 0) {
                    const size_t global_work_sizze_237529[1] =
                                 {(size_t) segmap_usable_groups_226890 *
                                 (size_t) segmap_group_sizze_226889};
                    const size_t local_work_sizze_237533[1] =
                                 {(size_t) segmap_group_sizze_226889};
                    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_226894",
                                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_226894,
                                                                    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_226894_runs,
                                                                                                              &ctx->mainzisegmap_226894_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_226894", time_diff_237532);
                    }
                }
                ctx->failure_is_an_option = 1;
                if (ctx->debugging)
                    fprintf(ctx->log, "%s\n", "");
                if (memblock_set_device(ctx, &ext_mem_231511, &mem_231510,
                                        "mem_231510") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_231510, "mem_231510") != 0)
                    return 1;
            } else {
                bool dim_match_206636 = n_203490 == t_n_m_203650;
                bool empty_or_match_cert_206637;
                
                if (!dim_match_206636) {
                    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_203577, ", ",
                                  (long long) t_n_m_203650,
                                  ") cannot match shape of type `[",
                                  (long long) partition_sizze_203577, "][",
                                  (long long) n_203490, "]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_231511,
                                              "ext_mem_231511") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231504,
                                              "ext_mem_231504") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231505,
                                              "ext_mem_231505") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_230920, "mem_230920") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_230914,
                                              "ext_mem_230914") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_230907,
                                              "ext_mem_230907") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_230908,
                                              "ext_mem_230908") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_230546,
                                              "ext_mem_230546") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_230529,
                                              "ext_mem_230529") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_230512,
                                              "ext_mem_230512") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_230494,
                                              "ext_mem_230494") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_230486,
                                              "ext_mem_230486") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_230487,
                                              "ext_mem_230487") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_229515,
                                              "mem_param_229515") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_229507,
                                              "mem_param_229507") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231517,
                                              "ext_mem_231517") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231518,
                                              "ext_mem_231518") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_229493,
                                              "mem_param_229493") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_229485,
                                              "mem_param_229485") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_229477,
                                              "mem_param_229477") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231860,
                                              "ext_mem_231860") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231861,
                                              "ext_mem_231861") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231862,
                                              "ext_mem_231862") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_230551, "mem_230551") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_230534, "mem_230534") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_230517, "mem_230517") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_230500, "mem_230500") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229531, "mem_229531") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229526, "mem_229526") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229520, "mem_229520") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229469, "mem_229469") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229465, "mem_229465") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229460,
                                              "ext_mem_229460") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229461,
                                              "ext_mem_229461") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229411,
                                              "ext_mem_229411") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229412,
                                              "ext_mem_229412") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229362,
                                              "ext_mem_229362") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229363,
                                              "ext_mem_229363") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229264,
                                              "ext_mem_229264") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229265,
                                              "ext_mem_229265") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229206, "mem_229206") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229200, "mem_229200") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229196,
                                              "ext_mem_229196") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229197,
                                              "ext_mem_229197") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229164, "mem_229164") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229161, "mem_229161") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229157, "mem_229157") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229155, "mem_229155") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229152, "mem_229152") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229148, "mem_229148") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_out_232249,
                                              "mem_out_232249") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_out_232248,
                                              "mem_out_232248") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_out_232247,
                                              "mem_out_232247") != 0)
                        return 1;
                    err = 1;
                    goto cleanup;
                }
                if (memblock_set_device(ctx, &ext_mem_231511, &ext_mem_231505,
                                        "ext_mem_231505") != 0)
                    return 1;
            }
            if (memblock_unref_device(ctx, &ext_mem_231504, "ext_mem_231504") !=
                0)
                return 1;
            if (memblock_unref_device(ctx, &ext_mem_231505, "ext_mem_231505") !=
                0)
                return 1;
            
            int64_t ctx_param_ext_tmp_232867 = ext_231512;
            int64_t ctx_param_ext_tmp_232868 = ext_231512;
            struct memblock_device mem_param_tmp_232869;
            
            mem_param_tmp_232869.references = NULL;
            if (memblock_set_device(ctx, &mem_param_tmp_232869, &mem_230920,
                                    "mem_230920") != 0)
                return 1;
            
            struct memblock_device mem_param_tmp_232870;
            
            mem_param_tmp_232870.references = NULL;
            if (memblock_set_device(ctx, &mem_param_tmp_232870, &ext_mem_231511,
                                    "ext_mem_231511") != 0)
                return 1;
            ctx_param_ext_229509 = ctx_param_ext_tmp_232867;
            ctx_param_ext_229511 = ctx_param_ext_tmp_232868;
            if (memblock_set_device(ctx, &mem_param_229507,
                                    &mem_param_tmp_232869,
                                    "mem_param_tmp_232869") != 0)
                return 1;
            if (memblock_set_device(ctx, &mem_param_229515,
                                    &mem_param_tmp_232870,
                                    "mem_param_tmp_232870") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_param_tmp_232870,
                                      "mem_param_tmp_232870") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_param_tmp_232869,
                                      "mem_param_tmp_232869") != 0)
                return 1;
            if (memblock_unref_device(ctx, &ext_mem_231511, "ext_mem_231511") !=
                0)
                return 1;
            if (memblock_unref_device(ctx, &ext_mem_231504, "ext_mem_231504") !=
                0)
                return 1;
            if (memblock_unref_device(ctx, &ext_mem_231505, "ext_mem_231505") !=
                0)
                return 1;
            if (memblock_unref_device(ctx, &mem_230920, "mem_230920") != 0)
                return 1;
            if (memblock_unref_device(ctx, &ext_mem_230914, "ext_mem_230914") !=
                0)
                return 1;
            if (memblock_unref_device(ctx, &ext_mem_230907, "ext_mem_230907") !=
                0)
                return 1;
            if (memblock_unref_device(ctx, &ext_mem_230908, "ext_mem_230908") !=
                0)
                return 1;
            if (memblock_unref_device(ctx, &ext_mem_230546, "ext_mem_230546") !=
                0)
                return 1;
            if (memblock_unref_device(ctx, &ext_mem_230529, "ext_mem_230529") !=
                0)
                return 1;
            if (memblock_unref_device(ctx, &ext_mem_230512, "ext_mem_230512") !=
                0)
                return 1;
            if (memblock_unref_device(ctx, &ext_mem_230494, "ext_mem_230494") !=
                0)
                return 1;
            if (memblock_unref_device(ctx, &ext_mem_230486, "ext_mem_230486") !=
                0)
                return 1;
            if (memblock_unref_device(ctx, &ext_mem_230487, "ext_mem_230487") !=
                0)
                return 1;
        }
        ext_231524 = ctx_param_ext_229509;
        ext_231522 = ctx_param_ext_229511;
        if (memblock_set_device(ctx, &ext_mem_231518, &mem_param_229507,
                                "mem_param_229507") != 0)
            return 1;
        if (memblock_set_device(ctx, &ext_mem_231517, &mem_param_229515,
                                "mem_param_229515") != 0)
            return 1;
        
        bool cond_206639 = slt64(i_outer_204192, y_204109);
        int64_t ext_231859;
        
        if (cond_206639) {
            ext_231859 = partition_sizze_203577;
        } else {
            ext_231859 = ctx_param_ext_229490;
        }
        
        int64_t ext_231858;
        
        if (cond_206639) {
            ext_231858 = n_203490;
        } else {
            ext_231858 = ctx_param_ext_229492;
        }
        
        int64_t ext_231857;
        
        if (cond_206639) {
            ext_231857 = partition_sizze_203577;
        } else {
            ext_231857 = ctx_param_ext_229486;
        }
        
        int64_t ext_231856;
        
        if (cond_206639) {
            ext_231856 = n_203490;
        } else {
            ext_231856 = ctx_param_ext_229487;
        }
        
        int64_t ext_231855;
        
        if (cond_206639) {
            ext_231855 = n_203490;
        } else {
            ext_231855 = ctx_param_ext_229489;
        }
        
        int64_t ext_231854;
        
        if (cond_206639) {
            ext_231854 = (int64_t) 1;
        } else {
            ext_231854 = ctx_param_ext_229491;
        }
        
        int64_t ext_231853;
        
        if (cond_206639) {
            ext_231853 = (int64_t) 0;
        } else {
            ext_231853 = ctx_param_ext_229488;
        }
        
        struct memblock_device ext_mem_231852;
        
        ext_mem_231852.references = NULL;
        if (cond_206639) {
            bool suff_intra_par_226977;
            
            suff_intra_par_226977 =
                *ctx->tuning_params.mainzisuff_intra_par_34 <= n_203490;
            if (ctx->logging)
                fprintf(ctx->log, "Compared %s <= %ld: %s.\n",
                        "main.suff_intra_par_34", (long) n_203490,
                        suff_intra_par_226977 ? "true" : "false");
            
            bool intra_suff_and_fits_226980 = fits_206888 &&
                 suff_intra_par_226977;
            int64_t segmap_group_sizze_227106;
            
            segmap_group_sizze_227106 =
                *ctx->tuning_params.mainzisegmap_group_sizze_227070;
            
            int64_t segmap_group_sizze_227127;
            
            segmap_group_sizze_227127 =
                *ctx->tuning_params.mainzisegmap_group_sizze_227027;
            
            struct memblock_device ext_mem_231561;
            
            ext_mem_231561.references = NULL;
            
            struct memblock_device ext_mem_231560;
            
            ext_mem_231560.references = NULL;
            
            int32_t local_memory_capacity_236323;
            
            local_memory_capacity_236323 = ctx->opencl.max_local_memory;
            if (sle64(bytes_229169 + srem64((int64_t) 8 - srem64(bytes_229169,
                                                                 (int64_t) 8),
                                            (int64_t) 8) + (bytes_229169 +
                                                            srem64((int64_t) 8 -
                                                                   srem64(bytes_229169,
                                                                          (int64_t) 8),
                                                                   (int64_t) 8)),
                      sext_i32_i64(local_memory_capacity_236323)) &&
                intra_suff_and_fits_226980) {
                struct memblock_device mem_231545;
                
                mem_231545.references = NULL;
                if (memblock_alloc_device(ctx, &mem_231545, bytes_229177,
                                          "mem_231545")) {
                    err = 1;
                    goto cleanup;
                }
                
                struct memblock_device mem_231549;
                
                mem_231549.references = NULL;
                if (memblock_alloc_device(ctx, &mem_231549, bytes_229177,
                                          "mem_231549")) {
                    err = 1;
                    goto cleanup;
                }
                if (ctx->debugging)
                    fprintf(ctx->log, "%s\n", "\n# SegMap");
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_226984,
                                                        1,
                                                        sizeof(ctx->failure_is_an_option),
                                                        &ctx->failure_is_an_option));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_226984,
                                                        3,
                                                        (size_t) bytes_229169,
                                                        NULL));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_226984,
                                                        4,
                                                        (size_t) bytes_229169,
                                                        NULL));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_226984,
                                                        5, sizeof(n_203490),
                                                        &n_203490));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_226984,
                                                        6,
                                                        sizeof(partition_sizze_203577),
                                                        &partition_sizze_203577));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_226984,
                                                        7, sizeof(ext_231522),
                                                        &ext_231522));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_226984,
                                                        8,
                                                        sizeof(mem_229161.mem),
                                                        &mem_229161.mem));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_226984,
                                                        9,
                                                        sizeof(ext_mem_229197.mem),
                                                        &ext_mem_229197.mem));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_226984,
                                                        10,
                                                        sizeof(ext_mem_231517.mem),
                                                        &ext_mem_231517.mem));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_226984,
                                                        11,
                                                        sizeof(ext_mem_231518.mem),
                                                        &ext_mem_231518.mem));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_226984,
                                                        12,
                                                        sizeof(mem_231545.mem),
                                                        &mem_231545.mem));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_226984,
                                                        13,
                                                        sizeof(mem_231549.mem),
                                                        &mem_231549.mem));
                if (1 * ((size_t) partition_sizze_203577 * (size_t) n_203490) !=
                    0) {
                    const size_t global_work_sizze_237534[1] =
                                 {(size_t) partition_sizze_203577 *
                                 (size_t) n_203490};
                    const size_t local_work_sizze_237538[1] =
                                 {(size_t) n_203490};
                    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.segmap_intragroup_226984",
                                global_work_sizze_237534[0],
                                local_work_sizze_237538[0], (int) (0 +
                                                                   bytes_229169 +
                                                                   bytes_229169));
                        time_start_237535 = get_wall_time();
                    }
                    OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                    ctx->mainzisegmap_intragroup_226984,
                                                                    1, NULL,
                                                                    global_work_sizze_237534,
                                                                    local_work_sizze_237538,
                                                                    0, NULL,
                                                                    ctx->profiling_paused ||
                                                                    !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                              &ctx->mainzisegmap_intragroup_226984_runs,
                                                                                                              &ctx->mainzisegmap_intragroup_226984_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.segmap_intragroup_226984",
                                time_diff_237537);
                    }
                }
                ctx->failure_is_an_option = 1;
                if (ctx->debugging)
                    fprintf(ctx->log, "%s\n", "");
                if (memblock_set_device(ctx, &ext_mem_231561, &mem_231545,
                                        "mem_231545") != 0)
                    return 1;
                if (memblock_set_device(ctx, &ext_mem_231560, &mem_231549,
                                        "mem_231549") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_231549, "mem_231549") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_231545, "mem_231545") != 0)
                    return 1;
            } else {
                int64_t segmap_usable_groups_227107 =
                        sdiv_up64(nest_sizze_207000, segmap_group_sizze_227106);
                struct memblock_device mem_231554;
                
                mem_231554.references = NULL;
                if (memblock_alloc_device(ctx, &mem_231554, bytes_229177,
                                          "mem_231554")) {
                    err = 1;
                    goto cleanup;
                }
                if (ctx->debugging)
                    fprintf(ctx->log, "%s\n", "\n# SegMap");
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_227111,
                                                        1, sizeof(n_203490),
                                                        &n_203490));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_227111,
                                                        2,
                                                        sizeof(partition_sizze_203577),
                                                        &partition_sizze_203577));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_227111,
                                                        3, sizeof(ext_231522),
                                                        &ext_231522));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_227111,
                                                        4,
                                                        sizeof(mem_229161.mem),
                                                        &mem_229161.mem));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_227111,
                                                        5,
                                                        sizeof(ext_mem_231517.mem),
                                                        &ext_mem_231517.mem));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_227111,
                                                        6,
                                                        sizeof(ext_mem_231518.mem),
                                                        &ext_mem_231518.mem));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_227111,
                                                        7,
                                                        sizeof(mem_231554.mem),
                                                        &mem_231554.mem));
                if (1 * ((size_t) segmap_usable_groups_227107 *
                         (size_t) segmap_group_sizze_227106) != 0) {
                    const size_t global_work_sizze_237539[1] =
                                 {(size_t) segmap_usable_groups_227107 *
                                 (size_t) segmap_group_sizze_227106};
                    const size_t local_work_sizze_237543[1] =
                                 {(size_t) segmap_group_sizze_227106};
                    int64_t time_start_237540 = 0, time_end_237541 = 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_227111",
                                global_work_sizze_237539[0],
                                local_work_sizze_237543[0], (int) 0);
                        time_start_237540 = get_wall_time();
                    }
                    OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                    ctx->mainzisegmap_227111,
                                                                    1, NULL,
                                                                    global_work_sizze_237539,
                                                                    local_work_sizze_237543,
                                                                    0, NULL,
                                                                    ctx->profiling_paused ||
                                                                    !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                              &ctx->mainzisegmap_227111_runs,
                                                                                                              &ctx->mainzisegmap_227111_total_runtime)));
                    if (ctx->debugging) {
                        OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                        time_end_237541 = get_wall_time();
                        
                        long time_diff_237542 = time_end_237541 -
                             time_start_237540;
                        
                        fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                                "main.segmap_227111", time_diff_237542);
                    }
                }
                if (ctx->debugging)
                    fprintf(ctx->log, "%s\n", "");
                
                int64_t segmap_usable_groups_227128 =
                        sdiv_up64(nest_sizze_207000, segmap_group_sizze_227127);
                struct memblock_device mem_231559;
                
                mem_231559.references = NULL;
                if (memblock_alloc_device(ctx, &mem_231559, bytes_229177,
                                          "mem_231559")) {
                    err = 1;
                    goto cleanup;
                }
                if (ctx->debugging)
                    fprintf(ctx->log, "%s\n", "\n# SegMap");
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_227132,
                                                        1,
                                                        sizeof(ctx->failure_is_an_option),
                                                        &ctx->failure_is_an_option));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_227132,
                                                        3, sizeof(n_203490),
                                                        &n_203490));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_227132,
                                                        4,
                                                        sizeof(partition_sizze_203577),
                                                        &partition_sizze_203577));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_227132,
                                                        5,
                                                        sizeof(ext_mem_229197.mem),
                                                        &ext_mem_229197.mem));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_227132,
                                                        6,
                                                        sizeof(mem_231554.mem),
                                                        &mem_231554.mem));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_227132,
                                                        7,
                                                        sizeof(mem_231559.mem),
                                                        &mem_231559.mem));
                if (1 * ((size_t) segmap_usable_groups_227128 *
                         (size_t) segmap_group_sizze_227127) != 0) {
                    const size_t global_work_sizze_237544[1] =
                                 {(size_t) segmap_usable_groups_227128 *
                                 (size_t) segmap_group_sizze_227127};
                    const size_t local_work_sizze_237548[1] =
                                 {(size_t) segmap_group_sizze_227127};
                    int64_t time_start_237545 = 0, time_end_237546 = 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_227132",
                                global_work_sizze_237544[0],
                                local_work_sizze_237548[0], (int) 0);
                        time_start_237545 = get_wall_time();
                    }
                    OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                    ctx->mainzisegmap_227132,
                                                                    1, NULL,
                                                                    global_work_sizze_237544,
                                                                    local_work_sizze_237548,
                                                                    0, NULL,
                                                                    ctx->profiling_paused ||
                                                                    !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                              &ctx->mainzisegmap_227132_runs,
                                                                                                              &ctx->mainzisegmap_227132_total_runtime)));
                    if (ctx->debugging) {
                        OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                        time_end_237546 = get_wall_time();
                        
                        long time_diff_237547 = time_end_237546 -
                             time_start_237545;
                        
                        fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                                "main.segmap_227132", time_diff_237547);
                    }
                }
                ctx->failure_is_an_option = 1;
                if (ctx->debugging)
                    fprintf(ctx->log, "%s\n", "");
                if (memblock_set_device(ctx, &ext_mem_231561, &mem_231559,
                                        "mem_231559") != 0)
                    return 1;
                if (memblock_set_device(ctx, &ext_mem_231560, &mem_231554,
                                        "mem_231554") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_231559, "mem_231559") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_231554, "mem_231554") != 0)
                    return 1;
            }
            
            int32_t iters_206665;
            
            if (empty_slice_204119) {
                iters_206665 = 0;
            } else {
                iters_206665 = 32;
            }
            
            bool loop_nonempty_206666 = slt32(0, iters_206665);
            bool loop_not_taken_206667 = !loop_nonempty_206666;
            bool protect_assert_disj_206668 = bounds_check_203673 ||
                 loop_not_taken_206667;
            bool index_certs_206669;
            
            if (!protect_assert_disj_206668) {
                ctx->error =
                    msgprintf("Error: %s%lld%s%lld%s\n\nBacktrace:\n%s",
                              "Index [", (long long) i_203670,
                              "] out of bounds for array of shape [",
                              (long long) n_203490, "].",
                              "-> #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_231560,
                                          "ext_mem_231560") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_231561,
                                          "ext_mem_231561") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_231852,
                                          "ext_mem_231852") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_param_229515,
                                          "mem_param_229515") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_param_229507,
                                          "mem_param_229507") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_231517,
                                          "ext_mem_231517") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_231518,
                                          "ext_mem_231518") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_param_229493,
                                          "mem_param_229493") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_param_229485,
                                          "mem_param_229485") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_param_229477,
                                          "mem_param_229477") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_231860,
                                          "ext_mem_231860") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_231861,
                                          "ext_mem_231861") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_231862,
                                          "ext_mem_231862") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_230551, "mem_230551") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_230534, "mem_230534") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_230517, "mem_230517") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_230500, "mem_230500") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_229531, "mem_229531") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_229526, "mem_229526") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_229520, "mem_229520") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_229469, "mem_229469") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_229465, "mem_229465") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_229460,
                                          "ext_mem_229460") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_229461,
                                          "ext_mem_229461") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_229411,
                                          "ext_mem_229411") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_229412,
                                          "ext_mem_229412") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_229362,
                                          "ext_mem_229362") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_229363,
                                          "ext_mem_229363") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_229264,
                                          "ext_mem_229264") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_229265,
                                          "ext_mem_229265") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_229206, "mem_229206") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_229200, "mem_229200") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_229196,
                                          "ext_mem_229196") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_229197,
                                          "ext_mem_229197") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_229164, "mem_229164") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_229161, "mem_229161") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_229157, "mem_229157") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_229155, "mem_229155") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_229152, "mem_229152") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_229148, "mem_229148") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_out_232249,
                                          "mem_out_232249") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_out_232248,
                                          "mem_out_232248") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_out_232247,
                                          "mem_out_232247") != 0)
                    return 1;
                err = 1;
                goto cleanup;
            }
            
            bool suff_outer_par_227154;
            
            suff_outer_par_227154 =
                *ctx->tuning_params.mainzisuff_outer_par_35 <=
                partition_sizze_203577;
            if (ctx->logging)
                fprintf(ctx->log, "Compared %s <= %ld: %s.\n",
                        "main.suff_outer_par_35", (long) partition_sizze_203577,
                        suff_outer_par_227154 ? "true" : "false");
            
            bool suff_intra_par_227353;
            
            suff_intra_par_227353 =
                *ctx->tuning_params.mainzisuff_intra_par_36 <= n_203490;
            if (ctx->logging)
                fprintf(ctx->log, "Compared %s <= %ld: %s.\n",
                        "main.suff_intra_par_36", (long) n_203490,
                        suff_intra_par_227353 ? "true" : "false");
            
            bool intra_suff_and_fits_227356 = fits_206888 &&
                 suff_intra_par_227353;
            int64_t segmap_group_sizze_227256;
            
            segmap_group_sizze_227256 =
                *ctx->tuning_params.mainzisegmap_group_sizze_227158;
            
            int64_t num_groups_227257;
            int32_t max_num_groups_236324;
            
            max_num_groups_236324 =
                *ctx->tuning_params.mainzisegmap_num_groups_227160;
            num_groups_227257 = sext_i64_i32(smax64((int64_t) 1,
                                                    smin64(sdiv_up64(partition_sizze_203577,
                                                                     segmap_group_sizze_227256),
                                                           sext_i32_i64(max_num_groups_236324))));
            
            bool suff_intra_par_227810;
            
            suff_intra_par_227810 =
                *ctx->tuning_params.mainzisuff_intra_par_37 <= n_203490;
            if (ctx->logging)
                fprintf(ctx->log, "Compared %s <= %ld: %s.\n",
                        "main.suff_intra_par_37", (long) n_203490,
                        suff_intra_par_227810 ? "true" : "false");
            
            bool intra_suff_and_fits_227811 = fits_206888 &&
                 suff_intra_par_227810;
            int64_t segscan_group_sizze_227905;
            
            segscan_group_sizze_227905 =
                *ctx->tuning_params.mainzisegscan_group_sizze_227625;
            
            int64_t num_groups_227906;
            int32_t max_num_groups_236325;
            
            max_num_groups_236325 =
                *ctx->tuning_params.mainzisegscan_num_groups_227627;
            num_groups_227906 = sext_i64_i32(smax64((int64_t) 1,
                                                    smin64(sdiv_up64(nest_sizze_207000,
                                                                     segscan_group_sizze_227905),
                                                           sext_i32_i64(max_num_groups_236325))));
            
            int64_t segmap_group_sizze_227981;
            
            segmap_group_sizze_227981 =
                *ctx->tuning_params.mainzisegmap_group_sizze_227577;
            
            int64_t segmap_usable_groups_227982 =
                    sdiv_up_safe64(nest_sizze_207000,
                                   segmap_group_sizze_227981);
            int64_t binop_y_231589 = (int64_t) 4 * n_203490;
            int64_t bytes_231590 = smax64((int64_t) 0, binop_y_231589);
            int64_t binop_y_231783 = (int64_t) 4 * nest_sizze_207000;
            int64_t bytes_231784 = smax64((int64_t) 0, binop_y_231783);
            int64_t num_bytes_231954 = (int64_t) 8 * n_203490;
            int64_t num_bytes_231959 = (int64_t) 8 * n_203490;
            int64_t num_threads_232227 = segmap_group_sizze_227256 *
                    num_groups_227257;
            int64_t total_sizze_232228 = num_bytes_231954 * num_threads_232227;
            int64_t total_sizze_232229 = bytes_229169 * num_threads_232227;
            int64_t total_sizze_232230 = bytes_231590 * num_threads_232227;
            int64_t total_sizze_232231 = bytes_229169 * num_threads_232227;
            int64_t total_sizze_232232 = bytes_229169 * num_threads_232227;
            int64_t total_sizze_232233 = bytes_229169 * num_threads_232227;
            int64_t total_sizze_232234 = bytes_229169 * num_threads_232227;
            int64_t total_sizze_232236 = partition_sizze_203577 *
                    num_bytes_231959;
            int64_t total_sizze_232237 = partition_sizze_203577 * bytes_229169;
            struct memblock_device ext_mem_231816;
            
            ext_mem_231816.references = NULL;
            
            int32_t local_memory_capacity_236567;
            
            local_memory_capacity_236567 = ctx->opencl.max_local_memory;
            if (sle64((int64_t) 0,
                      sext_i32_i64(local_memory_capacity_236567)) &&
                suff_outer_par_227154) {
                struct memblock_device mem_231564;
                
                mem_231564.references = NULL;
                if (memblock_alloc_device(ctx, &mem_231564, binop_y_229176,
                                          "mem_231564")) {
                    err = 1;
                    goto cleanup;
                }
                if (futrts_builtinzhgpu_map_transpose_f64(ctx, mem_231564,
                                                          (int64_t) 0,
                                                          ext_mem_231561,
                                                          (int64_t) 0,
                                                          (int64_t) 1, n_203490,
                                                          partition_sizze_203577) !=
                    0) {
                    if (memblock_unref_device(ctx, &mem_231564, "mem_231564") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231816,
                                              "ext_mem_231816") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231560,
                                              "ext_mem_231560") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231561,
                                              "ext_mem_231561") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231852,
                                              "ext_mem_231852") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_229515,
                                              "mem_param_229515") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_229507,
                                              "mem_param_229507") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231517,
                                              "ext_mem_231517") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231518,
                                              "ext_mem_231518") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_229493,
                                              "mem_param_229493") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_229485,
                                              "mem_param_229485") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_229477,
                                              "mem_param_229477") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231860,
                                              "ext_mem_231860") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231861,
                                              "ext_mem_231861") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231862,
                                              "ext_mem_231862") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_230551, "mem_230551") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_230534, "mem_230534") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_230517, "mem_230517") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_230500, "mem_230500") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229531, "mem_229531") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229526, "mem_229526") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229520, "mem_229520") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229469, "mem_229469") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229465, "mem_229465") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229460,
                                              "ext_mem_229460") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229461,
                                              "ext_mem_229461") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229411,
                                              "ext_mem_229411") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229412,
                                              "ext_mem_229412") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229362,
                                              "ext_mem_229362") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229363,
                                              "ext_mem_229363") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229264,
                                              "ext_mem_229264") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229265,
                                              "ext_mem_229265") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229206, "mem_229206") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229200, "mem_229200") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229196,
                                              "ext_mem_229196") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229197,
                                              "ext_mem_229197") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229164, "mem_229164") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229161, "mem_229161") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229157, "mem_229157") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229155, "mem_229155") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229152, "mem_229152") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229148, "mem_229148") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_out_232249,
                                              "mem_out_232249") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_out_232248,
                                              "mem_out_232248") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_out_232247,
                                              "mem_out_232247") != 0)
                        return 1;
                    err = 1;
                    goto cleanup;
                }
                
                struct memblock_device mem_231674;
                
                mem_231674.references = NULL;
                if (memblock_alloc_device(ctx, &mem_231674, binop_y_229176,
                                          "mem_231674")) {
                    err = 1;
                    goto cleanup;
                }
                
                struct memblock_device color_232062;
                
                color_232062.references = NULL;
                if (memblock_alloc_device(ctx, &color_232062,
                                          total_sizze_232228, "color_232062")) {
                    err = 1;
                    goto cleanup;
                }
                
                struct memblock_device color_232063;
                
                color_232063.references = NULL;
                if (memblock_alloc_device(ctx, &color_232063,
                                          total_sizze_232229, "color_232063")) {
                    err = 1;
                    goto cleanup;
                }
                
                struct memblock_device color_232064;
                
                color_232064.references = NULL;
                if (memblock_alloc_device(ctx, &color_232064,
                                          total_sizze_232230, "color_232064")) {
                    err = 1;
                    goto cleanup;
                }
                
                struct memblock_device color_232065;
                
                color_232065.references = NULL;
                if (memblock_alloc_device(ctx, &color_232065,
                                          total_sizze_232231, "color_232065")) {
                    err = 1;
                    goto cleanup;
                }
                
                struct memblock_device color_232066;
                
                color_232066.references = NULL;
                if (memblock_alloc_device(ctx, &color_232066,
                                          total_sizze_232232, "color_232066")) {
                    err = 1;
                    goto cleanup;
                }
                
                struct memblock_device color_232067;
                
                color_232067.references = NULL;
                if (memblock_alloc_device(ctx, &color_232067,
                                          total_sizze_232233, "color_232067")) {
                    err = 1;
                    goto cleanup;
                }
                
                struct memblock_device color_232068;
                
                color_232068.references = NULL;
                if (memblock_alloc_device(ctx, &color_232068,
                                          total_sizze_232234, "color_232068")) {
                    err = 1;
                    goto cleanup;
                }
                if (ctx->debugging)
                    fprintf(ctx->log, "%s\n", "\n# SegMap");
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_227261,
                                                        1, sizeof(n_203490),
                                                        &n_203490));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_227261,
                                                        2,
                                                        sizeof(partition_sizze_203577),
                                                        &partition_sizze_203577));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_227261,
                                                        3, sizeof(i_203670),
                                                        &i_203670));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_227261,
                                                        4, sizeof(iters_206665),
                                                        &iters_206665));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_227261,
                                                        5,
                                                        sizeof(num_groups_227257),
                                                        &num_groups_227257));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_227261,
                                                        6,
                                                        sizeof(num_threads_232227),
                                                        &num_threads_232227));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_227261,
                                                        7,
                                                        sizeof(mem_231564.mem),
                                                        &mem_231564.mem));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_227261,
                                                        8,
                                                        sizeof(mem_231674.mem),
                                                        &mem_231674.mem));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_227261,
                                                        9,
                                                        sizeof(color_232062.mem),
                                                        &color_232062.mem));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_227261,
                                                        10,
                                                        sizeof(color_232063.mem),
                                                        &color_232063.mem));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_227261,
                                                        11,
                                                        sizeof(color_232064.mem),
                                                        &color_232064.mem));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_227261,
                                                        12,
                                                        sizeof(color_232065.mem),
                                                        &color_232065.mem));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_227261,
                                                        13,
                                                        sizeof(color_232066.mem),
                                                        &color_232066.mem));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_227261,
                                                        14,
                                                        sizeof(color_232067.mem),
                                                        &color_232067.mem));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_227261,
                                                        15,
                                                        sizeof(color_232068.mem),
                                                        &color_232068.mem));
                if (1 * ((size_t) num_groups_227257 *
                         (size_t) segmap_group_sizze_227256) != 0) {
                    const size_t global_work_sizze_237549[1] =
                                 {(size_t) num_groups_227257 *
                                 (size_t) segmap_group_sizze_227256};
                    const size_t local_work_sizze_237553[1] =
                                 {(size_t) segmap_group_sizze_227256};
                    int64_t time_start_237550 = 0, time_end_237551 = 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_227261",
                                global_work_sizze_237549[0],
                                local_work_sizze_237553[0], (int) 0);
                        time_start_237550 = get_wall_time();
                    }
                    OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                    ctx->mainzisegmap_227261,
                                                                    1, NULL,
                                                                    global_work_sizze_237549,
                                                                    local_work_sizze_237553,
                                                                    0, NULL,
                                                                    ctx->profiling_paused ||
                                                                    !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                              &ctx->mainzisegmap_227261_runs,
                                                                                                              &ctx->mainzisegmap_227261_total_runtime)));
                    if (ctx->debugging) {
                        OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                        time_end_237551 = get_wall_time();
                        
                        long time_diff_237552 = time_end_237551 -
                             time_start_237550;
                        
                        fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                                "main.segmap_227261", time_diff_237552);
                    }
                }
                if (ctx->debugging)
                    fprintf(ctx->log, "%s\n", "");
                if (memblock_unref_device(ctx, &mem_231564, "mem_231564") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &color_232062, "color_232062") !=
                    0)
                    return 1;
                if (memblock_unref_device(ctx, &color_232063, "color_232063") !=
                    0)
                    return 1;
                if (memblock_unref_device(ctx, &color_232064, "color_232064") !=
                    0)
                    return 1;
                if (memblock_unref_device(ctx, &color_232065, "color_232065") !=
                    0)
                    return 1;
                if (memblock_unref_device(ctx, &color_232066, "color_232066") !=
                    0)
                    return 1;
                if (memblock_unref_device(ctx, &color_232067, "color_232067") !=
                    0)
                    return 1;
                if (memblock_unref_device(ctx, &color_232068, "color_232068") !=
                    0)
                    return 1;
                
                struct memblock_device mem_231809;
                
                mem_231809.references = NULL;
                if (memblock_alloc_device(ctx, &mem_231809, bytes_229177,
                                          "mem_231809")) {
                    err = 1;
                    goto cleanup;
                }
                if (futrts_builtinzhgpu_map_transpose_f64(ctx, mem_231809,
                                                          (int64_t) 0,
                                                          mem_231674,
                                                          (int64_t) 0,
                                                          (int64_t) 1,
                                                          partition_sizze_203577,
                                                          n_203490) != 0) {
                    if (memblock_unref_device(ctx, &mem_231809, "mem_231809") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &color_232068,
                                              "color_232068") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &color_232067,
                                              "color_232067") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &color_232066,
                                              "color_232066") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &color_232065,
                                              "color_232065") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &color_232064,
                                              "color_232064") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &color_232063,
                                              "color_232063") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &color_232062,
                                              "color_232062") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_231674, "mem_231674") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_231564, "mem_231564") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231816,
                                              "ext_mem_231816") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231560,
                                              "ext_mem_231560") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231561,
                                              "ext_mem_231561") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231852,
                                              "ext_mem_231852") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_229515,
                                              "mem_param_229515") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_229507,
                                              "mem_param_229507") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231517,
                                              "ext_mem_231517") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231518,
                                              "ext_mem_231518") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_229493,
                                              "mem_param_229493") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_229485,
                                              "mem_param_229485") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_229477,
                                              "mem_param_229477") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231860,
                                              "ext_mem_231860") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231861,
                                              "ext_mem_231861") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231862,
                                              "ext_mem_231862") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_230551, "mem_230551") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_230534, "mem_230534") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_230517, "mem_230517") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_230500, "mem_230500") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229531, "mem_229531") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229526, "mem_229526") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229520, "mem_229520") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229469, "mem_229469") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229465, "mem_229465") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229460,
                                              "ext_mem_229460") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229461,
                                              "ext_mem_229461") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229411,
                                              "ext_mem_229411") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229412,
                                              "ext_mem_229412") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229362,
                                              "ext_mem_229362") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229363,
                                              "ext_mem_229363") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229264,
                                              "ext_mem_229264") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229265,
                                              "ext_mem_229265") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229206, "mem_229206") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229200, "mem_229200") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229196,
                                              "ext_mem_229196") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229197,
                                              "ext_mem_229197") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229164, "mem_229164") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229161, "mem_229161") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229157, "mem_229157") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229155, "mem_229155") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229152, "mem_229152") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229148, "mem_229148") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_out_232249,
                                              "mem_out_232249") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_out_232248,
                                              "mem_out_232248") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_out_232247,
                                              "mem_out_232247") != 0)
                        return 1;
                    err = 1;
                    goto cleanup;
                }
                if (memblock_unref_device(ctx, &mem_231674, "mem_231674") != 0)
                    return 1;
                if (memblock_set_device(ctx, &ext_mem_231816, &mem_231809,
                                        "mem_231809") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_231809, "mem_231809") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &color_232068, "color_232068") !=
                    0)
                    return 1;
                if (memblock_unref_device(ctx, &color_232067, "color_232067") !=
                    0)
                    return 1;
                if (memblock_unref_device(ctx, &color_232066, "color_232066") !=
                    0)
                    return 1;
                if (memblock_unref_device(ctx, &color_232065, "color_232065") !=
                    0)
                    return 1;
                if (memblock_unref_device(ctx, &color_232064, "color_232064") !=
                    0)
                    return 1;
                if (memblock_unref_device(ctx, &color_232063, "color_232063") !=
                    0)
                    return 1;
                if (memblock_unref_device(ctx, &color_232062, "color_232062") !=
                    0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_231674, "mem_231674") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_231564, "mem_231564") != 0)
                    return 1;
            } else {
                struct memblock_device ext_mem_231798;
                
                ext_mem_231798.references = NULL;
                
                int32_t local_memory_capacity_236566;
                
                local_memory_capacity_236566 = ctx->opencl.max_local_memory;
                if (sle64(bytes_229169 + srem64((int64_t) 8 -
                                                srem64(bytes_229169,
                                                       (int64_t) 8),
                                                (int64_t) 8) + (bytes_231590 +
                                                                srem64((int64_t) 8 -
                                                                       srem64(bytes_231590,
                                                                              (int64_t) 8),
                                                                       (int64_t) 8)) +
                          (bytes_229169 + srem64((int64_t) 8 -
                                                 srem64(bytes_229169,
                                                        (int64_t) 8),
                                                 (int64_t) 8)) + (bytes_229169 +
                                                                  srem64((int64_t) 8 -
                                                                         srem64(bytes_229169,
                                                                                (int64_t) 8),
                                                                         (int64_t) 8)) +
                          (bytes_229169 + srem64((int64_t) 8 -
                                                 srem64(bytes_229169,
                                                        (int64_t) 8),
                                                 (int64_t) 8)) + (bytes_229169 +
                                                                  srem64((int64_t) 8 -
                                                                         srem64(bytes_229169,
                                                                                (int64_t) 8),
                                                                         (int64_t) 8)),
                          sext_i32_i64(local_memory_capacity_236566)) &&
                    intra_suff_and_fits_227356) {
                    struct memblock_device mem_231721;
                    
                    mem_231721.references = NULL;
                    if (memblock_alloc_device(ctx, &mem_231721, bytes_229177,
                                              "mem_231721")) {
                        err = 1;
                        goto cleanup;
                    }
                    
                    struct memblock_device color_232069;
                    
                    color_232069.references = NULL;
                    if (memblock_alloc_device(ctx, &color_232069,
                                              total_sizze_232236,
                                              "color_232069")) {
                        err = 1;
                        goto cleanup;
                    }
                    
                    struct memblock_device color_232070;
                    
                    color_232070.references = NULL;
                    if (memblock_alloc_device(ctx, &color_232070,
                                              total_sizze_232237,
                                              "color_232070")) {
                        err = 1;
                        goto cleanup;
                    }
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s\n", "\n# SegMap");
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_227359,
                                                            1,
                                                            (size_t) bytes_229169,
                                                            NULL));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_227359,
                                                            2,
                                                            (size_t) bytes_229169,
                                                            NULL));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_227359,
                                                            3,
                                                            (size_t) bytes_229169,
                                                            NULL));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_227359,
                                                            4,
                                                            (size_t) bytes_229169,
                                                            NULL));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_227359,
                                                            5,
                                                            (size_t) bytes_231590,
                                                            NULL));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_227359,
                                                            6,
                                                            (size_t) bytes_229169,
                                                            NULL));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_227359,
                                                            7, sizeof(n_203490),
                                                            &n_203490));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_227359,
                                                            8,
                                                            sizeof(partition_sizze_203577),
                                                            &partition_sizze_203577));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_227359,
                                                            9, sizeof(i_203670),
                                                            &i_203670));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_227359,
                                                            10,
                                                            sizeof(iters_206665),
                                                            &iters_206665));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_227359,
                                                            11,
                                                            sizeof(ext_mem_231561.mem),
                                                            &ext_mem_231561.mem));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_227359,
                                                            12,
                                                            sizeof(mem_231721.mem),
                                                            &mem_231721.mem));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_227359,
                                                            13,
                                                            sizeof(color_232069.mem),
                                                            &color_232069.mem));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_227359,
                                                            14,
                                                            sizeof(color_232070.mem),
                                                            &color_232070.mem));
                    if (1 * ((size_t) partition_sizze_203577 *
                             (size_t) n_203490) != 0) {
                        const size_t global_work_sizze_237554[1] =
                                     {(size_t) partition_sizze_203577 *
                                     (size_t) n_203490};
                        const size_t local_work_sizze_237558[1] =
                                     {(size_t) n_203490};
                        int64_t time_start_237555 = 0, time_end_237556 = 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_227359",
                                    global_work_sizze_237554[0],
                                    local_work_sizze_237558[0], (int) (0 +
                                                                       bytes_229169 +
                                                                       bytes_229169 +
                                                                       bytes_229169 +
                                                                       bytes_229169 +
                                                                       bytes_231590 +
                                                                       bytes_229169));
                            time_start_237555 = get_wall_time();
                        }
                        OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                        ctx->mainzisegmap_intragroup_227359,
                                                                        1, NULL,
                                                                        global_work_sizze_237554,
                                                                        local_work_sizze_237558,
                                                                        0, NULL,
                                                                        ctx->profiling_paused ||
                                                                        !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                  &ctx->mainzisegmap_intragroup_227359_runs,
                                                                                                                  &ctx->mainzisegmap_intragroup_227359_total_runtime)));
                        if (ctx->debugging) {
                            OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                            time_end_237556 = get_wall_time();
                            
                            long time_diff_237557 = time_end_237556 -
                                 time_start_237555;
                            
                            fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                                    "main.segmap_intragroup_227359",
                                    time_diff_237557);
                        }
                    }
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s\n", "");
                    if (memblock_unref_device(ctx, &color_232069,
                                              "color_232069") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &color_232070,
                                              "color_232070") != 0)
                        return 1;
                    if (memblock_set_device(ctx, &ext_mem_231798, &mem_231721,
                                            "mem_231721") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &color_232070,
                                              "color_232070") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &color_232069,
                                              "color_232069") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_231721, "mem_231721") !=
                        0)
                        return 1;
                } else {
                    struct memblock_device mem_231725;
                    
                    mem_231725.references = NULL;
                    if (memblock_alloc_device(ctx, &mem_231725, bytes_229177,
                                              "mem_231725")) {
                        err = 1;
                        goto cleanup;
                    }
                    if (partition_sizze_203577 * n_203490 * (int64_t) 8 > 0) {
                        OPENCL_SUCCEED_OR_RETURN(clEnqueueCopyBuffer(ctx->opencl.queue,
                                                                     ext_mem_231561.mem,
                                                                     mem_231725.mem,
                                                                     (size_t) (int64_t) 0,
                                                                     (size_t) (int64_t) 0,
                                                                     (size_t) (partition_sizze_203577 *
                                                                               n_203490 *
                                                                               (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_231790;
                    
                    ext_mem_231790.references = NULL;
                    
                    struct memblock_device mem_param_231733;
                    
                    mem_param_231733.references = NULL;
                    if (memblock_set_device(ctx, &mem_param_231733, &mem_231725,
                                            "mem_231725") != 0)
                        return 1;
                    for (int32_t i_227796 = 0; i_227796 < iters_206665;
                         i_227796++) {
                        struct memblock_device mem_231739;
                        
                        mem_231739.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_231739,
                                                  bytes_229177, "mem_231739")) {
                            err = 1;
                            goto cleanup;
                        }
                        if (partition_sizze_203577 * n_203490 * (int64_t) 8 >
                            0) {
                            OPENCL_SUCCEED_OR_RETURN(clEnqueueCopyBuffer(ctx->opencl.queue,
                                                                         mem_param_231733.mem,
                                                                         mem_231739.mem,
                                                                         (size_t) (int64_t) 0,
                                                                         (size_t) (int64_t) 0,
                                                                         (size_t) (partition_sizze_203577 *
                                                                                   n_203490 *
                                                                                   (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_227799 = mul32(2,
                                                                            i_227796);
                        int32_t defunc_0_get_bit_arg_227800 = add32(1,
                                                                    defunc_2_radix_sort_step_arg_227799);
                        bool cond_f_res_227801 = defunc_0_get_bit_arg_227800 ==
                             63;
                        bool cond_f_res_227802 =
                             defunc_2_radix_sort_step_arg_227799 == 63;
                        int64_t unsign_arg_227803 =
                                zext_i32_i64(defunc_0_get_bit_arg_227800);
                        int64_t unsign_arg_227804 =
                                zext_i32_i64(defunc_2_radix_sort_step_arg_227799);
                        struct memblock_device ext_mem_231787;
                        
                        ext_mem_231787.references = NULL;
                        
                        int32_t local_memory_capacity_236565;
                        
                        local_memory_capacity_236565 =
                            ctx->opencl.max_local_memory;
                        if (sle64(bytes_231590 + srem64((int64_t) 8 -
                                                        srem64(bytes_231590,
                                                               (int64_t) 8),
                                                        (int64_t) 8) +
                                  (bytes_229169 + srem64((int64_t) 8 -
                                                         srem64(bytes_229169,
                                                                (int64_t) 8),
                                                         (int64_t) 8)) +
                                  (bytes_229169 + srem64((int64_t) 8 -
                                                         srem64(bytes_229169,
                                                                (int64_t) 8),
                                                         (int64_t) 8)) +
                                  (bytes_229169 + srem64((int64_t) 8 -
                                                         srem64(bytes_229169,
                                                                (int64_t) 8),
                                                         (int64_t) 8)) +
                                  (bytes_229169 + srem64((int64_t) 8 -
                                                         srem64(bytes_229169,
                                                                (int64_t) 8),
                                                         (int64_t) 8)) +
                                  (bytes_229169 + srem64((int64_t) 8 -
                                                         srem64(bytes_229169,
                                                                (int64_t) 8),
                                                         (int64_t) 8)),
                                  sext_i32_i64(local_memory_capacity_236565)) &&
                            intra_suff_and_fits_227811) {
                            struct memblock_device mem_231764;
                            
                            mem_231764.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_231764,
                                                      bytes_229177,
                                                      "mem_231764")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s\n", "\n# SegMap");
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_227815,
                                                                    1,
                                                                    (size_t) bytes_229169,
                                                                    NULL));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_227815,
                                                                    2,
                                                                    (size_t) bytes_229169,
                                                                    NULL));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_227815,
                                                                    3,
                                                                    (size_t) bytes_229169,
                                                                    NULL));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_227815,
                                                                    4,
                                                                    (size_t) bytes_229169,
                                                                    NULL));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_227815,
                                                                    5,
                                                                    (size_t) bytes_229169,
                                                                    NULL));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_227815,
                                                                    6,
                                                                    (size_t) bytes_231590,
                                                                    NULL));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_227815,
                                                                    7,
                                                                    sizeof(n_203490),
                                                                    &n_203490));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_227815,
                                                                    8,
                                                                    sizeof(partition_sizze_203577),
                                                                    &partition_sizze_203577));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_227815,
                                                                    9,
                                                                    sizeof(i_203670),
                                                                    &i_203670));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_227815,
                                                                    10,
                                                                    sizeof(cond_f_res_227801),
                                                                    &cond_f_res_227801));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_227815,
                                                                    11,
                                                                    sizeof(cond_f_res_227802),
                                                                    &cond_f_res_227802));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_227815,
                                                                    12,
                                                                    sizeof(unsign_arg_227803),
                                                                    &unsign_arg_227803));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_227815,
                                                                    13,
                                                                    sizeof(unsign_arg_227804),
                                                                    &unsign_arg_227804));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_227815,
                                                                    14,
                                                                    sizeof(mem_param_231733.mem),
                                                                    &mem_param_231733.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_227815,
                                                                    15,
                                                                    sizeof(mem_231764.mem),
                                                                    &mem_231764.mem));
                            if (1 * ((size_t) partition_sizze_203577 *
                                     (size_t) n_203490) != 0) {
                                const size_t global_work_sizze_237559[1] =
                                             {(size_t) partition_sizze_203577 *
                                             (size_t) n_203490};
                                const size_t local_work_sizze_237563[1] =
                                             {(size_t) n_203490};
                                int64_t time_start_237560 = 0, time_end_237561 =
                                        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_227815",
                                            global_work_sizze_237559[0],
                                            local_work_sizze_237563[0],
                                            (int) (0 + bytes_229169 +
                                                   bytes_229169 + bytes_229169 +
                                                   bytes_229169 + bytes_229169 +
                                                   bytes_231590));
                                    time_start_237560 = get_wall_time();
                                }
                                OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                                ctx->mainzisegmap_intragroup_227815,
                                                                                1,
                                                                                NULL,
                                                                                global_work_sizze_237559,
                                                                                local_work_sizze_237563,
                                                                                0,
                                                                                NULL,
                                                                                ctx->profiling_paused ||
                                                                                !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                          &ctx->mainzisegmap_intragroup_227815_runs,
                                                                                                                          &ctx->mainzisegmap_intragroup_227815_total_runtime)));
                                if (ctx->debugging) {
                                    OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                    time_end_237561 = get_wall_time();
                                    
                                    long time_diff_237562 = time_end_237561 -
                                         time_start_237560;
                                    
                                    fprintf(ctx->log,
                                            "kernel %s runtime: %ldus\n",
                                            "main.segmap_intragroup_227815",
                                            time_diff_237562);
                                }
                            }
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s\n", "");
                            if (memblock_set_device(ctx, &ext_mem_231787,
                                                    &mem_231764,
                                                    "mem_231764") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_231764,
                                                      "mem_231764") != 0)
                                return 1;
                        } else {
                            struct memblock_device mem_231769;
                            
                            mem_231769.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_231769,
                                                      bytes_229177,
                                                      "mem_231769")) {
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device mem_231773;
                            
                            mem_231773.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_231773,
                                                      bytes_229177,
                                                      "mem_231773")) {
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device mem_231777;
                            
                            mem_231777.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_231777,
                                                      bytes_229177,
                                                      "mem_231777")) {
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device mem_231781;
                            
                            mem_231781.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_231781,
                                                      bytes_229177,
                                                      "mem_231781")) {
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device mem_231785;
                            
                            mem_231785.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_231785,
                                                      bytes_231784,
                                                      "mem_231785")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (slt64((int64_t) 0, partition_sizze_203577 *
                                      n_203490)) {
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s\n", "\n# SegScan");
                                
                                int64_t stage1_max_num_groups_236442;
                                
                                stage1_max_num_groups_236442 =
                                    ctx->opencl.max_group_size;
                                
                                int64_t stage1_num_groups_236443 =
                                        smin64(stage1_max_num_groups_236442,
                                               num_groups_227906);
                                int32_t num_threads_236444 =
                                        sext_i64_i32(stage1_num_groups_236443 *
                                        segscan_group_sizze_227905);
                                
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage1_227915,
                                                                        1,
                                                                        (size_t) smax64((int64_t) 1,
                                                                                        (int64_t) 8 *
                                                                                        segscan_group_sizze_227905),
                                                                        NULL));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage1_227915,
                                                                        2,
                                                                        (size_t) smax64((int64_t) 1,
                                                                                        (int64_t) 8 *
                                                                                        segscan_group_sizze_227905),
                                                                        NULL));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage1_227915,
                                                                        3,
                                                                        (size_t) smax64((int64_t) 1,
                                                                                        (int64_t) 8 *
                                                                                        segscan_group_sizze_227905),
                                                                        NULL));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage1_227915,
                                                                        4,
                                                                        (size_t) smax64((int64_t) 1,
                                                                                        (int64_t) 8 *
                                                                                        segscan_group_sizze_227905),
                                                                        NULL));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage1_227915,
                                                                        5,
                                                                        sizeof(n_203490),
                                                                        &n_203490));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage1_227915,
                                                                        6,
                                                                        sizeof(partition_sizze_203577),
                                                                        &partition_sizze_203577));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage1_227915,
                                                                        7,
                                                                        sizeof(cond_f_res_227801),
                                                                        &cond_f_res_227801));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage1_227915,
                                                                        8,
                                                                        sizeof(cond_f_res_227802),
                                                                        &cond_f_res_227802));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage1_227915,
                                                                        9,
                                                                        sizeof(unsign_arg_227803),
                                                                        &unsign_arg_227803));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage1_227915,
                                                                        10,
                                                                        sizeof(unsign_arg_227804),
                                                                        &unsign_arg_227804));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage1_227915,
                                                                        11,
                                                                        sizeof(num_threads_236444),
                                                                        &num_threads_236444));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage1_227915,
                                                                        12,
                                                                        sizeof(mem_param_231733.mem),
                                                                        &mem_param_231733.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage1_227915,
                                                                        13,
                                                                        sizeof(mem_231769.mem),
                                                                        &mem_231769.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage1_227915,
                                                                        14,
                                                                        sizeof(mem_231773.mem),
                                                                        &mem_231773.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage1_227915,
                                                                        15,
                                                                        sizeof(mem_231777.mem),
                                                                        &mem_231777.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage1_227915,
                                                                        16,
                                                                        sizeof(mem_231781.mem),
                                                                        &mem_231781.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage1_227915,
                                                                        17,
                                                                        sizeof(mem_231785.mem),
                                                                        &mem_231785.mem));
                                if (1 * ((size_t) stage1_num_groups_236443 *
                                         (size_t) segscan_group_sizze_227905) !=
                                    0) {
                                    const size_t global_work_sizze_237564[1] =
                                                 {(size_t) stage1_num_groups_236443 *
                                                 (size_t) segscan_group_sizze_227905};
                                    const size_t local_work_sizze_237568[1] =
                                                 {(size_t) segscan_group_sizze_227905};
                                    int64_t time_start_237565 = 0,
                                            time_end_237566 = 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_227915",
                                                global_work_sizze_237564[0],
                                                local_work_sizze_237568[0],
                                                (int) (0 + smax64((int64_t) 1,
                                                                  (int64_t) 8 *
                                                                  segscan_group_sizze_227905) +
                                                       smax64((int64_t) 1,
                                                              (int64_t) 8 *
                                                              segscan_group_sizze_227905) +
                                                       smax64((int64_t) 1,
                                                              (int64_t) 8 *
                                                              segscan_group_sizze_227905) +
                                                       smax64((int64_t) 1,
                                                              (int64_t) 8 *
                                                              segscan_group_sizze_227905)));
                                        time_start_237565 = get_wall_time();
                                    }
                                    OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                                    ctx->mainziscan_stage1_227915,
                                                                                    1,
                                                                                    NULL,
                                                                                    global_work_sizze_237564,
                                                                                    local_work_sizze_237568,
                                                                                    0,
                                                                                    NULL,
                                                                                    ctx->profiling_paused ||
                                                                                    !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                              &ctx->mainziscan_stage1_227915_runs,
                                                                                                                              &ctx->mainziscan_stage1_227915_total_runtime)));
                                    if (ctx->debugging) {
                                        OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                        time_end_237566 = get_wall_time();
                                        
                                        long time_diff_237567 =
                                             time_end_237566 -
                                             time_start_237565;
                                        
                                        fprintf(ctx->log,
                                                "kernel %s runtime: %ldus\n",
                                                "main.scan_stage1_227915",
                                                time_diff_237567);
                                    }
                                }
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s: %llu%c",
                                            "elems_per_group",
                                            (long long) (segscan_group_sizze_227905 *
                                                         sdiv_up64(partition_sizze_203577 *
                                                                   n_203490,
                                                                   sext_i32_i64(num_threads_236444))),
                                            '\n');
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage2_227915,
                                                                        1,
                                                                        (size_t) smax64((int64_t) 1,
                                                                                        (int64_t) 8 *
                                                                                        stage1_num_groups_236443),
                                                                        NULL));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage2_227915,
                                                                        2,
                                                                        (size_t) smax64((int64_t) 1,
                                                                                        (int64_t) 8 *
                                                                                        stage1_num_groups_236443),
                                                                        NULL));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage2_227915,
                                                                        3,
                                                                        (size_t) smax64((int64_t) 1,
                                                                                        (int64_t) 8 *
                                                                                        stage1_num_groups_236443),
                                                                        NULL));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage2_227915,
                                                                        4,
                                                                        (size_t) smax64((int64_t) 1,
                                                                                        (int64_t) 8 *
                                                                                        stage1_num_groups_236443),
                                                                        NULL));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage2_227915,
                                                                        5,
                                                                        sizeof(n_203490),
                                                                        &n_203490));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage2_227915,
                                                                        6,
                                                                        sizeof(partition_sizze_203577),
                                                                        &partition_sizze_203577));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage2_227915,
                                                                        7,
                                                                        sizeof(stage1_num_groups_236443),
                                                                        &stage1_num_groups_236443));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage2_227915,
                                                                        8,
                                                                        sizeof(num_threads_236444),
                                                                        &num_threads_236444));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage2_227915,
                                                                        9,
                                                                        sizeof(mem_231769.mem),
                                                                        &mem_231769.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage2_227915,
                                                                        10,
                                                                        sizeof(mem_231773.mem),
                                                                        &mem_231773.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage2_227915,
                                                                        11,
                                                                        sizeof(mem_231777.mem),
                                                                        &mem_231777.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage2_227915,
                                                                        12,
                                                                        sizeof(mem_231781.mem),
                                                                        &mem_231781.mem));
                                if (1 * ((size_t) (int64_t) 1 *
                                         (size_t) stage1_num_groups_236443) !=
                                    0) {
                                    const size_t global_work_sizze_237569[1] =
                                                 {(size_t) (int64_t) 1 *
                                                 (size_t) stage1_num_groups_236443};
                                    const size_t local_work_sizze_237573[1] =
                                                 {(size_t) stage1_num_groups_236443};
                                    int64_t time_start_237570 = 0,
                                            time_end_237571 = 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_227915",
                                                global_work_sizze_237569[0],
                                                local_work_sizze_237573[0],
                                                (int) (0 + smax64((int64_t) 1,
                                                                  (int64_t) 8 *
                                                                  stage1_num_groups_236443) +
                                                       smax64((int64_t) 1,
                                                              (int64_t) 8 *
                                                              stage1_num_groups_236443) +
                                                       smax64((int64_t) 1,
                                                              (int64_t) 8 *
                                                              stage1_num_groups_236443) +
                                                       smax64((int64_t) 1,
                                                              (int64_t) 8 *
                                                              stage1_num_groups_236443)));
                                        time_start_237570 = get_wall_time();
                                    }
                                    OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                                    ctx->mainziscan_stage2_227915,
                                                                                    1,
                                                                                    NULL,
                                                                                    global_work_sizze_237569,
                                                                                    local_work_sizze_237573,
                                                                                    0,
                                                                                    NULL,
                                                                                    ctx->profiling_paused ||
                                                                                    !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                              &ctx->mainziscan_stage2_227915_runs,
                                                                                                                              &ctx->mainziscan_stage2_227915_total_runtime)));
                                    if (ctx->debugging) {
                                        OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                        time_end_237571 = get_wall_time();
                                        
                                        long time_diff_237572 =
                                             time_end_237571 -
                                             time_start_237570;
                                        
                                        fprintf(ctx->log,
                                                "kernel %s runtime: %ldus\n",
                                                "main.scan_stage2_227915",
                                                time_diff_237572);
                                    }
                                }
                                
                                int32_t required_groups_236543 =
                                        sext_i64_i32(sdiv_up64(partition_sizze_203577 *
                                                               n_203490,
                                                               segscan_group_sizze_227905));
                                
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage3_227915,
                                                                        1,
                                                                        sizeof(n_203490),
                                                                        &n_203490));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage3_227915,
                                                                        2,
                                                                        sizeof(partition_sizze_203577),
                                                                        &partition_sizze_203577));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage3_227915,
                                                                        3,
                                                                        sizeof(num_groups_227906),
                                                                        &num_groups_227906));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage3_227915,
                                                                        4,
                                                                        sizeof(num_threads_236444),
                                                                        &num_threads_236444));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage3_227915,
                                                                        5,
                                                                        sizeof(required_groups_236543),
                                                                        &required_groups_236543));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage3_227915,
                                                                        6,
                                                                        sizeof(mem_231769.mem),
                                                                        &mem_231769.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage3_227915,
                                                                        7,
                                                                        sizeof(mem_231773.mem),
                                                                        &mem_231773.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage3_227915,
                                                                        8,
                                                                        sizeof(mem_231777.mem),
                                                                        &mem_231777.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage3_227915,
                                                                        9,
                                                                        sizeof(mem_231781.mem),
                                                                        &mem_231781.mem));
                                if (1 * ((size_t) num_groups_227906 *
                                         (size_t) segscan_group_sizze_227905) !=
                                    0) {
                                    const size_t global_work_sizze_237574[1] =
                                                 {(size_t) num_groups_227906 *
                                                 (size_t) segscan_group_sizze_227905};
                                    const size_t local_work_sizze_237578[1] =
                                                 {(size_t) segscan_group_sizze_227905};
                                    int64_t time_start_237575 = 0,
                                            time_end_237576 = 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_227915",
                                                global_work_sizze_237574[0],
                                                local_work_sizze_237578[0],
                                                (int) 0);
                                        time_start_237575 = get_wall_time();
                                    }
                                    OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                                    ctx->mainziscan_stage3_227915,
                                                                                    1,
                                                                                    NULL,
                                                                                    global_work_sizze_237574,
                                                                                    local_work_sizze_237578,
                                                                                    0,
                                                                                    NULL,
                                                                                    ctx->profiling_paused ||
                                                                                    !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                              &ctx->mainziscan_stage3_227915_runs,
                                                                                                                              &ctx->mainziscan_stage3_227915_total_runtime)));
                                    if (ctx->debugging) {
                                        OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                        time_end_237576 = get_wall_time();
                                        
                                        long time_diff_237577 =
                                             time_end_237576 -
                                             time_start_237575;
                                        
                                        fprintf(ctx->log,
                                                "kernel %s runtime: %ldus\n",
                                                "main.scan_stage3_227915",
                                                time_diff_237577);
                                    }
                                }
                            }
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s\n", "\n# SegMap");
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_227986,
                                                                    1,
                                                                    sizeof(n_203490),
                                                                    &n_203490));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_227986,
                                                                    2,
                                                                    sizeof(partition_sizze_203577),
                                                                    &partition_sizze_203577));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_227986,
                                                                    3,
                                                                    sizeof(i_203670),
                                                                    &i_203670));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_227986,
                                                                    4,
                                                                    sizeof(mem_param_231733.mem),
                                                                    &mem_param_231733.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_227986,
                                                                    5,
                                                                    sizeof(mem_231739.mem),
                                                                    &mem_231739.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_227986,
                                                                    6,
                                                                    sizeof(mem_231769.mem),
                                                                    &mem_231769.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_227986,
                                                                    7,
                                                                    sizeof(mem_231773.mem),
                                                                    &mem_231773.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_227986,
                                                                    8,
                                                                    sizeof(mem_231777.mem),
                                                                    &mem_231777.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_227986,
                                                                    9,
                                                                    sizeof(mem_231781.mem),
                                                                    &mem_231781.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_227986,
                                                                    10,
                                                                    sizeof(mem_231785.mem),
                                                                    &mem_231785.mem));
                            if (1 * ((size_t) segmap_usable_groups_227982 *
                                     (size_t) segmap_group_sizze_227981) != 0) {
                                const size_t global_work_sizze_237579[1] =
                                             {(size_t) segmap_usable_groups_227982 *
                                             (size_t) segmap_group_sizze_227981};
                                const size_t local_work_sizze_237583[1] =
                                             {(size_t) segmap_group_sizze_227981};
                                int64_t time_start_237580 = 0, time_end_237581 =
                                        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_227986",
                                            global_work_sizze_237579[0],
                                            local_work_sizze_237583[0],
                                            (int) 0);
                                    time_start_237580 = get_wall_time();
                                }
                                OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                                ctx->mainzisegmap_227986,
                                                                                1,
                                                                                NULL,
                                                                                global_work_sizze_237579,
                                                                                local_work_sizze_237583,
                                                                                0,
                                                                                NULL,
                                                                                ctx->profiling_paused ||
                                                                                !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                          &ctx->mainzisegmap_227986_runs,
                                                                                                                          &ctx->mainzisegmap_227986_total_runtime)));
                                if (ctx->debugging) {
                                    OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                    time_end_237581 = get_wall_time();
                                    
                                    long time_diff_237582 = time_end_237581 -
                                         time_start_237580;
                                    
                                    fprintf(ctx->log,
                                            "kernel %s runtime: %ldus\n",
                                            "main.segmap_227986",
                                            time_diff_237582);
                                }
                            }
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s\n", "");
                            if (memblock_unref_device(ctx, &mem_231769,
                                                      "mem_231769") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_231773,
                                                      "mem_231773") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_231777,
                                                      "mem_231777") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_231781,
                                                      "mem_231781") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_231785,
                                                      "mem_231785") != 0)
                                return 1;
                            if (memblock_set_device(ctx, &ext_mem_231787,
                                                    &mem_231739,
                                                    "mem_231739") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_231785,
                                                      "mem_231785") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_231781,
                                                      "mem_231781") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_231777,
                                                      "mem_231777") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_231773,
                                                      "mem_231773") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_231769,
                                                      "mem_231769") != 0)
                                return 1;
                        }
                        if (memblock_unref_device(ctx, &mem_231739,
                                                  "mem_231739") != 0)
                            return 1;
                        
                        struct memblock_device mem_param_tmp_236402;
                        
                        mem_param_tmp_236402.references = NULL;
                        if (memblock_set_device(ctx, &mem_param_tmp_236402,
                                                &ext_mem_231787,
                                                "ext_mem_231787") != 0)
                            return 1;
                        if (memblock_set_device(ctx, &mem_param_231733,
                                                &mem_param_tmp_236402,
                                                "mem_param_tmp_236402") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_param_tmp_236402,
                                                  "mem_param_tmp_236402") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_231787,
                                                  "ext_mem_231787") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_231739,
                                                  "mem_231739") != 0)
                            return 1;
                    }
                    if (memblock_set_device(ctx, &ext_mem_231790,
                                            &mem_param_231733,
                                            "mem_param_231733") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_231725, "mem_231725") !=
                        0)
                        return 1;
                    if (memblock_set_device(ctx, &ext_mem_231798,
                                            &ext_mem_231790,
                                            "ext_mem_231790") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_231733,
                                              "mem_param_231733") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231790,
                                              "ext_mem_231790") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_231725, "mem_231725") !=
                        0)
                        return 1;
                }
                
                struct memblock_device mem_231814;
                
                mem_231814.references = NULL;
                if (memblock_alloc_device(ctx, &mem_231814, bytes_229177,
                                          "mem_231814")) {
                    err = 1;
                    goto cleanup;
                }
                if (partition_sizze_203577 * n_203490 * (int64_t) 8 > 0) {
                    OPENCL_SUCCEED_OR_RETURN(clEnqueueCopyBuffer(ctx->opencl.queue,
                                                                 ext_mem_231798.mem,
                                                                 mem_231814.mem,
                                                                 (size_t) (int64_t) 0,
                                                                 (size_t) (int64_t) 0,
                                                                 (size_t) (partition_sizze_203577 *
                                                                           n_203490 *
                                                                           (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_231798,
                                          "ext_mem_231798") != 0)
                    return 1;
                if (memblock_set_device(ctx, &ext_mem_231816, &mem_231814,
                                        "mem_231814") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_231814, "mem_231814") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_231798,
                                          "ext_mem_231798") != 0)
                    return 1;
            }
            if (memblock_unref_device(ctx, &ext_mem_231561, "ext_mem_231561") !=
                0)
                return 1;
            
            bool empty_slice_206791 = j_m_i_204133 == (int64_t) 0;
            int64_t m_206792 = sub64(j_m_i_204133, (int64_t) 1);
            int64_t i_p_m_t_s_206793 = add64(stl_res_203664, m_206792);
            bool zzero_leq_i_p_m_t_s_206794 = sle64((int64_t) 0,
                                                    i_p_m_t_s_206793);
            bool i_p_m_t_s_leq_w_206795 = slt64(i_p_m_t_s_206793, n_203490);
            bool zzero_lte_i_206796 = sle64((int64_t) 0, stl_res_203664);
            bool i_lte_j_206797 = sle64(stl_res_203664, stl_res_203665);
            bool y_206798 = i_p_m_t_s_leq_w_206795 && zzero_lte_i_206796;
            bool y_206799 = zzero_leq_i_p_m_t_s_206794 && y_206798;
            bool y_206800 = i_lte_j_206797 && y_206799;
            bool forwards_ok_206801 = zzero_lte_i_206796 && y_206800;
            bool ok_or_empty_206802 = empty_slice_206791 || forwards_ok_206801;
            bool index_certs_206803;
            
            if (!ok_or_empty_206802) {
                ctx->error =
                    msgprintf("Error: %s%lld%s%lld%s%lld%s\n\nBacktrace:\n%s",
                              "Index [", (long long) stl_res_203664, ":",
                              (long long) stl_res_203665,
                              "] out of bounds for array of shape [",
                              (long long) n_203490, "].",
                              "-> #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_231816,
                                          "ext_mem_231816") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_231560,
                                          "ext_mem_231560") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_231561,
                                          "ext_mem_231561") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_231852,
                                          "ext_mem_231852") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_param_229515,
                                          "mem_param_229515") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_param_229507,
                                          "mem_param_229507") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_231517,
                                          "ext_mem_231517") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_231518,
                                          "ext_mem_231518") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_param_229493,
                                          "mem_param_229493") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_param_229485,
                                          "mem_param_229485") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_param_229477,
                                          "mem_param_229477") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_231860,
                                          "ext_mem_231860") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_231861,
                                          "ext_mem_231861") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_231862,
                                          "ext_mem_231862") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_230551, "mem_230551") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_230534, "mem_230534") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_230517, "mem_230517") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_230500, "mem_230500") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_229531, "mem_229531") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_229526, "mem_229526") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_229520, "mem_229520") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_229469, "mem_229469") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_229465, "mem_229465") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_229460,
                                          "ext_mem_229460") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_229461,
                                          "ext_mem_229461") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_229411,
                                          "ext_mem_229411") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_229412,
                                          "ext_mem_229412") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_229362,
                                          "ext_mem_229362") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_229363,
                                          "ext_mem_229363") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_229264,
                                          "ext_mem_229264") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_229265,
                                          "ext_mem_229265") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_229206, "mem_229206") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_229200, "mem_229200") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_229196,
                                          "ext_mem_229196") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_229197,
                                          "ext_mem_229197") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_229164, "mem_229164") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_229161, "mem_229161") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_229157, "mem_229157") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_229155, "mem_229155") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_229152, "mem_229152") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_229148, "mem_229148") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_out_232249,
                                          "mem_out_232249") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_out_232248,
                                          "mem_out_232248") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_out_232247,
                                          "mem_out_232247") != 0)
                    return 1;
                err = 1;
                goto cleanup;
            }
            
            bool suff_outer_par_228016;
            
            suff_outer_par_228016 =
                *ctx->tuning_params.mainzisuff_outer_par_38 <=
                partition_sizze_203577;
            if (ctx->logging)
                fprintf(ctx->log, "Compared %s <= %ld: %s.\n",
                        "main.suff_outer_par_38", (long) partition_sizze_203577,
                        suff_outer_par_228016 ? "true" : "false");
            
            int64_t segmap_group_sizze_228035;
            
            segmap_group_sizze_228035 =
                *ctx->tuning_params.mainzisegmap_group_sizze_228020;
            
            int64_t nest_sizze_228083 = partition_sizze_203577 * j_m_i_204133;
            int64_t segred_group_sizze_228084;
            
            segred_group_sizze_228084 =
                *ctx->tuning_params.mainzisegred_group_sizze_228067;
            
            int64_t num_groups_228085;
            int32_t max_num_groups_236568;
            
            max_num_groups_236568 =
                *ctx->tuning_params.mainzisegred_num_groups_228069;
            num_groups_228085 = sext_i64_i32(smax64((int64_t) 1,
                                                    smin64(sdiv_up64(nest_sizze_228083,
                                                                     segred_group_sizze_228084),
                                                           sext_i32_i64(max_num_groups_236568))));
            
            int64_t segmap_group_sizze_228097;
            
            segmap_group_sizze_228097 =
                *ctx->tuning_params.mainzisegmap_group_sizze_228055;
            
            struct memblock_device ext_mem_231846;
            
            ext_mem_231846.references = NULL;
            
            struct memblock_device ext_mem_231845;
            
            ext_mem_231845.references = NULL;
            
            struct memblock_device ext_mem_231844;
            
            ext_mem_231844.references = NULL;
            
            int32_t local_memory_capacity_236654;
            
            local_memory_capacity_236654 = ctx->opencl.max_local_memory;
            if (sle64((int64_t) 0,
                      sext_i32_i64(local_memory_capacity_236654)) &&
                suff_outer_par_228016) {
                int64_t segmap_usable_groups_228036 =
                        sdiv_up64(partition_sizze_203577,
                                  segmap_group_sizze_228035);
                struct memblock_device mem_231819;
                
                mem_231819.references = NULL;
                if (memblock_alloc_device(ctx, &mem_231819, binop_y_229176,
                                          "mem_231819")) {
                    err = 1;
                    goto cleanup;
                }
                if (futrts_builtinzhgpu_map_transpose_f64(ctx, mem_231819,
                                                          (int64_t) 0,
                                                          ext_mem_231816,
                                                          (int64_t) 0,
                                                          (int64_t) 1, n_203490,
                                                          partition_sizze_203577) !=
                    0) {
                    if (memblock_unref_device(ctx, &mem_231819, "mem_231819") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231844,
                                              "ext_mem_231844") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231845,
                                              "ext_mem_231845") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231846,
                                              "ext_mem_231846") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231816,
                                              "ext_mem_231816") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231560,
                                              "ext_mem_231560") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231561,
                                              "ext_mem_231561") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231852,
                                              "ext_mem_231852") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_229515,
                                              "mem_param_229515") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_229507,
                                              "mem_param_229507") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231517,
                                              "ext_mem_231517") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231518,
                                              "ext_mem_231518") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_229493,
                                              "mem_param_229493") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_229485,
                                              "mem_param_229485") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_229477,
                                              "mem_param_229477") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231860,
                                              "ext_mem_231860") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231861,
                                              "ext_mem_231861") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_231862,
                                              "ext_mem_231862") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_230551, "mem_230551") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_230534, "mem_230534") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_230517, "mem_230517") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_230500, "mem_230500") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229531, "mem_229531") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229526, "mem_229526") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229520, "mem_229520") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229469, "mem_229469") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229465, "mem_229465") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229460,
                                              "ext_mem_229460") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229461,
                                              "ext_mem_229461") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229411,
                                              "ext_mem_229411") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229412,
                                              "ext_mem_229412") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229362,
                                              "ext_mem_229362") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229363,
                                              "ext_mem_229363") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229264,
                                              "ext_mem_229264") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229265,
                                              "ext_mem_229265") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229206, "mem_229206") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229200, "mem_229200") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229196,
                                              "ext_mem_229196") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_229197,
                                              "ext_mem_229197") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229164, "mem_229164") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229161, "mem_229161") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229157, "mem_229157") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229155, "mem_229155") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229152, "mem_229152") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_229148, "mem_229148") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_out_232249,
                                              "mem_out_232249") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_out_232248,
                                              "mem_out_232248") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_out_232247,
                                              "mem_out_232247") != 0)
                        return 1;
                    err = 1;
                    goto cleanup;
                }
                
                struct memblock_device mem_231823;
                
                mem_231823.references = NULL;
                if (memblock_alloc_device(ctx, &mem_231823, bytes_229180,
                                          "mem_231823")) {
                    err = 1;
                    goto cleanup;
                }
                
                struct memblock_device mem_231826;
                
                mem_231826.references = NULL;
                if (memblock_alloc_device(ctx, &mem_231826, bytes_229180,
                                          "mem_231826")) {
                    err = 1;
                    goto cleanup;
                }
                
                struct memblock_device mem_231829;
                
                mem_231829.references = NULL;
                if (memblock_alloc_device(ctx, &mem_231829, bytes_229180,
                                          "mem_231829")) {
                    err = 1;
                    goto cleanup;
                }
                if (ctx->debugging)
                    fprintf(ctx->log, "%s\n", "\n# SegMap");
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_228041,
                                                        1,
                                                        sizeof(partition_sizze_203577),
                                                        &partition_sizze_203577));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_228041,
                                                        2,
                                                        sizeof(stl_res_203664),
                                                        &stl_res_203664));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_228041,
                                                        3, sizeof(j_m_i_204133),
                                                        &j_m_i_204133));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_228041,
                                                        4,
                                                        sizeof(mem_231819.mem),
                                                        &mem_231819.mem));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_228041,
                                                        5,
                                                        sizeof(mem_231823.mem),
                                                        &mem_231823.mem));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_228041,
                                                        6,
                                                        sizeof(mem_231826.mem),
                                                        &mem_231826.mem));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_228041,
                                                        7,
                                                        sizeof(mem_231829.mem),
                                                        &mem_231829.mem));
                if (1 * ((size_t) segmap_usable_groups_228036 *
                         (size_t) segmap_group_sizze_228035) != 0) {
                    const size_t global_work_sizze_237584[1] =
                                 {(size_t) segmap_usable_groups_228036 *
                                 (size_t) segmap_group_sizze_228035};
                    const size_t local_work_sizze_237588[1] =
                                 {(size_t) segmap_group_sizze_228035};
                    int64_t time_start_237585 = 0, time_end_237586 = 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_228041",
                                global_work_sizze_237584[0],
                                local_work_sizze_237588[0], (int) 0);
                        time_start_237585 = get_wall_time();
                    }
                    OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                    ctx->mainzisegmap_228041,
                                                                    1, NULL,
                                                                    global_work_sizze_237584,
                                                                    local_work_sizze_237588,
                                                                    0, NULL,
                                                                    ctx->profiling_paused ||
                                                                    !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                              &ctx->mainzisegmap_228041_runs,
                                                                                                              &ctx->mainzisegmap_228041_total_runtime)));
                    if (ctx->debugging) {
                        OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                        time_end_237586 = get_wall_time();
                        
                        long time_diff_237587 = time_end_237586 -
                             time_start_237585;
                        
                        fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                                "main.segmap_228041", time_diff_237587);
                    }
                }
                if (ctx->debugging)
                    fprintf(ctx->log, "%s\n", "");
                if (memblock_unref_device(ctx, &mem_231819, "mem_231819") != 0)
                    return 1;
                if (memblock_set_device(ctx, &ext_mem_231846, &mem_231823,
                                        "mem_231823") != 0)
                    return 1;
                if (memblock_set_device(ctx, &ext_mem_231845, &mem_231826,
                                        "mem_231826") != 0)
                    return 1;
                if (memblock_set_device(ctx, &ext_mem_231844, &mem_231829,
                                        "mem_231829") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_231829, "mem_231829") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_231826, "mem_231826") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_231823, "mem_231823") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_231819, "mem_231819") != 0)
                    return 1;
            } else {
                struct memblock_device mem_231833;
                
                mem_231833.references = NULL;
                if (memblock_alloc_device(ctx, &mem_231833, bytes_229180,
                                          "mem_231833")) {
                    err = 1;
                    goto cleanup;
                }
                if (slt64(j_m_i_204133 * (int64_t) 2,
                          segred_group_sizze_228084)) {
                    int64_t segment_sizze_nonzzero_236578 = smax64((int64_t) 1,
                                                                   j_m_i_204133);
                    int64_t num_threads_236579 = num_groups_228085 *
                            segred_group_sizze_228084;
                    
                    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_203577, '\n');
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s: %llu%c", "segment_size",
                                (long long) j_m_i_204133, '\n');
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s: %llu%c", "segments_per_group",
                                (long long) squot64(segred_group_sizze_228084,
                                                    segment_sizze_nonzzero_236578),
                                '\n');
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s: %llu%c", "required_groups",
                                (long long) sext_i64_i32(sdiv_up64(partition_sizze_203577,
                                                                   squot64(segred_group_sizze_228084,
                                                                           segment_sizze_nonzzero_236578))),
                                '\n');
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_228090,
                                                            1,
                                                            (size_t) ((int64_t) 8 *
                                                                      segred_group_sizze_228084),
                                                            NULL));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_228090,
                                                            2, sizeof(n_203490),
                                                            &n_203490));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_228090,
                                                            3,
                                                            sizeof(partition_sizze_203577),
                                                            &partition_sizze_203577));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_228090,
                                                            4,
                                                            sizeof(stl_res_203664),
                                                            &stl_res_203664));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_228090,
                                                            5,
                                                            sizeof(j_m_i_204133),
                                                            &j_m_i_204133));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_228090,
                                                            6,
                                                            sizeof(num_groups_228085),
                                                            &num_groups_228085));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_228090,
                                                            7,
                                                            sizeof(segment_sizze_nonzzero_236578),
                                                            &segment_sizze_nonzzero_236578));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_228090,
                                                            8,
                                                            sizeof(ext_mem_231816.mem),
                                                            &ext_mem_231816.mem));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_228090,
                                                            9,
                                                            sizeof(mem_231833.mem),
                                                            &mem_231833.mem));
                    if (1 * ((size_t) num_groups_228085 *
                             (size_t) segred_group_sizze_228084) != 0) {
                        const size_t global_work_sizze_237589[1] =
                                     {(size_t) num_groups_228085 *
                                     (size_t) segred_group_sizze_228084};
                        const size_t local_work_sizze_237593[1] =
                                     {(size_t) segred_group_sizze_228084};
                        int64_t time_start_237590 = 0, time_end_237591 = 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_228090",
                                    global_work_sizze_237589[0],
                                    local_work_sizze_237593[0], (int) (0 +
                                                                       (int64_t) 8 *
                                                                       segred_group_sizze_228084));
                            time_start_237590 = get_wall_time();
                        }
                        OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                        ctx->mainzisegred_small_228090,
                                                                        1, NULL,
                                                                        global_work_sizze_237589,
                                                                        local_work_sizze_237593,
                                                                        0, NULL,
                                                                        ctx->profiling_paused ||
                                                                        !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                  &ctx->mainzisegred_small_228090_runs,
                                                                                                                  &ctx->mainzisegred_small_228090_total_runtime)));
                        if (ctx->debugging) {
                            OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                            time_end_237591 = get_wall_time();
                            
                            long time_diff_237592 = time_end_237591 -
                                 time_start_237590;
                            
                            fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                                    "main.segred_small_228090",
                                    time_diff_237592);
                        }
                    }
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s\n", "");
                } else {
                    int64_t groups_per_segment_236605 =
                            sdiv_up64(num_groups_228085, smax64((int64_t) 1,
                                                                partition_sizze_203577));
                    int64_t elements_per_thread_236606 = sdiv_up64(j_m_i_204133,
                                                                   segred_group_sizze_228084 *
                                                                   groups_per_segment_236605);
                    int64_t virt_num_groups_236607 = groups_per_segment_236605 *
                            partition_sizze_203577;
                    int64_t num_threads_236608 = num_groups_228085 *
                            segred_group_sizze_228084;
                    int64_t threads_per_segment_236609 =
                            groups_per_segment_236605 *
                            segred_group_sizze_228084;
                    
                    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_203577, '\n');
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s: %llu%c", "segment_size",
                                (long long) j_m_i_204133, '\n');
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s: %llu%c", "virt_num_groups",
                                (long long) virt_num_groups_236607, '\n');
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s: %llu%c", "num_groups",
                                (long long) num_groups_228085, '\n');
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s: %llu%c", "group_size",
                                (long long) segred_group_sizze_228084, '\n');
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s: %llu%c", "elems_per_thread",
                                (long long) elements_per_thread_236606, '\n');
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s: %llu%c", "groups_per_segment",
                                (long long) groups_per_segment_236605, '\n');
                    
                    struct memblock_device segred_tmp_mem_236610;
                    
                    segred_tmp_mem_236610.references = NULL;
                    if (memblock_alloc_device(ctx, &segred_tmp_mem_236610,
                                              (int64_t) 8 *
                                              virt_num_groups_236607,
                                              "segred_tmp_mem_236610")) {
                        err = 1;
                        goto cleanup;
                    }
                    
                    struct memblock_device mainzicounter_mem_236612 =
                                           ctx->mainzicounter_mem_236612;
                    
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_228090,
                                                            1, (size_t) 1,
                                                            NULL));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_228090,
                                                            2,
                                                            (size_t) ((int64_t) 8 *
                                                                      segred_group_sizze_228084),
                                                            NULL));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_228090,
                                                            3, sizeof(n_203490),
                                                            &n_203490));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_228090,
                                                            4,
                                                            sizeof(partition_sizze_203577),
                                                            &partition_sizze_203577));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_228090,
                                                            5,
                                                            sizeof(stl_res_203664),
                                                            &stl_res_203664));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_228090,
                                                            6,
                                                            sizeof(j_m_i_204133),
                                                            &j_m_i_204133));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_228090,
                                                            7,
                                                            sizeof(num_groups_228085),
                                                            &num_groups_228085));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_228090,
                                                            8,
                                                            sizeof(groups_per_segment_236605),
                                                            &groups_per_segment_236605));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_228090,
                                                            9,
                                                            sizeof(elements_per_thread_236606),
                                                            &elements_per_thread_236606));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_228090,
                                                            10,
                                                            sizeof(virt_num_groups_236607),
                                                            &virt_num_groups_236607));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_228090,
                                                            11,
                                                            sizeof(threads_per_segment_236609),
                                                            &threads_per_segment_236609));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_228090,
                                                            12,
                                                            sizeof(ext_mem_231816.mem),
                                                            &ext_mem_231816.mem));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_228090,
                                                            13,
                                                            sizeof(mem_231833.mem),
                                                            &mem_231833.mem));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_228090,
                                                            14,
                                                            sizeof(segred_tmp_mem_236610.mem),
                                                            &segred_tmp_mem_236610.mem));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_228090,
                                                            15,
                                                            sizeof(mainzicounter_mem_236612.mem),
                                                            &mainzicounter_mem_236612.mem));
                    if (1 * ((size_t) num_groups_228085 *
                             (size_t) segred_group_sizze_228084) != 0) {
                        const size_t global_work_sizze_237595[1] =
                                     {(size_t) num_groups_228085 *
                                     (size_t) segred_group_sizze_228084};
                        const size_t local_work_sizze_237599[1] =
                                     {(size_t) segred_group_sizze_228084};
                        int64_t time_start_237596 = 0, time_end_237597 = 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_228090",
                                    global_work_sizze_237595[0],
                                    local_work_sizze_237599[0], (int) (0 + 1 +
                                                                       (int64_t) 8 *
                                                                       segred_group_sizze_228084));
                            time_start_237596 = get_wall_time();
                        }
                        OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                        ctx->mainzisegred_large_228090,
                                                                        1, NULL,
                                                                        global_work_sizze_237595,
                                                                        local_work_sizze_237599,
                                                                        0, NULL,
                                                                        ctx->profiling_paused ||
                                                                        !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                  &ctx->mainzisegred_large_228090_runs,
                                                                                                                  &ctx->mainzisegred_large_228090_total_runtime)));
                        if (ctx->debugging) {
                            OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                            time_end_237597 = get_wall_time();
                            
                            long time_diff_237598 = time_end_237597 -
                                 time_start_237596;
                            
                            fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                                    "main.segred_large_228090",
                                    time_diff_237598);
                        }
                    }
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s\n", "");
                    if (memblock_unref_device(ctx, &segred_tmp_mem_236610,
                                              "segred_tmp_mem_236610") != 0)
                        return 1;
                }
                
                int64_t segmap_usable_groups_228098 =
                        sdiv_up64(partition_sizze_203577,
                                  segmap_group_sizze_228097);
                struct memblock_device mem_231837;
                
                mem_231837.references = NULL;
                if (memblock_alloc_device(ctx, &mem_231837, bytes_229180,
                                          "mem_231837")) {
                    err = 1;
                    goto cleanup;
                }
                
                struct memblock_device mem_231840;
                
                mem_231840.references = NULL;
                if (memblock_alloc_device(ctx, &mem_231840, bytes_229180,
                                          "mem_231840")) {
                    err = 1;
                    goto cleanup;
                }
                
                struct memblock_device mem_231843;
                
                mem_231843.references = NULL;
                if (memblock_alloc_device(ctx, &mem_231843, bytes_229180,
                                          "mem_231843")) {
                    err = 1;
                    goto cleanup;
                }
                if (ctx->debugging)
                    fprintf(ctx->log, "%s\n", "\n# SegMap");
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_228103,
                                                        1,
                                                        sizeof(partition_sizze_203577),
                                                        &partition_sizze_203577));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_228103,
                                                        2,
                                                        sizeof(mem_231833.mem),
                                                        &mem_231833.mem));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_228103,
                                                        3,
                                                        sizeof(mem_231837.mem),
                                                        &mem_231837.mem));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_228103,
                                                        4,
                                                        sizeof(mem_231840.mem),
                                                        &mem_231840.mem));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_228103,
                                                        5,
                                                        sizeof(mem_231843.mem),
                                                        &mem_231843.mem));
                if (1 * ((size_t) segmap_usable_groups_228098 *
                         (size_t) segmap_group_sizze_228097) != 0) {
                    const size_t global_work_sizze_237600[1] =
                                 {(size_t) segmap_usable_groups_228098 *
                                 (size_t) segmap_group_sizze_228097};
                    const size_t local_work_sizze_237604[1] =
                                 {(size_t) segmap_group_sizze_228097};
                    int64_t time_start_237601 = 0, time_end_237602 = 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_228103",
                                global_work_sizze_237600[0],
                                local_work_sizze_237604[0], (int) 0);
                        time_start_237601 = get_wall_time();
                    }
                    OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                    ctx->mainzisegmap_228103,
                                                                    1, NULL,
                                                                    global_work_sizze_237600,
                                                                    local_work_sizze_237604,
                                                                    0, NULL,
                                                                    ctx->profiling_paused ||
                                                                    !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                              &ctx->mainzisegmap_228103_runs,
                                                                                                              &ctx->mainzisegmap_228103_total_runtime)));
                    if (ctx->debugging) {
                        OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                        time_end_237602 = get_wall_time();
                        
                        long time_diff_237603 = time_end_237602 -
                             time_start_237601;
                        
                        fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                                "main.segmap_228103", time_diff_237603);
                    }
                }
                if (ctx->debugging)
                    fprintf(ctx->log, "%s\n", "");
                if (memblock_unref_device(ctx, &mem_231833, "mem_231833") != 0)
                    return 1;
                if (memblock_set_device(ctx, &ext_mem_231846, &mem_231837,
                                        "mem_231837") != 0)
                    return 1;
                if (memblock_set_device(ctx, &ext_mem_231845, &mem_231840,
                                        "mem_231840") != 0)
                    return 1;
                if (memblock_set_device(ctx, &ext_mem_231844, &mem_231843,
                                        "mem_231843") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_231843, "mem_231843") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_231840, "mem_231840") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_231837, "mem_231837") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_231833, "mem_231833") != 0)
                    return 1;
            }
            if (memblock_unref_device(ctx, &ext_mem_231816, "ext_mem_231816") !=
                0)
                return 1;
            
            int64_t segmap_group_sizze_228184;
            
            segmap_group_sizze_228184 =
                *ctx->tuning_params.mainzisegmap_group_sizze_228124;
            
            int64_t segmap_usable_groups_228185 = sdiv_up64(nest_sizze_207000,
                                                            segmap_group_sizze_228184);
            struct memblock_device mem_231851;
            
            mem_231851.references = NULL;
            if (memblock_alloc_device(ctx, &mem_231851, bytes_229177,
                                      "mem_231851")) {
                err = 1;
                goto cleanup;
            }
            if (ctx->debugging)
                fprintf(ctx->log, "%s\n", "\n# SegMap");
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_228189, 1,
                                                    sizeof(n_203490),
                                                    &n_203490));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_228189, 2,
                                                    sizeof(partition_sizze_203577),
                                                    &partition_sizze_203577));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_228189, 3,
                                                    sizeof(ext_mem_231560.mem),
                                                    &ext_mem_231560.mem));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_228189, 4,
                                                    sizeof(ext_mem_231844.mem),
                                                    &ext_mem_231844.mem));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_228189, 5,
                                                    sizeof(ext_mem_231845.mem),
                                                    &ext_mem_231845.mem));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_228189, 6,
                                                    sizeof(ext_mem_231846.mem),
                                                    &ext_mem_231846.mem));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_228189, 7,
                                                    sizeof(mem_231851.mem),
                                                    &mem_231851.mem));
            if (1 * ((size_t) segmap_usable_groups_228185 *
                     (size_t) segmap_group_sizze_228184) != 0) {
                const size_t global_work_sizze_237605[1] =
                             {(size_t) segmap_usable_groups_228185 *
                             (size_t) segmap_group_sizze_228184};
                const size_t local_work_sizze_237609[1] =
                             {(size_t) segmap_group_sizze_228184};
                int64_t time_start_237606 = 0, time_end_237607 = 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_228189", global_work_sizze_237605[0],
                            local_work_sizze_237609[0], (int) 0);
                    time_start_237606 = get_wall_time();
                }
                OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                ctx->mainzisegmap_228189,
                                                                1, NULL,
                                                                global_work_sizze_237605,
                                                                local_work_sizze_237609,
                                                                0, NULL,
                                                                ctx->profiling_paused ||
                                                                !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                          &ctx->mainzisegmap_228189_runs,
                                                                                                          &ctx->mainzisegmap_228189_total_runtime)));
                if (ctx->debugging) {
                    OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                    time_end_237607 = get_wall_time();
                    
                    long time_diff_237608 = time_end_237607 - time_start_237606;
                    
                    fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                            "main.segmap_228189", time_diff_237608);
                }
            }
            if (ctx->debugging)
                fprintf(ctx->log, "%s\n", "");
            if (memblock_unref_device(ctx, &ext_mem_231560, "ext_mem_231560") !=
                0)
                return 1;
            if (memblock_unref_device(ctx, &ext_mem_231844, "ext_mem_231844") !=
                0)
                return 1;
            if (memblock_unref_device(ctx, &ext_mem_231845, "ext_mem_231845") !=
                0)
                return 1;
            if (memblock_unref_device(ctx, &ext_mem_231846, "ext_mem_231846") !=
                0)
                return 1;
            if (memblock_set_device(ctx, &ext_mem_231852, &mem_231851,
                                    "mem_231851") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_231851, "mem_231851") != 0)
                return 1;
            if (memblock_unref_device(ctx, &ext_mem_231844, "ext_mem_231844") !=
                0)
                return 1;
            if (memblock_unref_device(ctx, &ext_mem_231845, "ext_mem_231845") !=
                0)
                return 1;
            if (memblock_unref_device(ctx, &ext_mem_231846, "ext_mem_231846") !=
                0)
                return 1;
            if (memblock_unref_device(ctx, &ext_mem_231816, "ext_mem_231816") !=
                0)
                return 1;
            if (memblock_unref_device(ctx, &ext_mem_231560, "ext_mem_231560") !=
                0)
                return 1;
            if (memblock_unref_device(ctx, &ext_mem_231561, "ext_mem_231561") !=
                0)
                return 1;
        } else {
            if (memblock_set_device(ctx, &ext_mem_231852, &mem_param_229493,
                                    "mem_param_229493") != 0)
                return 1;
        }
        
        int64_t ctx_param_ext_tmp_232852 = ext_231524;
        int64_t ctx_param_ext_tmp_232853 = ext_231522;
        int64_t ctx_param_ext_tmp_232854 = ext_231857;
        int64_t ctx_param_ext_tmp_232855 = ext_231856;
        int64_t ctx_param_ext_tmp_232856 = ext_231853;
        int64_t ctx_param_ext_tmp_232857 = ext_231855;
        int64_t ctx_param_ext_tmp_232858 = ext_231859;
        int64_t ctx_param_ext_tmp_232859 = ext_231854;
        int64_t ctx_param_ext_tmp_232860 = ext_231858;
        struct memblock_device mem_param_tmp_232861;
        
        mem_param_tmp_232861.references = NULL;
        if (memblock_set_device(ctx, &mem_param_tmp_232861, &ext_mem_231518,
                                "ext_mem_231518") != 0)
            return 1;
        
        struct memblock_device mem_param_tmp_232862;
        
        mem_param_tmp_232862.references = NULL;
        if (memblock_set_device(ctx, &mem_param_tmp_232862, &ext_mem_231517,
                                "ext_mem_231517") != 0)
            return 1;
        
        struct memblock_device mem_param_tmp_232863;
        
        mem_param_tmp_232863.references = NULL;
        if (memblock_set_device(ctx, &mem_param_tmp_232863, &ext_mem_231852,
                                "ext_mem_231852") != 0)
            return 1;
        ctx_param_ext_229479 = ctx_param_ext_tmp_232852;
        ctx_param_ext_229481 = ctx_param_ext_tmp_232853;
        ctx_param_ext_229486 = ctx_param_ext_tmp_232854;
        ctx_param_ext_229487 = ctx_param_ext_tmp_232855;
        ctx_param_ext_229488 = ctx_param_ext_tmp_232856;
        ctx_param_ext_229489 = ctx_param_ext_tmp_232857;
        ctx_param_ext_229490 = ctx_param_ext_tmp_232858;
        ctx_param_ext_229491 = ctx_param_ext_tmp_232859;
        ctx_param_ext_229492 = ctx_param_ext_tmp_232860;
        if (memblock_set_device(ctx, &mem_param_229477, &mem_param_tmp_232861,
                                "mem_param_tmp_232861") != 0)
            return 1;
        if (memblock_set_device(ctx, &mem_param_229485, &mem_param_tmp_232862,
                                "mem_param_tmp_232862") != 0)
            return 1;
        if (memblock_set_device(ctx, &mem_param_229493, &mem_param_tmp_232863,
                                "mem_param_tmp_232863") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_param_tmp_232863,
                                  "mem_param_tmp_232863") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_param_tmp_232862,
                                  "mem_param_tmp_232862") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_param_tmp_232861,
                                  "mem_param_tmp_232861") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_231852, "ext_mem_231852") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_param_229515, "mem_param_229515") !=
            0)
            return 1;
        if (memblock_unref_device(ctx, &mem_param_229507, "mem_param_229507") !=
            0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_231517, "ext_mem_231517") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_231518, "ext_mem_231518") != 0)
            return 1;
    }
    ext_231875 = ctx_param_ext_229479;
    ext_231873 = ctx_param_ext_229481;
    ext_231869 = ctx_param_ext_229486;
    ext_231868 = ctx_param_ext_229487;
    ext_231867 = ctx_param_ext_229488;
    ext_231866 = ctx_param_ext_229489;
    ext_231865 = ctx_param_ext_229490;
    ext_231864 = ctx_param_ext_229491;
    ext_231863 = ctx_param_ext_229492;
    if (memblock_set_device(ctx, &ext_mem_231862, &mem_param_229477,
                            "mem_param_229477") != 0)
        return 1;
    if (memblock_set_device(ctx, &ext_mem_231861, &mem_param_229485,
                            "mem_param_229485") != 0)
        return 1;
    if (memblock_set_device(ctx, &ext_mem_231860, &mem_param_229493,
                            "mem_param_229493") != 0)
        return 1;
    if (memblock_unref_device(ctx, &ext_mem_229196, "ext_mem_229196") != 0)
        return 1;
    if (memblock_unref_device(ctx, &ext_mem_229197, "ext_mem_229197") != 0)
        return 1;
    if (memblock_unref_device(ctx, &ext_mem_229264, "ext_mem_229264") != 0)
        return 1;
    if (memblock_unref_device(ctx, &ext_mem_229265, "ext_mem_229265") != 0)
        return 1;
    if (memblock_unref_device(ctx, &ext_mem_229362, "ext_mem_229362") != 0)
        return 1;
    if (memblock_unref_device(ctx, &ext_mem_229363, "ext_mem_229363") != 0)
        return 1;
    if (memblock_unref_device(ctx, &ext_mem_229411, "ext_mem_229411") != 0)
        return 1;
    if (memblock_unref_device(ctx, &ext_mem_229412, "ext_mem_229412") != 0)
        return 1;
    if (memblock_unref_device(ctx, &ext_mem_229460, "ext_mem_229460") != 0)
        return 1;
    if (memblock_unref_device(ctx, &ext_mem_229461, "ext_mem_229461") != 0)
        return 1;
    if (memblock_unref_device(ctx, &mem_229465, "mem_229465") != 0)
        return 1;
    if (memblock_unref_device(ctx, &mem_229469, "mem_229469") != 0)
        return 1;
    if (memblock_unref_device(ctx, &mem_229520, "mem_229520") != 0)
        return 1;
    if (memblock_unref_device(ctx, &mem_229526, "mem_229526") != 0)
        return 1;
    if (memblock_unref_device(ctx, &mem_229531, "mem_229531") != 0)
        return 1;
    if (memblock_unref_device(ctx, &mem_230500, "mem_230500") != 0)
        return 1;
    if (memblock_unref_device(ctx, &mem_230517, "mem_230517") != 0)
        return 1;
    if (memblock_unref_device(ctx, &mem_230534, "mem_230534") != 0)
        return 1;
    if (memblock_unref_device(ctx, &mem_230551, "mem_230551") != 0)
        return 1;
    
    struct memblock_device mem_231887;
    
    mem_231887.references = NULL;
    if (memblock_alloc_device(ctx, &mem_231887, bytes_229160, "mem_231887")) {
        err = 1;
        goto cleanup;
    }
    if (futrts_builtinzhreplicate_f64(ctx, mem_231887, m_203489 * n_203490,
                                      NAN) != 0) {
        if (memblock_unref_device(ctx, &mem_231887, "mem_231887") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_param_229493, "mem_param_229493") !=
            0)
            return 1;
        if (memblock_unref_device(ctx, &mem_param_229485, "mem_param_229485") !=
            0)
            return 1;
        if (memblock_unref_device(ctx, &mem_param_229477, "mem_param_229477") !=
            0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_231860, "ext_mem_231860") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_231861, "ext_mem_231861") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_231862, "ext_mem_231862") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_230551, "mem_230551") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_230534, "mem_230534") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_230517, "mem_230517") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_230500, "mem_230500") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229531, "mem_229531") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229526, "mem_229526") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229520, "mem_229520") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229469, "mem_229469") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229465, "mem_229465") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229460, "ext_mem_229460") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229461, "ext_mem_229461") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229411, "ext_mem_229411") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229412, "ext_mem_229412") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229362, "ext_mem_229362") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229363, "ext_mem_229363") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229264, "ext_mem_229264") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229265, "ext_mem_229265") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229206, "mem_229206") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229200, "mem_229200") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229196, "ext_mem_229196") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229197, "ext_mem_229197") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229164, "mem_229164") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229161, "mem_229161") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229157, "mem_229157") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229155, "mem_229155") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229152, "mem_229152") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229148, "mem_229148") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232249, "mem_out_232249") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232248, "mem_out_232248") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232247, "mem_out_232247") != 0)
            return 1;
        err = 1;
        goto cleanup;
    }
    
    struct memblock_device mem_231891;
    
    mem_231891.references = NULL;
    if (memblock_alloc_device(ctx, &mem_231891, bytes_229160, "mem_231891")) {
        err = 1;
        goto cleanup;
    }
    if (futrts_builtinzhreplicate_f64(ctx, mem_231891, m_203489 * n_203490,
                                      NAN) != 0) {
        if (memblock_unref_device(ctx, &mem_231891, "mem_231891") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_231887, "mem_231887") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_param_229493, "mem_param_229493") !=
            0)
            return 1;
        if (memblock_unref_device(ctx, &mem_param_229485, "mem_param_229485") !=
            0)
            return 1;
        if (memblock_unref_device(ctx, &mem_param_229477, "mem_param_229477") !=
            0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_231860, "ext_mem_231860") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_231861, "ext_mem_231861") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_231862, "ext_mem_231862") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_230551, "mem_230551") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_230534, "mem_230534") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_230517, "mem_230517") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_230500, "mem_230500") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229531, "mem_229531") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229526, "mem_229526") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229520, "mem_229520") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229469, "mem_229469") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229465, "mem_229465") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229460, "ext_mem_229460") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229461, "ext_mem_229461") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229411, "ext_mem_229411") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229412, "ext_mem_229412") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229362, "ext_mem_229362") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229363, "ext_mem_229363") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229264, "ext_mem_229264") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229265, "ext_mem_229265") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229206, "mem_229206") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229200, "mem_229200") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229196, "ext_mem_229196") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229197, "ext_mem_229197") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229164, "mem_229164") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229161, "mem_229161") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229157, "mem_229157") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229155, "mem_229155") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229152, "mem_229152") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229148, "mem_229148") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232249, "mem_out_232249") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232248, "mem_out_232248") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232247, "mem_out_232247") != 0)
            return 1;
        err = 1;
        goto cleanup;
    }
    
    struct memblock_device mem_231895;
    
    mem_231895.references = NULL;
    if (memblock_alloc_device(ctx, &mem_231895, bytes_229160, "mem_231895")) {
        err = 1;
        goto cleanup;
    }
    if (futrts_builtinzhreplicate_f64(ctx, mem_231895, m_203489 * n_203490,
                                      NAN) != 0) {
        if (memblock_unref_device(ctx, &mem_231895, "mem_231895") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_231891, "mem_231891") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_231887, "mem_231887") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_param_229493, "mem_param_229493") !=
            0)
            return 1;
        if (memblock_unref_device(ctx, &mem_param_229485, "mem_param_229485") !=
            0)
            return 1;
        if (memblock_unref_device(ctx, &mem_param_229477, "mem_param_229477") !=
            0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_231860, "ext_mem_231860") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_231861, "ext_mem_231861") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_231862, "ext_mem_231862") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_230551, "mem_230551") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_230534, "mem_230534") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_230517, "mem_230517") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_230500, "mem_230500") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229531, "mem_229531") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229526, "mem_229526") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229520, "mem_229520") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229469, "mem_229469") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229465, "mem_229465") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229460, "ext_mem_229460") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229461, "ext_mem_229461") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229411, "ext_mem_229411") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229412, "ext_mem_229412") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229362, "ext_mem_229362") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229363, "ext_mem_229363") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229264, "ext_mem_229264") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229265, "ext_mem_229265") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229206, "mem_229206") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229200, "mem_229200") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229196, "ext_mem_229196") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229197, "ext_mem_229197") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229164, "mem_229164") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229161, "mem_229161") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229157, "mem_229157") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229155, "mem_229155") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229152, "mem_229152") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229148, "mem_229148") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232249, "mem_out_232249") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232248, "mem_out_232248") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232247, "mem_out_232247") != 0)
            return 1;
        err = 1;
        goto cleanup;
    }
    
    int64_t segmap_group_sizze_228215;
    
    segmap_group_sizze_228215 =
        *ctx->tuning_params.mainzisegmap_group_sizze_228214;
    
    int64_t num_groups_228217;
    int32_t max_num_groups_236665;
    
    max_num_groups_236665 = *ctx->tuning_params.mainzisegmap_num_groups_228216;
    num_groups_228217 = sext_i64_i32(smax64((int64_t) 1,
                                            smin64(sdiv_up64(partition_sizze_203577,
                                                             segmap_group_sizze_228215),
                                                   sext_i32_i64(max_num_groups_236665))));
    
    struct memblock_device mem_231898;
    
    mem_231898.references = NULL;
    if (memblock_alloc_device(ctx, &mem_231898, binop_y_229176, "mem_231898")) {
        err = 1;
        goto cleanup;
    }
    if (futrts_builtinzhgpu_map_transpose_f64(ctx, mem_231898, (int64_t) 0,
                                              ext_mem_231862, (int64_t) 0,
                                              (int64_t) 1, n_203490,
                                              partition_sizze_203577) != 0) {
        if (memblock_unref_device(ctx, &mem_231898, "mem_231898") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_231895, "mem_231895") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_231891, "mem_231891") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_231887, "mem_231887") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_param_229493, "mem_param_229493") !=
            0)
            return 1;
        if (memblock_unref_device(ctx, &mem_param_229485, "mem_param_229485") !=
            0)
            return 1;
        if (memblock_unref_device(ctx, &mem_param_229477, "mem_param_229477") !=
            0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_231860, "ext_mem_231860") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_231861, "ext_mem_231861") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_231862, "ext_mem_231862") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_230551, "mem_230551") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_230534, "mem_230534") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_230517, "mem_230517") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_230500, "mem_230500") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229531, "mem_229531") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229526, "mem_229526") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229520, "mem_229520") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229469, "mem_229469") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229465, "mem_229465") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229460, "ext_mem_229460") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229461, "ext_mem_229461") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229411, "ext_mem_229411") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229412, "ext_mem_229412") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229362, "ext_mem_229362") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229363, "ext_mem_229363") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229264, "ext_mem_229264") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229265, "ext_mem_229265") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229206, "mem_229206") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229200, "mem_229200") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229196, "ext_mem_229196") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229197, "ext_mem_229197") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229164, "mem_229164") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229161, "mem_229161") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229157, "mem_229157") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229155, "mem_229155") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229152, "mem_229152") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229148, "mem_229148") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232249, "mem_out_232249") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232248, "mem_out_232248") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232247, "mem_out_232247") != 0)
            return 1;
        err = 1;
        goto cleanup;
    }
    if (memblock_unref_device(ctx, &ext_mem_231862, "ext_mem_231862") != 0)
        return 1;
    
    struct memblock_device mem_231901;
    
    mem_231901.references = NULL;
    if (memblock_alloc_device(ctx, &mem_231901, binop_y_229176, "mem_231901")) {
        err = 1;
        goto cleanup;
    }
    if (futrts_builtinzhgpu_map_transpose_f64(ctx, mem_231901, (int64_t) 0,
                                              ext_mem_231861, (int64_t) 0,
                                              (int64_t) 1, n_203490,
                                              partition_sizze_203577) != 0) {
        if (memblock_unref_device(ctx, &mem_231901, "mem_231901") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_231898, "mem_231898") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_231895, "mem_231895") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_231891, "mem_231891") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_231887, "mem_231887") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_param_229493, "mem_param_229493") !=
            0)
            return 1;
        if (memblock_unref_device(ctx, &mem_param_229485, "mem_param_229485") !=
            0)
            return 1;
        if (memblock_unref_device(ctx, &mem_param_229477, "mem_param_229477") !=
            0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_231860, "ext_mem_231860") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_231861, "ext_mem_231861") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_231862, "ext_mem_231862") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_230551, "mem_230551") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_230534, "mem_230534") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_230517, "mem_230517") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_230500, "mem_230500") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229531, "mem_229531") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229526, "mem_229526") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229520, "mem_229520") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229469, "mem_229469") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229465, "mem_229465") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229460, "ext_mem_229460") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229461, "ext_mem_229461") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229411, "ext_mem_229411") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229412, "ext_mem_229412") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229362, "ext_mem_229362") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229363, "ext_mem_229363") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229264, "ext_mem_229264") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229265, "ext_mem_229265") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229206, "mem_229206") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229200, "mem_229200") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229196, "ext_mem_229196") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_229197, "ext_mem_229197") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229164, "mem_229164") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229161, "mem_229161") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229157, "mem_229157") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229155, "mem_229155") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229152, "mem_229152") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_229148, "mem_229148") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232249, "mem_out_232249") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232248, "mem_out_232248") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_out_232247, "mem_out_232247") != 0)
            return 1;
        err = 1;
        goto cleanup;
    }
    if (memblock_unref_device(ctx, &ext_mem_231861, "ext_mem_231861") != 0)
        return 1;
    
    int64_t num_threads_232245 = segmap_group_sizze_228215 * num_groups_228217;
    int64_t total_sizze_232246 = bytes_229169 * num_threads_232245;
    struct memblock_device color_232083;
    
    color_232083.references = NULL;
    if (memblock_alloc_device(ctx, &color_232083, total_sizze_232246,
                              "color_232083")) {
        err = 1;
        goto cleanup;
    }
    if (ctx->debugging)
        fprintf(ctx->log, "%s\n", "\n# SegMap");
    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_228212, 1,
                                            sizeof(m_203489), &m_203489));
    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_228212, 2,
                                            sizeof(n_203490), &n_203490));
    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_228212, 3,
                                            sizeof(partition_sizze_203577),
                                            &partition_sizze_203577));
    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_228212, 4,
                                            sizeof(num_groups_228217),
                                            &num_groups_228217));
    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_228212, 5,
                                            sizeof(num_threads_232245),
                                            &num_threads_232245));
    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_228212, 6,
                                            sizeof(mem_229161.mem),
                                            &mem_229161.mem));
    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_228212, 7,
                                            sizeof(mem_229164.mem),
                                            &mem_229164.mem));
    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_228212, 8,
                                            sizeof(mem_231887.mem),
                                            &mem_231887.mem));
    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_228212, 9,
                                            sizeof(mem_231891.mem),
                                            &mem_231891.mem));
    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_228212, 10,
                                            sizeof(mem_231895.mem),
                                            &mem_231895.mem));
    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_228212, 11,
                                            sizeof(mem_231898.mem),
                                            &mem_231898.mem));
    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_228212, 12,
                                            sizeof(mem_231901.mem),
                                            &mem_231901.mem));
    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_228212, 13,
                                            sizeof(color_232083.mem),
                                            &color_232083.mem));
    if (1 * ((size_t) num_groups_228217 * (size_t) segmap_group_sizze_228215) !=
        0) {
        const size_t global_work_sizze_237610[1] = {(size_t) num_groups_228217 *
                     (size_t) segmap_group_sizze_228215};
        const size_t local_work_sizze_237614[1] =
                     {(size_t) segmap_group_sizze_228215};
        int64_t time_start_237611 = 0, time_end_237612 = 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_228212", global_work_sizze_237610[0],
                    local_work_sizze_237614[0], (int) 0);
            time_start_237611 = get_wall_time();
        }
        OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                        ctx->mainzisegmap_228212,
                                                        1, NULL,
                                                        global_work_sizze_237610,
                                                        local_work_sizze_237614,
                                                        0, NULL,
                                                        ctx->profiling_paused ||
                                                        !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                  &ctx->mainzisegmap_228212_runs,
                                                                                                  &ctx->mainzisegmap_228212_total_runtime)));
        if (ctx->debugging) {
            OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
            time_end_237612 = get_wall_time();
            
            long time_diff_237613 = time_end_237612 - time_start_237611;
            
            fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                    "main.segmap_228212", time_diff_237613);
        }
    }
    if (ctx->debugging)
        fprintf(ctx->log, "%s\n", "");
    if (memblock_unref_device(ctx, &mem_229161, "mem_229161") != 0)
        return 1;
    if (memblock_unref_device(ctx, &mem_229164, "mem_229164") != 0)
        return 1;
    if (memblock_unref_device(ctx, &mem_231898, "mem_231898") != 0)
        return 1;
    if (memblock_unref_device(ctx, &mem_231901, "mem_231901") != 0)
        return 1;
    if (memblock_unref_device(ctx, &color_232083, "color_232083") != 0)
        return 1;
    if (memblock_set_device(ctx, &mem_out_232247, &mem_231887, "mem_231887") !=
        0)
        return 1;
    if (memblock_set_device(ctx, &mem_out_232248, &mem_231891, "mem_231891") !=
        0)
        return 1;
    if (memblock_set_device(ctx, &mem_out_232249, &mem_231895, "mem_231895") !=
        0)
        return 1;
    (*mem_out_p_236734).references = NULL;
    if (memblock_set_device(ctx, &*mem_out_p_236734, &mem_out_232247,
                            "mem_out_232247") != 0)
        return 1;
    (*mem_out_p_236735).references = NULL;
    if (memblock_set_device(ctx, &*mem_out_p_236735, &mem_out_232248,
                            "mem_out_232248") != 0)
        return 1;
    (*mem_out_p_236736).references = NULL;
    if (memblock_set_device(ctx, &*mem_out_p_236736, &mem_out_232249,
                            "mem_out_232249") != 0)
        return 1;
    if (memblock_unref_device(ctx, &color_232083, "color_232083") != 0)
        return 1;
    if (memblock_unref_device(ctx, &mem_231901, "mem_231901") != 0)
        return 1;
    if (memblock_unref_device(ctx, &mem_231898, "mem_231898") != 0)
        return 1;
    if (memblock_unref_device(ctx, &mem_231895, "mem_231895") != 0)
        return 1;
    if (memblock_unref_device(ctx, &mem_231891, "mem_231891") != 0)
        return 1;
    if (memblock_unref_device(ctx, &mem_231887, "mem_231887") != 0)
        return 1;
    if (memblock_unref_device(ctx, &mem_param_229493, "mem_param_229493") != 0)
        return 1;
    if (memblock_unref_device(ctx, &mem_param_229485, "mem_param_229485") != 0)
        return 1;
    if (memblock_unref_device(ctx, &mem_param_229477, "mem_param_229477") != 0)
        return 1;
    if (memblock_unref_device(ctx, &ext_mem_231860, "ext_mem_231860") != 0)
        return 1;
    if (memblock_unref_device(ctx, &ext_mem_231861, "ext_mem_231861") != 0)
        return 1;
    if (memblock_unref_device(ctx, &ext_mem_231862, "ext_mem_231862") != 0)
        return 1;
    if (memblock_unref_device(ctx, &mem_230551, "mem_230551") != 0)
        return 1;
    if (memblock_unref_device(ctx, &mem_230534, "mem_230534") != 0)
        return 1;
    if (memblock_unref_device(ctx, &mem_230517, "mem_230517") != 0)
        return 1;
    if (memblock_unref_device(ctx, &mem_230500, "mem_230500") != 0)
        return 1;
    if (memblock_unref_device(ctx, &mem_229531, "mem_229531") != 0)
        return 1;
    if (memblock_unref_device(ctx, &mem_229526, "mem_229526") != 0)
        return 1;
    if (memblock_unref_device(ctx, &mem_229520, "mem_229520") != 0)
        return 1;
    if (memblock_unref_device(ctx, &mem_229469, "mem_229469") != 0)
        return 1;
    if (memblock_unref_device(ctx, &mem_229465, "mem_229465") != 0)
        return 1;
    if (memblock_unref_device(ctx, &ext_mem_229460, "ext_mem_229460") != 0)
        return 1;
    if (memblock_unref_device(ctx, &ext_mem_229461, "ext_mem_229461") != 0)
        return 1;
    if (memblock_unref_device(ctx, &ext_mem_229411, "ext_mem_229411") != 0)
        return 1;
    if (memblock_unref_device(ctx, &ext_mem_229412, "ext_mem_229412") != 0)
        return 1;
    if (memblock_unref_device(ctx, &ext_mem_229362, "ext_mem_229362") != 0)
        return 1;
    if (memblock_unref_device(ctx, &ext_mem_229363, "ext_mem_229363") != 0)
        return 1;
    if (memblock_unref_device(ctx, &ext_mem_229264, "ext_mem_229264") != 0)
        return 1;
    if (memblock_unref_device(ctx, &ext_mem_229265, "ext_mem_229265") != 0)
        return 1;
    if (memblock_unref_device(ctx, &mem_229206, "mem_229206") != 0)
        return 1;
    if (memblock_unref_device(ctx, &mem_229200, "mem_229200") != 0)
        return 1;
    if (memblock_unref_device(ctx, &ext_mem_229196, "ext_mem_229196") != 0)
        return 1;
    if (memblock_unref_device(ctx, &ext_mem_229197, "ext_mem_229197") != 0)
        return 1;
    if (memblock_unref_device(ctx, &mem_229164, "mem_229164") != 0)
        return 1;
    if (memblock_unref_device(ctx, &mem_229161, "mem_229161") != 0)
        return 1;
    if (memblock_unref_device(ctx, &mem_229157, "mem_229157") != 0)
        return 1;
    if (memblock_unref_device(ctx, &mem_229155, "mem_229155") != 0)
        return 1;
    if (memblock_unref_device(ctx, &mem_229152, "mem_229152") != 0)
        return 1;
    if (memblock_unref_device(ctx, &mem_229148, "mem_229148") != 0)
        return 1;
    if (memblock_unref_device(ctx, &mem_out_232249, "mem_out_232249") != 0)
        return 1;
    if (memblock_unref_device(ctx, &mem_out_232248, "mem_out_232248") != 0)
        return 1;
    if (memblock_unref_device(ctx, &mem_out_232247, "mem_out_232247") != 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_229145;
    
    Y_mem_229145.references = NULL;
    
    int64_t m_203489;
    int64_t n_203490;
    int64_t n_p_203492;
    int64_t q_s_203493;
    int64_t q_t_203494;
    int64_t q_l_203495;
    int64_t d_s_203496;
    int64_t d_t_203497;
    int64_t d_l_203498;
    int64_t jump_s_203499;
    int64_t jump_t_203500;
    int64_t jump_l_203501;
    int64_t n_inner_203502;
    int64_t n_outer_203503;
    int64_t jump_threshold_203504;
    int64_t q_threshold_203505;
    struct memblock_device mem_out_232247;
    
    mem_out_232247.references = NULL;
    
    struct memblock_device mem_out_232248;
    
    mem_out_232248.references = NULL;
    
    struct memblock_device mem_out_232249;
    
    mem_out_232249.references = NULL;
    
    int ret = 0;
    
    lock_lock(&ctx->lock);
    Y_mem_229145 = in0->mem;
    m_203489 = in0->shape[0];
    n_203490 = in0->shape[1];
    n_p_203492 = in1;
    q_s_203493 = in2;
    q_t_203494 = in3;
    q_l_203495 = in4;
    d_s_203496 = in5;
    d_t_203497 = in6;
    d_l_203498 = in7;
    jump_s_203499 = in8;
    jump_t_203500 = in9;
    jump_l_203501 = in10;
    n_inner_203502 = in11;
    n_outer_203503 = in12;
    jump_threshold_203504 = in13;
    q_threshold_203505 = in14;
    if (!(m_203489 == in0->shape[0] && n_203490 == 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_232247, &mem_out_232248,
                                &mem_out_232249, Y_mem_229145, m_203489,
                                n_203490, n_p_203492, q_s_203493, q_t_203494,
                                q_l_203495, d_s_203496, d_t_203497, d_l_203498,
                                jump_s_203499, jump_t_203500, jump_l_203501,
                                n_inner_203502, n_outer_203503,
                                jump_threshold_203504, q_threshold_203505);
        if (ret == 0) {
            assert((*out0 =
                    (struct futhark_f64_2d *) malloc(sizeof(struct futhark_f64_2d))) !=
                NULL);
            (*out0)->mem = mem_out_232247;
            (*out0)->shape[0] = m_203489;
            (*out0)->shape[1] = n_203490;
            assert((*out1 =
                    (struct futhark_f64_2d *) malloc(sizeof(struct futhark_f64_2d))) !=
                NULL);
            (*out1)->mem = mem_out_232248;
            (*out1)->shape[0] = m_203489;
            (*out1)->shape[1] = n_203490;
            assert((*out2 =
                    (struct futhark_f64_2d *) malloc(sizeof(struct futhark_f64_2d))) !=
                NULL);
            (*out2)->mem = mem_out_232249;
            (*out2)->shape[0] = m_203489;
            (*out2)->shape[1] = n_203490;
        }
    }
    lock_unlock(&ctx->lock);
    return ret;
}
  
